From: akaftasev Date: Thu, 15 Apr 2021 12:50:14 +0000 (+0300) Subject: Update AnalyzeProgress() on BOPAlgo_PaveFiller and indication of progress in internal... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=b015305e97ad092778e7f28020940e909f6818ce;p=occt-copy.git Update AnalyzeProgress() on BOPAlgo_PaveFiller and indication of progress in internal methods --- diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx index 84d39467f9..a19c4d7e5d 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx @@ -229,7 +229,7 @@ NCollection_Array1 BOPAlgo_PaveFiller::AnalyzeProgress() aSteps(i) = 0; } - Standard_Real aPart = 85.; + Standard_Real aPart = 95.; myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX); Standard_Real aPerformVVSize = myIterator->ExpectedLength(); @@ -249,57 +249,61 @@ NCollection_Array1 BOPAlgo_PaveFiller::AnalyzeProgress() myIterator->Initialize(TopAbs_FACE, TopAbs_FACE); Standard_Real aPerformFFSize = myIterator->ExpectedLength(); - Standard_Real aSum = 1.5*aPerformVVSize + 1.5*aPerformVESize + aPerformEESize + 1.5*aPerformVFSize + 2.5*aPerformEFSize + 30*aPerformFFSize; + Standard_Real aStep1 = aPerformVVSize; + Standard_Real aStep2 = 2 * aPerformVESize; + Standard_Real aStep3 = 5 * aPerformEESize; + Standard_Real aStep4 = 5 * aPerformVFSize; + Standard_Real aStep5 = 10 * aPerformEFSize; + Standard_Real aStep6 = 0.1 * (aStep1 + aStep2 + aStep4); + Standard_Real aStep7 = 2 * aPerformEESize; + Standard_Real aStep8 = 2 * aPerformEFSize; + Standard_Real aStep9 = 30 * aPerformFFSize; + Standard_Real aStep10 = 0.2 * aStep3; + Standard_Real aStep11 = 0.2 * aStep9; + Standard_Real aStep12 = 0.2 * aStep3; + + Standard_Real aSum = aStep1 + aStep2 + aStep3 + aStep4 + aStep5 + aStep6 + + aStep7 + aStep8 + aStep9 + aStep10 + aStep11 + aStep12; if (!myNonDestructive) { aPart -= 5; aSteps(0) = 5; } - aSteps(7) = 5; - if (myIsPrimary) + if (!myIsPrimary) { - aPart -= 5; - aSteps(8) = 5; + aSum -= aStep8; + aSteps(8) = 0; } - aSteps(10) = 5; - if (myGlue == BOPAlgo_GlueOff) + if (myGlue != BOPAlgo_GlueOff) { - aSteps(11) = 5; - aPart -= 5; + aSteps(11) = 0; + aSum -= aStep8; } - if (!myAvoidBuildPCurve) + if (myAvoidBuildPCurve) { - aSteps(12) = 5; - aPart -= 5; + aSteps(12) = 0; + aSum -= aStep12; } if (aSum == 0) { - Standard_Integer nbNotNull = 0; - for (Standard_Integer i = 0; i < aSize; i++) - { - if (aSteps(i) != 0) - { - nbNotNull++; - } - } - for (Standard_Integer i = 0; i < aSize; i++) - { - if (aSteps(i) != 0) - { - aSteps(i) = (95 / nbNotNull); - } - } + aSteps(0) = 95.; return aSteps; } - aSteps(1) = aPart * aPerformVVSize / aSum; - aSteps(2) = (aPart * aPerformVESize / aSum); - aSteps(3) = (aPart * aPerformEESize / aSum); - aSteps(4) = (aPart * aPerformVFSize / aSum); - aSteps(5) = (aPart * 2.5*aPerformEFSize / aSum); - aSteps(6) = (0.5*(aSteps(1) + aSteps(2) + aSteps(4))); - aSteps(9) = (aPart * 30 * aPerformFFSize / aSum); + + aSteps(1) = aPart * aStep1 / aSum; + aSteps(2) = aPart * aStep2 / aSum; + aSteps(3) = aPart * aStep3 / aSum; + aSteps(4) = aPart * aStep4 / aSum; + aSteps(5) = aPart * aStep5 / aSum; + aSteps(6) = aPart * aStep6 / aSum; + aSteps(7) = aPart * aStep7 / aSum; + aSteps(8) = aPart * aStep8 / aSum; + aSteps(9) = aPart * aStep9 / aSum; + aSteps(10) = aPart * aStep10 / aSum; + aSteps(11) = aPart * aStep11 / aSum; + aSteps(12) = aPart * aStep12 / aSum; return aSteps; } @@ -325,9 +329,9 @@ void BOPAlgo_PaveFiller::Perform(const Message_ProgressRange& theRange) //======================================================================= void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange) { - Message_ProgressScope aPS(theRange, "Pave filler perform", 100); + Message_ProgressScope aPS(theRange, "Performing intersections of shapes", 100); - Init(aPS.Next(5)); // 1 - const = 2 + Init(aPS.Next(5)); if (HasErrors()) { return; } @@ -371,7 +375,6 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange) if (HasErrors()) { return; } - UpdatePaveBlocksWithSDVertices(); UpdateInterfsWithSDVertices(); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx index 744e4b8871..8587ca63fd 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx @@ -51,6 +51,7 @@ void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange) // myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX); aSize=myIterator->ExpectedLength(); + Message_ProgressScope aPS(theRange, "PerformVV", 1); if (!aSize) { return; } @@ -65,7 +66,6 @@ void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange) NCollection_List aMBlocks(aAllocator); // // 1. Map V/LV - Message_ProgressScope aPS(theRange, "PerformVV", 1); for (; myIterator->More(); myIterator->Next()) { if (UserBreak(aPS)) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx index 6863fab671..bffce71d0e 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx @@ -157,12 +157,12 @@ void BOPAlgo_PaveFiller::PerformVE(const Message_ProgressRange& theRange) FillShrunkData(TopAbs_VERTEX, TopAbs_EDGE); // myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE); + Message_ProgressScope aPS(theRange, NULL, 1); Standard_Integer iSize = myIterator->ExpectedLength(); if (!iSize) { return; } // - Message_ProgressScope aPS(theRange, NULL, 1); // Prepare pairs for intersection BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMVEPairs; for (; myIterator->More(); myIterator->Next()) { @@ -237,7 +237,7 @@ void BOPAlgo_PaveFiller::IntersectVE // intersection of the same SD vertex with edge NCollection_DataMap aDMVSD; // - Message_ProgressScope aPSOuter(theRange, "IntersectVE", 10); + Message_ProgressScope aPSOuter(theRange, NULL, 1); for (i = 1; i <= aNbVE; ++i) { if (UserBreak(aPSOuter)) { @@ -290,7 +290,7 @@ void BOPAlgo_PaveFiller::IntersectVE // aNbVE = aVVE.Length(); - Message_ProgressScope aPS(aPSOuter.Next(9), "Intersect vertex-edge", aNbVE); + Message_ProgressScope aPS(aPSOuter.Next(), "Intersect vertex-edge", aNbVE); for (i = 0; i < aVVE.Length(); i++) { BOPAlgo_VertexEdge& aVESolver = aVVE.ChangeValue(i); @@ -309,9 +309,8 @@ void BOPAlgo_PaveFiller::IntersectVE TColStd_MapOfInteger aMEdges; // // Analyze intersections - Message_ProgressScope aPS2(aPSOuter.Next(1), "Analyze intersections", aNbVE); - for (i = 0; i < aNbVE; ++i, aPS2.Next()) { - if (UserBreak(aPS2)) + for (i = 0; i < aNbVE; ++i) { + if (UserBreak(aPSOuter)) { return; } @@ -340,7 +339,7 @@ void BOPAlgo_PaveFiller::IntersectVE BOPDS_ListOfPaveBlock::Iterator itPB (aLPB); for (; itPB.More(); itPB.Next()) { - if (UserBreak(aPS2)) + if (UserBreak(aPSOuter)) { return; } @@ -365,7 +364,7 @@ void BOPAlgo_PaveFiller::IntersectVE const TColStd_ListOfInteger& aLI = aDMVSD.Find(aPair); TColStd_ListIteratorOfListOfInteger aItLI(aLI); for (; aItLI.More(); aItLI.Next()) { - if (UserBreak(aPS2)) + if (UserBreak(aPSOuter)) { return; } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index 91412ea25d..0fb6af6518 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -172,6 +172,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) // myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE); Standard_Integer iSize = myIterator->ExpectedLength(); + Message_ProgressScope aPSOuter(theRange, NULL, 100); if (!iSize) { return; } @@ -197,7 +198,6 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) BOPDS_VectorOfInterfEE& aEEs=myDS->InterfEE(); aEEs.SetIncrement(iSize); // - Message_ProgressScope aPSOuter(theRange, "PerformEE", 10); for (; myIterator->More(); myIterator->Next()) { if (UserBreak(aPSOuter)) { @@ -283,11 +283,11 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) // aNbEdgeEdge=aVEdgeEdge.Length(); - Message_ProgressScope aPS1(aPSOuter.Next(8), "Edge-edge perform", aNbEdgeEdge); + Message_ProgressScope aPS(aPSOuter.Next(90), "Edge-edge perform", aNbEdgeEdge); for (k = 0; k < aNbEdgeEdge; k++) { BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge.ChangeValue(k); - anEdgeEdge.SetRange(aPS1.Next()); + anEdgeEdge.SetRange(aPS.Next()); } //====================================================== BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge); @@ -297,9 +297,8 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) return; } // - Message_ProgressScope aPS2(aPSOuter.Next(1), "Post-treatment", aNbEdgeEdge); - for (k = 0; k < aNbEdgeEdge; ++k, aPS2.Next()) { - if (UserBreak(aPS2)) + for (k = 0; k < aNbEdgeEdge; ++k) { + if (UserBreak(aPSOuter)) { return; } @@ -367,7 +366,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) } // for (i=1; i<=aNbCPrts; ++i) { - if (UserBreak(aPS2)) + if (UserBreak(aPSOuter)) { return; } @@ -559,7 +558,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) // Update vertices of common blocks with real CB tolerances UpdateVerticesOfCB(); - PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(1)); + PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(10)); if (HasErrors()) { return; @@ -965,7 +964,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) // those pairs of pave blocks with the same bounding vertices. Handle(NCollection_IncAllocator) anAlloc = new NCollection_IncAllocator; - Message_ProgressScope aPSOuter(theRange, "ForceInterfEE", 10); + Message_ProgressScope aPSOuter(theRange, NULL, 1); // Initialize pave blocks for all vertices which participated in intersections const Standard_Integer aNbS = myDS->NbSourceShapes(); for (Standard_Integer i = 0; i < aNbS; ++i) @@ -1012,10 +1011,6 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB); for (; aItLPB.More(); aItLPB.Next()) { - if (UserBreak(aPSOuter)) - { - return; - } const Handle(BOPDS_PaveBlock)& aPB = aItLPB.Value(); const Handle(BOPDS_PaveBlock)& aPBR = myDS->RealPaveBlock(aPB); if (!aMPBFence.Add(aPBR)) @@ -1071,10 +1066,6 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) BOPDS_ListIteratorOfListOfPaveBlock aItLPB1(aLPB); for (; aItLPB1.More(); aItLPB1.Next()) { - if (UserBreak(aPSOuter)) - { - return; - } const Handle(BOPDS_PaveBlock)& aPB1 = aItLPB1.Value(); const Handle(BOPDS_CommonBlock)& aCB1 = myDS->CommonBlock(aPB1); const Standard_Integer nE1 = aPB1->OriginalEdge(); @@ -1093,10 +1084,6 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) BOPDS_ListIteratorOfListOfPaveBlock aItLPB2 = aItLPB1; for (aItLPB2.Next(); aItLPB2.More(); aItLPB2.Next()) { - if (UserBreak(aPSOuter)) - { - return; - } const Handle(BOPDS_PaveBlock)& aPB2 = aItLPB2.Value(); const Handle(BOPDS_CommonBlock)& aCB2 = myDS->CommonBlock(aPB2); const Standard_Integer nE2 = aPB2->OriginalEdge(); @@ -1179,7 +1166,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) aMPBFence.Clear(); anAlloc->Reset(); - Message_ProgressScope aPS(aPSOuter.Next(9), "Intersection edge-edge", aNbPairs); + Message_ProgressScope aPS(aPSOuter.Next(), "Intersection edge-edge", aNbPairs); for (Standard_Integer i = 0; i < aNbPairs; i++) { BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge.ChangeValue(i); @@ -1200,10 +1187,9 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) // intersection type only. BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock aMPBLPB(1, anAlloc); - Message_ProgressScope aPS1(aPSOuter.Next(1), "Analyze the results of intersection", aNbPairs); - for (Standard_Integer i = 0; i < aNbPairs; ++i, aPS1.Next()) + for (Standard_Integer i = 0; i < aNbPairs; ++i) { - if (UserBreak(aPS1)) + if (UserBreak(aPSOuter)) { return; } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx index d9ad7f2d72..5e7abe6711 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx @@ -156,6 +156,7 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) // Standard_Integer nV, nF; // + Message_ProgressScope aPSOuter(theRange, NULL, 1); if (myGlue == BOPAlgo_GlueFull) { // there is no need to intersect vertices with faces in this mode // just initialize FaceInfo for all faces @@ -186,7 +187,6 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) // Avoid repeated intersection of the same vertex with face in case // the group of vertices formed a single SD vertex NCollection_DataMap aMVFPairs; - Message_ProgressScope aPSOuter(theRange, "PerformVF", 10); for (; myIterator->More(); myIterator->Next()) { if (UserBreak(aPSOuter)) { @@ -236,7 +236,7 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) }//for (; myIterator->More(); myIterator->Next()) { // aNbVF=aVVF.Length(); - Message_ProgressScope aPS(aPSOuter.Next(9), "Vertex-face perform", aNbVF); + Message_ProgressScope aPS(aPSOuter.Next(), "Vertex-face perform", aNbVF); for (k = 0; k < aNbVF; k++) { BOPAlgo_VertexFace& aVertexFace = aVVF.ChangeValue(k); @@ -250,9 +250,8 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) return; } // - Message_ProgressScope aPS2(aPSOuter.Next(1), "Post treatment", aNbVF); - for (k=0; k < aNbVF; ++k, aPS2.Next()) { - if (UserBreak(aPS2)) + for (k=0; k < aNbVF; ++k) { + if (UserBreak(aPSOuter)) { return; } @@ -277,7 +276,7 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) TColStd_MapIteratorOfMapOfInteger itMV(aMV); for (; itMV.More(); itMV.Next()) { - if (UserBreak(aPS2)) + if (UserBreak(aPSOuter)) { return; } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index 2dca235619..c27fa4f95b 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -184,11 +184,11 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) FillShrunkData(TopAbs_EDGE, TopAbs_FACE); // myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE); + Message_ProgressScope aPSOuter(theRange, NULL, 100); Standard_Integer iSize = myIterator->ExpectedLength(); if (!iSize) { return; } - Message_ProgressScope aPSOuter(theRange, "PerformEF", 10); // Standard_Integer nE, nF; // @@ -309,11 +309,11 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) }//for (; myIterator->More(); myIterator->Next()) { // aNbEdgeFace=aVEdgeFace.Length(); - Message_ProgressScope aPS1(aPSOuter.Next(8), "Edge-face perform", aNbEdgeFace); + Message_ProgressScope aPS(aPSOuter.Next(90), "Edge-face perform", aNbEdgeFace); for (Standard_Integer index = 0; index < aNbEdgeFace; index++) { BOPAlgo_EdgeFace& aEdgeFace = aVEdgeFace.ChangeValue(index); - aEdgeFace.SetProgress(aPS1.Next()); + aEdgeFace.SetProgress(aPS.Next()); } //================================================================= BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext); @@ -323,9 +323,8 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) return; } // - Message_ProgressScope aPS2(aPSOuter.Next(1), "Post-treatment", aNbEdgeFace); - for (k=0; k < aNbEdgeFace; ++k, aPS2.Next()) { - if (UserBreak(aPS2)) + for (k=0; k < aNbEdgeFace; ++k) { + if (UserBreak(aPSOuter)) { return; } @@ -391,7 +390,7 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) } // for (i=1; i<=aNbCPrts; ++i) { - if (UserBreak(aPS2)) + if (UserBreak(aPSOuter)) { return; } @@ -561,7 +560,7 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) //========================================= BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator, myDS, myContext); UpdateVerticesOfCB(); - PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(1), Standard_False); + PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(10), Standard_False); if (HasErrors()) { return; @@ -776,6 +775,7 @@ void BOPAlgo_PaveFiller::ReduceIntersectionRange(const Standard_Integer theV1, //======================================================================= void BOPAlgo_PaveFiller::ForceInterfEF(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, NULL, 1); if (!myIsPrimary) return; @@ -788,7 +788,6 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const Message_ProgressRange& theRange) // Collect all pave blocks BOPDS_IndexedMapOfPaveBlock aMPB; const Standard_Integer aNbS = myDS->NbSourceShapes(); - Message_ProgressScope aPS(theRange, NULL, 1); for (Standard_Integer nE = 0; nE < aNbS; ++nE) { if (UserBreak(aPS)) @@ -812,10 +811,6 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const Message_ProgressRange& theRange) BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB); for (; aItLPB.More(); aItLPB.Next()) { - if (UserBreak(aPS)) - { - return; - } const Handle(BOPDS_PaveBlock)& aPB = aItLPB.Value(); const Handle(BOPDS_PaveBlock)& aPBR = myDS->RealPaveBlock(aPB); aMPB.Add(aPBR); @@ -835,9 +830,9 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB const Message_ProgressRange& theRange, const Standard_Boolean theAddInterf) { + Message_ProgressScope aPSOuter(theRange, NULL, 1); if (theMPB.IsEmpty()) return; - Message_ProgressScope aPSOuter(theRange, "ForceInterfEF", 10); // Fill the tree with bounding boxes of the pave blocks BOPTools_BoxTree aBBTree; @@ -922,10 +917,6 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB const Standard_Integer aNb = pMPBF[iM]->Extent(); for (Standard_Integer iPB = 1; iPB <= aNb; ++iPB) { - if (UserBreak(aPSOuter)) - { - return; - } const Handle(BOPDS_PaveBlock)& aPB = pMPBF[iM]->FindKey(iPB); aMVF.Add(aPB->Pave1().Index()); aMVF.Add(aPB->Pave2().Index()); @@ -942,10 +933,6 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB TColStd_ListOfInteger::Iterator itLIPB(aLIPB); for (; itLIPB.More(); itLIPB.Next()) { - if (UserBreak(aPSOuter)) - { - return; - } const Handle(BOPDS_PaveBlock)& aPB = aPBMap(itLIPB.Value()); if (pMPBF[0]->Contains(aPB) || pMPBF[1]->Contains(aPB) || @@ -1092,7 +1079,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB aPBMap.Clear(); anAlloc->Reset(); - Message_ProgressScope aPS(aPSOuter.Next(9), "Force intersection edge-face", aNbEFs); + Message_ProgressScope aPS(aPSOuter.Next(), "Force intersection edge-face", aNbEFs); for (Standard_Integer i = 0; i < aNbEFs; i++) { BOPAlgo_EdgeFace& aEdgeFace = aVEdgeFace.ChangeValue(i); @@ -1114,10 +1101,9 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB // Collect all pairs for common block creation BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(1, anAlloc); - Message_ProgressScope aPS1(aPSOuter.Next(1), "Analyze the results of force intersection", aNbEFs); - for (Standard_Integer i = 0; i < aNbEFs; ++i, aPS1.Next()) + for (Standard_Integer i = 0; i < aNbEFs; ++i) { - if (UserBreak(aPS1)) + if (UserBreak(aPSOuter)) { return; } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index 2665137fa3..23e131fe45 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -247,6 +247,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) { myIterator->Initialize(TopAbs_FACE, TopAbs_FACE); Standard_Integer iSize = myIterator->ExpectedLength(); + Message_ProgressScope aPSOuter(theRange, NULL, 1); if (!iSize) { return; } @@ -268,12 +269,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) BOPAlgo_VectorOfFaceFace aVFaceFace; Standard_Integer nF1, nF2; // - Message_ProgressScope aPSOuter(theRange, "PerformFF", 10); for (; myIterator->More(); myIterator->Next()) { - if (UserBreak(aPSOuter)) - { - return; - } myIterator->Value(nF1, nF2); aMIFence.Add (nF1); @@ -340,11 +336,11 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) }//for (; myIterator->More(); myIterator->Next()) { // Standard_Integer k, aNbFaceFace = aVFaceFace.Length();; - Message_ProgressScope aPS1(aPSOuter.Next(9), "Face-face perform", aNbFaceFace); + Message_ProgressScope aPS(aPSOuter.Next(), "Face-face perform", aNbFaceFace); for (k = 0; k < aVFaceFace.Size(); k++) { BOPAlgo_FaceFace& aFaceFace = aVFaceFace.ChangeValue(k); - aFaceFace.SetProgress(aPS1.Next()); + aFaceFace.SetProgress(aPS.Next()); } //====================================================== // Perform intersection @@ -356,9 +352,8 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) //====================================================== // Treatment of the results - Message_ProgressScope aPS2(aPSOuter.Next(1), "Treatment of the results", aNbFaceFace); - for (k = 0; k < aNbFaceFace; ++k, aPS2.Next()) { - if (UserBreak(aPS2)) + for (k = 0; k < aNbFaceFace; ++k) { + if (UserBreak(aPSOuter)) { return; } @@ -409,7 +404,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) // BOPDS_VectorOfCurve& aVNC = aFF.ChangeCurves(); for (Standard_Integer i = 1; i <= aNbCurves; ++i) { - if (UserBreak(aPS2)) + if (UserBreak(aPSOuter)) { return; } @@ -429,10 +424,6 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) // Points BOPDS_VectorOfPoint& aVNP = aFF.ChangePoints(); for (Standard_Integer i = 1; i <= aNbPoints; ++i) { - if (UserBreak(aPS2)) - { - return; - } const IntTools_PntOn2Faces& aPi = aPntsX(i); const gp_Pnt& aP = aPi.P1().Pnt(); // @@ -469,6 +460,7 @@ static void UpdateSavedTolerance(const BOPDS_PDS& theDS, //======================================================================= void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, NULL, 1); if (myGlue != BOPAlgo_GlueOff) { return; } @@ -512,7 +504,6 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) // Map of PaveBlocks with the faces to which it has to be added BOPAlgo_DataMapOfPaveBlockListOfInteger aPBFacesMap; // - Message_ProgressScope aPS(theRange, NULL, 1); for (i=0; iChangePaveBlocksPool(); Standard_Integer aNbPBP = aPBP.Length(); + Message_ProgressScope aPSOuter(theRange, NULL, 1); if(!aNbPBP) { return; } @@ -429,7 +430,6 @@ void BOPAlgo_PaveFiller::MakeSplitEdges(const Message_ProgressRange& theRange) // aNbPBP=aPBP.Length(); // - Message_ProgressScope aPSOuter(theRange, NULL, 1); for (i = 0; i < aNbPBP; ++i) { if (UserBreak(aPSOuter)) @@ -471,10 +471,6 @@ void BOPAlgo_PaveFiller::MakeSplitEdges(const Message_ProgressRange& theRange) BOPDS_ListIteratorOfListOfPaveBlock it(aCB->PaveBlocks()); for (; it.More(); it.Next()) { - if (UserBreak(aPSOuter)) - { - return; - } nE = it.Value()->OriginalEdge(); if (myDS->PaveBlocks(nE).Extent() == 1) break; @@ -621,6 +617,7 @@ Standard_Integer BOPAlgo_PaveFiller::SplitEdge(const Standard_Integer nE, //======================================================================= void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) { + Message_ProgressScope aPSOuter(theRange, NULL, 1); if (myAvoidBuildPCurve || (!mySectionAttribute.PCurveOnS1() && !mySectionAttribute.PCurveOnS2())) return; @@ -633,11 +630,10 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) // // 1. Process Common Blocks const BOPDS_VectorOfFaceInfo& aFIP=myDS->FaceInfoPool(); - Message_ProgressScope aPS(theRange, "MakePCurves", aVMPC.Length()); // aNbFI=aFIP.Length(); for (i=0; iEdge(); const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); @@ -667,10 +659,6 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) const BOPDS_IndexedMapOfPaveBlock& aMPBOn=aFI.PaveBlocksOn(); aNbPBOn = aMPBOn.Extent(); for (j = 1; j <= aNbPBOn; ++j) { - if (UserBreak(aPS)) - { - return; - } const Handle(BOPDS_PaveBlock)& aPB = aMPBOn(j); nE=aPB->Edge(); const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); @@ -743,7 +731,7 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF(); aNbFF=aFFs.Length(); for (i=0; iEdge(); const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); @@ -796,6 +776,7 @@ void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange) }// for (i=0; iInitialize(aType[i], aType[2]); for (; myIterator->More(); myIterator->Next()) { @@ -932,7 +914,7 @@ void BOPAlgo_PaveFiller::Prepare(const Message_ProgressRange& theRange) } } // - Message_ProgressScope aPS(theRange, "Prepare", aVBPC.Length()); + Message_ProgressScope aPS(aPSOuter.Next(), "Prepare", aVBPC.Length()); for (i = 0; i < aVBPC.Length(); i++) { BOPAlgo_BPC& aBPC = aVBPC.ChangeValue(i); @@ -949,7 +931,7 @@ void BOPAlgo_PaveFiller::Prepare(const Message_ProgressRange& theRange) BRep_Builder aBB; TopoDS_Edge E; for (i = 0; i < aVBPC.Length(); i++) { - if (UserBreak(aPS)) + if (UserBreak(aPSOuter)) { return; }