]> OCCT Git - occt-copy.git/commitdiff
Added AnalyzeProgress to BOPAlgo_BOP
authorakaftasev <akaftasev@opencascade.com>
Fri, 16 Apr 2021 15:51:23 +0000 (18:51 +0300)
committerakaftasev <akaftasev@opencascade.com>
Fri, 16 Apr 2021 15:51:23 +0000 (18:51 +0300)
src/BOPAlgo/BOPAlgo_BOP.cxx
src/BOPAlgo/BOPAlgo_BOP.hxx
src/BOPAlgo/BOPAlgo_PaveFiller.cxx

index 686391b9bccd638ddd0e58db9bff15e52cb0acc7..c573a9b6f200c534da69d571db194083fc241525 100644 (file)
@@ -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<Standard_Real> 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))
     {
index 223078152f66fde259c20907cd45f157de54c44c..af4494871cc8364e6000e08b02f7a4548e060439 100644 (file)
@@ -94,9 +94,12 @@ protected:
   //! object <thePF>
   Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange) Standard_OVERRIDE;
   
+  //! AnalyzeProgress
+  Standard_EXPORT NCollection_Array1<Standard_Real> 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();
   
index 559360ca36f289c70a788d72aa9f7e822cc03d05..90153b8ca9dff3f9fa327cc7e177542e620e9e31 100644 (file)
@@ -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;