]> OCCT Git - occt-copy.git/commitdiff
0021264: Modeling Algorithms - Progress indicator for Boolean operations
authorakaftasev <akaftasev@opencascade.com>
Thu, 18 Mar 2021 16:44:11 +0000 (19:44 +0300)
committerakaftasev <akaftasev@opencascade.com>
Mon, 12 Apr 2021 07:48:51 +0000 (10:48 +0300)
Update BOP commands to use progress indicator
Deleted wrong usage of progress indicator from bop operations
Added UserBreak() method to break execution boolean operation if progress indicator is used
Added method AnalyzeProgress() to calculate steps of progress indicator

121 files changed:
src/BOPAlgo/BOPAlgo_Alerts.hxx
src/BOPAlgo/BOPAlgo_Algo.cxx
src/BOPAlgo/BOPAlgo_Algo.hxx
src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx
src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.hxx
src/BOPAlgo/BOPAlgo_BOP.cxx
src/BOPAlgo/BOPAlgo_BOP.hxx
src/BOPAlgo/BOPAlgo_Builder.cxx
src/BOPAlgo/BOPAlgo_Builder.hxx
src/BOPAlgo/BOPAlgo_BuilderFace.cxx
src/BOPAlgo/BOPAlgo_BuilderFace.hxx
src/BOPAlgo/BOPAlgo_BuilderSolid.cxx
src/BOPAlgo/BOPAlgo_BuilderSolid.hxx
src/BOPAlgo/BOPAlgo_Builder_1.cxx
src/BOPAlgo/BOPAlgo_Builder_2.cxx
src/BOPAlgo/BOPAlgo_Builder_3.cxx
src/BOPAlgo/BOPAlgo_CellsBuilder.cxx
src/BOPAlgo/BOPAlgo_CellsBuilder.hxx
src/BOPAlgo/BOPAlgo_CheckerSI.cxx
src/BOPAlgo/BOPAlgo_CheckerSI.hxx
src/BOPAlgo/BOPAlgo_MakerVolume.cxx
src/BOPAlgo/BOPAlgo_MakerVolume.hxx
src/BOPAlgo/BOPAlgo_Options.cxx
src/BOPAlgo/BOPAlgo_Options.hxx
src/BOPAlgo/BOPAlgo_PaveFiller.cxx
src/BOPAlgo/BOPAlgo_PaveFiller.hxx
src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx
src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx
src/BOPAlgo/BOPAlgo_RemoveFeatures.hxx
src/BOPAlgo/BOPAlgo_Section.cxx
src/BOPAlgo/BOPAlgo_Section.hxx
src/BOPAlgo/BOPAlgo_ShellSplitter.cxx
src/BOPAlgo/BOPAlgo_ShellSplitter.hxx
src/BOPAlgo/BOPAlgo_Splitter.cxx
src/BOPAlgo/BOPAlgo_Splitter.hxx
src/BOPAlgo/BOPAlgo_Tools.cxx
src/BOPAlgo/BOPAlgo_WireSplitter.cxx
src/BOPAlgo/BOPAlgo_WireSplitter.hxx
src/BOPTest/BOPTest_APICommands.cxx
src/BOPTest/BOPTest_BOPCommands.cxx
src/BOPTest/BOPTest_CellsCommands.cxx
src/BOPTest/BOPTest_CheckCommands.cxx
src/BOPTest/BOPTest_PartitionCommands.cxx
src/BRepAlgo/BRepAlgo_Section.cxx
src/BRepAlgo/BRepAlgo_Section.hxx
src/BRepAlgoAPI/BRepAlgoAPI_Algo.hxx
src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx
src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.hxx
src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx
src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.hxx
src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx
src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Cut.hxx
src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.hxx
src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Fuse.hxx
src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx
src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Splitter.hxx
src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.cxx
src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.hxx
src/BRepFeat/BRepFeat_Builder.cxx
src/BRepFeat/BRepFeat_Builder.hxx
src/BRepFeat/BRepFeat_Gluer.cxx
src/BRepFeat/BRepFeat_Gluer.hxx
src/BRepFeat/BRepFeat_SplitShape.cxx
src/BRepFeat/BRepFeat_SplitShape.hxx
src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx
src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.hxx
src/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx
src/BRepFilletAPI/BRepFilletAPI_MakeFillet.hxx
src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.cxx
src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.hxx
src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx
src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.hxx
src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.cxx
src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.hxx
src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx
src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx
src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx
src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.hxx
src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx
src/BRepPrimAPI/BRepPrimAPI_MakeBox.hxx
src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.cxx
src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.hxx
src/BRepPrimAPI/BRepPrimAPI_MakePrism.cxx
src/BRepPrimAPI/BRepPrimAPI_MakePrism.hxx
src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx
src/BRepPrimAPI/BRepPrimAPI_MakeRevol.hxx
src/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx
src/BRepPrimAPI/BRepPrimAPI_MakeWedge.hxx
src/BRepTest/BRepTest_FilletCommands.cxx
src/IntTools/IntTools_FaceFace.cxx
src/IntTools/IntTools_FaceFace.hxx
src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx
src/ShapeConstruct/ShapeConstruct_MakeTriangulation.hxx

index 3871c58fcd60f921490aa73cb00085e5315ea6a2..8b9a2e37da941f72d9cf3254c22c679f3f0369a3 100644 (file)
@@ -18,6 +18,9 @@
 
 #include <TopoDS_AlertWithShape.hxx>
 
+//! Boolean operation was stoped by user
+DEFINE_SIMPLE_ALERT(BOPAlgo_AlertBOPUserBreak)
+
 //! Boolean operation of given type is not allowed on the given inputs
 DEFINE_SIMPLE_ALERT(BOPAlgo_AlertBOPNotAllowed)
 
index 1fd54eced92a78520eba97607d3e40777ed12aaa..e8f67c99287e8888b6a6d05be873a01cd5a3c532 100644 (file)
@@ -60,3 +60,8 @@ void BOPAlgo_Algo::CheckResult()
 {
   GetReport()->Clear(Message_Fail);
 }
+
+NCollection_Array1<Standard_Real> BOPAlgo_Algo::AnalyzeProgress()
+{
+  return NCollection_Array1<Standard_Real>();
+}
index fb62632d28ab783827223a3377e36401b2d14121..bfe80521224790ec71123d09011dcedbd58335d3 100644 (file)
@@ -21,6 +21,8 @@
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
+#include <Message_ProgressRange.hxx>
+#include <NCollection_Array1.hxx>
 
 #include <BOPAlgo_Options.hxx>
 
@@ -31,7 +33,7 @@ public:
 
   DEFINE_STANDARD_ALLOC
 
-  Standard_EXPORT virtual void Perform() = 0;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
 
 protected:
 
@@ -47,6 +49,9 @@ protected:
   //! Checks the obtained result
   Standard_EXPORT virtual void CheckResult();
 
+  //! Analyze progress steps
+  Standard_EXPORT virtual NCollection_Array1<Standard_Real> AnalyzeProgress();
+
 };
 
 #endif // _BOPAlgo_Algo_HeaderFile
index e92da635d821dd42cb0266be4ce656bdd4cba7ca..76f2c5dd9c143403852247b396aaff7609c0368b 100644 (file)
@@ -151,81 +151,99 @@ void BOPAlgo_ArgumentAnalyzer::Prepare()
 // function: Perform
 // purpose:
 // ================================================================================
-void BOPAlgo_ArgumentAnalyzer::Perform()
+void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange)
 {
+  Message_ProgressScope aPS(theRange, "Analyze", 1);
   try {
     OCC_CATCH_SIGNALS
     myResult.Clear();
-    //
-    UserBreak();
-    //
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     // 1. Prepare
     Prepare();
     //
-    UserBreak();
-    //
     // 2. Test types
     if(myArgumentTypeMode) {
       TestTypes();
+      if (UserBreak(aPS))
+      {
+        return;
+      }
     }
     //
-    UserBreak();
-    //
     // 3. Test self-interference
     if(mySelfInterMode) {
-      TestSelfInterferences();
+      TestSelfInterferences(aPS.Next());
+      if (UserBreak(aPS))
+      {
+        return;
+      }
     }
     //
-    UserBreak();
-    //
     // 4. Test small edges
     if(mySmallEdgeMode) {
       if(!(!myResult.IsEmpty() && myStopOnFirst))
         TestSmallEdge();
+      if (UserBreak(aPS))
+      {
+        return;
+      }
     }
     //
-    UserBreak();
-    //
     // 5. Test possibility to rebuild faces
     if(myRebuildFaceMode) {
       if(!(!myResult.IsEmpty() && myStopOnFirst))
         TestRebuildFace();
+      if (UserBreak(aPS))
+      {
+        return;
+      }
     }
     //
-    UserBreak();
-    //
     // 6. Test tangent
     if(myTangentMode) {
-      if(!(!myResult.IsEmpty() && myStopOnFirst))
+      if (!(!myResult.IsEmpty() && myStopOnFirst))
+      {
         TestTangent();
+        if (UserBreak(aPS))
+        {
+          return;
+        }
+      }
     }
     //
-    UserBreak();
-    //
     // 7. Test merge vertices
     if(myMergeVertexMode) {
       if(!(!myResult.IsEmpty() && myStopOnFirst))
         TestMergeVertex();
+      if (UserBreak(aPS))
+      {
+        return;
+      }
     }
     //
-    UserBreak();
-    //
     // 8. Test merge edges
     if(myMergeEdgeMode) {
       if(!(!myResult.IsEmpty() && myStopOnFirst))
         TestMergeEdge();
+      if (UserBreak(aPS))
+      {
+        return;
+      }
     }
     //
-    UserBreak();
-    //
     // 9. Test shapes continuity
     if(myContinuityMode) {
       if(!(!myResult.IsEmpty() && myStopOnFirst))
         TestContinuity();
+      if (UserBreak(aPS))
+      {
+        return;
+      }
     }
     //
-    UserBreak();
-    //
     // 10. Test validity of the curves on the surfaces
     if(myCurveOnSurfaceMode) {
       if(!(!myResult.IsEmpty() && myStopOnFirst))
@@ -332,10 +350,11 @@ void BOPAlgo_ArgumentAnalyzer::TestTypes()
 //function : TestSelfInterferences
 //purpose  : 
 //=======================================================================
-void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
+void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences(const Message_ProgressRange& theRange)
 {
   Standard_Integer ii;
   //
+  Message_ProgressScope aPS(theRange, NULL, 2);
   for(ii = 0; ii < 2; ii++) {
     const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2;
     if(aS.IsNull()) {
@@ -357,9 +376,12 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
     aChecker.SetNonDestructive(Standard_True);
     aChecker.SetRunParallel(myRunParallel);
     aChecker.SetFuzzyValue(myFuzzyValue);
-    aChecker.SetProgressIndicator(*myProgressScope);
     //
-    aChecker.Perform();
+    aChecker.Perform(aPS.Next());
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     Standard_Boolean hasError = aChecker.HasErrors();
     //
     const BOPDS_DS& aDS=*(aChecker.PDS());
index b26d3d2c3cedc0921e274a33019571ca5d75aad4..2c127cf55ebd37ed6a38f76f2d5584322d1c2166 100644 (file)
@@ -97,7 +97,7 @@ Standard_EXPORT virtual ~BOPAlgo_ArgumentAnalyzer();
     Standard_Boolean& CurveOnSurfaceMode();
   
   //! performs analysis
-  Standard_EXPORT void Perform();
+  Standard_EXPORT void Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
   
   //! result of test
   Standard_EXPORT Standard_Boolean HasFaulty() const;
@@ -114,7 +114,7 @@ protected:
   
   Standard_EXPORT void TestTypes();
   
-  Standard_EXPORT void TestSelfInterferences();
+  Standard_EXPORT void TestSelfInterferences(const Message_ProgressRange& theRange);
   
   Standard_EXPORT void TestSmallEdge();
   
index b3367e2eb02648b650460841af9a18bb84faa043..686391b9bccd638ddd0e58db9bff15e52cb0acc7 100644 (file)
@@ -353,7 +353,7 @@ void BOPAlgo_BOP::BuildResult(const TopAbs_ShapeEnum theType)
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BOP::Perform()
+void BOPAlgo_BOP::Perform(const Message_ProgressRange& theRange)
 {
   Handle(NCollection_BaseAllocator) aAllocator;
   BOPAlgo_PaveFiller* pPF;
@@ -387,25 +387,27 @@ void BOPAlgo_BOP::Perform()
   pPF=new BOPAlgo_PaveFiller(aAllocator);
   pPF->SetArguments(aLS);
   pPF->SetRunParallel(myRunParallel);
-  if (myProgressScope != NULL)
-  {
-    pPF->SetProgressIndicator(*myProgressScope);
-  }
+  Message_ProgressScope aPS(theRange, "BOPAlgo_BOP::Perform()", 10);
+
   pPF->SetFuzzyValue(myFuzzyValue);
   pPF->SetNonDestructive(myNonDestructive);
   pPF->SetGlue(myGlue);
   pPF->SetUseOBB(myUseOBB);
   //
-  pPF->Perform();
+  pPF->Perform(aPS.Next(9));
   //
+  if (!aPS.More())
+  {
+    return;
+  }
   myEntryPoint=1;
-  PerformInternal(*pPF);
+  PerformInternal(*pPF, aPS.Next(1));
 }
 //=======================================================================
 //function : PerformInternal1
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
 {
   myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
   myDS=myPaveFiller->PDS();
@@ -434,9 +436,10 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
     }
   }
   //
+  Message_ProgressScope aPS(theRange, "PerformInternal", 100);
   // 3. Fill Images
   // 3.1 Vertices
-  FillImagesVertices();
+  FillImagesVertices(aPS.Next(5));                          // 5
   if (HasErrors()) {
     return;
   }
@@ -446,7 +449,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
     return;
   }
   // 3.2 Edges
-  FillImagesEdges();
+  FillImagesEdges(aPS.Next(5));                             // 10
   if (HasErrors()) {
     return;
   }
@@ -457,7 +460,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   //
   // 3.3 Wires
-  FillImagesContainers(TopAbs_WIRE);
+  FillImagesContainers(TopAbs_WIRE, aPS.Next(10));          // 20
   if (HasErrors()) {
     return;
   }
@@ -468,18 +471,18 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   //
   // 3.4 Faces
-  FillImagesFaces();
+  FillImagesFaces(aPS.Next(30));                          // 50
   if (HasErrors()) {
     return;
   }
-  
+
   BuildResult(TopAbs_FACE);
   if (HasErrors()) {
     return;
   }
   //
   // 3.5 Shells
-  FillImagesContainers(TopAbs_SHELL);
+  FillImagesContainers(TopAbs_SHELL, aPS.Next(10));      // 60
   if (HasErrors()) {
     return;
   }
@@ -490,7 +493,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   //
   // 3.6 Solids
-  FillImagesSolids();
+  FillImagesSolids(aPS.Next(5));                       // 65
   if (HasErrors()) {
     return;
   }
@@ -501,7 +504,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   //
   // 3.7 CompSolids
-  FillImagesContainers(TopAbs_COMPSOLID);
+  FillImagesContainers(TopAbs_COMPSOLID, aPS.Next(10));   // 75
   if (HasErrors()) {
     return;
   }
@@ -512,7 +515,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   //
   // 3.8 Compounds
-  FillImagesCompounds();
+  FillImagesCompounds(aPS.Next(10));                    // 85
   if (HasErrors()) {
     return;
   }
@@ -523,7 +526,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   //
   // 4.BuildShape;
-  BuildShape();
+  BuildShape(aPS.Next(15));                             // 100
   if (HasErrors()) {
     return;
   }
@@ -768,8 +771,9 @@ void BOPAlgo_BOP::BuildRC()
 //function : BuildShape
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BOP::BuildShape()
+void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange)
 {
+  Message_ProgressScope aPS(theRange, "BuildShape", 1);
   if (myDims[0] == 3 && myDims[1] == 3)
   {
     // For the Boolean operation on solids we need to check first
@@ -830,6 +834,10 @@ void BOPAlgo_BOP::BuildShape()
   TopTools_MapOfShape aMInpFence;
   aItLS.Initialize(aLSC);
   for (; aItLS.More(); aItLS.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const TopoDS_Shape& aSC = aItLS.Value();
     aMInpFence.Add(aSC);
     //
@@ -837,6 +845,10 @@ void BOPAlgo_BOP::BuildShape()
     //
     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);
@@ -880,6 +892,10 @@ void BOPAlgo_BOP::BuildShape()
     //
     aItLCB.Initialize(aLCB);
     for (; aItLCB.More(); aItLCB.Next()) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       BOPTools_AlgoTools::MakeContainer(aType, aRCB);
       //
       const TopoDS_Shape& aCB = aItLCB.Value();
@@ -935,6 +951,10 @@ void BOPAlgo_BOP::BuildShape()
   aItLS.Initialize(aLSNonCont);
   for (; aItLS.More(); aItLS.Next())
   {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const TopoDS_Shape& aS = aItLS.Value();
     if (myImages.IsBound(aS))
     {
index 4598262348296f2f511fdf7636a6b8acbd98fe12..223078152f66fde259c20907cd45f157de54c44c 100644 (file)
@@ -84,7 +84,7 @@ public:
   
   Standard_EXPORT BOPAlgo_Operation Operation() const;
   
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 protected:
   
@@ -92,11 +92,11 @@ protected:
   
   //! Performs calculations using prepared Filler
   //! object <thePF>
-  Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange) Standard_OVERRIDE;
   
   Standard_EXPORT virtual void BuildResult (const TopAbs_ShapeEnum theType) Standard_OVERRIDE;
   
-  Standard_EXPORT void BuildShape();
+  Standard_EXPORT void BuildShape(const Message_ProgressRange& theRange);
   
   Standard_EXPORT void BuildRC();
   
index 7ef864a1b602e9797c5a6bc15cb73963366592ab..156a7ad38e058da3e6785181b2273318e7c2b579 100644 (file)
@@ -177,7 +177,7 @@ void BOPAlgo_Builder::Prepare()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::Perform()
+void BOPAlgo_Builder::Perform(const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
   //
@@ -195,25 +195,26 @@ void BOPAlgo_Builder::Perform()
   //
   pPF->SetArguments(myArguments);
   pPF->SetRunParallel(myRunParallel);
-  if (myProgressScope != NULL)
-  {
-    pPF->SetProgressIndicator(*myProgressScope);
-  }
+  Message_ProgressScope aPS(theRange, "BOPAlgo_Builder::Perform()", 10);
   pPF->SetFuzzyValue(myFuzzyValue);
   pPF->SetNonDestructive(myNonDestructive);
   pPF->SetGlue(myGlue);
   pPF->SetUseOBB(myUseOBB);
   //
-  pPF->Perform();
+  pPF->Perform(aPS.Next(9));
   //
+  if (HasErrors())
+  {
+    return;
+  }
   myEntryPoint=1;
-  PerformInternal(*pPF);
+  PerformInternal(*pPF, aPS.Next(1));
 }
 //=======================================================================
 //function : PerformWithFiller
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
   myEntryPoint=0;
@@ -221,19 +222,20 @@ void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller)
   myFuzzyValue = theFiller.FuzzyValue();
   myGlue = theFiller.Glue();
   myUseOBB = theFiller.UseOBB();
-  PerformInternal(theFiller);
+  Message_ProgressScope aPS(theRange, NULL, 1);
+  PerformInternal(theFiller, aPS.Next());
 }
 //=======================================================================
 //function : PerformInternal
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
   //
   try {
     OCC_CATCH_SIGNALS
-    PerformInternal1(theFiller);
+    PerformInternal1(theFiller, theRange);
   }
   //
   catch (Standard_Failure const&) {
@@ -244,7 +246,7 @@ void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
 //function : PerformInternal1
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
 {
   myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
   myDS=myPaveFiller->PDS();
@@ -252,6 +254,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   myFuzzyValue = myPaveFiller->FuzzyValue();
   myNonDestructive = myPaveFiller->NonDestructive();
   //
+  Message_ProgressScope aPS(theRange, "PerformInternal", 100);
   // 1. CheckData
   CheckData();
   if (HasErrors()) {
@@ -266,7 +269,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   //
   // 3. Fill Images
   // 3.1 Vertice
-  FillImagesVertices();
+  FillImagesVertices(aPS.Next(10));                    // 10
   if (HasErrors()) {
     return;
   }
@@ -276,7 +279,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
     return;
   }
   // 3.2 Edges
-  FillImagesEdges();
+  FillImagesEdges(aPS.Next(10));                       // 20
   if (HasErrors()) {
     return;
   }
@@ -287,7 +290,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   //
   // 3.3 Wires
-  FillImagesContainers(TopAbs_WIRE);
+  FillImagesContainers(TopAbs_WIRE, aPS.Next(10));      // 30
   if (HasErrors()) {
     return;
   }
@@ -298,7 +301,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   
   // 3.4 Faces
-  FillImagesFaces();
+  FillImagesFaces(aPS.Next(30));                        // 60 
   if (HasErrors()) {
     return;
   }
@@ -308,7 +311,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
     return;
   }
   // 3.5 Shells
-  FillImagesContainers(TopAbs_SHELL);
+  FillImagesContainers(TopAbs_SHELL, aPS.Next(10));     // 70
   if (HasErrors()) {
     return;
   }
@@ -318,7 +321,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
     return;
   }
   // 3.6 Solids
-  FillImagesSolids();
+  FillImagesSolids(aPS.Next(10));                        // 80
   if (HasErrors()) {
     return;
   }
@@ -328,7 +331,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
     return;
   }
   // 3.7 CompSolids
-  FillImagesContainers(TopAbs_COMPSOLID);
+  FillImagesContainers(TopAbs_COMPSOLID, aPS.Next(10));   // 90
   if (HasErrors()) {
     return;
   }
@@ -339,7 +342,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
   }
   
   // 3.8 Compounds
-  FillImagesCompounds();
+  FillImagesCompounds(aPS.Next(10));                      // 100
   if (HasErrors()) {
     return;
   }
@@ -635,10 +638,6 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
   aBS.SetRunParallel(myRunParallel);
   aBS.SetContext(myContext);
   aBS.SetFuzzyValue(myFuzzyValue);
-  if (myProgressScope != NULL)
-  {
-    aBS.SetProgressIndicator(*myProgressScope);
-  }
   aBS.Perform();
 
   // Resulting solids
index 2d8d1e97c9f17015eeefe6c617c989d97a452e21..78cfa8b6e0ed4e8546c07ffece6e7aaf41c861e6 100644 (file)
@@ -169,11 +169,11 @@ public: //! @name Performing the operation
 
   //! Performs the operation.
   //! The intersection will be performed also.
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
   //! Performs the operation with the prepared filler.
   //! The intersection will not be performed in this case.
-  Standard_EXPORT virtual void PerformWithFiller (const BOPAlgo_PaveFiller& theFiller);
+  Standard_EXPORT virtual void PerformWithFiller (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange = Message_ProgressRange());
 
 
 public: //! @name BOPs on open solids
@@ -339,12 +339,12 @@ protected: //! @name Methods for building the result
 
   //! Performs the building of the result.
   //! The method calls the PerformInternal1() method surrounded by a try-catch block.
-  Standard_EXPORT virtual void PerformInternal (const BOPAlgo_PaveFiller& thePF);
+  Standard_EXPORT virtual void PerformInternal (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange);
 
   //! Performs the building of the result.
   //! To build the result of any other operation
   //! it will be necessary to override this method.
-  Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF);
+  Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange);
 
   //! Builds the result of operation.
   //! The method is called for each of the arguments type and
@@ -367,19 +367,19 @@ protected: //! @name Checking input arguments
 protected: //! @name Fill Images of VERTICES
 
   //! Fills the images of vertices.
-  Standard_EXPORT void FillImagesVertices();
+  Standard_EXPORT void FillImagesVertices(const Message_ProgressRange& theRange);
 
 
 protected: //! @name Fill Images of EDGES
 
   //! Fills the images of edges.
-  Standard_EXPORT void FillImagesEdges();
+  Standard_EXPORT void FillImagesEdges(const Message_ProgressRange& theRange);
 
 
 protected: //! @name Fill Images of CONTAINERS
 
   //! Fills the images of containers (WIRES/SHELLS/COMPSOLID).
-  Standard_EXPORT void FillImagesContainers (const TopAbs_ShapeEnum theType);
+  Standard_EXPORT void FillImagesContainers (const TopAbs_ShapeEnum theType, const Message_ProgressRange& theRange);
 
   //! Builds the image of the given container using the splits
   //! of its sub-shapes.
@@ -393,7 +393,7 @@ protected: //! @name Fill Images of FACES
   //! 1. Build the splits of faces;
   //! 2. Find SD faces;
   //! 3. Add internal vertices (if any) to faces.
-  Standard_EXPORT void FillImagesFaces();
+  Standard_EXPORT void FillImagesFaces(const Message_ProgressRange& theRange);
 
   //! Builds the splits of faces using the information from the
   //! intersection stage stored in Data Structure.
@@ -416,7 +416,7 @@ protected: //! @name Fill Images of SOLIDS
   //! 2. Find faces from other arguments located inside the solids;
   //! 3. Build splits of solid using the inside faces;
   //! 4. Fill internal shapes for the splits (Wires and vertices).
-  Standard_EXPORT void FillImagesSolids();
+  Standard_EXPORT void FillImagesSolids(const Message_ProgressRange& theRange);
 
   //! Builds the draft solid by rebuilding the shells of the solid
   //! with the splits of faces.
@@ -439,7 +439,7 @@ protected: //! @name Fill Images of SOLIDS
 protected: //! @name Fill Images of COMPOUNDS
 
   //! Fills the images of compounds.
-  Standard_EXPORT void FillImagesCompounds();
+  Standard_EXPORT void FillImagesCompounds(const Message_ProgressRange& theRange);
 
   //! Builds the image of the given compound.
   Standard_EXPORT void FillImagesCompound (const TopoDS_Shape& theS,
index 8fe38f13ffdc02ee4a772177bce2fa5a2687453a..ecf3bc6cfd885455e8b3c6697a6604f5b7ef2570 100644 (file)
@@ -141,38 +141,31 @@ void BOPAlgo_BuilderFace::CheckData()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderFace::Perform()
+void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
   //
+  Message_ProgressScope aPS(theRange, NULL, 1);
   CheckData();
-  if (HasErrors()) {
+  if (HasErrors() && UserBreak(aPS)) {
     return;
   }
   //
-  UserBreak();
-  //
   PerformShapesToAvoid();
-  if (HasErrors()) {
+  if (HasErrors() && UserBreak(aPS)) {
     return;
   }
   //
-  UserBreak();
-  //
   PerformLoops();
-  if (HasErrors()) {
+  if (HasErrors() && UserBreak(aPS)) {
     return;
   }
   //
-  UserBreak();
-  //
   PerformAreas();
-  if (HasErrors()) {
+  if (HasErrors() && UserBreak(aPS)) {
     return;
   }
   //
-  UserBreak();
-  //
   PerformInternalShapes();
   if (HasErrors()) {
     return;
index 4ded4e6cc32f61500486ccdf2ee19e7e51dc8221..2bc29661517802c760115d2b70a868e1d24fd16b 100644 (file)
@@ -54,7 +54,7 @@ Standard_EXPORT virtual ~BOPAlgo_BuilderFace();
   Standard_EXPORT const TopoDS_Face& Face() const;
   
   //! Performs the algorithm
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   Standard_EXPORT TopAbs_Orientation Orientation() const;
 
index a024a4f2cae68b14793e8f8409ac9b06f7669a6b..eda7a3ebb6602d167f7cba44581dcff6614fb827 100644 (file)
@@ -106,7 +106,7 @@ BOPAlgo_BuilderSolid::~BOPAlgo_BuilderSolid()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderSolid::Perform()
+void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
   //
@@ -123,36 +123,35 @@ void BOPAlgo_BuilderSolid::Perform()
   BRep_Builder aBB;
   TopTools_ListIteratorOfListOfShape aIt;
   //
+  Message_ProgressScope aPS(theRange, NULL, 1);
   aBB.MakeCompound(aC);
   aIt.Initialize(myShapes);
   for(; aIt.More(); aIt.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const TopoDS_Shape& aF=aIt.Value();
     aBB.Add(aC, aF);
   }
   //
-  UserBreak();
+  
   //
   PerformShapesToAvoid();
-  if (HasErrors()) {
+  if (HasErrors() && UserBreak(aPS)) {
     return;
   }
   //
-  UserBreak();
-  //
   PerformLoops();
-  if (HasErrors()) {
+  if (HasErrors() && UserBreak(aPS)) {
     return;
   }
   //
-  UserBreak();
-  //
   PerformAreas();
-  if (HasErrors()) {
+  if (HasErrors() && UserBreak(aPS)) {
     return;
   }
   //
-  UserBreak();
-  //
   PerformInternalShapes();
   if (HasErrors()) {
     return;
index 756d1861e816c78488d9956bba000728ffe6428d..787c806cfbdc7bd9702045307710d3092d3232f0 100644 (file)
@@ -96,7 +96,7 @@ public: //! @name Constructors
 public: //! @name Performing the operation
 
   //! Performs the construction of the solids from the given faces
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 public: //! @name Getting the bounding boxes of the created solids
 
index 90767d6982cb1d9df6abb46d51218baff214598f..fce80e4cd4e6ea3f1aa4db67eef1350d85cdc828 100644 (file)
 //function : FillImagesVertices
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::FillImagesVertices()
+void BOPAlgo_Builder::FillImagesVertices(const Message_ProgressRange& theRange)
 {
+  Message_ProgressScope aPS(theRange, "FillImagesVertices", myDS->ShapesSD().Size());
   TColStd_DataMapIteratorOfDataMapOfIntegerInteger aIt(myDS->ShapesSD());
-  for (; aIt.More(); aIt.Next())
+  for (; aIt.More(); aIt.Next(), aPS.Next())
   {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     Standard_Integer nV = aIt.Key();
     Standard_Integer nVSD = aIt.Value();
 
@@ -63,10 +68,15 @@ void BOPAlgo_Builder::FillImagesVertices()
 //function : FillImagesEdges
 //purpose  : 
 //=======================================================================
-  void BOPAlgo_Builder::FillImagesEdges()
+  void BOPAlgo_Builder::FillImagesEdges(const Message_ProgressRange& theRange)
 {
   Standard_Integer i, aNbS = myDS->NbSourceShapes();
-  for (i = 0; i < aNbS; ++i) {
+  Message_ProgressScope aPS(theRange, "FillImagesEdges", aNbS);
+  for (i = 0; i < aNbS; ++i, aPS.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
     if (aSI.ShapeType() != TopAbs_EDGE) {
       continue;
@@ -87,6 +97,10 @@ void BOPAlgo_Builder::FillImagesVertices()
     //
     BOPDS_ListIteratorOfListOfPaveBlock aItPB(aLPB);
     for (; aItPB.More(); aItPB.Next()) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       const Handle(BOPDS_PaveBlock)& aPB = aItPB.Value();
       Handle(BOPDS_PaveBlock) aPBR = myDS->RealPaveBlock(aPB);
       //
@@ -149,13 +163,18 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType)
 // function: FillImagesContainers
 // purpose: 
 //=======================================================================
-  void BOPAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType)
+  void BOPAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType, const Message_ProgressRange& theRange)
 {
   Standard_Integer i, aNbS;
   TopTools_MapOfShape aMFP(100, myAllocator);
   //
   aNbS=myDS->NbSourceShapes();
-  for (i=0; i<aNbS; ++i) {
+  Message_ProgressScope aPS(theRange, "FillImagesContainers", aNbS);
+  for (i=0; i<aNbS; ++i, aPS.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
     if (aSI.ShapeType()==theType) {
       const TopoDS_Shape& aC=aSI.Shape();
@@ -167,13 +186,18 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType)
 // function: FillImagesCompounds
 // purpose: 
 //=======================================================================
-  void BOPAlgo_Builder::FillImagesCompounds()
+  void BOPAlgo_Builder::FillImagesCompounds(const Message_ProgressRange& theRange)
 {
   Standard_Integer i, aNbS;
   TopTools_MapOfShape aMFP(100, myAllocator);
   //
   aNbS=myDS->NbSourceShapes();
-  for (i=0; i<aNbS; ++i) {
+  Message_ProgressScope aPS(theRange, "FillImagesCompounds", aNbS);
+  for (i=0; i<aNbS; ++i, aPS.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
     if (aSI.ShapeType()==TopAbs_COMPOUND) {
       const TopoDS_Shape& aC=aSI.Shape();
index a0a2fc870c5a525402e2fa15074d43510f84946c..ec9e7be05e0fc430f53a6e2841002538ebe2bce8 100644 (file)
@@ -102,8 +102,7 @@ class BOPAlgo_PairOfShapeBoolean : public BOPAlgo_Algo {
     return myContext;
   }
   //
-  virtual void Perform() {
-    BOPAlgo_Algo::UserBreak();
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
     //  
     const TopoDS_Face& aFj=*((TopoDS_Face*)&myShape1);
     const TopoDS_Face& aFk=*((TopoDS_Face*)&myShape2);
@@ -169,10 +168,9 @@ class BOPAlgo_VFI : public BOPAlgo_Algo {
     return myContext;
   }
   //
-  virtual void Perform() {
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
     Standard_Real aT1, aT2, dummy;
     //
-    BOPAlgo_Algo::UserBreak();
     Standard_Integer iFlag =
       myContext->ComputeVF(myV, myF, aT1, aT2, dummy, myFuzzyValue);
     myIsInternal = (iFlag == 0);
@@ -191,10 +189,19 @@ typedef NCollection_Vector<BOPAlgo_VFI> BOPAlgo_VectorOfVFI;
 //function : FillImagesFaces
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::FillImagesFaces()
+void BOPAlgo_Builder::FillImagesFaces(const Message_ProgressRange& theRange)
 {
+  Message_ProgressScope aPS(theRange, "FillImagesFaces", 1);
   BuildSplitFaces();
+  if (UserBreak(aPS))
+  {
+    return;
+  }
   FillSameDomainFaces();
+  if (UserBreak(aPS))
+  {
+    return;
+  }
   FillInternalVertices();
 }
 //=======================================================================
@@ -450,10 +457,6 @@ void BOPAlgo_Builder::BuildSplitFaces()
     aBF.SetFace(aF);
     aBF.SetShapes(aLE);
     aBF.SetRunParallel(myRunParallel);
-    if (myProgressScope != NULL)
-    {
-      aBF.SetProgressIndicator(*myProgressScope);
-    }
     //
   }// for (i=0; i<aNbS; ++i) {
   //
@@ -640,10 +643,6 @@ void BOPAlgo_Builder::FillSameDomainFaces()
         aPSB.Shape1() = aF1;
         aPSB.Shape2() = aF2;
         aPSB.SetFuzzyValue(myFuzzyValue);
-        if (myProgressScope != NULL)
-        {
-          aPSB.SetProgressIndicator(*myProgressScope);
-        }
       }
     }
   }
@@ -796,10 +795,6 @@ void BOPAlgo_Builder::FillInternalVertices()
         aVFI.SetVertex(aV);
         aVFI.SetFace(aFIm);
         aVFI.SetFuzzyValue(myFuzzyValue);
-        if (myProgressScope != NULL)
-        {
-          aVFI.SetProgressIndicator(*myProgressScope);
-        }
       }
     }
   }
index f8d5b50999e8fc6b72cff5f7774ba8fd66590456..6a5cc2a692a241696390b47df2dab664c3a09c8b 100644 (file)
@@ -73,14 +73,19 @@ static
 //function : FillImagesSolids
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::FillImagesSolids()
+void BOPAlgo_Builder::FillImagesSolids(const Message_ProgressRange& theRange)
 {
+  Message_ProgressScope aPS(theRange, "FillImagesSolid", 1);
   Standard_Boolean bHasSolids;
   Standard_Integer i, aNbS;
   //
   bHasSolids=Standard_False;
   aNbS=myDS->NbSourceShapes();
   for (i=0; i<aNbS; ++i) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
     if (aSI.ShapeType()==TopAbs_SOLID) {
       bHasSolids=!bHasSolids;
@@ -96,8 +101,16 @@ void BOPAlgo_Builder::FillImagesSolids()
   TopTools_DataMapOfShapeShape aDraftSolids;
   // Find all IN faces for all IN faces
   FillIn3DParts(aDraftSolids);
+  if (UserBreak(aPS))
+  {
+    return;
+  }
   // Build split of the solids
   BuildSplitSolids(aDraftSolids);
+  if (UserBreak(aPS))
+  {
+    return;
+  }
   // Fill solids with internal parts
   FillInternalShapes();
 }
@@ -432,10 +445,6 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
     aBS.SetSolid(aSolid);
     aBS.SetShapes(aSFS);
     aBS.SetRunParallel(myRunParallel);
-    if (myProgressScope != NULL)
-    {
-      aBS.SetProgressIndicator(*myProgressScope);
-    }
   }//for (i=0; i<aNbS; ++i) {
   //
   Standard_Integer k, aNbBS;
@@ -611,8 +620,6 @@ void BOPAlgo_Builder::FillInternalShapes()
       continue;
     }
     //
-    UserBreak();
-    //
     const TopoDS_Shape& aS=aSI.Shape();
     //
     aMx.Clear();
index 83e87b24149ce0840edc7f4c204770951803d8c4..0d545e70c50ba1208a958c028b09e230f13c48bc 100644 (file)
@@ -102,14 +102,15 @@ const TopoDS_Shape& BOPAlgo_CellsBuilder::GetAllParts() const
 //function : PerformInternal1
 //purpose  : 
 //=======================================================================
-void BOPAlgo_CellsBuilder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_CellsBuilder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
 {
   // Avoid filling history after GF operation as later
   // in this method the result shape will be nullified
   Standard_Boolean isHistory = HasHistory();
   SetToFillHistory(Standard_False);
   // Perform splitting of the arguments
-  BOPAlgo_Builder::PerformInternal1(theFiller);
+  Message_ProgressScope aPS(theRange, "BOPAlgo_CellsBuilder", 1);
+  BOPAlgo_Builder::PerformInternal1(theFiller, aPS.Next());
   if (HasErrors()) {
     return;
   }
index c9183fa73021601988f570dd158300081671b152..dfcc691260fc9e05459460cb9203fa99ec36781a 100644 (file)
@@ -244,7 +244,7 @@ class BOPAlgo_CellsBuilder : public BOPAlgo_Builder
 
   //! Redefined method PerformInternal1 - makes all split parts,
   //! nullifies the result <myShape>, and index all parts.
-  Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange) Standard_OVERRIDE;
 
   //! Indexes the parts for quick access to the arguments.
   Standard_EXPORT void IndexParts();
index 93e4a0645c9fb622ea984c5a7219d28e1faf2eeb..02d317bcff7751b34bd54482889a658707c9a5b3 100644 (file)
@@ -88,8 +88,12 @@ class BOPAlgo_FaceSelfIntersect :
     return myTolF;
   }
   //
-  virtual void Perform() {
-    BOPAlgo_Algo::UserBreak();
+  virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) {
+    Message_ProgressScope aPS(theRange, NULL, 1);
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     IntTools_FaceFace::Perform(myF, myF);
   }
   //
@@ -140,7 +144,7 @@ void BOPAlgo_CheckerSI::SetLevelOfCheck(const Standard_Integer theLevel)
 //function : Init
 //purpose  : 
 //=======================================================================
-void BOPAlgo_CheckerSI::Init()
+void BOPAlgo_CheckerSI::Init(const Message_ProgressRange& /*theRange*/)
 {
   Clear();
   //
@@ -164,7 +168,7 @@ void BOPAlgo_CheckerSI::Init()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_CheckerSI::Perform()
+void BOPAlgo_CheckerSI::Perform(const Message_ProgressRange& theRange)
 {
   try {
     OCC_CATCH_SIGNALS
@@ -174,8 +178,13 @@ void BOPAlgo_CheckerSI::Perform()
       return;
     }
     //
+    Message_ProgressScope aPS(theRange, NULL, 1);
     // Perform intersection of sub shapes
-    BOPAlgo_PaveFiller::Perform();
+    BOPAlgo_PaveFiller::Perform(aPS.Next());
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     //
     CheckFaceSelfIntersection();
     
@@ -431,11 +440,6 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection()
     aFaceSelfIntersect.SetIndex(i);
     aFaceSelfIntersect.SetFace(aF);
     aFaceSelfIntersect.SetTolF(aTolF);
-    //
-    if (myProgressScope != NULL)
-    {
-      aFaceSelfIntersect.SetProgressIndicator(*myProgressScope);
-    }
   }
   
   Standard_Integer aNbFace = aVFace.Length();
index da10832f5a2c3db264e80b7e74b6bb47fcd83f97..3e8701149f88387d0bf8e3876f5d55eae6577fba 100644 (file)
@@ -46,7 +46,7 @@ public:
   Standard_EXPORT BOPAlgo_CheckerSI();
   Standard_EXPORT virtual ~BOPAlgo_CheckerSI();
   
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Sets the level of checking shape on self-interference.<br>
   //! It defines which interferences will be checked:<br>
@@ -64,7 +64,7 @@ public:
 
 protected:
 
-  Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Init(const Message_ProgressRange& theRange) Standard_OVERRIDE;
 
   //! Treats the intersection results
   Standard_EXPORT void PostTreat();
index 2ea86e878317b633dafb9620d785a84cbf3a93df..e2237324748fdc460e665d53b7e789f99cf4481c 100644 (file)
@@ -48,7 +48,7 @@ void BOPAlgo_MakerVolume::CheckData()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_MakerVolume::Perform()
+void BOPAlgo_MakerVolume::Perform(const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
   //
@@ -86,18 +86,19 @@ void BOPAlgo_MakerVolume::Perform()
   }
   //
   pPF->SetRunParallel(myRunParallel);
-  if (myProgressScope != NULL)
-  {
-    pPF->SetProgressIndicator(*myProgressScope);
-  }
   pPF->SetFuzzyValue(myFuzzyValue);
   pPF->SetNonDestructive(myNonDestructive);
   pPF->SetGlue(myGlue);
   pPF->SetUseOBB(myUseOBB);
-  pPF->Perform();
+  Message_ProgressScope aPS(theRange, "MakerVolume", 10);
+  pPF->Perform(aPS.Next(9));
+  if (HasErrors())
+  {
+    return;
+  }
   //
   myEntryPoint = 1;
-  PerformInternal(*pPF);
+  PerformInternal(*pPF, aPS.Next(1));
 }
 
 //=======================================================================
@@ -105,7 +106,7 @@ void BOPAlgo_MakerVolume::Perform()
 //purpose  : 
 //=======================================================================
 void BOPAlgo_MakerVolume::PerformInternal1
-  (const BOPAlgo_PaveFiller& theFiller)
+  (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
 {
   myPaveFiller = (BOPAlgo_PaveFiller*)&theFiller;
   myDS = myPaveFiller->PDS();
@@ -126,26 +127,31 @@ void BOPAlgo_MakerVolume::PerformInternal1
   // 3. Fill Images
   // 3.1. Vertice
   if (myIntersect) {
-    FillImagesVertices();
+    Message_ProgressScope aPS(theRange, "PerformInternal", 100);
+    FillImagesVertices(aPS.Next(15));         // 15
     if (HasErrors()) {
       return;
     }
     // 3.2. Edges
-    FillImagesEdges();
+    FillImagesEdges(aPS.Next(15));            // 30
     if (HasErrors()) {
       return;
     }
     // 3.3. Wires
-    FillImagesContainers(TopAbs_WIRE);
+    FillImagesContainers(TopAbs_WIRE, aPS.Next(20));    // 50
     if (HasErrors()) {
       return;
     }
     // 3.4. Faces
-    FillImagesFaces();
+    FillImagesFaces(aPS.Next(50));            // 100
     if (HasErrors()) {
       return;
     }
   }
+  else
+  {
+    Message_ProgressScope aPS(theRange, NULL, 1);
+  }
   //
   // 4. Collect faces
   CollectFaces();
@@ -187,7 +193,6 @@ void BOPAlgo_MakerVolume::PerformInternal1
 //=======================================================================
 void BOPAlgo_MakerVolume::CollectFaces()
 {
-  UserBreak();
   //
   Standard_Integer i, aNbShapes;
   TopTools_ListIteratorOfListOfShape aIt;
@@ -226,7 +231,6 @@ void BOPAlgo_MakerVolume::CollectFaces()
 //=======================================================================
 void BOPAlgo_MakerVolume::MakeBox(TopTools_MapOfShape& theBoxFaces)
 {
-  UserBreak();
   //
   Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt;
   //
@@ -253,7 +257,6 @@ void BOPAlgo_MakerVolume::MakeBox(TopTools_MapOfShape& theBoxFaces)
 //=======================================================================
 void BOPAlgo_MakerVolume::BuildSolids(TopTools_ListOfShape& theLSR)
 {
-  UserBreak();
   //
   BOPAlgo_BuilderSolid aBS;
   //
@@ -279,7 +282,6 @@ void BOPAlgo_MakerVolume::BuildSolids(TopTools_ListOfShape& theLSR)
 void BOPAlgo_MakerVolume::RemoveBox(TopTools_ListOfShape&      theLSR,
                                     const TopTools_MapOfShape& theBoxFaces)
 {
-  UserBreak();
   //
   TopTools_ListIteratorOfListOfShape aIt;
   TopExp_Explorer aExp;
@@ -336,8 +338,6 @@ void BOPAlgo_MakerVolume::FillInternalShapes(const TopTools_ListOfShape& theLSR)
     return;
   }
 
-  UserBreak();
-
   // Get all non-compound shapes
   TopTools_ListOfShape aLSC;
   // Fence map
index a17424363ba9caf2c4d6ec9ef28e3a631e16fb60..6763df030ce09ae6ca699660af458dc47ba5d133 100644 (file)
@@ -151,7 +151,7 @@ public:
   }
 
   //! Performs the operation.
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 protected:
 
@@ -159,7 +159,7 @@ protected:
   Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
 
   //! Performs the operation.
-  Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
   //! Collects all faces.
   Standard_EXPORT void CollectFaces();
index 34da6bcd3baa1a5e80dfdcecf8441205dce61edf..5beda282059c1c40325077f8b0e3123aec3d617a 100644 (file)
@@ -21,6 +21,7 @@
 #include <Precision.hxx>
 #include <Standard_NotImplemented.hxx>
 #include <Standard_ProgramError.hxx>
+#include <BOPAlgo_Alerts.hxx>
 
 namespace
 {
@@ -52,7 +53,6 @@ BOPAlgo_Options::BOPAlgo_Options()
   myReport(new Message_Report),
   myRunParallel(myGlobalRunParallel),
   myFuzzyValue(Precision::Confusion()),
-  myProgressScope(0L),
   myUseOBB(Standard_False)
 {
   BOPAlgo_LoadMessages();
@@ -69,7 +69,6 @@ BOPAlgo_Options::BOPAlgo_Options
   myReport(new Message_Report),
   myRunParallel(myGlobalRunParallel),
   myFuzzyValue(Precision::Confusion()),
-  myProgressScope(0L),
   myUseOBB(Standard_False)
 {
   BOPAlgo_LoadMessages();
@@ -129,27 +128,16 @@ void BOPAlgo_Options::SetFuzzyValue(const Standard_Real theFuzz)
   myFuzzyValue = Max(theFuzz, Precision::Confusion());
 }
 
-
-//=======================================================================
-//function : SetProgressIndicator
-//purpose  : 
-//=======================================================================
-void BOPAlgo_Options::SetProgressIndicator
-  (const Message_ProgressScope& theScope)
+Standard_EXPORT Standard_Boolean BOPAlgo_Options::UserBreak(const Message_ProgressScope& aPS)
 {
-  myProgressScope = &theScope;
-}
-
-//=======================================================================
-//function : UserBreak
-//purpose  : 
-//=======================================================================
-void BOPAlgo_Options::UserBreak() const
-{
-  if (!myProgressScope) {
-    return;
+  if (aPS.UserBreak())
+  {
+    AddError(new BOPAlgo_AlertBOPUserBreak);
+    return Standard_True;
   }
-  if (myProgressScope->UserBreak()) {
-    throw Standard_NotImplemented("BOPAlgo_Options::UserBreak(), method is not implemented");
+  else
+  {
+    return Standard_False;
   }
 }
+
index 6043fec3160b938c878828fa98113e4e92f1750a..9831351e99a4c2379e4d97dab868c96d1714d247 100644 (file)
@@ -30,8 +30,6 @@ class Message_ProgressScope;
 //! - *Parallel processing mode* - provides the possibility to perform operation in parallel mode;
 //! - *Fuzzy tolerance* - additional tolerance for the operation to detect
 //!                       touching or coinciding cases;
-//! - *Progress indicator* - provides interface to track the progress of
-//!                          operation and stop the operation by user's break.
 //! - *Using the Oriented Bounding Boxes* - Allows using the Oriented Bounding Boxes of the shapes
 //!                          for filtering the intersections.
 //!
@@ -152,12 +150,6 @@ public:
     return myFuzzyValue;
   }
 
-public:
-  //!@name Progress indicator
-
-  //! Set the Progress Indicator object.
-  Standard_EXPORT void SetProgressIndicator(const Message_ProgressScope& theProgress);
-
 public:
   //!@name Usage of Oriented Bounding boxes
 
@@ -175,9 +167,8 @@ public:
 
 protected:
 
-  //! Breaks the execution if the break signal
-  //! is indicated by myProgressIndicator.
-  Standard_EXPORT void UserBreak() const;
+    //! Return true if the break signal and add error to myReport
+    Standard_EXPORT Standard_Boolean UserBreak(const Message_ProgressScope& aPS);
 
 protected:
 
@@ -185,7 +176,6 @@ protected:
   Handle(Message_Report) myReport;
   Standard_Boolean myRunParallel;
   Standard_Real myFuzzyValue;
-  const Message_ProgressScope* myProgressScope;
   Standard_Boolean myUseOBB;
 
 };
index faf4ce3ee973870aba0c3c2af3e729caf221abcb..baa25725a89e68c9f5fda70f23568f0dd2fb6309 100644 (file)
@@ -177,15 +177,22 @@ void BOPAlgo_PaveFiller::SetSectionAttribute
 // function: Init
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::Init()
+void BOPAlgo_PaveFiller::Init(const Message_ProgressRange& theRange)
 {
+  
   if (!myArguments.Extent()) {
+    Message_ProgressScope aPS(theRange, "Init", 1);
     AddError (new BOPAlgo_AlertTooFewArguments);
     return;
   }
   //
+  Message_ProgressScope aPS(theRange, "Init", myArguments.Size());
   TopTools_ListIteratorOfListOfShape aIt(myArguments);
-  for (; aIt.More(); aIt.Next()) {
+  for (; aIt.More(); aIt.Next(), aPS.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     if (aIt.Value().IsNull()) {
       AddError (new BOPAlgo_AlertNullInputShapes);
       return;
@@ -212,16 +219,100 @@ void BOPAlgo_PaveFiller::Init()
   // 4 NonDestructive flag
   SetNonDestructive();
 }
+
+NCollection_Array1<Standard_Real> BOPAlgo_PaveFiller::AnalyzeProgress()
+{
+  Standard_Integer aSize = 13;
+  NCollection_Array1<Standard_Real> aSteps(0, aSize - 1);
+  for (Standard_Integer i = 0; i < aSize; i++)
+  {
+    aSteps(i) = 0;
+  }
+
+  Standard_Integer aPart = 85;
+
+  myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
+  Standard_Real aPerformVVSize = myIterator->ExpectedLength();
+
+  myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
+  Standard_Real aPerformVESize = myIterator->ExpectedLength();
+
+  myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE);
+  Standard_Real aPerformEESize = myIterator->ExpectedLength();
+
+  myIterator->Initialize(TopAbs_VERTEX, TopAbs_FACE);
+  Standard_Real aPerformVFSize = myIterator->ExpectedLength();
+
+  myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE);
+  Standard_Real aPerformEFSize = myIterator->ExpectedLength();
+
+  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;
+
+  if (!myNonDestructive)
+  {
+    aPart -= 5;
+    aSteps(0) = 5;
+  }
+  aSteps(7) = 5;
+  if (myIsPrimary)
+  {
+    aPart -= 5;
+    aSteps(8) = 5;
+  }
+  aSteps(10) = 5;
+  if (myGlue == BOPAlgo_GlueOff)
+  {
+    aSteps(11) = 5;
+    aPart -= 5;
+  }
+  if (!myAvoidBuildPCurve)
+  {
+    aSteps(12) = 5;
+    aPart -= 5;
+  }
+
+  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);
+      }
+    }
+    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);
+  return aSteps;
+}
+
 //=======================================================================
 // function: Perform
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::Perform()
+void BOPAlgo_PaveFiller::Perform(const Message_ProgressRange& theRange)
 {
   try {
     OCC_CATCH_SIGNALS
-    //
-    PerformInternal();
+      //
+    PerformInternal(theRange);
   }
   //
   catch (Standard_Failure const&) {
@@ -232,63 +323,79 @@ void BOPAlgo_PaveFiller::Perform()
 // function: PerformInternal
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::PerformInternal()
+void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange)
 {
-  Init();
+  Message_ProgressScope aPS(theRange, "Pave filler perform", 100);
+
+  Init(aPS.Next(5));                        // 1 - const = 2
   if (HasErrors()) {
     return; 
   }
+  NCollection_Array1<Standard_Real> aSteps = AnalyzeProgress();
+  Standard_Real a = 0;
+  for (int i = 0; i < aSteps.Size(); i++)
+  {
+    a += aSteps[i];
+  }
   //
-  Prepare();
+  Prepare(aPS.Next(aSteps[0]));                     // 2 - const = 3
   if (HasErrors()) {
     return; 
   }
   // 00
-  PerformVV();
+  PerformVV(aPS.Next(aSteps[1]));                   // 3 - myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
   if (HasErrors()) {
     return; 
   }
   // 01
-  PerformVE();
+  PerformVE(aPS.Next(aSteps[2]));                  // 4 -  myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
   if (HasErrors()) {
     return; 
   }
   //
   UpdatePaveBlocksWithSDVertices();
   // 11
-  PerformEE();
+  PerformEE(aPS.Next(aSteps[3]));                  // 5 -  myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE);
   if (HasErrors()) {
     return; 
   }
   UpdatePaveBlocksWithSDVertices();
   // 02
-  PerformVF();
+  PerformVF(aPS.Next(aSteps[4]));                   // 6 -  vertex-face
   if (HasErrors()) {
     return; 
   }
   UpdatePaveBlocksWithSDVertices();
   // 12
-  PerformEF();
+  PerformEF(aPS.Next(aSteps[5]));                  // 7 - edge-face
   if (HasErrors()) {
     return; 
   }
+  
   UpdatePaveBlocksWithSDVertices();
   UpdateInterfsWithSDVertices();
 
   // Repeat Intersection with increased vertices
-  RepeatIntersection();
+  RepeatIntersection(aPS.Next(aSteps[6]));           // 8 -  vf+ve+vv
   if (HasErrors())
     return;
-
   // Force intersection of edges after increase
   // of the tolerance values of their vertices
-  ForceInterfEE();
+  ForceInterfEE(aPS.Next(aSteps[7]));                 // 9 - EE    const = 2
+  if (HasErrors())
+  {
+    return;
+  }
   // Force Edge/Face intersection after increase
   // of the tolerance values of their vertices
-  ForceInterfEF();
+  ForceInterfEF(aPS.Next(aSteps[8]));                      // 10 -  EF   const = 3
+  if (HasErrors())
+  {
+    return;
+  }
   //
   // 22
-  PerformFF();
+  PerformFF(aPS.Next(aSteps[9]));                              // 11 - FF
   if (HasErrors()) {
     return; 
   }
@@ -297,14 +404,14 @@ void BOPAlgo_PaveFiller::PerformInternal()
   //
   myDS->RefineFaceInfoIn();
   //
-  MakeSplitEdges();
+  MakeSplitEdges(aPS.Next(aSteps[10]));                           // 12 - const = 2
   if (HasErrors()) {
     return;
   }
   //
   UpdatePaveBlocksWithSDVertices();
   //
-  MakeBlocks();
+  MakeBlocks(aPS.Next(aSteps[11]));                          // 13 - const = 2
   if (HasErrors()) {
     return; 
   }
@@ -317,7 +424,7 @@ void BOPAlgo_PaveFiller::PerformInternal()
   //
   RemoveMicroEdges();
   //
-  MakePCurves();
+  MakePCurves(aPS.Next(aSteps[12]));                          // 14 - const = 2
   if (HasErrors()) {
     return; 
   }
@@ -332,13 +439,18 @@ void BOPAlgo_PaveFiller::PerformInternal()
 // function: RepeatIntersection
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::RepeatIntersection()
+void BOPAlgo_PaveFiller::RepeatIntersection(const Message_ProgressRange& theRange)
 {
   // Find all vertices with increased tolerance
   TColStd_MapOfInteger anExtraInterfMap;
   const Standard_Integer aNbS = myDS->NbSourceShapes();
+  Message_ProgressScope aPS(theRange, "Repeat intersection", 3);
   for (Standard_Integer i = 0; i < aNbS; ++i)
   {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
     if (aSI.ShapeType() != TopAbs_VERTEX)
       continue;
@@ -365,17 +477,18 @@ void BOPAlgo_PaveFiller::RepeatIntersection()
   myIterator->IntersectExt(anExtraInterfMap);
 
   // Perform intersections with vertices
-  PerformVV();
+
+  PerformVV(aPS.Next());
   if (HasErrors())
     return;
   UpdatePaveBlocksWithSDVertices();
 
-  PerformVE();
+  PerformVE(aPS.Next());
   if (HasErrors())
     return;
   UpdatePaveBlocksWithSDVertices();
 
-  PerformVF();
+  PerformVF(aPS.Next());
   if (HasErrors())
     return;
 
index 307f2e5031bfe1b10c7ba6d066d8809adeedff1c..af56b86aa37bbe84768e512a4db234f47f9c799c 100644 (file)
@@ -158,7 +158,7 @@ public:
   //! a copy of a sub-shape is created in the result if it is needed to be updated.
   Standard_EXPORT Standard_Boolean NonDestructive() const;
 
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   
 
@@ -204,20 +204,21 @@ protected:
    
   Standard_EXPORT Standard_Boolean IsPrimary() const;
 
-  Standard_EXPORT virtual void PerformInternal();
+  Standard_EXPORT virtual void PerformInternal(const Message_ProgressRange& theRange);
   
   Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
   
-  Standard_EXPORT virtual void Init();
+  Standard_EXPORT virtual void Init(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT void Prepare();
+  Standard_EXPORT void Prepare(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT virtual void PerformVV();
+  Standard_EXPORT virtual void PerformVV(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT virtual void PerformVE();
+  Standard_EXPORT virtual void PerformVE(const Message_ProgressRange& theRange);
 
   //! Performs the intersection of the vertices with edges.
   Standard_EXPORT void IntersectVE(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theVEPairs,
+                                   const Message_ProgressRange& theRange,
                                    const Standard_Boolean bAddInterfs = Standard_True);
 
   //! Splits the Pave Blocks of the given edges with the extra paves.<br>
@@ -230,25 +231,27 @@ protected:
   //! of the Pave Blocks will also form a Common Block.
   Standard_EXPORT void SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges,
                                        const Standard_Boolean theAddInterfs);
+
+  Standard_EXPORT virtual NCollection_Array1<Standard_Real> AnalyzeProgress() Standard_OVERRIDE;
+
+  Standard_EXPORT virtual void PerformVF(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT virtual void PerformVF();
-  
-  Standard_EXPORT virtual void PerformEE();
+  Standard_EXPORT virtual void PerformEE(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT virtual void PerformEF();
+  Standard_EXPORT virtual void PerformEF(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT virtual void PerformFF();
+  Standard_EXPORT virtual void PerformFF(const Message_ProgressRange& theRange);
   
   Standard_EXPORT void TreatVerticesEE();
   
   Standard_EXPORT void MakeSDVerticesFF(const TColStd_DataMapOfIntegerListOfInteger& aDMVLV,
                                         TColStd_DataMapOfIntegerInteger& theDMNewSD);
 
-  Standard_EXPORT void MakeSplitEdges();
+  Standard_EXPORT void MakeSplitEdges(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT void MakeBlocks();
+  Standard_EXPORT void MakeBlocks(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT void MakePCurves();
+  Standard_EXPORT void MakePCurves(const Message_ProgressRange& theRange);
 
   Standard_EXPORT Standard_Integer MakeSDVertices(const TColStd_ListOfInteger& theVertIndices,
                                                   const Standard_Boolean theAddInterfs = 1);
@@ -269,6 +272,7 @@ protected:
   //! Performs intersection of new vertices, obtained in E/E and E/F intersections
   Standard_EXPORT void PerformNewVertices(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
                                           const Handle(NCollection_BaseAllocator)& theAllocator,
+                                          const Message_ProgressRange& theRange,
                                           const Standard_Boolean theIsEEIntersection = Standard_True);
   
   Standard_EXPORT Standard_Boolean CheckFacePaves (const TopoDS_Vertex& theVnew,
@@ -564,7 +568,7 @@ protected:
   //! If the intersection says that the section edge is lying on the face
   //! it will be added into FaceInfo structure of the face as IN edge
   //! and will be used for splitting.
-  Standard_EXPORT void PutSEInOtherFaces();
+  Standard_EXPORT void PutSEInOtherFaces(const Message_ProgressRange& theRange);
 
   //! Analyzes the results of interferences of sub-shapes of the shapes
   //! looking for self-interfering entities by the following rules:<br>
@@ -581,22 +585,23 @@ protected:
                                                     const TopoDS_Shape& theS2);
 
   //! Repeat intersection of sub-shapes with increased vertices.
-  Standard_EXPORT void RepeatIntersection();
+  Standard_EXPORT void RepeatIntersection(const Message_ProgressRange& theRange);
 
   //! Updates vertices of CommonBlocks with real tolerance of CB.
   Standard_EXPORT void UpdateVerticesOfCB();
 
   //! The method looks for the additional common blocks among pairs of edges
   //! with the same bounding vertices.
-  Standard_EXPORT void ForceInterfEE();
+  Standard_EXPORT void ForceInterfEE(const Message_ProgressRange& theRange);
 
   //! The method looks for the additional edge/face common blocks
   //! among pairs of edge/face having the same vertices.
-  Standard_EXPORT void ForceInterfEF();
+  Standard_EXPORT void ForceInterfEF(const Message_ProgressRange& theRange);
 
   //! Performs intersection of given pave blocks
   //! with all faces from arguments.
   Standard_EXPORT void ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB,
+                                     const Message_ProgressRange& theRange,
                                      const Standard_Boolean theAddInterf);
 
   //! When all section edges are created and no increase of the tolerance
index 6c27314ce38a6fafb9b3baa962a32c5f7fc8a5d1..744e4b8871a8ff423597717041d0c5cc1508c5dd 100644 (file)
@@ -44,7 +44,7 @@
 // function: PerformVV
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::PerformVV(
+void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange)
 {
   Standard_Integer n1, n2, iFlag, aSize;
   Handle(NCollection_BaseAllocator) aAllocator;
@@ -65,7 +65,12 @@ void BOPAlgo_PaveFiller::PerformVV()
   NCollection_List<TColStd_ListOfInteger> aMBlocks(aAllocator);
   //
   // 1. Map V/LV
+  Message_ProgressScope aPS(theRange, "PerformVV", 1);
   for (; myIterator->More(); myIterator->Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     myIterator->Value(n1, n2);
     //
     if (myDS->HasInterf(n1, n2))
@@ -96,6 +101,10 @@ void BOPAlgo_PaveFiller::PerformVV()
   // 3. Make vertices
   NCollection_List<TColStd_ListOfInteger>::Iterator aItB(aMBlocks);
   for (; aItB.More(); aItB.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const TColStd_ListOfInteger& aLI = aItB.Value();
     MakeSDVertices(aLI);
   }
@@ -105,6 +114,10 @@ void BOPAlgo_PaveFiller::PerformVV()
   TColStd_DataMapOfIntegerInteger& aDMII=myDS->ShapesSD();
   aItDMII.Initialize(aDMII);
   for (; aItDMII.More(); aItDMII.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     n1=aItDMII.Key();
     myDS->InitPaveBlocksForVertex(n1);
   }
index ee6b573d5992bd4ec4741b46129b91a6b5dfa416..6863fab6715cb35f2c8f89ac00798198ebeaa3a7 100644 (file)
@@ -109,9 +109,17 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo {
   const Handle(BOPDS_PaveBlock)& PaveBlock() const {
     return myPB;
   }
+  void SetRange(const Message_ProgressRange& theRange)
+  {
+    myRange = theRange;
+  }
   //
-  virtual void Perform() {
-    BOPAlgo_Algo::UserBreak();
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
+    Message_ProgressScope aPS(myRange, NULL, 1);
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     try
     {
       OCC_CATCH_SIGNALS
@@ -134,6 +142,8 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo {
   TopoDS_Edge myE;
   Handle(IntTools_Context) myContext;
   Handle(BOPDS_PaveBlock) myPB;
+private:
+  Message_ProgressRange myRange;
 };
 //=======================================================================
 typedef NCollection_Vector<BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
@@ -142,7 +152,7 @@ typedef NCollection_Vector<BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
 // function: PerformVE
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::PerformVE()
+void BOPAlgo_PaveFiller::PerformVE(const Message_ProgressRange& theRange)
 {
   FillShrunkData(TopAbs_VERTEX, TopAbs_EDGE);
   //
@@ -152,9 +162,14 @@ void BOPAlgo_PaveFiller::PerformVE()
     return; 
   }
   //
+  Message_ProgressScope aPS(theRange, NULL, 1);
   // Prepare pairs for intersection
   BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMVEPairs;
   for (; myIterator->More(); myIterator->Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     Standard_Integer nV, nE;
     myIterator->Value(nV, nE);
     //
@@ -192,7 +207,7 @@ void BOPAlgo_PaveFiller::PerformVE()
     pLV->Append(nV);
   }
   //
-  IntersectVE(aMVEPairs);
+  IntersectVE(aMVEPairs, aPS.Next());
 }
 
 //=======================================================================
@@ -201,6 +216,7 @@ void BOPAlgo_PaveFiller::PerformVE()
 //=======================================================================
 void BOPAlgo_PaveFiller::IntersectVE
   (const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theVEPairs,
+   const Message_ProgressRange& theRange,
    const Standard_Boolean theAddInterfs)
 {
   Standard_Integer i, aNbVE = theVEPairs.Extent();
@@ -221,7 +237,12 @@ void BOPAlgo_PaveFiller::IntersectVE
   // intersection of the same SD vertex with edge
   NCollection_DataMap<BOPDS_Pair, TColStd_ListOfInteger, BOPDS_PairMapHasher> aDMVSD;
   //
+  Message_ProgressScope aPSOuter(theRange, "IntersectVE", 10);
   for (i = 1; i <= aNbVE; ++i) {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     const Handle(BOPDS_PaveBlock)& aPB = theVEPairs.FindKey(i);
     Standard_Integer nE = aPB->OriginalEdge();
     //
@@ -264,24 +285,36 @@ void BOPAlgo_PaveFiller::IntersectVE
       aVESolver.SetEdge(aE);
       aVESolver.SetPaveBlock(aPB);
       aVESolver.SetFuzzyValue(myFuzzyValue);
-      if (myProgressScope != NULL)
-      {
-        aVESolver.SetProgressIndicator(*myProgressScope);
-      }
     }
   }
   //
+  aNbVE = aVVE.Length();
+
+  Message_ProgressScope aPS(aPSOuter.Next(9), "Intersect vertex-edge", aNbVE);
+  for (i = 0; i < aVVE.Length(); i++)
+  {
+    BOPAlgo_VertexEdge& aVESolver = aVVE.ChangeValue(i);
+    aVESolver.SetRange(aPS.Next());
+  }
   // Perform intersection
   //=============================================================
   BOPTools_Parallel::Perform (myRunParallel, aVVE, myContext);
   //=============================================================
+  if (HasErrors())
+  {
+    return;
+  }
   //
   // Keep the modified edges for further update
   TColStd_MapOfInteger aMEdges;
   //
   // Analyze intersections
-  aNbVE = aVVE.Length();
-  for (i = 0; i < aNbVE; ++i) {
+  Message_ProgressScope aPS2(aPSOuter.Next(1), "Analyze intersections", aNbVE);
+  for (i = 0; i < aNbVE; ++i, aPS2.Next()) {
+    if (UserBreak(aPS2))
+    {
+      return;
+    }
     const BOPAlgo_VertexEdge& aVESolver = aVVE(i);
     if (aVESolver.Flag() != 0) {
       if (aVESolver.HasErrors())
@@ -307,6 +340,10 @@ void BOPAlgo_PaveFiller::IntersectVE
     BOPDS_ListOfPaveBlock::Iterator itPB (aLPB);
     for (; itPB.More(); itPB.Next())
     {
+      if (UserBreak(aPS2))
+      {
+        return;
+      }
       aPB = itPB.Value();
       Standard_Real aT1, aT2;
       aPB->Range (aT1, aT2);
@@ -328,6 +365,10 @@ void BOPAlgo_PaveFiller::IntersectVE
       const TColStd_ListOfInteger& aLI = aDMVSD.Find(aPair);
       TColStd_ListIteratorOfListOfInteger aItLI(aLI);
       for (; aItLI.More(); aItLI.Next()) {
+        if (UserBreak(aPS2))
+        {
+          return;
+        }
         const Standard_Integer nVOld = aItLI.Value();
         // 3. Create interference V/E
         BOPDS_InterfVE& aVE = aVEs.Appended();
index 0c0835ecbef96cd676fddf129ea2c13c53828190..91412ea25d07915739c23bde2565bbe83043095b 100644 (file)
@@ -101,8 +101,17 @@ class BOPAlgo_EdgeEdge :
     IntTools_EdgeEdge::SetFuzzyValue(theFuzz);
   }
   //
-  virtual void Perform() {
-    BOPAlgo_Algo::UserBreak();
+  void SetRange(const Message_ProgressRange& theRange)
+  {
+    myRange = theRange;
+  }
+  //
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
+    Message_ProgressScope aPS(myRange, NULL, 1);
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     TopoDS_Edge anE1 = myEdge1, anE2 = myEdge2;
     Standard_Boolean hasTrsf = false;
     try
@@ -146,6 +155,8 @@ class BOPAlgo_EdgeEdge :
   Handle(BOPDS_PaveBlock) myPB2;
   Bnd_Box myBox1;
   Bnd_Box myBox2;
+private:
+  Message_ProgressRange myRange;
 };
 //
 //=======================================================================
@@ -155,7 +166,7 @@ typedef NCollection_Vector<BOPAlgo_EdgeEdge> BOPAlgo_VectorOfEdgeEdge;
 // function: PerformEE
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::PerformEE()
+void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
 {
   FillShrunkData(TopAbs_EDGE, TopAbs_EDGE);
   //
@@ -186,7 +197,12 @@ void BOPAlgo_PaveFiller::PerformEE()
   BOPDS_VectorOfInterfEE& aEEs=myDS->InterfEE();
   aEEs.SetIncrement(iSize);
   //
+  Message_ProgressScope aPSOuter(theRange, "PerformEE", 10);
   for (; myIterator->More(); myIterator->Next()) {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     myIterator->Value(nE1, nE2);
     //
     const BOPDS_ShapeInfo& aSIE1=myDS->ShapeInfo(nE1);
@@ -213,6 +229,10 @@ void BOPAlgo_PaveFiller::PerformEE()
     //
     aIt1.Initialize(aLPB1);
     for (; aIt1.More(); aIt1.Next()) {
+      if (UserBreak(aPSOuter))
+      {
+        return;
+      }
       Bnd_Box aBB1;
       //
       Handle(BOPDS_PaveBlock)& aPB1=aIt1.ChangeValue();
@@ -225,6 +245,10 @@ void BOPAlgo_PaveFiller::PerformEE()
       //
       aIt2.Initialize(aLPB2);
       for (; aIt2.More(); aIt2.Next()) {
+        if (UserBreak(aPSOuter))
+        {
+          return;
+        }
         Bnd_Box aBB2;
         //
         Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue();
@@ -253,20 +277,32 @@ void BOPAlgo_PaveFiller::PerformEE()
         anEdgeEdge.SetEdge2(aE2, aT21, aT22);
         anEdgeEdge.SetBoxes (aBB1, aBB2);
         anEdgeEdge.SetFuzzyValue(myFuzzyValue);
-        if (myProgressScope != NULL)
-        {
-          anEdgeEdge.SetProgressIndicator(*myProgressScope);
-        }
       }//for (; aIt2.More(); aIt2.Next()) {
     }//for (; aIt1.More(); aIt1.Next()) {
   }//for (; myIterator->More(); myIterator->Next()) {
   //
   aNbEdgeEdge=aVEdgeEdge.Length();
+
+  Message_ProgressScope aPS1(aPSOuter.Next(8), "Edge-edge perform", aNbEdgeEdge);
+  for (k = 0; k < aNbEdgeEdge; k++)
+  {
+    BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge.ChangeValue(k);
+    anEdgeEdge.SetRange(aPS1.Next());
+  }
   //======================================================
   BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
   //======================================================
+  if (HasErrors())
+  {
+    return;
+  }
   //
-  for (k = 0; k < aNbEdgeEdge; ++k) {
+  Message_ProgressScope aPS2(aPSOuter.Next(1), "Post-treatment", aNbEdgeEdge);
+  for (k = 0; k < aNbEdgeEdge; ++k, aPS2.Next()) {
+    if (UserBreak(aPS2))
+    {
+      return;
+    }
     Bnd_Box aBB1, aBB2;
     //
     BOPAlgo_EdgeEdge& anEdgeEdge=aVEdgeEdge(k);
@@ -331,6 +367,10 @@ void BOPAlgo_PaveFiller::PerformEE()
     }
     //
     for (i=1; i<=aNbCPrts; ++i) {
+      if (UserBreak(aPS2))
+      {
+        return;
+      }
       const IntTools_CommonPrt& aCPart=aCPrts(i);
       //
       const TopoDS_Edge& aE1=aCPart.Edge1();
@@ -519,7 +559,11 @@ void BOPAlgo_PaveFiller::PerformEE()
   // Update vertices of common blocks with real CB tolerances
   UpdateVerticesOfCB();
 
-  PerformNewVertices(aMVCPB, aAllocator);
+  PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(1));
+  if (HasErrors())
+  {
+    return;
+  }
   //
   if (aMEdges.Extent()) {
     Standard_Integer aNbV = aMVCPB.Extent();
@@ -546,6 +590,7 @@ void BOPAlgo_PaveFiller::PerformEE()
 void BOPAlgo_PaveFiller::PerformNewVertices
   (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
    const Handle(NCollection_BaseAllocator)& theAllocator,
+   const Message_ProgressRange& theRange,
    const Standard_Boolean bIsEEIntersection)
 {
   Standard_Integer aNbV = theMVCPB.Extent();
@@ -563,8 +608,14 @@ void BOPAlgo_PaveFiller::PerformNewVertices
   BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
   BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF();
   //
+    // 4. Compute Extra Paves and split Pave blocks by the Extra paves
+  Message_ProgressScope aPS(theRange, NULL, 1);
   Standard_Integer i, aNb = aImages.Extent();
   for (i = 1; i <= aNb; ++i) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const TopoDS_Vertex& aV = TopoDS::Vertex(aImages.FindKey(i));
     const TopTools_ListOfShape& aLVSD = aImages.FindFromIndex(i);
     //
@@ -580,6 +631,10 @@ void BOPAlgo_PaveFiller::PerformNewVertices
     //
     TopTools_ListIteratorOfListOfShape aItLS(aLVSD);
     for (; aItLS.More(); aItLS.Next()) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       const TopoDS_Shape& aVx = aItLS.Value();
       BOPDS_CoupleOfPaveBlocks &aCPB = theMVCPB.ChangeFromKey(aVx);
       aCPB.SetIndex(iV);
@@ -593,6 +648,10 @@ void BOPAlgo_PaveFiller::PerformNewVertices
   // 3. Map PaveBlock/ListOfVertices to add to this PaveBlock ->aMPBLI
   BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator);
   for (i = 1; i <= aNbV; ++i) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_CoupleOfPaveBlocks& aCPB = theMVCPB.FindFromIndex(i);
     Standard_Integer iV = aCPB.Index();
     //
@@ -610,9 +669,8 @@ void BOPAlgo_PaveFiller::PerformNewVertices
       }
     }
   }
-  //
   // 4. Compute Extra Paves and split Pave blocks by the Extra paves
-  IntersectVE(aMPBLI, Standard_False);
+  IntersectVE(aMPBLI, aPS.Next(), Standard_False);
 }
 //=======================================================================
 //function : TreatNewVertices
@@ -898,7 +956,7 @@ void BOPAlgo_PaveFiller::UpdateVerticesOfCB()
 //function : ForceInterfEE
 //purpose  : 
 //=======================================================================
-void BOPAlgo_PaveFiller::ForceInterfEE()
+void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
 {
   // Now that we have vertices increased and unified, try to find additional
   // common blocks among the pairs of edges.
@@ -907,11 +965,15 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
   // those pairs of pave blocks with the same bounding vertices.
 
   Handle(NCollection_IncAllocator) anAlloc = new NCollection_IncAllocator;
-
+  Message_ProgressScope aPSOuter(theRange, "ForceInterfEE", 10);
   // Initialize pave blocks for all vertices which participated in intersections
   const Standard_Integer aNbS = myDS->NbSourceShapes();
   for (Standard_Integer i = 0; i < aNbS; ++i)
   {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
     if (aSI.ShapeType() == TopAbs_VERTEX)
     {
@@ -919,7 +981,6 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
         myDS->InitPaveBlocksForVertex(i);
     }
   }
-
   // Fill the connection map from bounding vertices to pave blocks
   // having those bounding vertices
   NCollection_IndexedDataMap<BOPDS_Pair,
@@ -930,6 +991,10 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
 
   for (Standard_Integer i = 0; i < aNbS; ++i)
   {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
     if (aSI.ShapeType() != TopAbs_EDGE)
       // Not an edge
@@ -947,6 +1012,10 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
     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))
@@ -976,6 +1045,10 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
 
   for (Standard_Integer i = 1; i <= aNbPB; ++i)
   {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     const BOPDS_ListOfPaveBlock& aLPB = aPBMap(i);
     if (aLPB.Extent() < 2)
       continue;
@@ -998,6 +1071,10 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
     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();
@@ -1016,6 +1093,10 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
       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();
@@ -1086,10 +1167,6 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
         {
           anEdgeEdge.SetFuzzyValue(myFuzzyValue);
         }
-        if (myProgressScope != NULL)
-        {
-          anEdgeEdge.SetProgressIndicator(*myProgressScope);
-        }
       }
     }
   }
@@ -1102,9 +1179,19 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
   aMPBFence.Clear();
   anAlloc->Reset();
 
+  Message_ProgressScope aPS(aPSOuter.Next(9), "Intersection edge-edge", aNbPairs);
+  for (Standard_Integer i = 0; i < aNbPairs; i++)
+  {
+    BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge.ChangeValue(i);
+    anEdgeEdge.SetRange(aPS.Next());
+  }
+
   // Perform intersection of the found pairs
   BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
-
+  if (HasErrors())
+  {
+    return;
+  }
   BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
   if (aEEs.IsEmpty())
     aEEs.SetIncrement(10);
@@ -1113,9 +1200,13 @@ void BOPAlgo_PaveFiller::ForceInterfEE()
   // intersection type only.
 
   BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock aMPBLPB(1, anAlloc);
-
-  for (Standard_Integer i = 0; i < aNbPairs; ++i)
+  Message_ProgressScope aPS1(aPSOuter.Next(1), "Analyze the results of intersection", aNbPairs);
+  for (Standard_Integer i = 0; i < aNbPairs; ++i, aPS1.Next())
   {
+    if (UserBreak(aPS1))
+    {
+      return;
+    }
     BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge(i);
     if (!anEdgeEdge.IsDone() || anEdgeEdge.HasErrors())
     {
index 9a289ddf6d340272dde936efa930d436cf40bc73..d9ad7f2d720ad7c541da187e235c7b6d4fdd4083 100644 (file)
@@ -106,8 +106,17 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo {
     return myContext;
   }
   //
-  virtual void Perform() {
-    BOPAlgo_Algo::UserBreak();
+  void SetRange(const Message_ProgressRange& theRange)
+  {
+    myRange = theRange;
+  }
+  //
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
+    Message_ProgressScope aPS(myRange, NULL, 1);
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     try
     {
       OCC_CATCH_SIGNALS
@@ -130,6 +139,8 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo {
   TopoDS_Vertex myV;
   TopoDS_Face myF;
   Handle(IntTools_Context) myContext;
+private:
+  Message_ProgressRange myRange;
 };
 //=======================================================================
 typedef NCollection_Vector<BOPAlgo_VertexFace> BOPAlgo_VectorOfVertexFace;
@@ -138,7 +149,7 @@ typedef NCollection_Vector<BOPAlgo_VertexFace> BOPAlgo_VectorOfVertexFace;
 // function: PerformVF
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::PerformVF()
+void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange)
 {
   myIterator->Initialize(TopAbs_VERTEX, TopAbs_FACE);
   Standard_Integer iSize = myIterator->ExpectedLength();
@@ -175,8 +186,12 @@ void BOPAlgo_PaveFiller::PerformVF()
   // Avoid repeated intersection of the same vertex with face in case
   // the group of vertices formed a single SD vertex
   NCollection_DataMap<BOPDS_Pair, TColStd_MapOfInteger, BOPDS_PairMapHasher> aMVFPairs;
-
+  Message_ProgressScope aPSOuter(theRange, "PerformVF", 10);
   for (; myIterator->More(); myIterator->Next()) {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     myIterator->Value(nV, nF);
     //
     if (myDS->IsSubShape(nV, nF)) {
@@ -217,18 +232,30 @@ void BOPAlgo_PaveFiller::PerformVF()
     aVertexFace.SetVertex(aV);
     aVertexFace.SetFace(aF);
     aVertexFace.SetFuzzyValue(myFuzzyValue);
-    if (myProgressScope != NULL)
-    {
-      aVertexFace.SetProgressIndicator(*myProgressScope);
-    }
+    
   }//for (; myIterator->More(); myIterator->Next()) {
   //
   aNbVF=aVVF.Length();
+  Message_ProgressScope aPS(aPSOuter.Next(9), "Vertex-face perform", aNbVF);
+  for (k = 0; k < aNbVF; k++)
+  {
+    BOPAlgo_VertexFace& aVertexFace = aVVF.ChangeValue(k);
+    aVertexFace.SetRange(aPS.Next());
+  }
   //================================================================
   BOPTools_Parallel::Perform (myRunParallel, aVVF, myContext);
   //================================================================
+  if (HasErrors())
+  {
+    return;
+  }
   //
-  for (k=0; k < aNbVF; ++k) {
+  Message_ProgressScope aPS2(aPSOuter.Next(1), "Post treatment", aNbVF);
+  for (k=0; k < aNbVF; ++k, aPS2.Next()) {
+    if (UserBreak(aPS2))
+    {
+      return;
+    }
     const BOPAlgo_VertexFace& aVertexFace=aVVF(k);
     // 
     iFlag=aVertexFace.Flag();
@@ -250,6 +277,10 @@ void BOPAlgo_PaveFiller::PerformVF()
     TColStd_MapIteratorOfMapOfInteger itMV(aMV);
     for (; itMV.More(); itMV.Next())
     {
+      if (UserBreak(aPS2))
+      {
+        return;
+      }
       nV = itMV.Value();
       // 1
       BOPDS_InterfVF& aVF = aVFs.Appended();
index aebd4882d41ea25c7ec6cde5fb0e62c41049f2b2..2dca235619c6c92c18f0a810f605764cbc19f865 100644 (file)
@@ -112,8 +112,17 @@ class BOPAlgo_EdgeFace :
     myBox2 = theBox2;
   }
   //
-  virtual void Perform() {
-    BOPAlgo_Algo::UserBreak();
+  void SetProgress (const Message_ProgressRange& theRange)
+  {
+    myRange = theRange;
+  }
+  //
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
+    Message_ProgressScope aPS(myRange, NULL, 1);
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     TopoDS_Face aFace = myFace;
     TopoDS_Edge anEdge = myEdge;
     Standard_Boolean hasTrsf = false;
@@ -158,6 +167,9 @@ class BOPAlgo_EdgeFace :
   Handle(BOPDS_PaveBlock) myPB;
   Bnd_Box myBox1;
   Bnd_Box myBox2;
+  
+private:
+  Message_ProgressRange myRange;
 };
 //
 //=======================================================================
@@ -167,7 +179,7 @@ typedef NCollection_Vector<BOPAlgo_EdgeFace> BOPAlgo_VectorOfEdgeFace;
 //function : PerformEF
 //purpose  : 
 //=======================================================================
-void BOPAlgo_PaveFiller::PerformEF()
+void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange)
 {
   FillShrunkData(TopAbs_EDGE, TopAbs_FACE);
   //
@@ -176,6 +188,7 @@ void BOPAlgo_PaveFiller::PerformEF()
   if (!iSize) {
     return; 
   }
+  Message_ProgressScope aPSOuter(theRange, "PerformEF", 10);
   //
   Standard_Integer nE, nF;
   //
@@ -214,6 +227,10 @@ void BOPAlgo_PaveFiller::PerformEF()
   aEFs.SetIncrement(iSize);
   //
   for (; myIterator->More(); myIterator->Next()) {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     myIterator->Value(nE, nF);
     //
     const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
@@ -237,6 +254,10 @@ void BOPAlgo_PaveFiller::PerformEF()
     BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
     aIt.Initialize(aLPB);
     for (; aIt.More(); aIt.Next()) {
+      if (UserBreak(aPSOuter))
+      {
+        return;
+      }
       Handle(BOPDS_PaveBlock)& aPB=aIt.ChangeValue();
       //
       const Handle(BOPDS_PaveBlock) aPBR=myDS->RealPaveBlock(aPB);
@@ -268,20 +289,17 @@ void BOPAlgo_PaveFiller::PerformEF()
       aEdgeFace.SetBoxes (myDS->ShapeInfo(nE).Box(), myDS->ShapeInfo (nF).Box());
       aEdgeFace.SetFuzzyValue(myFuzzyValue);
       aEdgeFace.UseQuickCoincidenceCheck(bExpressCompute);
-      //
+
       IntTools_Range aSR(aTS1, aTS2);
-      IntTools_Range anewSR=aSR;
+      IntTools_Range anewSR = aSR;
       BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, anewSR);
       aEdgeFace.SetNewSR(anewSR);
       //
       IntTools_Range aPBRange(aT1, aT2);
       aSR = aPBRange;
       BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
-      aEdgeFace.SetRange (aPBRange);
-      if (myProgressScope != NULL)
-      {
-        aEdgeFace.SetProgressIndicator(*myProgressScope);
-      }
+      aEdgeFace.SetRange(aPBRange);
+      //
       // Save the pair to avoid their forced intersection
       BOPDS_MapOfPaveBlock* pMPB = myFPBDone.ChangeSeek(nF);
       if (!pMPB)
@@ -291,11 +309,26 @@ void BOPAlgo_PaveFiller::PerformEF()
   }//for (; myIterator->More(); myIterator->Next()) {
   //
   aNbEdgeFace=aVEdgeFace.Length();
+  Message_ProgressScope aPS1(aPSOuter.Next(8), "Edge-face perform", aNbEdgeFace);
+  for (Standard_Integer index = 0; index < aNbEdgeFace; index++)
+  {
+    BOPAlgo_EdgeFace& aEdgeFace = aVEdgeFace.ChangeValue(index);
+    aEdgeFace.SetProgress(aPS1.Next());
+  }
   //=================================================================
   BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
   //=================================================================
+  if (HasErrors())
+  {
+    return;
+  }
   //
-  for (k=0; k < aNbEdgeFace; ++k) {
+  Message_ProgressScope aPS2(aPSOuter.Next(1), "Post-treatment", aNbEdgeFace);
+  for (k=0; k < aNbEdgeFace; ++k, aPS2.Next()) {
+    if (UserBreak(aPS2))
+    {
+      return;
+    }
     BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace(k);
     if (!aEdgeFace.IsDone() || aEdgeFace.HasErrors()) {
       // Warn about failed intersection of sub-shapes
@@ -358,6 +391,10 @@ void BOPAlgo_PaveFiller::PerformEF()
     }
     //
     for (i=1; i<=aNbCPrts; ++i) {
+      if (UserBreak(aPS2))
+      {
+        return;
+      }
       const IntTools_CommonPrt& aCPart=aCPrts(i);
       aType=aCPart.Type();
       switch (aType) {
@@ -524,7 +561,11 @@ void BOPAlgo_PaveFiller::PerformEF()
   //=========================================
   BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator, myDS, myContext);
   UpdateVerticesOfCB();
-  PerformNewVertices(aMVCPB, aAllocator, Standard_False);
+  PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(1), Standard_False);
+  if (HasErrors())
+  {
+    return;
+  }
   //
   // Update FaceInfoIn for all faces having EF common parts
   myDS->UpdateFaceInfoIn (aMIEFC);
@@ -733,7 +774,7 @@ void BOPAlgo_PaveFiller::ReduceIntersectionRange(const Standard_Integer theV1,
 //function : ForceInterfEF
 //purpose  : 
 //=======================================================================
-void BOPAlgo_PaveFiller::ForceInterfEF()
+void BOPAlgo_PaveFiller::ForceInterfEF(const Message_ProgressRange& theRange)
 {
   if (!myIsPrimary)
     return;
@@ -747,8 +788,13 @@ void BOPAlgo_PaveFiller::ForceInterfEF()
   // 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))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(nE);
     if (aSI.ShapeType() != TopAbs_EDGE)
       // Not an edge
@@ -766,6 +812,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF()
     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);
@@ -773,7 +823,8 @@ void BOPAlgo_PaveFiller::ForceInterfEF()
   }
 
   // Perform intersection of collected pave blocks with faces
-  ForceInterfEF(aMPB, Standard_True);
+
+  ForceInterfEF(aMPB, aPS.Next(), Standard_True);
 }
 
 //=======================================================================
@@ -781,11 +832,12 @@ void BOPAlgo_PaveFiller::ForceInterfEF()
 //purpose  : 
 //=======================================================================
 void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB,
+                                       const Message_ProgressRange& theRange,
                                        const Standard_Boolean theAddInterf)
 {
   if (theMPB.IsEmpty())
     return;
-
+  Message_ProgressScope aPSOuter(theRange, "ForceInterfEF", 10);
   // Fill the tree with bounding boxes of the pave blocks
   BOPTools_BoxTree aBBTree;
 
@@ -795,6 +847,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
   Standard_Integer aNbPB = theMPB.Extent();
   for (Standard_Integer iPB = 1; iPB <= aNbPB; ++iPB)
   {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     Handle(BOPDS_PaveBlock) aPB = theMPB(iPB);
     if (!aPB->HasShrunkData() || !myDS->IsValidShrunkData(aPB))
     {
@@ -823,6 +879,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
   const Standard_Integer aNbS = myDS->NbSourceShapes();
   for (Standard_Integer nF = 0; nF < aNbS; ++nF)
   {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(nF);
     if (aSI.ShapeType() != TopAbs_FACE)
       // Not a face
@@ -862,6 +922,10 @@ 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());
@@ -878,6 +942,10 @@ 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) ||
@@ -1013,10 +1081,6 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
         aEdgeFace.SetFuzzyValue(myFuzzyValue + aTolAdd);
         aEdgeFace.UseQuickCoincidenceCheck(Standard_True);
         aEdgeFace.SetRange(IntTools_Range(aPB->Pave1().Parameter(), aPB->Pave2().Parameter()));
-        if (myProgressScope != NULL)
-        {
-          aEdgeFace.SetProgressIndicator(*myProgressScope);
-        }
       }
     }
   }
@@ -1028,8 +1092,18 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
   aPBMap.Clear();
   anAlloc->Reset();
 
+  Message_ProgressScope aPS(aPSOuter.Next(9), "Force intersection edge-face", aNbEFs);
+  for (Standard_Integer i = 0; i < aNbEFs; i++)
+  {
+    BOPAlgo_EdgeFace& aEdgeFace = aVEdgeFace.ChangeValue(i);
+    aEdgeFace.SetProgress(aPS.Next());
+  }
   // Perform intersection of the found pairs
   BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
+  if (HasErrors())
+  {
+    return;
+  }
 
   BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF();
   if (theAddInterf && aEFs.IsEmpty())
@@ -1040,9 +1114,13 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
 
   // Collect all pairs for common block creation
   BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(1, anAlloc);
-
-  for (Standard_Integer i = 0; i < aNbEFs; ++i)
+  Message_ProgressScope aPS1(aPSOuter.Next(1), "Analyze the results of force intersection", aNbEFs);
+  for (Standard_Integer i = 0; i < aNbEFs; ++i, aPS1.Next())
   {
+    if (UserBreak(aPS1))
+    {
+      return;
+    }
     BOPAlgo_EdgeFace& anEdgeFace = aVEdgeFace(i);
     if (!anEdgeFace.IsDone() || anEdgeFace.HasErrors())
     {
index 27a79abca29a02427f19aa02882f9a40aba08bcb..2665137fa3bd6e6d5e04e8a8f63a6d5223353788 100644 (file)
@@ -150,10 +150,19 @@ class BOPAlgo_FaceFace :
     IntTools_FaceFace::SetFuzzyValue(theFuzz);
   }
   //
+  void SetProgress(const Message_ProgressRange& theRange)
+  {
+    myRange = theRange;
+  }
+  //
   const gp_Trsf& Trsf() const { return myTrsf; }
   //
-  virtual void Perform() {
-    BOPAlgo_Algo::UserBreak();
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
+    Message_ProgressScope aPS(myRange, NULL, 1);
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     try
     {
       OCC_CATCH_SIGNALS
@@ -180,7 +189,7 @@ class BOPAlgo_FaceFace :
         myTrsf = aTrsf.Inverted();
       }
 
-      IntTools_FaceFace::Perform (aF1, aF2);
+      IntTools_FaceFace::Perform (aF1, aF2, aPS.Next());
     }
     catch (Standard_Failure const&)
     {
@@ -221,6 +230,9 @@ class BOPAlgo_FaceFace :
   Bnd_Box myBox1;
   Bnd_Box myBox2;
   gp_Trsf myTrsf;
+
+  private:
+    Message_ProgressRange myRange;
 };
 //
 //=======================================================================
@@ -231,7 +243,7 @@ typedef NCollection_Vector<BOPAlgo_FaceFace> BOPAlgo_VectorOfFaceFace;
 //function : PerformFF
 //purpose  : 
 //=======================================================================
-void BOPAlgo_PaveFiller::PerformFF()
+void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
 {
   myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
   Standard_Integer iSize = myIterator->ExpectedLength();
@@ -256,7 +268,12 @@ void BOPAlgo_PaveFiller::PerformFF()
   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);
@@ -269,6 +286,10 @@ void BOPAlgo_PaveFiller::PerformFF()
   // Initialize interferences
   myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
   for (; myIterator->More(); myIterator->Next()) {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     myIterator->Value(nF1, nF2);
 
     if (myGlue == BOPAlgo_GlueOff)
@@ -308,10 +329,6 @@ void BOPAlgo_PaveFiller::PerformFF()
       //
       aFaceFace.SetParameters(bApprox, bCompC2D1, bCompC2D2, anApproxTol);
       aFaceFace.SetFuzzyValue(myFuzzyValue);
-      if (myProgressScope != NULL)
-      {
-        aFaceFace.SetProgressIndicator(*myProgressScope);
-      }
     }
     else {
       // for the Glue mode just add all interferences of that type
@@ -322,13 +339,29 @@ void BOPAlgo_PaveFiller::PerformFF()
     }
   }//for (; myIterator->More(); myIterator->Next()) {
   //
+  Standard_Integer k, aNbFaceFace = aVFaceFace.Length();;
+  Message_ProgressScope aPS1(aPSOuter.Next(9), "Face-face perform", aNbFaceFace);
+  for (k = 0; k < aVFaceFace.Size(); k++)
+  {
+    BOPAlgo_FaceFace& aFaceFace = aVFaceFace.ChangeValue(k);
+    aFaceFace.SetProgress(aPS1.Next());
+  }
   //======================================================
   // Perform intersection
   BOPTools_Parallel::Perform (myRunParallel, aVFaceFace);
+  if (HasErrors())
+  {
+    return;
+  }
   //======================================================
   // Treatment of the results
-  Standard_Integer k, aNbFaceFace = aVFaceFace.Length();
-  for (k = 0; k < aNbFaceFace; ++k) {
+
+  Message_ProgressScope aPS2(aPSOuter.Next(1), "Treatment of the results", aNbFaceFace);
+  for (k = 0; k < aNbFaceFace; ++k, aPS2.Next()) {
+    if (UserBreak(aPS2))
+    {
+      return;
+    }
     BOPAlgo_FaceFace& aFaceFace = aVFaceFace(k);
     aFaceFace.Indices(nF1, nF2);
     if (!aFaceFace.IsDone() || aFaceFace.HasErrors()) {
@@ -376,6 +409,10 @@ void BOPAlgo_PaveFiller::PerformFF()
     //
     BOPDS_VectorOfCurve& aVNC = aFF.ChangeCurves();
     for (Standard_Integer i = 1; i <= aNbCurves; ++i) {
+      if (UserBreak(aPS2))
+      {
+        return;
+      }
       Bnd_Box aBox;
       const IntTools_Curve& aIC = aCvsX(i);
       Standard_Boolean bIsValid = IntTools_Tools::CheckCurve(aIC, aBox);
@@ -392,6 +429,10 @@ void BOPAlgo_PaveFiller::PerformFF()
     // 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();
       //
@@ -426,7 +467,7 @@ static void UpdateSavedTolerance(const BOPDS_PDS& theDS,
 //function : MakeBlocks
 //purpose  : 
 //=======================================================================
-void BOPAlgo_PaveFiller::MakeBlocks()
+void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
 {
   if (myGlue != BOPAlgo_GlueOff) {
     return;
@@ -471,9 +512,12 @@ void BOPAlgo_PaveFiller::MakeBlocks()
   // 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; i<aNbFF; ++i) {
-    //
-    UserBreak();
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     //
     BOPDS_InterfFF& aFF=aFFs(i);
     aFF.Indices(nF1, nF2);
@@ -507,6 +551,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
     //
     // 1. Treat Points
     for (j=0; j<aNbP; ++j) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       TopoDS_Vertex aV;
       BOPDS_CoupleOfPaveBlocks aCPB;
       //
@@ -529,6 +577,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
     GetStickVertices(nF1, nF2, aMVStick, aMVEF, aMI);
     //
     for (j = 0; j < aNbC; ++j) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       BOPDS_Curve& aNC = aVC.ChangeValue(j);
       // DEBt
       aNC.InitPaveBlock1();
@@ -548,6 +600,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
     FilterPavesOnCurves(aVC, aMVTol);
 
     for (j = 0; j<aNbC; ++j) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       BOPDS_Curve& aNC=aVC.ChangeValue(j);
       const IntTools_Curve& aIC=aNC.Curve();
       //
@@ -601,6 +657,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
     //
     // 3. Make section edges
     for (j=0; j<aNbC; ++j) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       BOPDS_Curve& aNC=aVC.ChangeValue(j);
       const IntTools_Curve& aIC=aNC.Curve();
       Standard_Real aTolR3D = Max(aNC.Tolerance(), aNC.TangentialTolerance());
@@ -613,6 +673,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
       //
       aItLPB.Initialize(aLPB);
       for (; aItLPB.More(); aItLPB.Next()) {
+        if (UserBreak(aPS))
+        {
+          return;
+        }
         Handle(BOPDS_PaveBlock)& aPB=aItLPB.ChangeValue();
         aPB->Indices(nV1, nV2);
         aPB->Range  (aT1, aT2);
@@ -754,6 +818,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
     //and forget about SD groups of such vertices
     aItMV.Initialize(aMVTol);
     for (; aItMV.More(); aItMV.Next()) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       nV1 = aItMV.Key();
       Standard_Real aTol = aItMV.Value();
       //
@@ -794,7 +862,8 @@ void BOPAlgo_PaveFiller::MakeBlocks()
   //
   // Treat possible common zones by trying to put each section edge
   // into all faces, not participated in creation of that edge, as IN edge
-  PutSEInOtherFaces();
+
+  PutSEInOtherFaces(aPS.Next());
   //
   //-----------------------------------------------------scope t
   aMVStick.Clear();
@@ -1022,10 +1091,6 @@ void BOPAlgo_PaveFiller::PostTreatFF
   }
   //
   // 2 Fuse shapes
-  if (myProgressScope != NULL)
-  {
-    aPF.SetProgressIndicator(*myProgressScope);
-  }
   aPF.SetRunParallel(myRunParallel);
   aPF.SetArguments(aLS);
   aPF.Perform();
@@ -3662,7 +3727,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE()
 //function : PutSEInOtherFaces
 //purpose  : 
 //=======================================================================
-void BOPAlgo_PaveFiller::PutSEInOtherFaces()
+void BOPAlgo_PaveFiller::PutSEInOtherFaces(const Message_ProgressRange& theRange)
 {
   // Try to intersect each section edge with the faces
   // not participated in its creation
@@ -3672,12 +3737,21 @@ void BOPAlgo_PaveFiller::PutSEInOtherFaces()
 
   BOPDS_VectorOfInterfFF& aFFs = myDS->InterfFF();
   const Standard_Integer aNbFF = aFFs.Length();
+  Message_ProgressScope aPS(theRange, NULL, 1);
   for (Standard_Integer i = 0; i < aNbFF; ++i)
   {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_VectorOfCurve& aVNC = aFFs(i).Curves();
     const Standard_Integer aNbC = aVNC.Length();
     for (Standard_Integer j = 0; j < aNbC; ++j)
     {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       const BOPDS_ListOfPaveBlock& aLPBC = aVNC(j).PaveBlocks();
       BOPDS_ListIteratorOfListOfPaveBlock aItPB(aLPBC);
       for (; aItPB.More(); aItPB.Next())
@@ -3685,7 +3759,7 @@ void BOPAlgo_PaveFiller::PutSEInOtherFaces()
     }
   }
   // Perform intersection of collected pave blocks
-  ForceInterfEF(aMPBScAll, Standard_False);
+  ForceInterfEF(aMPBScAll, aPS.Next(), Standard_False);
 }
 
 //=======================================================================
index 11a0cacc39f96c76121ef3ce3b594e62dc07955f..5595a8929097be4be00a98f2b263a317cb73febd 100644 (file)
@@ -138,8 +138,17 @@ class BOPAlgo_SplitEdge : public BOPAlgo_Algo  {
     myContext = aContext;
   }
   //
-  virtual void Perform () {
-    BOPAlgo_Algo::UserBreak();
+  void SetRange(const Message_ProgressRange& theRange)
+  {
+    myRange = theRange;
+  }
+  //
+  virtual void Perform (const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
+    Message_ProgressScope aPS(myRange, NULL, 1);
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     myTol = BOPAlgo_Tools::ComputeToleranceOfCB(myCB, myDS, myContext);
     BOPTools_AlgoTools::MakeSplitEdge(myE, 
                                       myV1, myT1, 
@@ -166,6 +175,8 @@ class BOPAlgo_SplitEdge : public BOPAlgo_Algo  {
   //
   BOPDS_PDS   myDS;
   Handle(IntTools_Context) myContext;
+private:
+  Message_ProgressRange myRange;
 };
 //
 //=======================================================================
@@ -232,7 +243,17 @@ class BOPAlgo_MPC : public BOPAlgo_Algo  {
     return myContext;
   }
   //
-  virtual void Perform() {
+  void SetRange(const Message_ProgressRange& theRange)
+  {
+    myRange = theRange;
+  }
+  //
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {
+    Message_ProgressScope aPS(myRange, NULL, 1);
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     try
     {
       OCC_CATCH_SIGNALS
@@ -318,6 +339,8 @@ class BOPAlgo_MPC : public BOPAlgo_Algo  {
   Standard_Real myNewTol;
   //
   Handle(IntTools_Context) myContext;
+ private:
+   Message_ProgressRange myRange;
 };
 //
 //=======================================================================
@@ -355,8 +378,17 @@ class BOPAlgo_BPC {
   Standard_Boolean IsToUpdate() const {
     return myToUpdate;
   }
+  void SetRange(const Message_ProgressRange& theRange)
+  {
+    myRange = theRange;
+  }
   //
   void Perform() {
+    Message_ProgressScope aPS(myRange, NULL, 1);
+    if (!aPS.More())
+    {
+      return;
+    }
     BRepLib::BuildPCurveForEdgeOnPlane(myE, myF, myCurve, myToUpdate);
   };
   //
@@ -365,6 +397,8 @@ class BOPAlgo_BPC {
   TopoDS_Face myF;
   Handle(Geom2d_Curve) myCurve;
   Standard_Boolean myToUpdate;
+private:
+  Message_ProgressRange myRange;
 };
 //=======================================================================
 typedef NCollection_Vector<BOPAlgo_BPC> BOPAlgo_VectorOfBPC;
@@ -373,7 +407,7 @@ typedef NCollection_Vector<BOPAlgo_BPC> BOPAlgo_VectorOfBPC;
 // function: MakeSplitEdges
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::MakeSplitEdges()
+void BOPAlgo_PaveFiller::MakeSplitEdges(const Message_ProgressRange& theRange)
 {
   BOPDS_VectorOfListOfPaveBlock& aPBP=myDS->ChangePaveBlocksPool();
   Standard_Integer aNbPBP = aPBP.Length();
@@ -395,8 +429,13 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
   //
   aNbPBP=aPBP.Length();
   //
+  Message_ProgressScope aPSOuter(theRange, NULL, 1);
   for (i = 0; i < aNbPBP; ++i)
   {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     BOPDS_ListOfPaveBlock& aLPB = aPBP(i);
     //
     aItPB.Initialize(aLPB);
@@ -432,6 +471,10 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
               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;
@@ -484,19 +527,29 @@ void BOPAlgo_PaveFiller::MakeSplitEdges()
         aBSE.SetCommonBlock(aCB);
       }
       aBSE.SetDS(myDS);
-      if (myProgressScope != NULL)
-      {
-        aBSE.SetProgressIndicator(*myProgressScope);
-      }
     } // for (; aItPB.More(); aItPB.Next()) {
   }  // for (i=0; i<aNbPBP; ++i) {      
   //
   aNbVBSE=aVBSE.Length();
+  Message_ProgressScope aPS(aPSOuter.Next(), "MakeSplitEdges", aNbVBSE);
+  for (k = 0; k < aNbVBSE; k++)
+  {
+    BOPAlgo_SplitEdge& aBSE = aVBSE.ChangeValue(k);
+    aBSE.SetRange(aPS.Next());
+  }
   //======================================================
   BOPTools_Parallel::Perform (myRunParallel, aVBSE, myContext);
   //======================================================
+  if (HasErrors())
+  {
+    return;
+  }
   //
   for (k=0; k < aNbVBSE; ++k) {
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     BOPAlgo_SplitEdge& aBSE=aVBSE(k);
     //
     const TopoDS_Edge& aSp=aBSE.SplitEdge();
@@ -566,7 +619,7 @@ Standard_Integer BOPAlgo_PaveFiller::SplitEdge(const Standard_Integer nE,
 // function: MakePCurves
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::MakePCurves()
+void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange)
 {
   if (myAvoidBuildPCurve ||
       (!mySectionAttribute.PCurveOnS1() && !mySectionAttribute.PCurveOnS2()))
@@ -580,9 +633,14 @@ void BOPAlgo_PaveFiller::MakePCurves()
   //
   // 1. Process Common Blocks 
   const BOPDS_VectorOfFaceInfo& aFIP=myDS->FaceInfoPool();
+  Message_ProgressScope aPS(theRange, "MakePCurves", aVMPC.Length());
   //
   aNbFI=aFIP.Length();
   for (i=0; i<aNbFI; ++i) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_FaceInfo& aFI=aFIP(i);
     nF1=aFI.Index();
     //
@@ -592,6 +650,10 @@ void BOPAlgo_PaveFiller::MakePCurves()
     const BOPDS_IndexedMapOfPaveBlock& aMPBIn=aFI.PaveBlocksIn();
     aNbPBIn = aMPBIn.Extent();
     for (j = 1; j <= aNbPBIn; ++j) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       const Handle(BOPDS_PaveBlock)& aPB = aMPBIn(j);
       nE=aPB->Edge();
       const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE)));
@@ -599,16 +661,16 @@ void BOPAlgo_PaveFiller::MakePCurves()
       BOPAlgo_MPC& aMPC=aVMPC.Appended();
       aMPC.SetEdge(aE);
       aMPC.SetFace(aF1F);
-      if (myProgressScope != NULL)
-      {
-        aMPC.SetProgressIndicator(*myProgressScope);
-      }
     }
     //
     // On
     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)));
@@ -666,10 +728,6 @@ void BOPAlgo_PaveFiller::MakePCurves()
 
       aMPC.SetEdge(aE);
       aMPC.SetFace(aF1F);
-      if (myProgressScope != NULL)
-      {
-        aMPC.SetProgressIndicator(*myProgressScope);
-      }
     }
   }// for (i=0; i<aNbFI; ++i) {
   //
@@ -685,6 +743,10 @@ void BOPAlgo_PaveFiller::MakePCurves()
     BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
     aNbFF=aFFs.Length();
     for (i=0; i<aNbFF; ++i) {
+      if (UserBreak(aPS))
+      {
+        return;
+      }
       const BOPDS_InterfFF& aFF=aFFs(i);
       const BOPDS_VectorOfCurve& aVNC = aFF.Curves();
       aNbC = aVNC.Length();
@@ -702,11 +764,19 @@ void BOPAlgo_PaveFiller::MakePCurves()
       //
       for (k=0; k<aNbC; ++k)
       {
+        if (UserBreak(aPS))
+        {
+          return;
+        }
         const BOPDS_Curve& aNC=aVNC(k);
         const BOPDS_ListOfPaveBlock& aLPB=aNC.PaveBlocks();
         aItLPB.Initialize(aLPB);
         for(; aItLPB.More(); aItLPB.Next())
         {
+          if (UserBreak(aPS))
+          {
+            return;
+          }
           const Handle(BOPDS_PaveBlock)& aPB=aItLPB.Value();
           nE=aPB->Edge();
           const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&myDS->Shape(nE))); 
@@ -719,10 +789,6 @@ void BOPAlgo_PaveFiller::MakePCurves()
               aMPC.SetEdge(aE);
               aMPC.SetFace(aFf[m]);
               aMPC.SetFlag(Standard_True);
-              if (myProgressScope != NULL)
-              {
-                aMPC.SetProgressIndicator(*myProgressScope);
-              }
             }
           }
         }
@@ -730,14 +796,27 @@ void BOPAlgo_PaveFiller::MakePCurves()
     }// for (i=0; i<aNbFF; ++i) {
   }//if (bPCurveOnS1 || bPCurveOnS2 ) {
   //
+  for (i = 0; i < aVMPC.Length(); i++)
+  {
+    BOPAlgo_MPC& aMPC = aVMPC.ChangeValue(i);
+    aMPC.SetRange(aPS.Next());
+  }
   //======================================================
   BOPTools_Parallel::Perform (myRunParallel, aVMPC, myContext);
   //======================================================
+  if (HasErrors())
+  {
+    return;
+  }
 
   // Add warnings of the failed projections and update edges with new pcurves
   Standard_Integer aNb = aVMPC.Length();
   for (i = 0; i < aNb; ++i)
   {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPAlgo_MPC& aMPC = aVMPC(i);
     if (aMPC.HasErrors())
     {
@@ -804,7 +883,7 @@ void UpdateVertices(const TopoDS_Edge& aE,
 // function: Prepare
 // purpose: 
 //=======================================================================
-void BOPAlgo_PaveFiller::Prepare()
+void BOPAlgo_PaveFiller::Prepare(const Message_ProgressRange& theRange)
 {
   if (myNonDestructive) {
     // do not allow storing pcurves in original edges if non-destructive mode is on
@@ -853,14 +932,27 @@ void BOPAlgo_PaveFiller::Prepare()
     }
   }
   //
+  Message_ProgressScope aPS(theRange, "Prepare", aVBPC.Length());
+  for (i = 0; i < aVBPC.Length(); i++)
+  {
+    BOPAlgo_BPC& aBPC = aVBPC.ChangeValue(i);
+    aBPC.SetRange(aPS.Next());
+  }
   //======================================================
   BOPTools_Parallel::Perform (myRunParallel, aVBPC);
   //======================================================
-
+  if (UserBreak(aPS))
+  {
+    return;
+  }
   // pcurves are built, and now update edges
   BRep_Builder aBB;
   TopoDS_Edge E;
   for (i = 0; i < aVBPC.Length(); i++) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPAlgo_BPC& aBPC=aVBPC(i);
     if (aBPC.IsToUpdate()) {
       Standard_Real aTolE = BRep_Tool::Tolerance(aBPC.GetEdge());
index 3ae8e5b7735bb2ce0a296fb250e43443b5a2b1a8..7616e1d84146b5777040d7baf8aa8685f4bfef92 100644 (file)
@@ -124,7 +124,7 @@ static void FindSolid(const TopoDS_Shape& theSolIn,
 // function: Perform
 // purpose: Performs the removal of the requested faces from the input shape
 //=======================================================================
-void BOPAlgo_RemoveFeatures::Perform()
+void BOPAlgo_RemoveFeatures::Perform(const Message_ProgressRange& /*theRange*/)
 {
   try
   {
index e855f248156d53f6f38dc671eece05ef9948f1cc..7db54ffa8cb130606daa7315ad3eb9f14db9a811 100644 (file)
@@ -201,7 +201,7 @@ public: //! @name Setting input data for the algorithm
 public: //! @name Performing the operation
 
   //! Performs the operation
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 
 public: //! @name Clearing the contents of the algorithm
index 26ec591fc556c1ab751399f838de197cc208171e..3a4838396dbc5186742232cb1f6d504c2d0726ed 100644 (file)
@@ -88,7 +88,7 @@ void BOPAlgo_Section::CheckData()
 //purpose  : 
 //=======================================================================
 void BOPAlgo_Section::PerformInternal1
-  (const BOPAlgo_PaveFiller& theFiller)
+  (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
 {
   myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
   myDS=myPaveFiller->PDS();
@@ -106,9 +106,10 @@ void BOPAlgo_Section::PerformInternal1
     return;
   }
   //
+  Message_ProgressScope aPS(theRange, "PerformInternal", 100);
   // 3. Fill Images
   // 3.1 Vertices
-  FillImagesVertices();
+  FillImagesVertices(aPS.Next(30));           // 30
   if (HasErrors()) {
     return;
   }
@@ -118,7 +119,7 @@ void BOPAlgo_Section::PerformInternal1
     return;
   }
   // 3.2 Edges
-  FillImagesEdges();
+  FillImagesEdges(aPS.Next(35));              // 65
   if (HasErrors()) {
     return;
   }
@@ -128,7 +129,7 @@ void BOPAlgo_Section::PerformInternal1
     return;
   }
   // 4. Section
-  BuildSection();
+  BuildSection(aPS.Next(35));                 // 100
   //
   if (HasErrors()) {
     return;
@@ -146,8 +147,9 @@ void BOPAlgo_Section::PerformInternal1
 //function : BuildSection
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Section::BuildSection()
+void BOPAlgo_Section::BuildSection(const Message_ProgressRange& theRange)
 {
+  Message_ProgressScope aPS(theRange, "BuildSection", 1);
   Standard_Integer i, aNbMS, aNbLE;
   Standard_Integer j,  nE, nV, aNb, aNbF, aNbPBSc;
   TopoDS_Shape aRC, aRC1;
@@ -170,6 +172,10 @@ void BOPAlgo_Section::BuildSection()
   // 1. aRC1
   aNb=myDS->NbSourceShapes();
   for (i=0; i<aNb; ++i) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
     if (aSI.ShapeType()!=TopAbs_FACE) {
       continue;
@@ -181,6 +187,10 @@ void BOPAlgo_Section::BuildSection()
     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);
@@ -190,6 +200,10 @@ void BOPAlgo_Section::BuildSection()
     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;
@@ -205,6 +219,10 @@ void BOPAlgo_Section::BuildSection()
     //
     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);
@@ -217,9 +235,17 @@ void BOPAlgo_Section::BuildSection()
   //
   aNb=aPBP.Size();
   for (i=0; i<aNb; ++i) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     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()) {
@@ -250,6 +276,10 @@ void BOPAlgo_Section::BuildSection()
   // 3.1 Set to treat => aLS
   aIt.Initialize(aLSA);
   for (; aIt.More(); aIt.Next()) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const TopoDS_Shape& aSA=aIt.Value();
     //
     aLS.Clear();
@@ -280,6 +310,10 @@ void BOPAlgo_Section::BuildSection()
         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);
@@ -293,6 +327,10 @@ void BOPAlgo_Section::BuildSection()
     //
     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);
@@ -317,6 +355,10 @@ void BOPAlgo_Section::BuildSection()
   //
   aNbMS=aMSI.Extent();
   for (i=1; i<=aNbMS; ++i) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const TopoDS_Shape& aV=aMSI.FindKey(i);
     const Standard_Integer& iCnt=aMSI.FindFromIndex(i);
     if (iCnt>1) {
@@ -331,6 +373,10 @@ void BOPAlgo_Section::BuildSection()
   //
   aNbMS=aMVE.Extent();
   for (i=1; i<=aNbMS; ++i) {
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const TopoDS_Shape& aV=aMVE.FindKey(i);
     const TopTools_ListOfShape& aLE=aMVE.FindFromIndex(i);
     aNbLE=aLE.Extent();
index 588b4b30620a4eff152b9d46aa4a696cf2f55c3d..ac7cd1f9586b719f5c7740fcb1e39c20de7c20bc 100644 (file)
@@ -53,10 +53,10 @@ protected:
   Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
 
   //! Combine the result of section operation
-  Standard_EXPORT virtual void BuildSection();
+  Standard_EXPORT virtual void BuildSection(const Message_ProgressRange& theRange);
 
   //! Performs calculations using prepared Filler object <thePF>
-  Standard_EXPORT virtual void PerformInternal1(const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformInternal1(const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange) Standard_OVERRIDE;
 
 private:
 
index 108d44f4088ca6a7cd6788e60df510036ef465f4..033d441246f8948caf579e856754a3021737b4d9 100644 (file)
@@ -133,7 +133,7 @@ const TopTools_ListOfShape& BOPAlgo_ShellSplitter::Shells()const
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_ShellSplitter::Perform()
+void BOPAlgo_ShellSplitter::Perform(const Message_ProgressRange& /*theRange*/)
 {
   GetReport()->Clear();
   //
index 95ef70540e00cb90932f837c74be85494b7154c2..8f2d42cb5c463cb0c003477281165ef9210b280d 100644 (file)
@@ -51,7 +51,7 @@ Standard_EXPORT virtual ~BOPAlgo_ShellSplitter();
   Standard_EXPORT const TopTools_ListOfShape& StartElements() const;
   
   //! performs the algorithm
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! returns the loops
   Standard_EXPORT const TopTools_ListOfShape& Shells() const;
index dc53bef84871a6a1297d30ebe8e561761429493d..88088f2175e82be7207fee6e6c1e3e74de8f4710 100644 (file)
@@ -62,7 +62,7 @@ void BOPAlgo_Splitter::CheckData()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Splitter::Perform()
+void BOPAlgo_Splitter::Perform(const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
   //
@@ -89,19 +89,21 @@ void BOPAlgo_Splitter::Perform()
   BOPAlgo_PaveFiller *pPF = new BOPAlgo_PaveFiller();
   pPF->SetArguments(aLS);
   pPF->SetRunParallel(myRunParallel);
-  if (myProgressScope != NULL)
-  {
-    pPF->SetProgressIndicator(*myProgressScope);
-  }
+  
   pPF->SetFuzzyValue(myFuzzyValue);
   pPF->SetNonDestructive(myNonDestructive);
   pPF->SetGlue(myGlue);
   pPF->SetUseOBB(myUseOBB);
   //
-  pPF->Perform();
+  Message_ProgressScope aPS(theRange, "BOPAlgo_Splitter", 10);
+  pPF->Perform(aPS.Next(9));
+  if (HasErrors())
+  {
+    return;
+  }
   //
   myEntryPoint = 1;
-  PerformInternal(*pPF);
+  PerformInternal(*pPF, aPS.Next(1));
 }
 
 //=======================================================================
index 67189f31601ea516e7df6739a1fa10f583422b7d..bc3a08ee23997682ea74b71e220ec6642cddcd39 100644 (file)
@@ -60,7 +60,7 @@ public:
   Standard_EXPORT BOPAlgo_Splitter(const Handle(NCollection_BaseAllocator)& theAllocator);
 
   //! Performs the operation
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 protected:
 
index e5f3c071a20a7c27d9778a15481e9e1283c5a482..4f4e292ad6b048f87d375db593be72a01bc0c59c 100644 (file)
@@ -1219,7 +1219,7 @@ public:
   }
 
   //! Performs the classification
-  virtual void Perform();
+  virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
 
   //! Returns the faces classified as IN for solid
   const TopTools_ListOfShape& InFaces() const
@@ -1260,9 +1260,13 @@ private:
 //function : BOPAlgo_FillIn3DParts::Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_FillIn3DParts::Perform()
+void BOPAlgo_FillIn3DParts::Perform(const Message_ProgressRange& theRange)
 {
-  BOPAlgo_Algo::UserBreak();
+  Message_ProgressScope aPS(theRange, NULL, 1);
+  if (UserBreak(aPS))
+  {
+    return;
+  }
 
   myInFaces.Clear();
 
index 9302342c52ec08ffa721e89ec02b35cd17eced2b..b6f2d2b20519a7700b8d4b8c4ef18c7a6464232f 100644 (file)
@@ -109,7 +109,7 @@ void BOPAlgo_WireSplitter::CheckData()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_WireSplitter::Perform()
+void BOPAlgo_WireSplitter::Perform(const Message_ProgressRange& /*theRange*/)
 {
   GetReport()->Clear();
   //
index 2c54dd78e3b6df0d9250182a8b5837fc6d791297..5820ad3a93586071ee00751c9e4908e103e049c1 100644 (file)
@@ -58,7 +58,7 @@ public:
   //! Returns the context
   Standard_EXPORT const Handle(IntTools_Context)& Context();
 
-  Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   static void MakeWire(TopTools_ListOfShape& theLE, TopoDS_Wire& theW);
   
index 6a90550cec558cb88735369a130f9dbebda1fe92..613ea086d6a90e228a341f5929b23c0217d372d9 100644 (file)
@@ -29,6 +29,8 @@
 #include <TopoDS_Shape.hxx>
 #include <TopTools_ListOfShape.hxx>
 
+#include <Draw_ProgressIndicator.hxx>
+
 #include <stdio.h>
 #include <string.h>
 
@@ -130,7 +132,8 @@ Standard_Integer bapibop(Draw_Interpretor& di,
   pBuilder->SetUseOBB(BOPTest_Objects::UseOBB());
   pBuilder->SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
-  pBuilder->Build();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  pBuilder->Build(aProgress->Start());
   pBuilder->SimplifyResult(BOPTest_Objects::UnifyEdges(),
                            BOPTest_Objects::UnifyFaces(),
                            BOPTest_Objects::Angular());
@@ -197,7 +200,8 @@ Standard_Integer bapibuild(Draw_Interpretor& di,
   aBuilder.SetUseOBB(BOPTest_Objects::UseOBB());
   aBuilder.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
-  aBuilder.Build();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  aBuilder.Build(aProgress->Start());
   aBuilder.SimplifyResult(BOPTest_Objects::UnifyEdges(),
                           BOPTest_Objects::UnifyFaces(),
                           BOPTest_Objects::Angular());
@@ -257,7 +261,8 @@ Standard_Integer bapisplit(Draw_Interpretor& di,
   aSplitter.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
   // performing operation
-  aSplitter.Build();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  aSplitter.Build(aProgress->Start());
   aSplitter.SimplifyResult(BOPTest_Objects::UnifyEdges(),
                            BOPTest_Objects::UnifyFaces(),
                            BOPTest_Objects::Angular());
index edf17415e209f485fc2e02d4e327945e466c6992..b8b4b9930038f90f50369c2dd3b2f2add5441e8c 100644 (file)
@@ -43,6 +43,7 @@
 #include <TopoDS_Iterator.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopTools_ListOfShape.hxx>
+#include <Draw_ProgressIndicator.hxx>
 
 #include <stdio.h>
 //
@@ -145,6 +146,7 @@ Standard_Integer bop(Draw_Interpretor& di,
   bRunParallel=BOPTest_Objects::RunParallel();
   bNonDestructive = BOPTest_Objects::NonDestructive();
   BOPAlgo_GlueEnum aGlue = BOPTest_Objects::Glue();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
   //
   aLC.Append(aS1);
   aLC.Append(aS2);
@@ -164,7 +166,7 @@ Standard_Integer bop(Draw_Interpretor& di,
   pPF->SetGlue(aGlue);
   pPF->SetUseOBB(BOPTest_Objects::UseOBB());
   //
-  pPF->Perform();
+  pPF->Perform(aProgress->Start());
   BOPTest::ReportAlerts(pPF->GetReport());
   //
   return 0;
@@ -247,6 +249,7 @@ Standard_Integer bopsmt(Draw_Interpretor& di,
   }
   // 
   bRunParallel=BOPTest_Objects::RunParallel();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
   //
   const TopoDS_Shape& aS1=aLC.First();
   const TopoDS_Shape& aS2=aLC.Last();
@@ -258,7 +261,7 @@ Standard_Integer bopsmt(Draw_Interpretor& di,
   aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted());
   aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
-  aBOP.PerformWithFiller(*pPF);
+  aBOP.PerformWithFiller(*pPF, aProgress->Start());  
   BOPTest::ReportAlerts(aBOP.GetReport());
 
   // Store the history of Boolean operation into the session
@@ -325,7 +328,8 @@ Standard_Integer bopsection(Draw_Interpretor& di,
   aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted());
   aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
-  aBOP.PerformWithFiller(*pPF);
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  aBOP.PerformWithFiller(*pPF, aProgress->Start());
   BOPTest::ReportAlerts(aBOP.GetReport());
 
   // Store the history of Section operation into the session
@@ -436,6 +440,7 @@ Standard_Integer  bsection(Draw_Interpretor& di,
   //
   BRepAlgoAPI_Section aSec(aS1, aS2, Standard_False);
   //
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
   aSec.Approximation(bApp);
   aSec.ComputePCurveOn1(bPC1);
   aSec.ComputePCurveOn2(bPC2);
@@ -446,8 +451,7 @@ Standard_Integer  bsection(Draw_Interpretor& di,
   aSec.SetGlue(aGlue);
   aSec.SetUseOBB(BOPTest_Objects::UseOBB());
   //
-  aSec.Build();
-
+  aSec.Build(aProgress->Start());  
   // Store the history of Section operation into the session
   if (BRepTest_Objects::IsHistoryNeeded())
     BRepTest_Objects::SetHistory(aSec.History());
@@ -521,7 +525,9 @@ Standard_Integer bsmt (Draw_Interpretor& di,
   aPF.SetGlue(aGlue);
   aPF.SetUseOBB(BOPTest_Objects::UseOBB());
   //
-  aPF.Perform();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  Message_ProgressScope aPS(aProgress->Start(), "BOP", 10);
+  aPF.Perform(aPS.Next(9));
   BOPTest::ReportAlerts(aPF.GetReport());
   if (aPF.HasErrors()) {
     return 0;
@@ -537,7 +543,7 @@ Standard_Integer bsmt (Draw_Interpretor& di,
   aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted());
   aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
-  aBOP.PerformWithFiller(aPF);
+  aBOP.PerformWithFiller(aPF, aPS.Next(1));
   BOPTest::ReportAlerts(aBOP.GetReport());
 
   // Store the history of Boolean operation into the session
@@ -649,7 +655,8 @@ Standard_Integer bopcurves (Draw_Interpretor& di,
   aFF.SetList(aListOfPnts);
   aFF.SetFuzzyValue (BOPTest_Objects::FuzzyValue());
   //
-  aFF.Perform (aF1, aF2);
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  aFF.Perform (aF1, aF2, aProgress->Start());
   //
   anIsDone=aFF.IsDone();
   if (!anIsDone) {
@@ -852,7 +859,8 @@ Standard_Integer mkvolume(Draw_Interpretor& di, Standard_Integer n, const char**
   aMV.SetUseOBB(BOPTest_Objects::UseOBB());
   aMV.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
-  aMV.Perform();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  aMV.Perform(aProgress->Start());
   BOPTest::ReportAlerts(aMV.GetReport());
 
   // Store the history of Volume Maker into the session
index 6ff33c655f39eef7664228795424c997a72ac6df..2878fa32b00be13e5701e7e81148d5cbc8dd5967 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <BRepTest_Objects.hxx>
 
+#include <Draw_ProgressIndicator.hxx>
+
 static Standard_Integer bcbuild (Draw_Interpretor&, Standard_Integer, const char**);
 static Standard_Integer bcaddall (Draw_Interpretor&, Standard_Integer, const char**);
 static Standard_Integer bcremoveall (Draw_Interpretor&, Standard_Integer, const char**);
@@ -116,9 +118,9 @@ Standard_Integer bcbuild(Draw_Interpretor& di,
   aCBuilder.SetUseOBB(BOPTest_Objects::UseOBB());
   aCBuilder.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
-  aCBuilder.PerformWithFiller(aPF); 
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  aCBuilder.PerformWithFiller(aPF, aProgress->Start()); 
   BOPTest::ReportAlerts(aCBuilder.GetReport());
-
   // Store the history of the Cells Builder into the session
   if (BRepTest_Objects::IsHistoryNeeded())
     BRepTest_Objects::SetHistory(aCBuilder.Arguments(), aCBuilder);
index 83ccd18a4706cda4a681d1bbaa2d169d1a67c724..7a67b013d446c28454b2deedb695cf675a5653f5 100644 (file)
@@ -26,6 +26,7 @@
 #include <BRepBuilderAPI_Copy.hxx>
 #include <DBRep.hxx>
 #include <Draw.hxx>
+#include <Draw_ProgressIndicator.hxx>
 #include <OSD_Timer.hxx>
 #include <TCollection_AsciiString.hxx>
 #include <TopExp_Explorer.hxx>
@@ -243,7 +244,8 @@ Standard_Integer bopcheck (Draw_Interpretor& di,
   OSD_Timer aTimer;
   aTimer.Start();
   //
-  aChecker.Perform();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  aChecker.Perform(aProgress->Start());
   //
   aTimer.Stop();
   //
@@ -549,9 +551,9 @@ Standard_Integer bopargcheck (Draw_Interpretor& di,
     }
   }
 
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);  
   // run checker
-  aChecker.Perform();
-
+  aChecker.Perform(aProgress->Start());
   // process result of checking
   if(!aChecker.HasFaulty()) {
     di << "Shape(s) seem(s) to be valid for BOP."  << "\n";
index ebbb605d21f8cadf253105f0cc602f91a5b93917..0f18c76bbb3c66c0d2bb46ebf881ab9218b2fda2 100644 (file)
@@ -31,6 +31,7 @@
 #include <OSD_Timer.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS.hxx>
+#include <Draw_ProgressIndicator.hxx>
 
 #include <stdio.h>
 #include <string.h>
@@ -138,7 +139,8 @@ Standard_Integer bfillds(Draw_Interpretor& di,
   OSD_Timer aTimer;
   aTimer.Start();
   //
-  aPF.Perform();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  aPF.Perform(aProgress->Start());
   BOPTest::ReportAlerts(aPF.GetReport());
   if (aPF.HasErrors()) {
     return 0;
@@ -404,7 +406,8 @@ Standard_Integer bsplit(Draw_Interpretor& di,
   aTimer.Start();
   //
   // perform the operation
-  pSplitter->PerformWithFiller(aPF);
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  pSplitter->PerformWithFiller(aPF, aProgress->Start());
   //
   aTimer.Stop();
   BOPTest::ReportAlerts(pSplitter->GetReport());
index 1e9b3672c0a03d32ff8df2517d8c6af083e98c7a..cc713e63fa7ee12d7c19751ebc353894aee478fd 100644 (file)
@@ -269,7 +269,7 @@ Standard_DISABLE_DEPRECATION_WARNINGS
 //function : Build
 //purpose  : compute the section
 //=======================================================================
-  void BRepAlgo_Section::Build()
+  void BRepAlgo_Section::Build(const Message_ProgressRange& /*theRange*/)
 {
   if (myS1Changed || 
       myS2Changed ||
index 20b80f18313c3241a03de7b1a193fc153e5d92de..ba5f98247f84aa455b0f3457d0d02702978ba80a 100644 (file)
@@ -264,7 +264,7 @@ public:
   //! You may also have combined these computation
   //! options: look at the example given above to illustrate
   //! the use of the constructors.
-  Standard_EXPORT void Build() Standard_OVERRIDE;
+  Standard_EXPORT void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Identifies the ancestor faces of the new
   //! intersection edge E resulting from the last
index 1511ee4645594554b7298fdd1a482b6e60ac8350..5ff5a9e8aa16350e44b47af703369b4e4bfbec55 100644 (file)
@@ -53,7 +53,6 @@ public:
   using BOPAlgo_Options::DumpWarnings;
   using BOPAlgo_Options::ClearWarnings;
   using BOPAlgo_Options::GetReport;
-  using BOPAlgo_Options::SetProgressIndicator;
   using BOPAlgo_Options::SetUseOBB;
 
 protected:
index 969b9be10ded2a99a5c2b6d7ec30a29d21d3685d..3cc64283c98ea8ddbe2f01ad08d857c3fec31839 100644 (file)
@@ -138,7 +138,7 @@ BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation
 //function : Build
 //purpose  :
 //=======================================================================
-void BRepAlgoAPI_BooleanOperation::Build()
+void BRepAlgoAPI_BooleanOperation::Build(const Message_ProgressRange& theRange)
 {
   // Set Not Done status by default
   NotDone();
@@ -167,6 +167,7 @@ void BRepAlgoAPI_BooleanOperation::Build()
     }
   }
 
+  Message_ProgressScope aPS(theRange, NULL, myIsIntersectionNeeded ? 10 : 1);
   // If necessary perform intersection of the argument shapes
   if (myIsIntersectionNeeded)
   {
@@ -176,7 +177,7 @@ void BRepAlgoAPI_BooleanOperation::Build()
       aLArgs.Append(it.Value());
 
     // Perform intersection
-    IntersectShapes(aLArgs);
+    IntersectShapes(aLArgs, aPS.Next(9));
     if (HasErrors())
     {
       if (aDumpOper.IsDump())
@@ -203,7 +204,11 @@ void BRepAlgoAPI_BooleanOperation::Build()
   }
 
   // Build the result
-  BuildResult();
+  BuildResult(aPS.Next(1));
+  if (HasErrors())
+  {
+    return;
+  }
 
   if (aDumpOper.IsDump()) {
     Standard_Boolean isDumpRes = myShape.IsNull() ||
index b298efa54aad9bd719832c782912274f9d733154..7ab0800f56a649e5c431c0774fd18c83508a83be 100644 (file)
@@ -110,7 +110,7 @@ public: //! @name Setting/Getting the type of Boolean operation
 public: //! @name Performing the operation
 
   //! Performs the Boolean operation.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 
 protected: //! @name Constructors
index 4e310b2f6d95c6fd0d30c33777cf31cc61718d0a..60020e7472046acc54bd46442df3d16e5146cc31 100644 (file)
@@ -87,14 +87,15 @@ void BRepAlgoAPI_BuilderAlgo::Clear()
 //function : Build
 //purpose  : 
 //=======================================================================
-void BRepAlgoAPI_BuilderAlgo::Build()
+void BRepAlgoAPI_BuilderAlgo::Build(const Message_ProgressRange& theRange)
 {
   // Setting not done status
   NotDone();
   // Destroy the tools if necessary
   Clear();
+  Message_ProgressScope aPS(theRange, NULL, 2);
   // If necessary perform intersection of the argument shapes
-  IntersectShapes(myArguments);
+  IntersectShapes(myArguments, aPS.Next());
   if (HasErrors())
     return;
 
@@ -102,16 +103,15 @@ void BRepAlgoAPI_BuilderAlgo::Build()
   myBuilder = new BOPAlgo_Builder(myAllocator);
   // Set arguments to builder
   myBuilder->SetArguments(myArguments);
-
   // Build the result basing on intersection results
-  BuildResult();
+  BuildResult(aPS.Next());
 }
 
 //=======================================================================
 //function : IntersectShapes
 //purpose  : Intersects the given shapes with the intersection tool
 //=======================================================================
-void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs)
+void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange)
 {
   if (!myIsIntersectionNeeded)
     return;
@@ -125,18 +125,16 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg
   myDSFiller->SetArguments(theArgs);
   // Set options for intersection
   myDSFiller->SetRunParallel(myRunParallel);
-  if (myProgressScope != NULL)
-  {
-    myDSFiller->SetProgressIndicator(*myProgressScope);
-  }
+  
   myDSFiller->SetFuzzyValue(myFuzzyValue);
   myDSFiller->SetNonDestructive(myNonDestructive);
   myDSFiller->SetGlue(myGlue);
   myDSFiller->SetUseOBB(myUseOBB);
   // Set Face/Face intersection options to the intersection algorithm
   SetAttributes();
+  Message_ProgressScope aPS(theRange, NULL, 1);
   // Perform intersection
-  myDSFiller->Perform();
+  myDSFiller->Perform(aPS.Next());
   // Check for the errors during intersection
   GetReport()->Merge(myDSFiller->GetReport());
 }
@@ -144,18 +142,16 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg
 //function : BuildResult
 //purpose  : Builds the result shape
 //=======================================================================
-void BRepAlgoAPI_BuilderAlgo::BuildResult()
+void BRepAlgoAPI_BuilderAlgo::BuildResult(const Message_ProgressRange& theRange)
 {
   // Set options to the builder
   myBuilder->SetRunParallel(myRunParallel);
-  if (myProgressScope != NULL)
-  {
-    myBuilder->SetProgressIndicator(*myProgressScope);
-  }
+
   myBuilder->SetCheckInverted(myCheckInverted);
   myBuilder->SetToFillHistory(myFillHistory);
   // Perform building of the result with pre-calculated intersections
-  myBuilder->PerformWithFiller(*myDSFiller);
+  Message_ProgressScope aPS(theRange, NULL, 1);
+  myBuilder->PerformWithFiller(*myDSFiller, aPS.Next());
   // Merge the warnings of the Building part
   GetReport()->Merge(myBuilder->GetReport());
   // Check for the errors
index d8cc474de3560b6c520bd409a850559f128560a3..051e9ef930baed07f8c78e77c824c6e5c752f8de 100644 (file)
@@ -138,7 +138,7 @@ public: //! @name Setting options
 public: //! @name Performing the operation
 
   //! Performs the algorithm
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 
 public: //! @name Result simplification
@@ -250,10 +250,10 @@ protected: //! @name Setting options to the Intersection tool
 protected: //! @name Protected methods for shapes intersection and building result
 
   //! Intersects the given shapes with the intersection tool
-  Standard_EXPORT void IntersectShapes(const TopTools_ListOfShape& theArgs);
+  Standard_EXPORT void IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange);
 
   //! Builds the resulting shape
-  Standard_EXPORT void BuildResult();
+  Standard_EXPORT void BuildResult(const Message_ProgressRange& theRange = Message_ProgressRange());
 
 
 protected: //! @name Clearing the contents of the algorithm
index 3dc00987798bbcf6cff58fd3788813992c00be66..d4a05d0a9b1350eae0d71102df9bfb86c78860e8 100644 (file)
@@ -38,7 +38,8 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check()
 //=======================================================================
 BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS,
                                      const Standard_Boolean bTestSE,
-                                     const Standard_Boolean bTestSI)
+                                     const Standard_Boolean bTestSI,
+                                     const Message_ProgressRange& theRange)
 :
   BOPAlgo_Options(),
   myS1(theS),
@@ -46,7 +47,7 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS,
   myTestSI(bTestSI),
   myOperation(BOPAlgo_UNKNOWN)
 {
-  Perform();
+  Perform(theRange);
 }
 
 //=======================================================================
@@ -57,7 +58,8 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS1,
                                      const TopoDS_Shape& theS2,
                                      const BOPAlgo_Operation theOp,
                                      const Standard_Boolean bTestSE,
-                                     const Standard_Boolean bTestSI)
+                                     const Standard_Boolean bTestSI,
+                                     const Message_ProgressRange& theRange)
 :
   BOPAlgo_Options(),
   myS1(theS1),
@@ -66,7 +68,7 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS1,
   myTestSI(bTestSI),
   myOperation(theOp)
 {
-  Perform();
+  Perform(theRange);
 }
 
 //=======================================================================
@@ -81,7 +83,7 @@ BRepAlgoAPI_Check::~BRepAlgoAPI_Check()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BRepAlgoAPI_Check::Perform()
+void BRepAlgoAPI_Check::Perform(const Message_ProgressRange& theRange)
 {
   // Check the incompatibility of shapes types, small edges and self-interference
   BOPAlgo_ArgumentAnalyzer anAnalyzer;
@@ -94,13 +96,14 @@ void BRepAlgoAPI_Check::Perform()
   anAnalyzer.SelfInterMode() = myTestSI;
   // Set options from BOPAlgo_Options
   anAnalyzer.SetRunParallel(myRunParallel);
-  if (myProgressScope != NULL)
-  {
-    anAnalyzer.SetProgressIndicator(*myProgressScope);
-  }
   anAnalyzer.SetFuzzyValue(myFuzzyValue);
   // Perform the check
-  anAnalyzer.Perform();
+  Message_ProgressScope aPS(theRange, NULL, 1);
+  anAnalyzer.Perform(aPS.Next());
+  if (HasErrors())
+  {
+    return;
+  }
   // Get the results
   myFaultyShapes = anAnalyzer.GetCheckResult();
 
index e3ded7899cdebffdb0a537151959587bf6998df7..38b954db8166b352810d06e354bf2b3ab47a62d5 100644 (file)
@@ -26,6 +26,7 @@
 #include <Standard_Boolean.hxx>
 #include <Standard_Real.hxx>
 #include <TopoDS_Shape.hxx>
+#include <Message_ProgressRange.hxx>
 
 
 //! The class Check provides a diagnostic tool for checking the validity
@@ -66,9 +67,11 @@ public: //! @name Constructors
   //!                       on small edges or not; by default it is set to TRUE;
   //! @param bTestSI [in] - flag which specifies whether to check the shape
   //!                       on self-interference or not; by default it is set to TRUE;
+  //! @param theRange [in] - parameter to use progrs indicator
   Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS,
                                     const Standard_Boolean bTestSE = Standard_True,
-                                    const Standard_Boolean bTestSI = Standard_True);
+                                    const Standard_Boolean bTestSI = Standard_True,
+                                    const Message_ProgressRange& theRange = Message_ProgressRange());
 
   //! Constructor for checking the couple of shapes.
   //! Additionally to the validity checks of each given shape,
@@ -83,11 +86,13 @@ public: //! @name Constructors
   //!                       on small edges or not; by default it is set to TRUE;
   //! @param bTestSI [in] - flag which specifies whether to check the shape
   //!                       on self-interference or not; by default it is set to TRUE;
+  //! @param theRange [in] - parameter to use progrs indicator
   Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS1,
                                     const TopoDS_Shape& theS2,
                                     const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN,
                                     const Standard_Boolean bTestSE = Standard_True,
-                                    const Standard_Boolean bTestSI = Standard_True);
+                                    const Standard_Boolean bTestSI = Standard_True,
+                                    const Message_ProgressRange& theRange = Message_ProgressRange());
 
 
 public: //! @name Initializing the algorithm
@@ -141,7 +146,7 @@ public: //! @name Initializing the algorithm
 public: //! @name Performing the operation
 
   //! Performs the check.
-  Standard_EXPORT void Perform();
+  Standard_EXPORT void Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
 
 
 public: //! @name Getting the results.
index f2a3d4fdd1ab19dc4fcb34e160966a10ff3243cb..09186489c08fdf910da742a4e1edf3eaee81b803 100644 (file)
@@ -52,11 +52,13 @@ BRepAlgoAPI_Cut::~BRepAlgoAPI_Cut()
 //purpose  : 
 //=======================================================================
 BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1, 
-                                 const TopoDS_Shape& S2)
+                                 const TopoDS_Shape& S2,
+                                 const Message_ProgressRange& theRange)
 :
   BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_CUT)
 {
-  Build();
+  Message_ProgressScope aPS(theRange, "Cut", 1);
+  Build(aPS.Next());
 }
 //=======================================================================
 //function : BRepAlgoAPI_Cut
@@ -65,10 +67,12 @@ BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1,
 BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1, 
                                  const TopoDS_Shape& S2,
                                  const BOPAlgo_PaveFiller& aDSF,
-                                 const Standard_Boolean bFWD)
+                                 const Standard_Boolean bFWD,
+                                 const Message_ProgressRange& theRange)
 : 
   BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, 
                                (bFWD) ? BOPAlgo_CUT : BOPAlgo_CUT21)
 {
-  Build();
+  Message_ProgressScope aPS(theRange, "Cut", 1);
+  Build(aPS.Next());
 }
index b5255bb0897b882f84bc772d7b844d4d26d34fb1..41dba20286b427767204151ef36c4995cd061074 100644 (file)
@@ -50,7 +50,8 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Cut();
   //! <S2>  -tool
   //! <anOperation> - the type of the operation
   //! Obsolete
-  Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
+  Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
+                                  const Message_ProgressRange& theRange = Message_ProgressRange());
   
   //! Constructor with two shapes
   //! <S1>  -argument
@@ -58,7 +59,9 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Cut();
   //! <anOperation> - the type of the operation
   //! <PF> - PaveFiller object that is carried out
   //! Obsolete
-  Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF, const Standard_Boolean bFWD = Standard_True);
+  Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF, 
+                                  const Standard_Boolean bFWD = Standard_True, 
+                                  const Message_ProgressRange& theRange = Message_ProgressRange());
 
 
 
index 272a876a9401319d3db56f20c5636e2871146000..2f4def8b8d62701566daa93b5109d20dac2c396f 100644 (file)
@@ -21,7 +21,7 @@
 //function : Build
 //purpose  : 
 //=======================================================================
-void BRepAlgoAPI_Defeaturing::Build()
+void BRepAlgoAPI_Defeaturing::Build(const Message_ProgressRange& /*theRange*/)
 {
   // Set not done state for the operation
   NotDone();
index 43258f9548a825f7ad54dcb70c917e1f51a123f2..a547766f764901be7acf78e420d84e0ab6ae9614 100644 (file)
@@ -157,7 +157,7 @@ public: //! @name Setting input data for the algorithm
 public: //! @name Performing the operation
 
   //! Performs the operation
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 
 public: //! @name History Methods
index 1e24153be7ba79cf6eabb73877445cb3a16f7ff0..dd0f9488b4b12c4775f378847ac362a36f42853d 100644 (file)
@@ -52,11 +52,13 @@ BRepAlgoAPI_Fuse::~BRepAlgoAPI_Fuse()
 //purpose  : 
 //=======================================================================
 BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, 
-                                   const TopoDS_Shape& S2)
+                                   const TopoDS_Shape& S2, 
+                                   const Message_ProgressRange& theRange)
 : 
   BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_FUSE)
 {
-  Build();
+  Message_ProgressScope aPS(theRange, "Fuse", 1);
+  Build(aPS.Next());
 }
 //=======================================================================
 //function : BRepAlgoAPI_Fuse
@@ -64,9 +66,11 @@ BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1,
 //=======================================================================
 BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, 
                                    const TopoDS_Shape& S2,
-                                   const BOPAlgo_PaveFiller& aDSF)
+                                   const BOPAlgo_PaveFiller& aDSF,
+                                   const Message_ProgressRange& theRange)
 : 
   BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, BOPAlgo_FUSE)
 {
-  Build();
+  Message_ProgressScope aPS(theRange, "Fuse", 1);
+  Build(aPS.Next());
 }
index 52dd5dc89ec4d5575d2ec561449e4885a07d0cd9..53fd1767734364e0a068b9aac342f87f85064aae 100644 (file)
@@ -49,7 +49,8 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Fuse();
   //! <S2>  -tool
   //! <anOperation> - the type of the operation
   //! Obsolete
-  Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
+  Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
+                                   const Message_ProgressRange& theRange = Message_ProgressRange());
   
   //! Constructor with two shapes
   //! <S1>  -argument
@@ -57,7 +58,8 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Fuse();
   //! <anOperation> - the type of the operation
   //! <PF> - PaveFiller object that is carried out
   //! Obsolete
-  Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF);
+  Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF,
+                                   const Message_ProgressRange& theRange = Message_ProgressRange());
 
 
 
index 2e59aaf5f45c609d1c6a8f62a6e8174212316805..407dee4cb7891cdc2e8d5507e61e0d06217a2422 100644 (file)
@@ -271,9 +271,10 @@ void BRepAlgoAPI_Section::SetAttributes()
 //function : Build
 //purpose  : 
 //=======================================================================
-void BRepAlgoAPI_Section::Build() 
+void BRepAlgoAPI_Section::Build(const Message_ProgressRange& theRange
 {
-  BRepAlgoAPI_BooleanOperation::Build();
+  Message_ProgressScope aPS(theRange, NULL, 1);
+  BRepAlgoAPI_BooleanOperation::Build(aPS.Next());
 }
 //=======================================================================
 //function : HasAncestorFaceOn1
index 2582d5705a472ace7d6a3b44bd3f9b46f8c12995..78e525f8b73ebe9439c28aa004f0ce0904d5071e 100644 (file)
@@ -158,7 +158,7 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Section();
   //! Performs the algorithm
   //! Filling interference Data Structure (if it is necessary)
   //! Building the result of the operation.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
 
   //! get the face of the first part giving section edge <E>.
index 4a0fd00d701aa223128a04a7a114c5888ea3ac26..cca83d831a67d17d71fc30d3f2db7679c3a8bfc1 100644 (file)
@@ -35,7 +35,7 @@ BRepAlgoAPI_Splitter::BRepAlgoAPI_Splitter(const BOPAlgo_PaveFiller& thePF)
 // function: Build
 // purpose: 
 //=======================================================================
-void BRepAlgoAPI_Splitter::Build()
+void BRepAlgoAPI_Splitter::Build(const Message_ProgressRange& theRange)
 {
   // Set Not Done status by default
   NotDone();
@@ -50,6 +50,7 @@ void BRepAlgoAPI_Splitter::Build()
   }
 
   // If necessary perform intersection of the argument shapes
+  Message_ProgressScope aPS(theRange, NULL, myIsIntersectionNeeded ? 10 : 1);
   if (myIsIntersectionNeeded)
   {
     // Combine Arguments and Tools for intersection into a single list
@@ -58,7 +59,7 @@ void BRepAlgoAPI_Splitter::Build()
       aLArgs.Append(it.Value());
 
     // Perform intersection
-    IntersectShapes(aLArgs);
+    IntersectShapes(aLArgs, aPS.Next(9));
     if (HasErrors())
       return;
   }
@@ -69,5 +70,5 @@ void BRepAlgoAPI_Splitter::Build()
   ((BOPAlgo_Splitter*)myBuilder)->SetTools(myTools);
 
   // Build result shape basing on the intersection results
-  BuildResult();
+  BuildResult(aPS.Next(1));
 }
index 97288441d247743806b641f6800e547b4edf1723..eed068076088664286af2a97a15869bf600834f4 100644 (file)
@@ -82,7 +82,7 @@ public: //! @name Performing the operation
   //! Performs the Split operation.
   //! Performs the intersection of the argument shapes (both objects and tools)
   //! and splits objects by the tools.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 
 protected: //! @name Fields
index ba27b58772610bd0dc960a70db343177db210636..2ff0a1454c4c072107ea1568de6a0cd5ad213219 100644 (file)
@@ -36,7 +36,7 @@ BRepBuilderAPI_MakeShape::BRepBuilderAPI_MakeShape()
 //purpose  : 
 //=======================================================================
 
-void BRepBuilderAPI_MakeShape::Build()
+void BRepBuilderAPI_MakeShape::Build(const Message_ProgressRange& /*theRange*/)
 {
 }
 
index 7536e26b13c07a7ede997e5b851190f122b3f79e..d7d6b5ec91eb78dbd23d5ba3edfa1ecdb4266d9a 100644 (file)
@@ -25,6 +25,7 @@
 #include <TopTools_ListOfShape.hxx>
 #include <BRepBuilderAPI_Command.hxx>
 #include <Standard_Boolean.hxx>
+#include <Message_ProgressRange.hxx>
 class StdFail_NotDone;
 class TopoDS_Shape;
 
@@ -42,7 +43,7 @@ public:
 
   //! This is  called by  Shape().  It does  nothing but
   //! may be redefined.
-  Standard_EXPORT virtual void Build();
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange());
   
   //! Returns a shape built by the shape construction algorithm.
   //! Raises exception StdFail_NotDone if the shape was not built.
index 4a6635ea556b2d28f33d12d83bdcbf1ac0d9180e..6bf049b3f32b8583a97e2912cf9b7097dffa56af 100644 (file)
 //function : PerformResult
 //purpose  : 
 //=======================================================================
-  void BRepFeat_Builder::PerformResult()
+  void BRepFeat_Builder::PerformResult(const Message_ProgressRange& theRange)
 {
   myOperation = myFuse ? BOPAlgo_FUSE : BOPAlgo_CUT;
   //
+  Message_ProgressScope aPSOuter(theRange, NULL, 2);
   if (!myShapes.IsEmpty()) {
+    Message_ProgressScope aPS(aPSOuter.Next(), "BRepFeat_Builder", 100);
     //
     Prepare(); 
     //
     RebuildFaces();
     //
-    FillImagesContainers(TopAbs_SHELL);
+    FillImagesContainers(TopAbs_SHELL, aPS.Next(30));
     if (HasErrors()) {
       return;
     }
     //
-    FillImagesSolids();
+    FillImagesSolids(aPS.Next(30));
     if (HasErrors()) {
       return;
     }
       return;
     }
     // 
-    FillImagesCompounds();
+    FillImagesCompounds(aPS.Next(40));
     if (HasErrors()) {
       return;
     }
     }
   }
   //
-  BuildShape();
+  BuildShape(aPSOuter.Next());
 }
 
 //=======================================================================
index a9a96a03b529f0105892d1db27ba350be2b14e38..9807e582c8f84123dc222573c936e0c471078281 100644 (file)
@@ -89,7 +89,7 @@ Standard_EXPORT virtual ~BRepFeat_Builder();
   
   //! Main function to build the result of the
   //! local operation required.
-  Standard_EXPORT void PerformResult();
+  Standard_EXPORT void PerformResult(const Message_ProgressRange& theRange = Message_ProgressRange());
   
   //! Rebuilds faces in accordance with the kept parts of the tool.
   Standard_EXPORT void RebuildFaces();
index a6f9c836f81f20ee8e23b083f7871cf44069eb82..b119560b4af666edb7638f981419a1a97de99b6d 100644 (file)
@@ -26,7 +26,7 @@
 //function : Build
 //purpose  : 
 //=======================================================================
-void BRepFeat_Gluer::Build()
+void BRepFeat_Gluer::Build(const Message_ProgressRange& /*theRange*/)
 {
   myGluer.Perform();
   if (myGluer.IsDone()) {
index cd29cd033c3cc36be01e2f068d49f426c142802a..aba0dfe40c7977f5bb404de5ce4f76efebae5445 100644 (file)
@@ -91,7 +91,7 @@ public:
   
   //! This is  called by  Shape().  It does  nothing but
   //! may be redefined.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! returns the status of the Face after
   //! the shape creation.
index 2a559c05fa80fd904f98b190d028be7c316aab06..4b5ea9399c1133a588f994dd8e863cd7a6a18fec 100644 (file)
@@ -33,7 +33,7 @@
 //function : Build
 //purpose  : 
 //=======================================================================
-void BRepFeat_SplitShape::Build ()
+void BRepFeat_SplitShape::Build (const Message_ProgressRange& /*theRange*/)
 {
   mySShape.Perform(myWOnShape);
   if (mySShape.IsDone()) {
index 1ebcce2a012d1529776aea44adc3e9c29b2dded6..e38edf2d5e61816e52f4378063e1a82c8574f2c1 100644 (file)
@@ -109,7 +109,7 @@ public:
   Standard_EXPORT const TopTools_ListOfShape& Right() const;
   
   //! Builds the cut and the resulting faces and edges as well.
-  Standard_EXPORT void Build() Standard_OVERRIDE;
+  Standard_EXPORT void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns true if the shape has been deleted.
   Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S) Standard_OVERRIDE;
index 25dbeb6190ebf4fdd7936a26159233664c7544d0..85bcc71d618827452d51596ccdad79b772c6d386 100644 (file)
@@ -391,7 +391,7 @@ Handle(TopOpeBRepBuild_HBuilder) BRepFilletAPI_MakeChamfer::Builder()const
 //purpose  : 
 //=======================================================================
 
-void BRepFilletAPI_MakeChamfer::Build()
+void BRepFilletAPI_MakeChamfer::Build(const Message_ProgressRange& /*theRange*/)
 {
   myBuilder.Compute();
   if (myBuilder.IsDone()){
index b395ef88fa9049a01fdb8206c94aaebf4ade91bf..b13cc67e3cf36a19035b5b7e74ef2e042dda5143 100644 (file)
@@ -250,7 +250,7 @@ public:
   //! intersection of 4 or more edges of the shape, or
   //! -   the intersection of the chamfer with a face which
   //! limits the contour is not fully contained in this face.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Reinitializes this algorithm, thus canceling the effects of the Build function.
   //! This function allows modifications to be made to the
index 8a942e992b4e00c8f4bcb8e5bdac7676f7d9d101..54c31dafd1fa954064dca11a9de0118aaf68ae8a 100644 (file)
@@ -528,7 +528,7 @@ Handle(TopOpeBRepBuild_HBuilder) BRepFilletAPI_MakeFillet::Builder()const
 //purpose  : 
 //=======================================================================
 
-void BRepFilletAPI_MakeFillet::Build()
+void BRepFilletAPI_MakeFillet::Build(const Message_ProgressRange& /*theRange*/)
 {
   myBuilder.Compute();
   if(myBuilder.IsDone()) {
index 8c22d8a09cef806b0914c526b9f6bb72e1fe5bd3..1d4dee1babd37e02d41cbe2bcd71a60970fb37cb 100644 (file)
@@ -293,7 +293,7 @@ public:
   //! intersection of 4 or more edges of the shape, or
   //! -   the intersection of the fillet with a face which limits
   //! the contour is not fully contained in this face.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Reinitializes this algorithm, thus canceling the effects of the Build function.
   //! This function allows modifications to be made to the
index 08926078e6f7ece4fee4c78e327ede7c78df9cf3..3c544d8e63172a2da1ad19eacd696cbdfe85381b 100644 (file)
@@ -155,7 +155,7 @@ const TopoDS_Edge& BRepFilletAPI_MakeFillet2d::BasisEdge(const TopoDS_Edge& E) c
 //purpose  : 
 //=======================================================================
 
-void BRepFilletAPI_MakeFillet2d::Build()
+void BRepFilletAPI_MakeFillet2d::Build(const Message_ProgressRange& /*theRange*/)
 {
   // test if the operation is done
   if (Status() == ChFi2d_IsDone) {
index 645e4b14f28e5d68b6ea31437c9b7bf03c9103b6..a7a3a85a265016c43ad3d2ff666d23745755a261 100644 (file)
@@ -282,7 +282,7 @@ public:
     ChFi2d_ConstructionError Status() const;
   
   //! Update the result and set the Done flag
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 
 
index 50eadac75bf506e02cde44953fad5b1c5370f236..4e2f73ed37b60ba2f268e9176249c41f23f41bec 100644 (file)
@@ -305,7 +305,7 @@ TopoDS_Shape BRepOffsetAPI_DraftAngle::ModifiedShape
 //purpose  : 
 //=======================================================================
 
-void BRepOffsetAPI_DraftAngle::Build()
+void BRepOffsetAPI_DraftAngle::Build(const Message_ProgressRange& /*theRange*/)
 {
   Handle(Draft_Modification)::DownCast (myModification)->Perform();
   if (!Handle(Draft_Modification)::DownCast (myModification)->IsDone()) {
index 8fef1b02278aadd426c714db93323a110313db93..a74e31b3bbc14b4612522a98f24a8c2326f37b23 100644 (file)
@@ -176,7 +176,7 @@ public:
   Standard_EXPORT const TopTools_ListOfShape& ModifiedFaces() const;
   
   //! Builds the resulting shape (redefined from MakeShape).
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   Standard_EXPORT void CorrectWires();
   
index 1b7612b5703437809f28f8d8f48638ba37fad40e..0fc1c6763c3e2081ed43d4e3b44305ba77ae2a7c 100644 (file)
@@ -114,7 +114,7 @@ const BRepFill_Evolved& BRepOffsetAPI_MakeEvolved::Evolved() const
 //function : Build
 //purpose  : 
 //=======================================================================
-void BRepOffsetAPI_MakeEvolved::Build()
+void BRepOffsetAPI_MakeEvolved::Build(const Message_ProgressRange& /*theRange*/)
 {
   if (myEvolved.IsDone())
   {
index ea2e1062114a320370a0b54f30944af4ddca517d..f311f4c5616753546c1c7cc50e08f6cde9614820 100644 (file)
@@ -106,7 +106,7 @@ public:
   Standard_EXPORT const BRepFill_Evolved& Evolved() const;
   
   //! Builds the resulting shape (redefined from MakeShape).
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns   the  shapes  created  from   a  subshape
   //! <SpineShape>  of     the  spine   and   a subshape
index b8bfcbef6685f1b5026d666ed91b0075328c85cb..5eb9909159d7108098143fb24064afd6c677dd18 100644 (file)
@@ -144,7 +144,7 @@ Standard_Integer BRepOffsetAPI_MakeFilling::Add( const Standard_Real U,
 //function : Build
 //purpose  : builds the resulting face
 //======================================================================
-void BRepOffsetAPI_MakeFilling::Build(
+void BRepOffsetAPI_MakeFilling::Build(const Message_ProgressRange& /*theRange*/)
 {
   myFilling.Build();
   myShape = myFilling.Face();
index 975eac073e00daf16db67f5d0a6b7d98332b7da8..641633c4073adc55c4353bcc6c94e4d6b76e52ef 100644 (file)
@@ -183,7 +183,7 @@ public:
   Standard_EXPORT Standard_Integer Add (const Standard_Real U, const Standard_Real V, const TopoDS_Face& Support, const GeomAbs_Shape Order);
   
   //! Builds the resulting faces
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Tests whether computation of the filling plate has been completed.
   Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
index df157f5b05c08ef3f1568558b3173ccfee0cffbb..c5683e57a6c255cbf4140084380af7e2e8542b89 100644 (file)
@@ -371,7 +371,7 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset,
 //purpose  : 
 //=======================================================================
 
-void BRepOffsetAPI_MakeOffset::Build()
+void BRepOffsetAPI_MakeOffset::Build(const Message_ProgressRange& /*theRange*/)
 {
   Done();
 }
index f2ea8cb64644a2854fa5361da9536a44bc91e73e..1ab16bb1fd576a7343a48cee199b3b41433cbd1b 100644 (file)
@@ -79,7 +79,7 @@ public:
   Standard_EXPORT void Perform (const Standard_Real Offset, const Standard_Real Alt = 0.0);
   
   //! Builds the resulting shape (redefined from MakeShape).
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! returns a list of the created shapes
   //! from the shape <S>.
index 99e6eb4a743367fca0006794f5a6f03ae6c9b0f2..d00d7d16106a6a55577cd4ff12eb520c1ec2ea5f 100644 (file)
@@ -90,7 +90,7 @@ const BRepOffset_MakeOffset& BRepOffsetAPI_MakeOffsetShape::MakeOffset() const
 //function : Build
 //purpose  : 
 //=======================================================================
-void BRepOffsetAPI_MakeOffsetShape::Build()
+void BRepOffsetAPI_MakeOffsetShape::Build(const Message_ProgressRange& /*theRange*/)
 {
 }
 
index c380e1b275c239eab3b868ac54b48b9c83a41e5f..1a863c1091c69912075b5da9323324bf2258251d 100644 (file)
@@ -120,7 +120,7 @@ public:
   Standard_EXPORT virtual const BRepOffset_MakeOffset& MakeOffset() const;
 
   //! Does nothing.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the list of shapes generated from the shape <S>.
   Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
index a4131ea8caa7f6b7e306a4ec774e982bb0924391..3d3f80fe6eddc5bf2a5f798dedbcdca7895dfa98 100644 (file)
@@ -77,7 +77,7 @@ const BRepFill_Pipe& BRepOffsetAPI_MakePipe::Pipe() const
 //purpose  : 
 //=======================================================================
 
-void BRepOffsetAPI_MakePipe::Build(
+void BRepOffsetAPI_MakePipe::Build(const Message_ProgressRange& /*theRange*/)
 {
   myShape = myPipe.Shape();
   //Check for emptiness of result
index fc49ce31eb4048e7b0b2bda3317aa48efee8cd80..7e2f30f8ecaae542c3be21aa53819b3ac53edf7f 100644 (file)
@@ -71,7 +71,7 @@ public:
   Standard_EXPORT const BRepFill_Pipe& Pipe() const;
   
   //! Builds the resulting shape (redefined from MakeShape).
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the  TopoDS  Shape of the bottom of the prism.
   Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE;
index ef0343c4a07cf6ac1c19a2a2bfca07a674f3040e..b222a52b041ef311c16d05cf684b5328fe02b426 100644 (file)
@@ -253,7 +253,7 @@ void BRepOffsetAPI_MakePipeShell::SetMaxSegments(const Standard_Integer NewMaxSe
 //function :Build() 
 //purpose  : 
 //=======================================================================
- void BRepOffsetAPI_MakePipeShell::Build()
+ void BRepOffsetAPI_MakePipeShell::Build(const Message_ProgressRange& /*theRange*/)
 {
   Standard_Boolean Ok;
   Ok = myPipe->Build();
index a10a9d4f31eb1be7d289cdd65dd7ac731a81282a..401df7340dc97447eb01df6ea4867b876f9829c1 100644 (file)
@@ -241,7 +241,7 @@ public:
   Standard_EXPORT void Simulate (const Standard_Integer NumberOfSection, TopTools_ListOfShape& Result);
   
   //! Builds the resulting shape (redefined from MakeShape).
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Transforms the sweeping Shell in Solid.
   //! If a propfile is not closed returns False
index 4376c6cd0a87e33c72e70b13e9bbdce91766f9a9..5024a3dfada5898214b6b7bd8bac021519074150 100644 (file)
@@ -89,7 +89,7 @@ void BRepOffsetAPI_MakeThickSolid::MakeThickSolidBySimple(const TopoDS_Shape& th
 //function : Build
 //purpose  : 
 //=======================================================================
-void BRepOffsetAPI_MakeThickSolid::Build()
+void BRepOffsetAPI_MakeThickSolid::Build(const Message_ProgressRange& /*theRange*/)
 {
 }
 
index 4dc6589c3d20c8460239c3656e83d20a463724c4..b15eb150f5dae7a3ffe93d846b77b9c9c53c4e87 100644 (file)
@@ -113,7 +113,7 @@ public:
                                             const Standard_Boolean RemoveIntEdges = Standard_False);
 
   // Does nothing.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the list  of shapes modified from the shape
   //! <S>.
index 305c6ffdcf7e1aeb6e28cd73f4439f95fc661e0a..67bce0849cf89f7d99fa092cb5c2063c10fea22e 100644 (file)
@@ -332,7 +332,7 @@ BRepOffsetAPI_MiddlePath::BRepOffsetAPI_MiddlePath(const TopoDS_Shape& aShape,
 //purpose  : 
 //=======================================================================
 
-void BRepOffsetAPI_MiddlePath::Build()
+void BRepOffsetAPI_MiddlePath::Build(const Message_ProgressRange& /*theRange*/)
 {
   TopTools_ListIteratorOfListOfShape itl;
   
index a68cb68368321af2fd15d6c03e05031230c65d08..68e533ca432eaf5ceac8afc7987b0e9d04e8cbb7 100644 (file)
@@ -43,7 +43,7 @@ public:
   //! a wire or a face
   Standard_EXPORT BRepOffsetAPI_MiddlePath(const TopoDS_Shape& aShape, const TopoDS_Shape& StartShape, const TopoDS_Shape& EndShape);
   
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 
 
index 08361b7a84de2f84b201d5c68b5e91088bd5b35c..6d0be92578267ae37cb0cc855ea36dae720243af 100644 (file)
@@ -61,7 +61,7 @@ BRepOffsetAPI_NormalProjection::BRepOffsetAPI_NormalProjection()
   myNormalProjector.Compute3d(With3d);
 }
 
- void BRepOffsetAPI_NormalProjection::Build(
+ void BRepOffsetAPI_NormalProjection::Build(const Message_ProgressRange& /*theRange*/)
 {
   myNormalProjector.Build();
   myShape = myNormalProjector.Projection();
index 2156812b9c4632cf4102ed4c8155b4202f8acb0d..4b569019e0563e64b4bb8e94e5a5199e9837a403 100644 (file)
@@ -91,7 +91,7 @@ public:
   
   //! Builds the result of the projection as a compound of
   //! wires. Tries to build oriented wires.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns true if the object was correctly built by the shape
   //! construction algorithm.
index dd7eeee2e92a0bff3980e66761176414993ce231..745eba1f3806c060e5ea1cdd2af5c4840f134bbe 100644 (file)
@@ -339,7 +339,7 @@ void BRepOffsetAPI_ThruSections::CheckCompatibility(const Standard_Boolean check
 //purpose  : 
 //=======================================================================
 
-void BRepOffsetAPI_ThruSections::Build()
+void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/)
 {
   //Check set of section for right configuration of punctual sections
   Standard_Integer i;
index 79c88394d4e03e79cb86a9772f172b213e576ee0..705939443b193302a7ef8ad6edabbc3a671e16e5 100644 (file)
@@ -130,7 +130,7 @@ public:
   //! the  optimization.
   Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const;
   
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the TopoDS Shape of the bottom of the loft if solid
   Standard_EXPORT const TopoDS_Shape& FirstShape() const;
index 5a75797ed12e1131dc7f1e575e03a3b88e433618..6cd21578fbec174ab5a20737a8685ec1d42978ea 100644 (file)
@@ -27,7 +27,7 @@
 //function : Build
 //purpose  :
 //=======================================================================
-void BRepPreviewAPI_MakeBox::Build()
+void BRepPreviewAPI_MakeBox::Build(const Message_ProgressRange& /*theRange*/)
 {
   gp_Pnt anLocation = myWedge.Axes().Location();
 
index 3cee338dc1cf5b9b4e9ea211e882c928791c8ab2..17c478676c974465ca42aef258eed792603a7f81 100644 (file)
@@ -34,7 +34,7 @@ public:
   BRepPreviewAPI_MakeBox() {}
 
   //! Creates a preview depending on point values.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 private:
 
index 8cf9916704c8968f0016ea10471e281ab05af08f..52cda67cc87c8b318b756ce2df909fb889b0b3dc 100644 (file)
@@ -181,7 +181,7 @@ const TopoDS_Shell&  BRepPrimAPI_MakeBox::Shell()
 //purpose  : 
 //=======================================================================
 
-void BRepPrimAPI_MakeBox::Build()
+void BRepPrimAPI_MakeBox::Build(const Message_ProgressRange& /*theRange*/)
 {
   Solid();
 }
index dd58918ab45650a4f3f8a95d0d04fe544e08e9fc..26c2680cd7fdea540b8749e9977b4bedd35f9c2c 100644 (file)
@@ -98,7 +98,7 @@ public:
   Standard_EXPORT BRepPrim_Wedge& Wedge();
   
   //! Stores the solid in myShape.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the constructed box as a shell.
   Standard_EXPORT const TopoDS_Shell& Shell();
index 218a0b9e51fa12cd57cd48a6f8223158d63651b1..dc9d9fefe4d21cab70f2c731a70f535539847cd1 100644 (file)
@@ -51,7 +51,7 @@ const TopoDS_Shell&  BRepPrimAPI_MakeOneAxis::Shell()
 //purpose  : 
 //=======================================================================
 
-void BRepPrimAPI_MakeOneAxis::Build()
+void BRepPrimAPI_MakeOneAxis::Build(const Message_ProgressRange& /*theRange*/)
 {
   BRep_Builder B;
   B.MakeSolid(TopoDS::Solid(myShape));
index 0bf2bd6c27a9098e1b2af8f1c90ad1a939140ffb..647300dde427ee2758014b83d455d98072fbdd22 100644 (file)
@@ -43,7 +43,7 @@ public:
   Standard_EXPORT virtual Standard_Address OneAxis() = 0;
   
   //! Stores the solid in myShape.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the lateral face of the rotational primitive.
   Standard_EXPORT const TopoDS_Face& Face();
index 18d9803257b5751efd9a73e559e2cd17367ec255..40809742c22deebdad6160dfad6348b897c9eac4 100644 (file)
@@ -78,7 +78,7 @@ const BRepSweep_Prism&  BRepPrimAPI_MakePrism::Prism()const
 //purpose  : 
 //=======================================================================
 
-void  BRepPrimAPI_MakePrism::Build()
+void  BRepPrimAPI_MakePrism::Build(const Message_ProgressRange& /*theRange*/)
 {
   myShape = myPrism.Shape();
   Done();
index c33de96aac5d555e06b5c4e2828c47c07bbdcfa7..d069851b3fa66c58fdccf70a99b94b7f88bdaeed 100644 (file)
@@ -72,7 +72,7 @@ public:
   Standard_EXPORT const BRepSweep_Prism& Prism() const;
   
   //! Builds the resulting shape (redefined from MakeShape).
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the  TopoDS  Shape of the bottom of the prism.
   Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE;
index ec5a69a96e6da074adb1c874245591bea1ac5de3..b8e61e9b06ff9082981bf81b5eea70cc2910c64f 100644 (file)
@@ -109,7 +109,7 @@ const BRepSweep_Revol&  BRepPrimAPI_MakeRevol::Revol() const
 //purpose  : 
 //=======================================================================
 
-void  BRepPrimAPI_MakeRevol::Build()
+void  BRepPrimAPI_MakeRevol::Build(const Message_ProgressRange& /*theRange*/)
 {
   if (myIsBuild)
   {
index a24adbad2b149a34e3ac679f142f56f4f3b2cf9e..1132df39ca8a8f66c4077a07ba0781ea449a4bee 100644 (file)
@@ -81,7 +81,7 @@ public:
   Standard_EXPORT const BRepSweep_Revol& Revol() const;
   
   //! Builds the resulting shape (redefined from MakeShape).
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the first shape of the revol  (coinciding with
   //! the generating shape).
index 0491f4f9e152935d9edcc3defdc6e2f4955153f4..d98e4d25d8dc6eb8a169d0e15e93f94c62c8f764 100644 (file)
@@ -119,7 +119,7 @@ const TopoDS_Shell&  BRepPrimAPI_MakeWedge::Shell()
 //purpose  : 
 //=======================================================================
 
-void BRepPrimAPI_MakeWedge::Build()
+void BRepPrimAPI_MakeWedge::Build(const Message_ProgressRange& /*theRange*/)
 {
   BRep_Builder B;
   B.MakeSolid(TopoDS::Solid(myShape));
index c65b051c652fcfc07d48c537946307d5d8abfe41..5ade9348bb0885e49455bdd37ca03286078c4644 100644 (file)
@@ -60,7 +60,7 @@ public:
   Standard_EXPORT BRepPrim_Wedge& Wedge();
   
   //! Stores the solid in myShape.
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Returns the constructed box in the form of a shell.
   Standard_EXPORT const TopoDS_Shell& Shell();
index a9af23106d2142a77689dc2c9221b6d9184601c9..18d39c18008c1726430fce3ee993b19b030cdda3 100644 (file)
@@ -52,6 +52,7 @@
 #include <TopAbs.hxx>
 #include <DrawTrSurf.hxx>
 #include <Message.hxx>
+#include <Draw_ProgressIndicator.hxx>
 
 #include <stdio.h>
 
@@ -357,23 +358,24 @@ Standard_Integer boptopoblend(Draw_Interpretor& di, Standard_Integer narg, const
   }
 
   BOPAlgo_PaveFiller theDSFiller;
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+  Message_ProgressScope aPS(aProgress->Start(), NULL, 10);
   TopTools_ListOfShape aLS;
   aLS.Append(S1); 
   aLS.Append(S2); 
   theDSFiller.SetArguments(aLS);
   //
-  theDSFiller.Perform();
+  theDSFiller.Perform(aPS.Next(8));
   if (theDSFiller.HasErrors()) {
     Message::SendFail() << "Check types of the arguments, please";
     return 1;
   }
 
   BRepAlgoAPI_BooleanOperation* pBuilder=NULL;
-
   if (fuse)
-    pBuilder = new BRepAlgoAPI_Fuse( S1, S2, theDSFiller );
+    pBuilder = new BRepAlgoAPI_Fuse( S1, S2, theDSFiller, aPS.Next(2) );
   else
-    pBuilder = new BRepAlgoAPI_Cut ( S1, S2, theDSFiller );
+    pBuilder = new BRepAlgoAPI_Cut ( S1, S2, theDSFiller, Standard_True, aPS.Next(2));
 
   Standard_Boolean anIsDone = pBuilder->IsDone();
   if (!anIsDone)
index 6b4047c99837b7fab06afc6f79ec26c023faf116..2279c91d3ea027b55f45674714024277d7b6b053 100644 (file)
@@ -357,8 +357,10 @@ static Standard_Boolean isTreatAnalityc(const BRepAdaptor_Surface& theBAS1,
 //purpose  : intersect surfaces of the faces
 //=======================================================================
 void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
-                                const TopoDS_Face& aF2)
+                                const TopoDS_Face& aF2,
+                                const Message_ProgressRange& theRange)
 {
+  Message_ProgressScope aPS(theRange, NULL, 1);
   if (myContext.IsNull()) {
     myContext=new IntTools_Context;
   }
index 9a74f94b3987cd540761b2895e905ef7e19475de..a0103b2ba81dcbd52327f7308ff46380d38d344d 100644 (file)
@@ -22,6 +22,7 @@
 #include <IntSurf_ListOfPntOn2S.hxx>
 #include <IntTools_SequenceOfCurves.hxx>
 #include <IntTools_SequenceOfPntOn2Faces.hxx>
+#include <Message_ProgressRange.hxx>
 #include <TopoDS_Face.hxx>
 
 class IntTools_Context;
@@ -48,7 +49,7 @@ public:
   //! Intersects underliing surfaces of F1 and F2
   //! Use sum of tolerance of F1 and F2 as intersection
   //! criteria
-  Standard_EXPORT void Perform (const TopoDS_Face& F1, const TopoDS_Face& F2);
+  Standard_EXPORT void Perform (const TopoDS_Face& F1, const TopoDS_Face& F2, const Message_ProgressRange& theRange = Message_ProgressRange());
   
 
   //! Returns True if the intersection was successful
index fc4bf61dbdeb459efda28e7b25388c8c21e6a94a..66fd7791a77462792d52759304b9a0ddf7119ddc 100644 (file)
@@ -142,7 +142,7 @@ ShapeConstruct_MakeTriangulation::ShapeConstruct_MakeTriangulation (const TopoDS
 //purpose  : 
 //=======================================================================
 
- void ShapeConstruct_MakeTriangulation::Build()
+ void ShapeConstruct_MakeTriangulation::Build(const Message_ProgressRange& /*theRange*/)
 {
   if (myShape.IsNull()) {
     // Triangulate polygonal wire
index db04bbc859f84c2e7acdace9aa6b2f0ab5d9a2e2..10ed234cc70e6269c9a47f18b164b87d8ac43fc1 100644 (file)
@@ -41,7 +41,7 @@ public:
   
   Standard_EXPORT ShapeConstruct_MakeTriangulation(const TopoDS_Wire& wire, const Standard_Real prec = 0.0);
   
-  Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+  Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;