From faf50ddd730d2101e7f63d3b6c98d3853cc534cc Mon Sep 17 00:00:00 2001 From: akaftasev Date: Fri, 16 Apr 2021 16:41:39 +0300 Subject: [PATCH] Some fixes for PaveFiller and another classes --- src/BOPAlgo/BOPAlgo_PaveFiller.cxx | 47 +++++++++++++-------- src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx | 2 +- src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx | 2 +- src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx | 4 +- src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx | 4 +- src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx | 2 +- src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx | 2 +- 7 files changed, 38 insertions(+), 25 deletions(-) diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx index a19c4d7e5d..559360ca36 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx @@ -268,22 +268,23 @@ NCollection_Array1 BOPAlgo_PaveFiller::AnalyzeProgress() if (!myNonDestructive) { aPart -= 5; + // step for init aSteps(0) = 5; } if (!myIsPrimary) { aSum -= aStep8; - aSteps(8) = 0; + aStep8 = 0; } if (myGlue != BOPAlgo_GlueOff) { - aSteps(11) = 0; aSum -= aStep8; + aStep11 = 0; } if (myAvoidBuildPCurve) { - aSteps(12) = 0; aSum -= aStep12; + aStep12 = 0; } if (aSum == 0) @@ -291,19 +292,31 @@ NCollection_Array1 BOPAlgo_PaveFiller::AnalyzeProgress() aSteps(0) = 95.; return aSteps; } - + // step for PerformVV() aSteps(1) = aPart * aStep1 / aSum; + // step for PerformVE() aSteps(2) = aPart * aStep2 / aSum; + // step for PerformEE() aSteps(3) = aPart * aStep3 / aSum; + // step for PerformVF() aSteps(4) = aPart * aStep4 / aSum; + // step for PerformEF() aSteps(5) = aPart * aStep5 / aSum; + // step for RepeatIntersection() aSteps(6) = aPart * aStep6 / aSum; + // step for ForceInterfEE() aSteps(7) = aPart * aStep7 / aSum; + // step for ForceInterfEF() aSteps(8) = aPart * aStep8 / aSum; + // step for PerformFF() aSteps(9) = aPart * aStep9 / aSum; + // step for MakeSplitEdges() aSteps(10) = aPart * aStep10 / aSum; + // step for MakeBloks() aSteps(11) = aPart * aStep11 / aSum; + // step for MakePCurves() aSteps(12) = aPart * aStep12 / aSum; + return aSteps; } @@ -342,36 +355,36 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange) a += aSteps[i]; } // - Prepare(aPS.Next(aSteps[0])); // 2 - const = 3 + Prepare(aPS.Next(aSteps[0])); if (HasErrors()) { return; } // 00 - PerformVV(aPS.Next(aSteps[1])); // 3 - myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX); + PerformVV(aPS.Next(aSteps[1])); if (HasErrors()) { return; } // 01 - PerformVE(aPS.Next(aSteps[2])); // 4 - myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE); + PerformVE(aPS.Next(aSteps[2])); if (HasErrors()) { return; } // UpdatePaveBlocksWithSDVertices(); // 11 - PerformEE(aPS.Next(aSteps[3])); // 5 - myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE); + PerformEE(aPS.Next(aSteps[3])); if (HasErrors()) { return; } UpdatePaveBlocksWithSDVertices(); // 02 - PerformVF(aPS.Next(aSteps[4])); // 6 - vertex-face + PerformVF(aPS.Next(aSteps[4])); if (HasErrors()) { return; } UpdatePaveBlocksWithSDVertices(); // 12 - PerformEF(aPS.Next(aSteps[5])); // 7 - edge-face + PerformEF(aPS.Next(aSteps[5])); if (HasErrors()) { return; } @@ -379,26 +392,26 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange) UpdateInterfsWithSDVertices(); // Repeat Intersection with increased vertices - RepeatIntersection(aPS.Next(aSteps[6])); // 8 - vf+ve+vv + RepeatIntersection(aPS.Next(aSteps[6])); if (HasErrors()) return; // Force intersection of edges after increase // of the tolerance values of their vertices - ForceInterfEE(aPS.Next(aSteps[7])); // 9 - EE const = 2 + ForceInterfEE(aPS.Next(aSteps[7])); if (HasErrors()) { return; } // Force Edge/Face intersection after increase // of the tolerance values of their vertices - ForceInterfEF(aPS.Next(aSteps[8])); // 10 - EF const = 3 + ForceInterfEF(aPS.Next(aSteps[8])); if (HasErrors()) { return; } // // 22 - PerformFF(aPS.Next(aSteps[9])); // 11 - FF + PerformFF(aPS.Next(aSteps[9])); if (HasErrors()) { return; } @@ -407,14 +420,14 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange) // myDS->RefineFaceInfoIn(); // - MakeSplitEdges(aPS.Next(aSteps[10])); // 12 - const = 2 + MakeSplitEdges(aPS.Next(aSteps[10])); if (HasErrors()) { return; } // UpdatePaveBlocksWithSDVertices(); // - MakeBlocks(aPS.Next(aSteps[11])); // 13 - const = 2 + MakeBlocks(aPS.Next(aSteps[11])); if (HasErrors()) { return; } @@ -427,7 +440,7 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange) // RemoveMicroEdges(); // - MakePCurves(aPS.Next(aSteps[12])); // 14 - const = 2 + MakePCurves(aPS.Next(aSteps[12])); if (HasErrors()) { return; } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx index 60020e7472..824bcddc26 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx @@ -113,6 +113,7 @@ void BRepAlgoAPI_BuilderAlgo::Build(const Message_ProgressRange& theRange) //======================================================================= void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, NULL, 1); if (!myIsIntersectionNeeded) return; @@ -132,7 +133,6 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg myDSFiller->SetUseOBB(myUseOBB); // Set Face/Face intersection options to the intersection algorithm SetAttributes(); - Message_ProgressScope aPS(theRange, NULL, 1); // Perform intersection myDSFiller->Perform(aPS.Next()); // Check for the errors during intersection diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx index d4a05d0a9b..86bba86ecc 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx @@ -100,7 +100,7 @@ void BRepAlgoAPI_Check::Perform(const Message_ProgressRange& theRange) // Perform the check Message_ProgressScope aPS(theRange, NULL, 1); anAnalyzer.Perform(aPS.Next()); - if (HasErrors()) + if (UserBreak(aPS)) { return; } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx index 09186489c0..ae4dc2603a 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx @@ -57,7 +57,7 @@ BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1, : BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_CUT) { - Message_ProgressScope aPS(theRange, "Cut", 1); + Message_ProgressScope aPS(theRange, "Performing CUT operation", 1); Build(aPS.Next()); } //======================================================================= @@ -73,6 +73,6 @@ BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1, BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, (bFWD) ? BOPAlgo_CUT : BOPAlgo_CUT21) { - Message_ProgressScope aPS(theRange, "Cut", 1); + Message_ProgressScope aPS(theRange, "Performing CUT operation", 1); Build(aPS.Next()); } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx index dd0f9488b4..b7e47da979 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx @@ -57,7 +57,7 @@ BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, : BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_FUSE) { - Message_ProgressScope aPS(theRange, "Fuse", 1); + Message_ProgressScope aPS(theRange, "Performing FUSE operation", 1); Build(aPS.Next()); } //======================================================================= @@ -71,6 +71,6 @@ BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, : BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, BOPAlgo_FUSE) { - Message_ProgressScope aPS(theRange, "Fuse", 1); + Message_ProgressScope aPS(theRange, "Performing FUSE operation", 1); Build(aPS.Next()); } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx index 407dee4cb7..b5a1d325d2 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx @@ -273,7 +273,7 @@ void BRepAlgoAPI_Section::SetAttributes() //======================================================================= void BRepAlgoAPI_Section::Build(const Message_ProgressRange& theRange) { - Message_ProgressScope aPS(theRange, NULL, 1); + Message_ProgressScope aPS(theRange, "Performing SECTION operation", 1); BRepAlgoAPI_BooleanOperation::Build(aPS.Next()); } //======================================================================= diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx index cca83d831a..3ccfbfd2b9 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx @@ -50,7 +50,7 @@ void BRepAlgoAPI_Splitter::Build(const Message_ProgressRange& theRange) } // If necessary perform intersection of the argument shapes - Message_ProgressScope aPS(theRange, NULL, myIsIntersectionNeeded ? 10 : 1); + Message_ProgressScope aPS(theRange, "Performing Split operation", myIsIntersectionNeeded ? 10 : 1); if (myIsIntersectionNeeded) { // Combine Arguments and Tools for intersection into a single list -- 2.39.5