}
}
+//=======================================================================
+//function : AnalyzeProgress
+//purpose :
+//=======================================================================
+NCollection_Array1<Standard_Real> BRepFeat_Builder::AnalyzeProgress()
+{
+ Standard_Integer aSize = 3;
+ NCollection_Array1<Standard_Real> aSteps(0, aSize - 1);
+ for (Standard_Integer i = 0; i < aSize; i++)
+ {
+ aSteps(i) = 0;
+ }
+
+ Standard_Real aPart = 100.;
+ Standard_Integer aNbSh = 0;
+ Standard_Integer aNbS = 0;
+ Standard_Integer aNbC = 0;
+ for (Standard_Integer i = 0; i < myDS->NbSourceShapes(); i++)
+ {
+ const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
+ switch (aSI.ShapeType())
+ {
+ case TopAbs_SHELL:
+ aNbSh++;
+ break;
+ case TopAbs_SOLID:
+ aNbS++;
+ break;
+ case TopAbs_COMPOUND:
+ aNbC++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ aNbSh = 10 * aNbSh;
+ aNbS = 10 * aNbS;
+ aNbC = 5 * aNbC;
+ Standard_Real aSum = aNbSh + aNbS + aNbC;
+ if (aSum == 0)
+ {
+ return aSteps;
+ }
+
+ aSteps(0) = aPart * aNbSh / aSum;
+ aSteps(1) = aPart * aNbS / aSum;
+ aSteps(2) = aPart * aNbC / aSum;
+
+ return aSteps;
+}
+
//=======================================================================
//function : PerformResult
//purpose :
{
myOperation = myFuse ? BOPAlgo_FUSE : BOPAlgo_CUT;
//
- Message_ProgressScope aPSOuter(theRange, NULL, 2);
if (!myShapes.IsEmpty()) {
- Message_ProgressScope aPS(aPSOuter.Next(), "BRepFeat_Builder", 100);
+ Message_ProgressScope aPS(theRange, "BRepFeat_Builder", 100);
//
+ NCollection_Array1<Standard_Real> aSteps = AnalyzeProgress();
Prepare();
//
RebuildFaces();
//
- FillImagesContainers(TopAbs_SHELL, aPS.Next(30));
+ FillImagesContainers(TopAbs_SHELL, aPS.Next(aSteps(0)));
if (HasErrors()) {
return;
}
//
- FillImagesSolids(aPS.Next(30));
+ FillImagesSolids(aPS.Next(aSteps(1)));
if (HasErrors()) {
return;
}
return;
}
//
- FillImagesCompounds(aPS.Next(40));
+ FillImagesCompounds(aPS.Next(aSteps(2)));
if (HasErrors()) {
return;
}
}
}
//
- BuildShape(aPSOuter.Next());
+ BuildShape();
}
//=======================================================================