From: akaftasev Date: Fri, 16 Apr 2021 15:51:23 +0000 (+0300) Subject: Added AnalyzeProgress to BOPAlgo_BOP X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c9b256b91c9e4438214a5eceb3c6853b9ab8477e;p=occt-copy.git Added AnalyzeProgress to BOPAlgo_BOP --- diff --git a/src/BOPAlgo/BOPAlgo_BOP.cxx b/src/BOPAlgo/BOPAlgo_BOP.cxx index 686391b9bc..c573a9b6f2 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP.cxx @@ -403,6 +403,7 @@ void BOPAlgo_BOP::Perform(const Message_ProgressRange& theRange) myEntryPoint=1; PerformInternal(*pPF, aPS.Next(1)); } + //======================================================================= //function : PerformInternal1 //purpose : @@ -437,9 +438,10 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } // Message_ProgressScope aPS(theRange, "PerformInternal", 100); + NCollection_Array1 aSteps = BOPAlgo_Builder::AnalyzeProgress(); // 3. Fill Images // 3.1 Vertices - FillImagesVertices(aPS.Next(5)); // 5 + FillImagesVertices(aPS.Next(aSteps(0))); if (HasErrors()) { return; } @@ -449,7 +451,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me return; } // 3.2 Edges - FillImagesEdges(aPS.Next(5)); // 10 + FillImagesEdges(aPS.Next(aSteps(1))); if (HasErrors()) { return; } @@ -460,7 +462,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } // // 3.3 Wires - FillImagesContainers(TopAbs_WIRE, aPS.Next(10)); // 20 + FillImagesContainers(TopAbs_WIRE, aPS.Next(aSteps(2))); if (HasErrors()) { return; } @@ -471,7 +473,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } // // 3.4 Faces - FillImagesFaces(aPS.Next(30)); // 50 + FillImagesFaces(aPS.Next(aSteps(3))); if (HasErrors()) { return; } @@ -482,7 +484,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } // // 3.5 Shells - FillImagesContainers(TopAbs_SHELL, aPS.Next(10)); // 60 + FillImagesContainers(TopAbs_SHELL, aPS.Next(aSteps(4))); if (HasErrors()) { return; } @@ -493,7 +495,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } // // 3.6 Solids - FillImagesSolids(aPS.Next(5)); // 65 + FillImagesSolids(aPS.Next(aSteps(5))); if (HasErrors()) { return; } @@ -504,7 +506,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } // // 3.7 CompSolids - FillImagesContainers(TopAbs_COMPSOLID, aPS.Next(10)); // 75 + FillImagesContainers(TopAbs_COMPSOLID, aPS.Next(aSteps(6))); if (HasErrors()) { return; } @@ -515,7 +517,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } // // 3.8 Compounds - FillImagesCompounds(aPS.Next(10)); // 85 + FillImagesCompounds(aPS.Next(aSteps(7))); if (HasErrors()) { return; } @@ -526,7 +528,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } // // 4.BuildShape; - BuildShape(aPS.Next(15)); // 100 + BuildShape(); if (HasErrors()) { return; } @@ -771,9 +773,8 @@ void BOPAlgo_BOP::BuildRC() //function : BuildShape //purpose : //======================================================================= -void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange) +void BOPAlgo_BOP::BuildShape() { - Message_ProgressScope aPS(theRange, "BuildShape", 1); if (myDims[0] == 3 && myDims[1] == 3) { // For the Boolean operation on solids we need to check first @@ -834,10 +835,6 @@ void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange) TopTools_MapOfShape aMInpFence; aItLS.Initialize(aLSC); for (; aItLS.More(); aItLS.Next()) { - if (UserBreak(aPS)) - { - return; - } const TopoDS_Shape& aSC = aItLS.Value(); aMInpFence.Add(aSC); // @@ -845,10 +842,6 @@ void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange) // aIt.Initialize(aSC); for (; aIt.More(); aIt.Next()) { - if (UserBreak(aPS)) - { - return; - } const TopoDS_Shape& aS = aIt.Value(); if (myImages.IsBound(aS)) { const TopTools_ListOfShape& aLSIm = myImages.Find(aS); @@ -892,10 +885,6 @@ void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange) // aItLCB.Initialize(aLCB); for (; aItLCB.More(); aItLCB.Next()) { - if (UserBreak(aPS)) - { - return; - } BOPTools_AlgoTools::MakeContainer(aType, aRCB); // const TopoDS_Shape& aCB = aItLCB.Value(); @@ -951,10 +940,6 @@ void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange) aItLS.Initialize(aLSNonCont); for (; aItLS.More(); aItLS.Next()) { - if (UserBreak(aPS)) - { - return; - } const TopoDS_Shape& aS = aItLS.Value(); if (myImages.IsBound(aS)) { diff --git a/src/BOPAlgo/BOPAlgo_BOP.hxx b/src/BOPAlgo/BOPAlgo_BOP.hxx index 223078152f..af4494871c 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.hxx +++ b/src/BOPAlgo/BOPAlgo_BOP.hxx @@ -94,9 +94,12 @@ protected: //! object Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange) Standard_OVERRIDE; + //! AnalyzeProgress + Standard_EXPORT NCollection_Array1 AnalyzeProgress() Standard_OVERRIDE; + Standard_EXPORT virtual void BuildResult (const TopAbs_ShapeEnum theType) Standard_OVERRIDE; - Standard_EXPORT void BuildShape(const Message_ProgressRange& theRange); + Standard_EXPORT void BuildShape(); Standard_EXPORT void BuildRC(); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx index 559360ca36..90153b8ca9 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx @@ -179,9 +179,7 @@ void BOPAlgo_PaveFiller::SetSectionAttribute //======================================================================= void BOPAlgo_PaveFiller::Init(const Message_ProgressRange& theRange) { - if (!myArguments.Extent()) { - Message_ProgressScope aPS(theRange, "Init", 1); AddError (new BOPAlgo_AlertTooFewArguments); return; } @@ -189,10 +187,6 @@ void BOPAlgo_PaveFiller::Init(const Message_ProgressRange& theRange) Message_ProgressScope aPS(theRange, "Init", myArguments.Size()); TopTools_ListIteratorOfListOfShape aIt(myArguments); for (; aIt.More(); aIt.Next(), aPS.Next()) { - if (UserBreak(aPS)) - { - return; - } if (aIt.Value().IsNull()) { AddError (new BOPAlgo_AlertNullInputShapes); return;