//
CheckFiller();
}
+
+//=======================================================================
+//function : AnalyzeProgress
+//purpose :
+//=======================================================================
+NCollection_Array1<Standard_Real> BOPAlgo_Section::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 aNbV = myDS->ShapesSD().Size();
+ Standard_Integer aNbE = 0;
+ Standard_Integer aNbF = 0;
+ for (Standard_Integer i = 0; i < myDS->NbSourceShapes(); i++)
+ {
+ const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
+ switch (aSI.ShapeType())
+ {
+ case TopAbs_EDGE:
+ aNbE++;
+ break;
+ case TopAbs_FACE:
+ aNbF++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ aNbE = 5 * aNbE;
+ aNbF = 20 * aNbF;
+
+ Standard_Real aSum = aNbV + aNbE + aNbF;
+ if (aSum == 0)
+ {
+ return aSteps;
+ }
+
+ aSteps(0) = aPart * aNbV / aSum;
+ aSteps(1) = aPart * aNbE / aSum;
+ aSteps(2) = aPart * aNbF / aSum;
+
+ return aSteps;
+}
+
//=======================================================================
//function : PerformInternal1
//purpose :
return;
}
//
- Message_ProgressScope aPS(theRange, "PerformInternal", 100);
+ Message_ProgressScope aPS(theRange, "Building result of SECTION operation", 100);
+ NCollection_Array1<Standard_Real> aSteps = AnalyzeProgress();
// 3. Fill Images
// 3.1 Vertices
- FillImagesVertices(aPS.Next(30)); // 30
+ FillImagesVertices(aPS.Next(aSteps(0)));
if (HasErrors()) {
return;
}
return;
}
// 3.2 Edges
- FillImagesEdges(aPS.Next(35)); // 65
+ FillImagesEdges(aPS.Next(aSteps(1)));
if (HasErrors()) {
return;
}
return;
}
// 4. Section
- BuildSection(aPS.Next(35)); // 100
+ BuildSection(aPS.Next(aSteps(2)));
//
if (HasErrors()) {
return;
const TColStd_MapOfInteger& aMVSc=aFI.VerticesSc();
aItMI.Initialize(aMVSc);
for(; aItMI.More(); aItMI.Next()) {
- if (UserBreak(aPS))
- {
- return;
- }
nV=aItMI.Key();
const TopoDS_Shape& aV=myDS->Shape(nV);
aBB.Add(aRC1, aV);
const TColStd_MapOfInteger& aMI=aFI.VerticesIn();
aItMI.Initialize(aMI);
for(; aItMI.More(); aItMI.Next()) {
- if (UserBreak(aPS))
- {
- return;
- }
nV=aItMI.Key();
if (nV<0) {
continue;
//
aNbPBSc=aMPBSc.Extent();
for (j=1; j<=aNbPBSc; ++j) {
- if (UserBreak(aPS))
- {
- return;
- }
const Handle(BOPDS_PaveBlock)& aPB=aMPBSc(j);
nE=aPB->Edge();
const TopoDS_Shape& aE=myDS->Shape(nE);
const BOPDS_ListOfPaveBlock& aLPB=aPBP(i);
aItPB.Initialize(aLPB);
for (; aItPB.More(); aItPB.Next()) {
- if (UserBreak(aPS))
- {
- return;
- }
const Handle(BOPDS_PaveBlock)& aPB=aItPB.Value();
Handle(BOPDS_CommonBlock) aCB=myDS->CommonBlock(aPB);
if (!aCB.IsNull()) {
const TopTools_ListOfShape& aLSIm=myImages.Find(aS);
aItIm.Initialize(aLSIm);
for (; aItIm.More(); aItIm.Next()) {
- if (UserBreak(aPS))
- {
- return;
- }
const TopoDS_Shape& aSIm=aItIm.Value();
TopExp::MapShapes(aSIm, TopAbs_VERTEX, aMS);
TopExp::MapShapes(aSIm, TopAbs_EDGE , aMS);
//
aNbMS=aMS.Extent();
for (i=1; i<=aNbMS; ++i) {
- if (UserBreak(aPS))
- {
- return;
- }
const TopoDS_Shape& aS=aMS(i);
if (aMSI.Contains(aS)) {
Standard_Integer& iCnt=aMSI.ChangeFromKey(aS);