]> OCCT Git - occt-copy.git/commitdiff
Process indication added in the following classes: BOPAlgo_BuilderFace and BOPAlgo_Bu... CR21264_BS_BF
authorZhuravlev Kirill <kirill.zhuravlev.ext@opencascade.com>
Wed, 26 May 2021 14:32:32 +0000 (17:32 +0300)
committerZhuravlev Kirill <kirill.zhuravlev.ext@opencascade.com>
Wed, 26 May 2021 14:34:32 +0000 (17:34 +0300)
bbop of Draw modified: indicator displayed
Indication in PerformanceAreas() may be incorrect due to the lack of tests

14 files changed:
src/BOPAlgo/BOPAlgo_Builder.hxx
src/BOPAlgo/BOPAlgo_BuilderArea.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_2.cxx
src/BOPAlgo/BOPAlgo_Builder_3.cxx
src/BOPAlgo/BOPAlgo_CellsBuilder.cxx
src/BOPAlgo/BOPAlgo_ShellSplitter.cxx
src/BOPAlgo/BOPAlgo_ShellSplitter.hxx
src/BOPAlgo/BOPAlgo_WireSplitter.cxx
src/BOPAlgo/BOPAlgo_WireSplitter.hxx
src/BOPTest/BOPTest_PartitionCommands.cxx

index d20ca1beb3b2d4c4054c6830238e26d263844417..5f71f7b90bae5d16efb15cbb800828368bf421ca 100644 (file)
@@ -397,7 +397,7 @@ protected: //! @name Fill Images of FACES
 
   //! Builds the splits of faces using the information from the
   //! intersection stage stored in Data Structure.
-  Standard_EXPORT virtual void BuildSplitFaces();
+  Standard_EXPORT virtual void BuildSplitFaces(const Message_ProgressRange& theRange = Message_ProgressRange());
 
   //! Looks for the same domain faces among the splits of the faces.
   //! Updates the map of images with SD faces.
@@ -429,7 +429,7 @@ protected: //! @name Fill Images of SOLIDS
 
   //! Builds the splits of the solids using their draft versions
   //! and faces located inside.
-  Standard_EXPORT void BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSolids);
+  Standard_EXPORT void BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSolids, const Message_ProgressRange& theRange = Message_ProgressRange());
 
   //! Classifies the vertices and edges from the arguments relatively
   //! splits of solids and makes them INTERNAL for solids.
@@ -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(const Message_ProgressRange& theRange);
+  Standard_EXPORT void FillImagesCompounds(const Message_ProgressRange& theRange = Message_ProgressRange());
 
   //! Builds the image of the given compound.
   Standard_EXPORT void FillImagesCompound (const TopoDS_Shape& theS,
index ae818a50a88580409f39e280e3c0f188d624c0b5..fbb28e07119dc5da2b6e61909d9748b170b39566 100644 (file)
@@ -80,13 +80,13 @@ protected:
   
   Standard_EXPORT BOPAlgo_BuilderArea(const Handle(NCollection_BaseAllocator)& theAllocator);
   
-  virtual void PerformShapesToAvoid() = 0;
+  virtual void PerformShapesToAvoid(const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
   
-  virtual void PerformLoops() = 0;
+  virtual void PerformLoops(const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
   
-  virtual void PerformAreas() = 0;
+  virtual void PerformAreas(const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
   
-  virtual void PerformInternalShapes() = 0;
+  virtual void PerformInternalShapes(const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
 
 
   Handle(IntTools_Context) myContext;
index f4ddc32c8defdb0f0b601e6a2d598c578f6b5abf..a16c280d2f95dcdb181630161ff77ac7f07a4442 100644 (file)
@@ -143,50 +143,34 @@ void BOPAlgo_BuilderFace::CheckData()
 //=======================================================================
 void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& theRange)
 {
+
+  Message_ProgressScope aPS(theRange, "Perform", 100);
+
   GetReport()->Clear();
   //
   CheckData();
-  if (HasErrors()) {
-    return;
-  }
-  //
-  if (!theRange.More())
-  {
-    return;
-  }
-  //
-  PerformShapesToAvoid();
-  if (HasErrors()) {
-    return;
-  }
-  //
-  if (!theRange.More())
-  {
+  if (HasErrors() || !theRange.More()) {
     return;
   }
   //
-  PerformLoops();
-  if (HasErrors()) {
+    PerformShapesToAvoid(aPS.Next(1));         //1%
+  if (HasErrors() || !theRange.More()) {
     return;
   }
   //
-  if (!theRange.More())
-  {
-    return;
-  }
   //
-  PerformAreas();
-  if (HasErrors()) {
+  PerformLoops(aPS.Next(9));                           //9%
+  if (HasErrors() || !theRange.More()) {
     return;
   }
   //
-  if (!theRange.More())
-  {
+  PerformAreas(aPS.Next(80));                          //80%
+  if (HasErrors() || !theRange.More()) {
     return;
   }
   //
-  PerformInternalShapes();
-  if (HasErrors()) {
+  PerformInternalShapes(aPS.Next(9));          //9%
+  if (HasErrors() || !theRange.More()) {
     return;
   }
 }
@@ -194,7 +178,7 @@ void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& theRange)
 //function :PerformShapesToAvoid
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderFace::PerformShapesToAvoid()
+void BOPAlgo_BuilderFace::PerformShapesToAvoid(const Message_ProgressRange& theRange)
 {
   Standard_Boolean bFound;
   Standard_Integer i, iCnt, aNbV, aNbE;
@@ -203,6 +187,8 @@ void BOPAlgo_BuilderFace::PerformShapesToAvoid()
   //
   myShapesToAvoid.Clear();
   //
+  Message_ProgressScope theScope(theRange, "Perform Shapes to Avoid", 1);
+  //
   iCnt=0;
   for(;;) {
     ++iCnt;
@@ -267,7 +253,7 @@ void BOPAlgo_BuilderFace::PerformShapesToAvoid()
 //function : PerformLoops
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderFace::PerformLoops()
+void BOPAlgo_BuilderFace::PerformLoops(const Message_ProgressRange& theRange)
 {
   Standard_Boolean bFlag;
   Standard_Integer i, aNbEA;
@@ -279,12 +265,17 @@ void BOPAlgo_BuilderFace::PerformLoops()
   BOPAlgo_WireEdgeSet aWES(myAllocator);
   BOPAlgo_WireSplitter aWSp(myAllocator);
   //
+  Message_ProgressScope MainScope(theRange, "PerformLoops", 100);
+  //
   // 1. 
   myLoops.Clear();
   aWES.SetFace(myFace);
   //
   aIt.Initialize(myShapes);
-  for (; aIt.More(); aIt.Next()) {
+  Message_ProgressScope aPS(MainScope.Next(4), "Shells Usual", myShapes.Size());
+  for (; aIt.More(); aIt.Next(), aPS.Next()) {
+       if (!aPS.More())
+         return;
     const TopoDS_Shape& aE=aIt.Value();
     if (!myShapesToAvoid.Contains(aE)) {
       aWES.AddStartElement(aE);
@@ -294,7 +285,7 @@ void BOPAlgo_BuilderFace::PerformLoops()
   aWSp.SetWES(aWES);
   aWSp.SetRunParallel(myRunParallel);
   aWSp.SetContext(myContext);
-  aWSp.Perform();
+  aWSp.Perform(MainScope.Next(90));
   if (aWSp.HasErrors()) {
     return;
   }
@@ -310,7 +301,10 @@ void BOPAlgo_BuilderFace::PerformLoops()
   // 
   // a. collect all edges that are in loops
   aIt.Initialize (myLoops);
-  for (; aIt.More(); aIt.Next()) {
+  Message_ProgressScope aPT_PS(MainScope.Next(), "Post Treatment: collect all edges", myLoops.Size());
+  for (; aIt.More(); aIt.Next(), aPT_PS.Next()) {
+       if (!aPT_PS.More())
+         return;
     const TopoDS_Shape& aW=aIt.Value();
     aItW.Initialize(aW);
     for (; aItW.More(); aItW.Next()) {
@@ -328,7 +322,8 @@ void BOPAlgo_BuilderFace::PerformLoops()
   //
   // c. add all edges that are not processed to myShapesToAvoid
   aIt.Initialize (myShapes);
-  for (; aIt.More(); aIt.Next()) {
+  Message_ProgressScope aPT_PS1(MainScope.Next(), "Post Treatment: adding edges", myShapes.Size());
+  for (; aIt.More(); aIt.Next(), aPT_PS1.Next()) {
     const TopoDS_Shape& aE=aIt.Value();
     if (!aMEP.Contains(aE)) {
       myShapesToAvoid.Add(aE);
@@ -387,7 +382,7 @@ void BOPAlgo_BuilderFace::PerformLoops()
 //function : PerformAreas
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderFace::PerformAreas()
+void BOPAlgo_BuilderFace::PerformAreas(const Message_ProgressRange& theRange)
 {
   myAreas.Clear();
   BRep_Builder aBB;
@@ -398,6 +393,8 @@ void BOPAlgo_BuilderFace::PerformAreas()
   // Get tolerance of myFace
   Standard_Real aTol = BRep_Tool::Tolerance(myFace);
 
+  Message_ProgressScope theMainPS(theRange, "PerformAreas", 10);
+
   // Check if there are no loops at all
   if (myLoops.IsEmpty())
   {
@@ -423,7 +420,8 @@ void BOPAlgo_BuilderFace::PerformAreas()
 
   // Analyze the new wires - classify them to be the holes and growths
   TopTools_ListIteratorOfListOfShape aItLL(myLoops);
-  for (; aItLL.More(); aItLL.Next())
+  Message_ProgressScope aPS(theMainPS.Next(4), "Analyze the shells", myLoops.Size());
+  for (; aItLL.More(); aItLL.Next(), aPS.Next())
   {
     const TopoDS_Shape& aWire = aItLL.Value();
 
@@ -464,7 +462,8 @@ void BOPAlgo_BuilderFace::PerformAreas()
   BOPTools_Box2dTree aBoxTree;
   Standard_Integer i, aNbH = aHoleFaces.Extent();
   aBoxTree.SetSize (aNbH);
-  for (i = 1; i <= aNbH; ++i)
+  Message_ProgressScope aTPPS(theMainPS.Next(), "Prepare tree with the boxes of the hole faces", aNbH);
+  for (i = 1; i <= aNbH; ++i, aTPPS.Next())
   {
     const TopoDS_Face& aHFace = TopoDS::Face(aHoleFaces(i));
     //
@@ -484,7 +483,8 @@ void BOPAlgo_BuilderFace::PerformAreas()
   aSelector.SetBVHSet (&aBoxTree);
 
   TopTools_ListIteratorOfListOfShape aItLS(aNewFaces);
-  for (; aItLS.More(); aItLS.Next())
+  Message_ProgressScope aPS1(theMainPS.Next(), "Selector", aNewFaces.Size());
+  for (; aItLS.More(); aItLS.Next(), aPS1.Next())
   {
     const TopoDS_Face& aFace = TopoDS::Face(aItLS.Value());
 
@@ -526,7 +526,8 @@ void BOPAlgo_BuilderFace::PerformAreas()
   TopTools_IndexedDataMapOfShapeListOfShape aFaceHolesMap;
 
   aNbH = aHoleFaceMap.Extent();
-  for (i = 1; i <= aNbH; ++i)
+  Message_ProgressScope aPS2(theMainPS.Next(), "Make the back map from faces to holes", aNbH);
+  for (i = 1; i <= aNbH; ++i, aPS2.Next())
   {
     const TopoDS_Shape& aHole = aHoleFaceMap.FindKey(i);
     const TopoDS_Shape& aFace = aHoleFaceMap(i);
@@ -563,6 +564,7 @@ void BOPAlgo_BuilderFace::PerformAreas()
 
   // Add Holes to Faces and add them to myAreas
   aItLS.Initialize(aNewFaces);
+  Message_ProgressScope aPS4(theMainPS.Next(), "Adding Holes to Faces", aNewFaces.Size());
   for ( ; aItLS.More(); aItLS.Next())
   {
     TopoDS_Face& aFace = *(TopoDS_Face*)&aItLS.Value();
@@ -591,7 +593,7 @@ void BOPAlgo_BuilderFace::PerformAreas()
 //function : PerformInternalShapes
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderFace::PerformInternalShapes()
+void BOPAlgo_BuilderFace::PerformInternalShapes(const Message_ProgressRange& theRange)
 {
   if (myAvoidInternalShapes)
     // User-defined option to avoid internal edges
@@ -607,10 +609,14 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
 
   // Map of edges to classify
   TopTools_IndexedMapOfShape anEdgesMap;
+  
+  //Make main progress scope
+  Message_ProgressScope aPS(theRange, "PerformInternalShapes", 3);
 
   // Fill the tree and the map
   TopTools_ListIteratorOfListOfShape itLE(myLoopsInternal);
-  for (; itLE.More(); itLE.Next())
+  Message_ProgressScope aFTPS(aPS.Next(), "Filling the tree and the map", myLoopsInternal.Size());
+  for (; itLE.More(); itLE.Next(), aFTPS.Next())
   {
     TopoDS_Iterator itE(itLE.Value());
     for (; itE.More(); itE.Next())
@@ -635,7 +641,8 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
 
   // Classify edges relatively faces
   TopTools_ListIteratorOfListOfShape itLF(myAreas);
-  for (; itLF.More(); itLF.Next())
+  Message_ProgressScope aCEPS(aPS.Next(), "Classify edges", myAreas.Size());
+  for (; itLF.More(); itLF.Next(), aCEPS.Next())
   {
     TopoDS_Face& aF = *(TopoDS_Face*)&itLF.Value();
 
@@ -700,7 +707,7 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
 
   // Make internal wires
   TopTools_ListOfShape aLSI;
-  MakeInternalWires(anEdgesUnUsed, aLSI);
+  MakeInternalWires(anEdgesUnUsed, aLSI/*, aPS.Next()*/);
 
   // Make compound
   TopoDS_Compound aWShape;
@@ -717,6 +724,8 @@ void BOPAlgo_BuilderFace::PerformInternalShapes()
     BRep_Builder().Add(aWShape, aCE);
   }
 
+  aPS.Next();
+
   // Add warning
   AddWarning(new BOPAlgo_AlertFaceBuilderUnusedEdges(aWShape));
 }
index 2bc29661517802c760115d2b70a868e1d24fd16b..e888d1553ac8b2f4ab063253e14b589ae6ab8330 100644 (file)
@@ -63,20 +63,20 @@ protected:
   //! Collect the edges that
   //! a) are internal
   //! b) are the same and have different orientation
-  Standard_EXPORT virtual void PerformShapesToAvoid() Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformShapesToAvoid(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Build draft wires
   //! a)myLoops - draft wires that consist of
   //! boundary edges
   //! b)myLoopsInternal - draft wires that contains
   //! inner edges
-  Standard_EXPORT virtual void PerformLoops() Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformLoops(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Build draft faces that contains boundary edges
-  Standard_EXPORT virtual void PerformAreas() Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformAreas(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   //! Build finalized faces with internals
-  Standard_EXPORT virtual void PerformInternalShapes() Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformInternalShapes(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
   
   Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
 
index f85bd2e053096ad0d5fcf8b00e0075c7994ae32d..5a5e3d5e3d23b027212158e5d51a45869dacd5e8 100644 (file)
 #include <NCollection_DataMap.hxx>
 #include <NCollection_List.hxx>
 #include <NCollection_Vector.hxx>
-
-#include <Message_ProgressIndicator.hxx>
-#include <Message_ProgressScope.hxx>
-
 #include <TColStd_MapIntegerHasher.hxx>
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
@@ -64,9 +60,6 @@
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_MapOfOrientedShape.hxx>
 #include <TopTools_MapOfShape.hxx>
-//-----------------------------------------------------------
-#include <OSD_Timer.hxx>
-//-----------------------------------------------------------
 
 //
 static
@@ -115,103 +108,51 @@ BOPAlgo_BuilderSolid::~BOPAlgo_BuilderSolid()
 //=======================================================================
 void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange)
 {
-       //Message_ProgressRange aRootRange=theRange->Start();
-  Message_ProgressScope aPS(theRange, "Perform Builder Solid", 100);
-  //Timer construction
-  //---------------------------------------------------------------------
-  OSD_Timer DurationTimer;
-  //---------------------------------------------------------------------
-
-  DurationTimer.Start();
+  Message_ProgressScope theScope(theRange, "Perform", 100);  
 
   GetReport()->Clear();
   //
   if (myShapes.IsEmpty())
     return;
-
   if (myContext.IsNull()) {
     myContext=new IntTools_Context;
   }
-
   myBoxes.Clear();
-
-  DurationTimer.Stop();
-  std::cout << "Prelim. duration: " << DurationTimer.ElapsedTime() << std::endl;
-  aPS.Next(1);
-  
-
+  //
   TopoDS_Compound aC;
   BRep_Builder aBB;
   TopTools_ListIteratorOfListOfShape aIt;
   //
-  DurationTimer.Restart();
-  aBB.MakeCompound(aC);
-  DurationTimer.Stop();
-  std::cout << "MakeCompound duration: " << DurationTimer.ElapsedTime() << std::endl;
-  aPS.Next(1);
-  DurationTimer.Restart();
+  aBB.MakeCompound(aC);  
   aIt.Initialize(myShapes);
-  DurationTimer.Stop();
-  std::cout << "Initialize duration: " << DurationTimer.ElapsedTime() << std::endl;
-  aPS.Next(1);
-  DurationTimer.Restart();
+  
   for(; aIt.More(); aIt.Next()) {
     const TopoDS_Shape& aF=aIt.Value();
     aBB.Add(aC, aF);
   }
-  DurationTimer.Stop();
-  std::cout << "ItLoop duration: " << DurationTimer.ElapsedTime() << std::endl;
-  //
   if (!theRange.More())
   {
     return;
   }
   //
-  DurationTimer.Restart();
-  PerformShapesToAvoid();
-  DurationTimer.Stop();
-  std::cout << "PerformShapesToAvoid duration: " << DurationTimer.ElapsedTime() << std::endl;
-  if (HasErrors()) {
-    return;
-  }
-  //
-  if (!theRange.More())
-  {
+  PerformShapesToAvoid(theScope.Next(1));      //1%
+  if (HasErrors() || !theRange.More()) {
     return;
   }
-  //
-  DurationTimer.Restart();
-  PerformLoops();
-  DurationTimer.Stop();
-  std::cout << "PerformLoops duration: " << DurationTimer.ElapsedTime() << std::endl;
-  aPS.Next(97);
-  if (HasErrors()) {
-    return;
-  }
-  //
-  if (!theRange.More())
-  {
-    return;
-  }
-  //
-  DurationTimer.Restart();
-  PerformAreas();
-  DurationTimer.Stop();
-  std::cout << "PerformAreas duration: " << DurationTimer.ElapsedTime() << std::endl;
-  if (HasErrors()) {
+  // 
+  PerformLoops(theScope.Next(9));                      //9%
+  
+  if (HasErrors() || !theRange.More()) {
     return;
   }
-  //
-  if (!theRange.More())
-  {
+  //  
+  PerformAreas(theScope.Next(80));                     //80%  
+  if (HasErrors() || !theRange.More()) {
     return;
   }
   //
-  DurationTimer.Restart();
-  PerformInternalShapes();
-  DurationTimer.Stop();
-  std::cout << "PerformInternalShapes duration: " << DurationTimer.ElapsedTime() << std::endl;
-  if (HasErrors()) {
+  PerformInternalShapes(theScope.Next(9));     //10% 
+  if (HasErrors() || !theRange.More()) {
     return;
   }
 }
@@ -219,7 +160,7 @@ void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange)
 //function :PerformShapesToAvoid
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderSolid::PerformShapesToAvoid()
+void BOPAlgo_BuilderSolid::PerformShapesToAvoid(const Message_ProgressRange& theRange)
 {
   Standard_Boolean bFound;
   Standard_Integer i, iCnt, aNbE, aNbF;
@@ -229,6 +170,8 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid()
   //
   myShapesToAvoid.Clear();
   //
+  Message_ProgressScope theScope(theRange, "Perform Shapes to Avoid", 1);
+  //
   iCnt=0;
   for(;;) {
     ++iCnt;
@@ -299,7 +242,7 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid()
 //function : PerformLoops
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderSolid::PerformLoops()
+void BOPAlgo_BuilderSolid::PerformLoops(const Message_ProgressRange& theRange)
 {
   Standard_Integer i, aNbSh;
   TopTools_ListIteratorOfListOfShape aIt;
@@ -307,17 +250,24 @@ void BOPAlgo_BuilderSolid::PerformLoops()
   Handle(NCollection_BaseAllocator) aAlr;
   // 
   myLoops.Clear();
+  //  
   //
   aAlr=
     NCollection_BaseAllocator::CommonBaseAllocator();
   BOPAlgo_ShellSplitter aSSp(aAlr);
   //
-  // 1. Shells Usual
+  //
+  Message_ProgressScope MainScope(theRange, "PerformLoops", 100); 
+
+  // 1. Shells Usual 
   aIt.Initialize (myShapes);
-  for (; aIt.More(); aIt.Next()) {
+  Message_ProgressScope aPS(MainScope.Next(4), "Shells Usual", myShapes.Size());
+  for (; aIt.More(); aIt.Next(), aPS.Next()) {
+       if (!aPS.More())                
+               return;
     const TopoDS_Face& aF=*((TopoDS_Face*)&aIt.Value());
     if (myContext->IsInfiniteFace(aF)) {
-      TopoDS_Shell aSh;
+             TopoDS_Shell aSh;
       BRep_Builder aBB;
       //
       aBB.MakeShell(aSh);
@@ -330,11 +280,14 @@ void BOPAlgo_BuilderSolid::PerformLoops()
       aSSp.AddStartElement(aF);
     }
   }
-  //
   aSSp.SetRunParallel(myRunParallel);
-  aSSp.Perform();
+  aSSp.Perform(MainScope.Next(90));
+  if (!MainScope.More())               
+         return;
+
   if (aSSp.HasErrors()) {
-    // add warning status
+    // add warning status      
     {
       TopoDS_Compound aFacesSp;
       BRep_Builder().MakeCompound(aFacesSp);
@@ -346,24 +299,26 @@ void BOPAlgo_BuilderSolid::PerformLoops()
     }
     return;
   }
-  //
+
   const TopTools_ListOfShape& aLSh=aSSp.Shells();
   aIt.Initialize (aLSh);
   for (; aIt.More(); aIt.Next()) {
     const TopoDS_Shape& aSh=aIt.Value();
     myLoops.Append(aSh);
   }
-  //=================================================
   //
   // 2. Post Treatment
   BRep_Builder aBB;
   TopTools_MapOfOrientedShape AddedFacesMap;
   TopTools_IndexedDataMapOfShapeListOfShape aEFMap;
   TopTools_MapOfOrientedShape aMP;
-  //
+
   // a. collect all edges that are in loops
   aIt.Initialize (myLoops);
-  for (; aIt.More(); aIt.Next()) {
+  Message_ProgressScope aPT_PS(MainScope.Next(), "Post Treatment: collect all edges", myLoops.Size());
+  for (; aIt.More(); aIt.Next(), aPT_PS.Next()) {
+       if (!aPT_PS.More())             
+               return;
     const TopoDS_Shape& aS=aIt.Value();
     aItS.Initialize(aS);
     for (; aItS.More(); aItS.Next()) {
@@ -379,17 +334,17 @@ void BOPAlgo_BuilderSolid::PerformLoops()
     aMP.Add(aF);
   }
   //
-  // c. add all edges that are not processed to myShapesToAvoid
+  // c. add all edges that are not processed to myShapesToAvoid  
   aIt.Initialize (myShapes);
-  for (; aIt.More(); aIt.Next()) {
+  Message_ProgressScope aPT_PS1(MainScope.Next(), "Post Treatment: adding edges", myShapes.Size());
+  for (; aIt.More(); aIt.Next(), aPT_PS1.Next()) {
     const TopoDS_Face& aF=*((TopoDS_Face*)&aIt.Value());
     if (!myContext->IsInfiniteFace(aF)) {
       if (!aMP.Contains(aF)) {
         myShapesToAvoid.Add(aF);
       }
     }
-  }
-  //=================================================
+  }  
   //
   // 3.Internal Shells
   myLoopsInternal.Clear();
@@ -398,13 +353,14 @@ void BOPAlgo_BuilderSolid::PerformLoops()
   AddedFacesMap.Clear();
   //
   aNbSh = myShapesToAvoid.Extent();
+
   for (i = 1; i <= aNbSh; ++i) {
     const TopoDS_Shape& aFF = myShapesToAvoid(i);
     TopExp::MapShapesAndAncestors(aFF, 
         TopAbs_EDGE, TopAbs_FACE, 
         aEFMap);
   }
-  //
+  //  
   for (i = 1; i <= aNbSh; ++i) {
     const TopoDS_Shape& aFF = myShapesToAvoid(i);
     if (!AddedFacesMap.Add(aFF)) {
@@ -442,8 +398,9 @@ void BOPAlgo_BuilderSolid::PerformLoops()
 //function : PerformAreas
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderSolid::PerformAreas()
+void BOPAlgo_BuilderSolid:: PerformAreas(const Message_ProgressRange& theRange)
 {
+       
   myAreas.Clear();
   BRep_Builder aBB;
   // The new solids
@@ -454,12 +411,17 @@ void BOPAlgo_BuilderSolid::PerformAreas()
   // If the analyzed shell contains any of the hole faces, it is considered as growth.
   TopTools_IndexedMapOfShape aMHF;
 
+  Message_ProgressScope theMainPS(theRange, "PerformAreas", 10);
+  
   // Analyze the shells
   TopTools_ListIteratorOfListOfShape aItLL(myLoops);
-  for (; aItLL.More(); aItLL.Next())
+  Message_ProgressScope aPS(theMainPS.Next(4), "Analyze the shells", myLoops.Size());
+  for (; aItLL.More(); aItLL.Next(), aPS.Next())
   {
-    const TopoDS_Shape& aShell = aItLL.Value();
+       if (!aPS.More())                
+               return;
 
+    const TopoDS_Shape& aShell = aItLL.Value();
     Standard_Boolean bIsGrowth = IsGrowthShell(aShell, aMHF);
     if (!bIsGrowth)
     {
@@ -481,12 +443,13 @@ void BOPAlgo_BuilderSolid::PerformAreas()
       TopExp::MapShapes(aShell, TopAbs_FACE, aMHF);
     }
   }
-
+  
   if (aHoleShells.IsEmpty())
   {
     // No holes, stop the analysis
     TopTools_ListIteratorOfListOfShape aItLS(aNewSolids);
-    for (; aItLS.More(); aItLS.Next())
+       Message_ProgressScope aSHPS(theMainPS.Next(), "SearchHoles", aNewSolids.Size());
+    for (; aItLS.More(); aItLS.Next(), aSHPS.Next())
     {
       const TopoDS_Shape& aSol = aItLS.Value();
       myAreas.Append(aSol);
@@ -497,14 +460,13 @@ void BOPAlgo_BuilderSolid::PerformAreas()
     }
     return;
   }
-
   // Classify holes relatively solids
-
   // Prepare tree with the boxes of the hole shells
   BOPTools_BoxTree aBBTree;
   Standard_Integer i, aNbH = aHoleShells.Extent();
+  Message_ProgressScope aPS1(theMainPS.Next(), "Prepare tree with the boxes of the hole shells", aNbH);
   aBBTree.SetSize (aNbH);
-  for (i = 1; i <= aNbH; ++i)
+  for (i = 1; i <= aNbH; ++i, aPS.Next())
   {
     const TopoDS_Shape& aHShell = aHoleShells(i);
     //
@@ -520,8 +482,9 @@ void BOPAlgo_BuilderSolid::PerformAreas()
 
   // Find outer growth shell that is most close to each hole shell
   TopTools_IndexedDataMapOfShapeShape aHoleSolidMap;
-
   TopTools_ListIteratorOfListOfShape aItLS(aNewSolids);
+  Message_ProgressScope aPS2(theMainPS.Next(), "Find outer growth shell that is most close to each hole shell", aNewSolids.Size());
+  //50% 
   for (; aItLS.More(); aItLS.Next())
   {
     const TopoDS_Shape& aSolid = aItLS.Value();
@@ -539,7 +502,8 @@ void BOPAlgo_BuilderSolid::PerformAreas()
 
     const TColStd_ListOfInteger& aLI = aSelector.Indices();
     TColStd_ListIteratorOfListOfInteger aItLI(aLI);
-    for (; aItLI.More(); aItLI.Next())
+       Message_ProgressScope aPS21(aPS2.Next(), "Iteration", aLI.Size());
+    for (; aItLI.More(); aItLI.Next(), aPS21.Next())
     {
       Standard_Integer k = aItLI.Value();
       const TopoDS_Shape& aHole = aHoleShells(k);
@@ -562,12 +526,12 @@ void BOPAlgo_BuilderSolid::PerformAreas()
       }
     }
   }
-
+  
   // Make the back map from solids to holes
   TopTools_IndexedDataMapOfShapeListOfShape aSolidHolesMap;
-
   aNbH = aHoleSolidMap.Extent();
-  for (i = 1; i <= aNbH; ++i)
+  Message_ProgressScope aPS3(theMainPS.Next(), "Make the back map from solids to holes", aNbH);
+  for (i = 1; i <= aNbH; ++i, aPS3.Next())
   {
     const TopoDS_Shape& aHole = aHoleSolidMap.FindKey(i);
     const TopoDS_Shape& aSolid = aHoleSolidMap(i);
@@ -580,7 +544,8 @@ void BOPAlgo_BuilderSolid::PerformAreas()
 
   // Add Holes to Solids and add them to myAreas
   aItLS.Initialize(aNewSolids);
-  for ( ; aItLS.More(); aItLS.Next())
+  Message_ProgressScope aPS4(theMainPS.Next(), "Adding Holes to Solids", aNewSolids.Size());
+  for ( ; aItLS.More(); aItLS.Next(), aPS4.Next())
   {
     TopoDS_Solid& aSolid = *(TopoDS_Solid*)&aItLS.Value();
     const TopTools_ListOfShape* pLHoles = aSolidHolesMap.Seek(aSolid);
@@ -603,7 +568,8 @@ void BOPAlgo_BuilderSolid::PerformAreas()
 
   // Add holes that outside the solids to myAreas
   aNbH = aHoleShells.Extent();
-  for (i = 1; i <= aNbH; ++i)
+  Message_ProgressScope aPS5(theMainPS.Next(), "Add holes that outside the solids to myAreas", aNbH);
+  for (i = 1; i <= aNbH; ++i, aPS5.Next())
   {
     const TopoDS_Shape& aHole = aHoleShells(i);
     if (!aHoleSolidMap.Contains(aHole))
@@ -626,20 +592,22 @@ void BOPAlgo_BuilderSolid::PerformAreas()
 //function : PerformInternalShapes
 //purpose  : 
 //=======================================================================
-void BOPAlgo_BuilderSolid::PerformInternalShapes()
-{
+void BOPAlgo_BuilderSolid::PerformInternalShapes(const Message_ProgressRange& theRange)
+{  
   if (myAvoidInternalShapes)
-    // user-defined option to avoid internal parts is in force
-    return;
+         // user-defined option to avoid internal parts is in force
+         return;   
 
   if (myLoopsInternal.IsEmpty())
-    // no internal parts
-    return;
+         // no internal parts
+         return;         
 
   // Get all faces to classify
   TopTools_IndexedMapOfShape aMFs;
   TopTools_ListIteratorOfListOfShape aItLS(myLoopsInternal);
-  for (; aItLS.More(); aItLS.Next())
+  Message_ProgressScope aMainPS(theRange, "PerformInternalShapes", 3);
+  Message_ProgressScope aSPrSc(aMainPS.Next(), "PerformInternalShapes", myLoopsInternal.Size());
+  for (; aItLS.More(); aItLS.Next(), aSPrSc.Next())
   {
     const TopoDS_Shape& aShell = aItLS.Value();
     TopoDS_Iterator aIt(aShell);
@@ -686,7 +654,8 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
   TopTools_MapOfShape aMFDone;
 
   Standard_Integer aNbS = aMSLF.Extent();
-  for (i = 1; i <= aNbS; ++i)
+  Message_ProgressScope aSPrSc1(aMainPS.Next(), "Update Solids by internal Faces", aNbS);
+  for (i = 1; i <= aNbS; ++i, aSPrSc1.Next())
   {
     const TopoDS_Shape& aSolid = aMSLF.FindKey(i);
     TopoDS_Shape *pSolid = (TopoDS_Shape*)&aSolid;
index 787c806cfbdc7bd9702045307710d3092d3232f0..b4dbb526ac79441c402552fb06e70000897138b6 100644 (file)
@@ -114,28 +114,28 @@ protected: //! @name Protected methods performing the operation
   //! - that are alone but given twice with different orientation.
   //! These faces will be put into the map *myShapesToAvoid* and will be
   //! avoided in shells construction, but will be classified later on.
-  Standard_EXPORT virtual void PerformShapesToAvoid() Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformShapesToAvoid(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
   //! Build all possible closed shells from the given faces.
   //! The method fills the following maps:
   //! - myLoops - Created closed shells;
   //! - myLoopsInternal - The shells created from unused faces.
-  Standard_EXPORT virtual void PerformLoops() Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformLoops(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
   //! Classifies the created shells on the Holes and Growths.
   //! Creates the solids from the Growths shells.
   //! Puts the Hole shells into the closest Growths solids.
-  Standard_EXPORT virtual void PerformAreas() Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformAreas(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
   //! Classifies the unused faces relatively the created solids.
   //! Puts the classified faces into the closest solids as internal shells.
   //! Warns the user about unclassified faces if any.
-  Standard_EXPORT virtual void PerformInternalShapes() Standard_OVERRIDE;
+  Standard_EXPORT virtual void PerformInternalShapes(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
 
 private:
 
   TopTools_DataMapOfShapeBox myBoxes; // Boxes of the produced solids
-
 };
 
 #endif // _BOPAlgo_BuilderSolid_HeaderFile
index 3464b3de3963363b823802f27fc3215905926da4..b0da72f3aa42866459b4e1838a311c2e6f754008 100644 (file)
@@ -200,23 +200,15 @@ typedef NCollection_Vector<BOPAlgo_VFI> BOPAlgo_VectorOfVFI;
 void BOPAlgo_Builder::FillImagesFaces(const Message_ProgressRange& theRange)
 {
   Message_ProgressScope aPS(theRange, "FillImagesFaces", 1);
-  BuildSplitFaces();
-  if (!aPS.More())
-  {
-    return;
-  }
+  BuildSplitFaces(aPS.Next());
   FillSameDomainFaces();
-  if (!aPS.More())
-  {
-    return;
-  }
   FillInternalVertices();
 }
 //=======================================================================
 //function : BuildSplitFaces
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::BuildSplitFaces()
+void BOPAlgo_Builder::BuildSplitFaces(const Message_ProgressRange& theRange)
 {
   Standard_Boolean bHasFaceInfo, bIsClosed, bIsDegenerated, bToReverse;
   Standard_Integer i, j, k, aNbS, aNbPBIn, aNbPBOn, aNbPBSc, aNbAV, nSp;
@@ -473,11 +465,13 @@ void BOPAlgo_Builder::BuildSplitFaces()
   //===================================================
   //
   Standard_Integer aNbBF = aVBF.Length();
+  Message_ProgressScope aPS(theRange, "Builder Face", aNbBF);
   for (k = 0; k < aNbBF; ++k)
   {
-    BOPAlgo_BuilderFace& aBF = aVBF(k);
+    BOPAlgo_BuilderFace& aBF = aVBF(k);        
     aFacesIm.Add(myDS->Index(aBF.Face()), aBF.Areas());
     myReport->Merge(aBF.GetReport());
+       aBF.Perform(aPS.Next());
   }
 
   aNbBF = aFacesIm.Extent();
index 499317cc5c15d82a275ffc1e1a75b83118e25571..7f470650788b8c0911cdbd726d1812090e9c86f0 100644 (file)
@@ -105,8 +105,9 @@ void BOPAlgo_Builder::FillImagesSolids(const Message_ProgressRange& theRange)
   {
     return;
   }
+  //std::cout << "FillImagesSolids:theRange = " << theRange.IsActive() << std::endl;
   // Build split of the solids
-  BuildSplitSolids(aDraftSolids);
+  BuildSplitSolids(aDraftSolids, aPS.Next());
   if (!aPS.More())
   {
     return;
@@ -348,8 +349,19 @@ public:
   //! Returns the solid
   const TopoDS_Solid& Solid() const { return mySolid; }
 
+  void SetProgress(const Message_ProgressRange& theRange)
+  {
+         myRange = theRange;
+  }
+
+  virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange())
+  {
+         BOPAlgo_BuilderSolid::Perform(myRange);
+  }
+
 private:
   TopoDS_Solid mySolid; //!< Solid to split
+  Message_ProgressRange myRange;
 };
 
 // Vector of Solid Builders
@@ -359,7 +371,7 @@ typedef NCollection_Vector<BOPAlgo_SplitSolid> BOPAlgo_VectorOfBuilderSolid;
 //function : BuildSplitSolids
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSolids)
+void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSolids, const Message_ProgressRange& theRange)
 {
   Standard_Boolean bFlagSD;
   Standard_Integer i, aNbS;
@@ -376,6 +388,7 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
   //
   // 0. Find same domain solids for non-interfered solids
   aNbS=myDS->NbSourceShapes();
   for (i=0; i<aNbS; ++i) {
     const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
     //
@@ -451,11 +464,17 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol
   //
   aNbBS=aVBS.Length();
   //
+
+  Message_ProgressScope aPS(theRange, "Builder solid", aNbBS);
+  for (Standard_Integer index = 0; index < aNbBS; index++) {
+         BOPAlgo_SplitSolid& aSplitSolid = aVBS.ChangeValue(index);
+         aSplitSolid.SetProgress(aPS.Next());
+  }
   //===================================================
   BOPTools_Parallel::Perform (myRunParallel, aVBS);
   //===================================================
   //
-  for (k = 0; k < aNbBS; ++k)
+   for (k = 0; k < aNbBS; ++k)
   {
     BOPAlgo_SplitSolid& aBS = aVBS(k);
     aSolidsIm.Add(aBS.Solid(), aBS.Areas());
index 1a4f7ee110f8638c4923e32bacfe867614279bbf..dca505d89becb33b317021a40287ea3fb0bd3810 100644 (file)
@@ -109,7 +109,7 @@ void BOPAlgo_CellsBuilder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller,
   Standard_Boolean isHistory = HasHistory();
   SetToFillHistory(Standard_False);
   // Perform splitting of the arguments
-  Message_ProgressScope aPS(theRange, "BOPAlgo_CellsBuilder", 1);
+  Message_ProgressScope aPS(theRange, "BOPAlgo_CellsBuilder", 2);
   BOPAlgo_Builder::PerformInternal1(theFiller, aPS.Next());
   if (HasErrors() || !aPS.More()) {
     return;
index 033d441246f8948caf579e856754a3021737b4d9..bf493ebf0b3888ef21bd8d1ee85fc3e831f84a26 100644 (file)
@@ -64,11 +64,19 @@ class BOPAlgo_CBK {
     return *myPCB;
   }
   //
+  void SetProgress(const Message_ProgressRange& theRange)
+  {
+         myRange = theRange;
+  }
+  //
   void Perform() {
     BOPAlgo_ShellSplitter::SplitBlock(*myPCB);
   }
  protected:
   BOPTools_ConnexityBlock *myPCB;
+
+ private:
+       Message_ProgressRange myRange;
 };
 //=======================================================================
 typedef NCollection_Vector<BOPAlgo_CBK> BOPAlgo_VectorOfCBK;
@@ -133,14 +141,15 @@ const TopTools_ListOfShape& BOPAlgo_ShellSplitter::Shells()const
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_ShellSplitter::Perform(const Message_ProgressRange& /*theRange*/)
+void BOPAlgo_ShellSplitter::Perform(const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
+  Message_ProgressScope aPS(theRange, "Perform", 1);
   //
   BOPTools_AlgoTools::MakeConnexityBlocks
     (myStartShapes, TopAbs_EDGE, TopAbs_FACE, myLCB);
   //
-  MakeShells();
+  MakeShells(aPS.Next());
 }
 
 //=======================================================================
@@ -535,7 +544,7 @@ void RefineShell(TopoDS_Shell& theShell,
 //function : MakeShells
 //purpose  : 
 //=======================================================================
-void BOPAlgo_ShellSplitter::MakeShells()
+void BOPAlgo_ShellSplitter::MakeShells(const Message_ProgressRange& theRange)
 {
   Standard_Boolean bIsRegular;
   Standard_Integer aNbVCBK, k;
@@ -546,7 +555,9 @@ void BOPAlgo_ShellSplitter::MakeShells()
   myShells.Clear();
   //
   aItCB.Initialize(myLCB);
-  for (; aItCB.More(); aItCB.Next()) {
+  Message_ProgressScope aPSOuter(theRange, "Make shells", 10);
+  Message_ProgressScope aPS(aPSOuter.Next(1), "Iteration", myLCB.Size());
+  for (; aItCB.More(); aItCB.Next(), aPS.Next()) {
     BOPTools_ConnexityBlock& aCB=aItCB.ChangeValue();
     bIsRegular=aCB.IsRegular();
     if (bIsRegular) {
@@ -564,10 +575,21 @@ void BOPAlgo_ShellSplitter::MakeShells()
   }
   //
   aNbVCBK=aVCBK.Length();
+  
+  //Message_ProgressScope aPS(aPSOuter.Next(8), "MS", aNbVCBK);
+  //for (Standard_Integer index = 0; index < aNbVCBK; index++) {
+        //BOPAlgo_CBK& aUselessCBK = aVCBK.ChangeValue(index);
+        //aUselessCBK.SetProgress(aPS.Next());
+  //}
+
   //===================================================
   BOPTools_Parallel::Perform (myRunParallel, aVCBK);
   //===================================================
-  for (k=0; k<aNbVCBK; ++k) {
+  if (!aPSOuter.More())
+         return;
+  //
+  Message_ProgressScope aPS2(aPSOuter.Next(8), "Post treatment", aNbVCBK);
+  for (k=0; k<aNbVCBK; ++k, aPS2.Next()) {
     BOPAlgo_CBK& aCBK=aVCBK(k);
     const BOPTools_ConnexityBlock& aCB=aCBK.ConnexityBlock();
     const TopTools_ListOfShape& aLS=aCB.Loops();
index 8f2d42cb5c463cb0c003477281165ef9210b280d..d9cf0ebb635b3b983703725d812a667596f541a9 100644 (file)
@@ -61,7 +61,7 @@ Standard_EXPORT virtual ~BOPAlgo_ShellSplitter();
 
 protected:
 
-  Standard_EXPORT void MakeShells();
+  Standard_EXPORT void MakeShells(const Message_ProgressRange& theRange = Message_ProgressRange());
 
 
   TopTools_ListOfShape myStartShapes;
index b6f2d2b20519a7700b8d4b8c4ef18c7a6464232f..af3a28274e1a183245bc318a3301795288e209c8 100644 (file)
@@ -109,9 +109,10 @@ void BOPAlgo_WireSplitter::CheckData()
 //function : Perform
 //purpose  : 
 //=======================================================================
-void BOPAlgo_WireSplitter::Perform(const Message_ProgressRange& /*theRange*/)
+void BOPAlgo_WireSplitter::Perform(const Message_ProgressRange& theRange)
 {
   GetReport()->Clear();
+  Message_ProgressScope aPS(theRange, "Perform", 1);
   //
   CheckData();
   if (HasErrors()) {
@@ -126,7 +127,7 @@ void BOPAlgo_WireSplitter::Perform(const Message_ProgressRange& /*theRange*/)
   BOPTools_AlgoTools::MakeConnexityBlocks
     (myWES->StartElements(), TopAbs_VERTEX, TopAbs_EDGE, myLCB);
 
-  MakeWires();
+  MakeWires(aPS.Next());
 }
 
 /////////////////////////////////////////////////////////////////////////
@@ -175,7 +176,7 @@ typedef NCollection_Vector<BOPAlgo_WS_ConnexityBlock> BOPAlgo_VectorOfConnexityB
 //function : MakeWires
 //purpose  : 
 //=======================================================================
-void BOPAlgo_WireSplitter::MakeWires()
+void BOPAlgo_WireSplitter::MakeWires(const Message_ProgressRange& theRange)
 {
   Standard_Boolean bIsRegular;
   Standard_Integer aNbVCB, k;
@@ -185,9 +186,11 @@ void BOPAlgo_WireSplitter::MakeWires()
   BOPAlgo_VectorOfConnexityBlock aVCB;
   //
   const TopoDS_Face& aF=myWES->Face();
+  Message_ProgressScope aPSOuter(theRange, "Make shells", 10);
   //
-  aItCB.Initialize(myLCB);
-  for (; aItCB.More(); aItCB.Next()) {
+  aItCB.Initialize(myLCB);  
+  Message_ProgressScope aPS(aPSOuter.Next(1), "Iteration", myLCB.Size());
+  for (; aItCB.More(); aItCB.Next(), aPS.Next()) {
     BOPTools_ConnexityBlock& aCB=aItCB.ChangeValue();
     bIsRegular=aCB.IsRegular();
     if (bIsRegular) {
@@ -204,8 +207,11 @@ void BOPAlgo_WireSplitter::MakeWires()
   //===================================================
   BOPTools_Parallel::Perform (myRunParallel, aVCB, myContext);
   //===================================================
+  if (!aPSOuter.More())
+         return;  
   aNbVCB=aVCB.Length();
-  for (k=0; k<aNbVCB; ++k) {
+  Message_ProgressScope aPS2(aPSOuter.Next(8), "Post treatment", aNbVCB);
+  for (k=0; k<aNbVCB; ++k, aPS2.Next()) {
     const BOPAlgo_WS_ConnexityBlock& aCB=aVCB(k);
     const TopTools_ListOfShape& aLW=aCB.ConnexityBlock().Loops();
     aIt.Initialize(aLW);
index 5820ad3a93586071ee00751c9e4908e103e049c1..5591d80624d51adb50e34b514483cd3b948dabaa 100644 (file)
@@ -70,7 +70,7 @@ protected:
 
   Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
   
-  Standard_EXPORT void MakeWires();
+  Standard_EXPORT void MakeWires(const Message_ProgressRange& theRange = Message_ProgressRange());
 
   BOPAlgo_PWireEdgeSet myWES;
   BOPTools_ListOfConnexityBlock myLCB;
index 06d93ba5868cf4f22f04d5ab3056465052b46e61..1faaf286c994e3a88fde1f916114d87de80f1ba2 100644 (file)
@@ -334,10 +334,17 @@ Standard_Integer bbop(Draw_Interpretor& di,
   pBuilder->SetCheckInverted(BOPTest_Objects::CheckInverted());
   pBuilder->SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
   //
+
   OSD_Timer aTimer;
   aTimer.Start();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
   //
-  pBuilder->PerformWithFiller(aPF);
+  pBuilder->PerformWithFiller(aPF, aProgress->Start());
+  if (aProgress->UserBreak())
+  {
+         di << "Error: User break";
+         return 0;
+  }
   BOPTest::ReportAlerts(pBuilder->GetReport());
 
   // Set history of Boolean operation into the session