// Chapter's name
const char* g = "Partition commands";
// Commands
- theCommands.Add("bfillds" , "use bfillds [-s -t]" , __FILE__, bfillds, g);
- theCommands.Add("bbuild" , "use bbuild r [-s -t]", __FILE__, bbuild, g);
- theCommands.Add("bbop" , "use bbop r op" , __FILE__, bbop, g);
- theCommands.Add("bclear" , "use bclear" , __FILE__, bclear, g);
+ theCommands.Add("bfillds", "use bfillds [-s -t]" , __FILE__, bfillds, g);
+ theCommands.Add("bbuild" , "use bbuild r [-s -t]" , __FILE__, bbuild, g);
+ theCommands.Add("bbop" , "use bbop r op [-s -t]", __FILE__, bbop, g);
+ theCommands.Add("bclear" , "use bclear" , __FILE__, bclear, g);
}
//=======================================================================
Standard_Integer n,
const char** a)
{
- if (n!=3) {
- di << " use bbop r op\n";
+ if (n<3) {
+ di << " use bbop r op [-s -t]\n";
return 0;
}
//
}
//
char buf[32];
- Standard_Integer iErr, iOp;
+ Standard_Boolean bRunParallel, bShowTime;
+ Standard_Integer iErr, iOp, i;
BOPAlgo_Operation aOp;
- BOPCol_ListIteratorOfListOfShape aIt;
+ BOPCol_ListIteratorOfListOfShape aIt;
+ BOPTime_Chronometer aChrono;
//
iOp=Draw::Atoi(a[2]);
if (iOp<0 || iOp>4) {
di << " invalid operation type\n";
+ return 0;
}
aOp=(BOPAlgo_Operation)iOp;
//
+ bShowTime=Standard_False;
+ bRunParallel=Standard_True;
+ for (i=3; i<n; ++i) {
+ if (!strcmp(a[i], "-s")) {
+ bRunParallel=Standard_False;
+ }
+ else if (!strcmp(a[i], "-t")) {
+ bShowTime=Standard_True;
+ }
+ }
+ //
BOPAlgo_PaveFiller& aPF=BOPTest_Objects::PaveFiller();
//
BOPAlgo_BOP& aBOP=BOPTest_Objects::BOP();
}
//
aBOP.SetOperation(aOp);
+ aBOP.SetRunParallel(bRunParallel);
+ //
+ aChrono.Start();
//
aBOP.PerformWithFiller(aPF);
iErr=aBOP.ErrorStatus();
return 0;
}
//
+ aChrono.Stop();
+ //
+ if (bShowTime) {
+ Standard_Real aTime;
+ //
+ aTime=aChrono.Time();
+ Sprintf(buf, " Tps: %7.2lf\n", aTime);
+ di << buf;
+ }
+ //
const TopoDS_Shape& aR=aBOP.Shape();
if (aR.IsNull()) {
di << " null shape\n";