]> OCCT Git - occt-copy.git/commitdiff
Remarks from msv
authorakaftasev <akaftasev@opencascade.com>
Fri, 13 Aug 2021 16:48:57 +0000 (19:48 +0300)
committerakaftasev <akaftasev@opencascade.com>
Mon, 30 Aug 2021 12:40:32 +0000 (15:40 +0300)
27 files changed:
src/BOPAlgo/BOPAlgo_Alerts.hxx
src/BOPAlgo/BOPAlgo_Algo.hxx
src/BOPAlgo/BOPAlgo_BOP.cxx
src/BOPAlgo/BOPAlgo_Builder.cxx
src/BOPAlgo/BOPAlgo_Builder.hxx
src/BOPAlgo/BOPAlgo_BuilderFace.cxx
src/BOPAlgo/BOPAlgo_Builder_1.cxx
src/BOPAlgo/BOPAlgo_Builder_2.cxx
src/BOPAlgo/BOPAlgo_Builder_3.cxx
src/BOPAlgo/BOPAlgo_Builder_4.cxx
src/BOPAlgo/BOPAlgo_CheckerSI.cxx
src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx
src/BOPAlgo/BOPAlgo_MakerVolume.cxx
src/BOPAlgo/BOPAlgo_PaveFiller.cxx
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_8.cxx
src/BOPAlgo/BOPAlgo_Section.cxx
src/BOPAlgo/BOPAlgo_Splitter.cxx
src/BOPAlgo/BOPAlgo_Tools.cxx
src/BOPTest/BOPTest_PartitionCommands.cxx
src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx
src/BRepFill/BRepFill_Draft.cxx

index 7a77adee1fe12ee2810d1fe5e408595cb82cbec4..d670a6e43739a04681ea351376595c582e7846ba 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <TopoDS_AlertWithShape.hxx>
 
-//! Boolean operation was stoped by user
+//! Boolean operation was stopped by user
 DEFINE_SIMPLE_ALERT(BOPAlgo_AlertUserBreak)
 
 //! Boolean operation of given type is not allowed on the given inputs
index ba5c0fd60fdeb3165e3d3e181d5f3c7bd6a8b079..8043b06bd15f46cf4eb0a98b1bbceb0e86626de6 100644 (file)
@@ -37,7 +37,7 @@ public:
 
   //! The main method to implement the operation
   //! Providing the range allows to enable Progress indicator User break functionalities.
-  Standard_EXPORT virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) = 0;
+  Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
 
 protected:
 
@@ -78,12 +78,12 @@ protected: //! @name Analyzing operations to fill progress indicator
   //! step1 = number_of_input_vertices;
   //! step2 = 2 * number_of_input_edges;
   //! step3 = 10 * number_of_input_faces.
-  //! Normalization of this values will be done automatically in analyzeProgress() method.
+  //! Normalization of these values will be done automatically in analyzeProgress() method.
   Standard_EXPORT virtual void fillPISteps(BOPAlgo_PISteps& theSteps) const;
 };
 
 //! Additional root class to provide interface to be launched from parallel vector.
-//! It already has the range as a field, and has to be used with cautious to create
+//! It already has the range as a field, and has to be used with caution to create
 //! scope from the range only once.
 class BOPAlgo_ParallelAlgo : public BOPAlgo_Algo
 {
@@ -117,10 +117,7 @@ public:
   BOPAlgo_PISteps(const Standard_Integer theNbOp)
     : mySteps(0, theNbOp - 1)
   {
-    for (Standard_Integer i = 0; i < theNbOp; ++i)
-    {
-      mySteps(i) = 0.;
-    }
+    mySteps.Init(0);
   }
 
   //! Returns the steps
@@ -128,7 +125,7 @@ public:
   //! Returns modifiable steps
   TColStd_Array1OfReal& ChangeSteps() { return mySteps; }
 
-  //! Returns the step assigned to the operation
+  //! Assign the value theSteps to theOperation
   void SetStep(const Standard_Integer theOperation, const Standard_Real theStep)
   {
     if (theOperation >= mySteps.Lower() && theOperation <= mySteps.Upper())
index 1d78f1e41125ac3a907d3832613624fbc217ab6d..de8e7ebf23ea0b0f8992da7b2907b8656ead1589 100644 (file)
@@ -420,8 +420,6 @@ void BOPAlgo_BOP::fillPIConstants (const Standard_Real theWhole, BOPAlgo_PISteps
 void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller,
                                    const Message_ProgressRange& theRange)
 {
-  Message_ProgressScope aPS (theRange, "Building the result of Boolean operation", 100);
-
   myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
   myDS=myPaveFiller->PDS();
   myContext=myPaveFiller->Context();
@@ -448,6 +446,7 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller,
       return;
     }
   }
+  Message_ProgressScope aPS(theRange, "Building the result of Boolean operation", 100);
   //
   BOPAlgo_PISteps aSteps (PIOperation_Last);
   analyzeProgress (100, aSteps);
@@ -822,7 +821,7 @@ void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange)
     if (hasNotClosedSolids)
     {
       Handle(Message_Report) aReport = new Message_Report();
-      BuildBOP(myArguments, myTools, myOperation, aReport);
+      BuildBOP(myArguments, myTools, myOperation, Message_ProgressRange(), aReport);
       if (aReport->GetAlerts(Message_Fail).IsEmpty())
       {
         // Success. Merge the report into the main report.
index 8196cfd2f1100ab942fab7e519b86c3eb72b70bc..73c95d314089b7bc08ad1c8a69e95e366aee09cd 100644 (file)
@@ -302,11 +302,11 @@ void BOPAlgo_Builder::fillPIConstants (const Standard_Real theWhole,
   if (myFillHistory)
   {
     // for FillHistroty, which takes about 5% of the whole operation
-    theSteps.SetStep(PIOperation_FillHistory, 5. * theWhole / 100.);
+    theSteps.SetStep(PIOperation_FillHistory, 0.05 * theWhole);
   }
 
   // and for PostTreat, which takes about 3% of the whole operation 
-  theSteps.SetStep(PIOperation_PostTreat, 3. * theWhole / 100.);
+  theSteps.SetStep(PIOperation_PostTreat, 0.03 * theWhole);
 }
 
 //=======================================================================
@@ -476,7 +476,7 @@ void BOPAlgo_Builder::PostTreat(const Message_ProgressRange& theRange)
   //
   Message_ProgressScope aPS(theRange, "Post treatment of result shape", 2);
   BOPTools_AlgoTools::CorrectTolerances(myShape, aMA, 0.05, myRunParallel);
-  aPS.Next().Close();
+  aPS.Next();
   BOPTools_AlgoTools::CorrectShapeTolerances(myShape, aMA, myRunParallel);
 }
 
@@ -484,11 +484,12 @@ void BOPAlgo_Builder::PostTreat(const Message_ProgressRange& theRange)
 //function : BuildBOP
 //purpose  : 
 //=======================================================================
-void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
-                               const TopAbs_State          theObjState,
-                               const TopTools_ListOfShape& theTools,
-                               const TopAbs_State          theToolsState,
-                               Handle(Message_Report)      theReport)
+void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape&  theObjects,
+                               const TopAbs_State           theObjState,
+                               const TopTools_ListOfShape&  theTools,
+                               const TopAbs_State           theToolsState,
+                               const Message_ProgressRange& theRange,
+                               Handle(Message_Report)       theReport)
 {
   if (HasErrors())
     return;
@@ -501,7 +502,6 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
     aReport->AddAlert(Message_Fail, new BOPAlgo_AlertBuilderFailed());
     return;
   }
-
   // Check the input data
   if ((theObjState   != TopAbs_IN && theObjState   != TopAbs_OUT) ||
       (theToolsState != TopAbs_IN && theToolsState != TopAbs_OUT))
@@ -721,7 +721,7 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
     if (!aMFToAvoid.Contains(aRF))
       aResFaces.Append(aRF);
   }
-
+  Message_ProgressScope aPS(theRange, NULL, 2);
   BRep_Builder aBB;
 
   // Try to build closed solids from the faces
@@ -730,7 +730,7 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
   aBS.SetRunParallel(myRunParallel);
   aBS.SetContext(myContext);
   aBS.SetFuzzyValue(myFuzzyValue);
-  aBS.Perform();
+  aBS.Perform(aPS.Next());
 
   // Resulting solids
   TopTools_ListOfShape aResSolids;
@@ -759,6 +759,10 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
       }
     }
   }
+  else
+  {
+    return;
+  }
 
   // Collect unused faces
   TopoDS_Compound anUnUsedFaces;
@@ -839,5 +843,5 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
     aBB.Add(aResult, itLS.Value());
 
   myShape = aResult;
-  PrepareHistory(Message_ProgressRange());
+  PrepareHistory(aPS.Next());
 }
index fc7fc593469eb8918aeb57fde0acb39733a103f1..8d23567638cd10d5401b5decca9980e300451744 100644 (file)
@@ -217,11 +217,12 @@ public: //! @name BOPs on open solids
   //! @param theTools     - The group of Tools for BOP;
   //! @param theObjState  - State for tools faces to pass into result;
   //! @param theReport    - The alternative report to avoid pollution of the main one.
-  Standard_EXPORT virtual void BuildBOP(const TopTools_ListOfShape& theObjects,
-                                        const TopAbs_State          theObjState,
-                                        const TopTools_ListOfShape& theTools,
-                                        const TopAbs_State          theToolsState,
-                                        Handle(Message_Report)      theReport = NULL);
+  Standard_EXPORT virtual void BuildBOP(const TopTools_ListOfShape&  theObjects,
+                                        const TopAbs_State           theObjState,
+                                        const TopTools_ListOfShape&  theTools,
+                                        const TopAbs_State           theToolsState,
+                                        const Message_ProgressRange& theRange,
+                                        Handle(Message_Report)       theReport = NULL);
 
   //! Builds the result of Boolean operation of given type
   //! basing on the result of Builder operation (GF or any other).
@@ -241,11 +242,13 @@ public: //! @name BOPs on open solids
   //! @param theObjects   - The group of Objects for BOP;
   //! @param theTools     - The group of Tools for BOP;
   //! @param theOperation - The BOP type;
+  //! @param theRange     - The parameter to progressIndicator
   //! @param theReport    - The alternative report to avoid pollution of the global one.
-  void BuildBOP(const TopTools_ListOfShape& theObjects,
-                const TopTools_ListOfShape& theTools,
-                const BOPAlgo_Operation     theOperation,
-                Handle(Message_Report)      theReport = NULL)
+  void BuildBOP(const TopTools_ListOfShape&  theObjects,
+                const TopTools_ListOfShape&  theTools,
+                const BOPAlgo_Operation      theOperation,
+                const Message_ProgressRange& theRange,
+                Handle(Message_Report)       theReport = NULL)
   {
     TopAbs_State anObjState, aToolsState;
     switch (theOperation)
@@ -281,7 +284,7 @@ public: //! @name BOPs on open solids
         break;
       }
     }
-    BuildBOP(theObjects, anObjState, theTools, aToolsState, theReport);
+    BuildBOP(theObjects, anObjState, theTools, aToolsState, theRange, theReport);
   }
 
 protected: //! @name History methods
index c895387ff3ecdf539a99c410599e1cc3c39e4a4d..46addcede53a2483f57b65f286ef2df0fdfc96d1 100644 (file)
@@ -651,7 +651,7 @@ void BOPAlgo_BuilderFace::PerformInternalShapes(const Message_ProgressRange& the
   // Build BVH
   aBoxTree.Build();
 
-  aMainScope.Next().Close();
+  aMainScope.Next();
 
   // Fence map
   TColStd_MapOfInteger aMEDone;
index 47df33a24841dfc7e614a2809b221dcd644bdc67..125f91c5aba7b96ad0090ed93dad94da9b5033c2 100644 (file)
@@ -73,10 +73,6 @@ void BOPAlgo_Builder::FillImagesVertices(const Message_ProgressRange& theRange)
   Standard_Integer i, aNbS = myDS->NbSourceShapes();
   Message_ProgressScope aPS(theRange, "Filling splits of edges", 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;
@@ -115,6 +111,10 @@ void BOPAlgo_Builder::FillImagesVertices(const Message_ProgressRange& theRange)
         const TopoDS_Shape& aSp = myDS->Shape(nSp);
         myShapesSD.Bind(aSp, aSpR);
       }
+      if (UserBreak(aPS))
+      {
+        return;
+      }
     }
   }
 }
@@ -167,15 +167,15 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType)
   aNbS=myDS->NbSourceShapes();
   Message_ProgressScope aPS(theRange, "Building splits of containers", 1);
   for (i=0; i<aNbS; ++i) {
-    if (UserBreak(aPS))
-    {
-      return;
-    }
     const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
     if (aSI.ShapeType()==theType) {
       const TopoDS_Shape& aC=aSI.Shape();
       FillImagesContainer(aC, theType);
     }   
+    if (UserBreak(aPS))
+    {
+      return;
+    }
   }// for (; aItS.More(); aItS.Next()) {
 }
 //=======================================================================
@@ -190,15 +190,15 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType)
   aNbS=myDS->NbSourceShapes();
   Message_ProgressScope aPS(theRange, "Building splits of compounds", 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();
       FillImagesCompound(aC, aMFP);
     }
+    if (UserBreak(aPS))
+    {
+      return;
+    }
   }// for (; aItS.More(); aItS.Next()) {
 }
 //=======================================================================
index d51d462ecf823448d5c2fdc7f6ecba102a8f6405..5611cc04f7f2c8b014813143e6e5b51d9c9ee02d 100644 (file)
@@ -152,7 +152,6 @@ private:
   virtual void Perform(const Message_ProgressRange& /*theRange*/) {};
 
 private:
-  TopoDS_Solid mySolid; //!< Solid to split
   Message_ProgressRange myRange;
 };
 typedef NCollection_Vector<BOPAlgo_SplitFace> BOPAlgo_VectorOfBuilderFace;
@@ -506,7 +505,7 @@ void BOPAlgo_Builder::BuildSplitFaces(const Message_ProgressRange& theRange)
   }// for (i=0; i<aNbS; ++i) {
 
   // close preparation task
-  aPSOuter.Next().Close();
+  aPSOuter.Next();
   //
   Standard_Integer aNbBF = aVBF.Length();
   // Set progress range for each task to be run in parallel
@@ -719,7 +718,7 @@ void BOPAlgo_Builder::FillSameDomainFaces(const Message_ProgressRange& theRange)
     }
   }
 
-  aPSOuter.Next().Close();
+  aPSOuter.Next();
 
   // Set progress range for each task to be run in parallel
   Message_ProgressScope aPSParallel(aPSOuter.Next(6), "Checking SD faces", aVPSB.Size());
index 84ae70cdc033eb55e0ad4b66989c0d993933e414..1a6fd06f3aa5c74beaf50a873e1a3bb799b2bfed 100644 (file)
@@ -747,7 +747,7 @@ void BOPAlgo_Builder::FillInternalShapes(const Message_ProgressRange& theRange)
     return;
   }
 
-  aPS.Next().Close();
+  aPS.Next();
   //
   // 5 Settle internal vertices and edges into solids
   aMx.Clear();
index ee92e3f85fbffa62c4008257ff597155810cb753..a9d125f07029c147da593f8f1bbca8f962637093 100644 (file)
@@ -169,16 +169,17 @@ void BOPAlgo_Builder::PrepareHistory(const Message_ProgressRange& theRange)
   Message_ProgressScope aPS(theRange, "Preparing history information", aNbS);
   for (Standard_Integer i = 0; i < aNbS; ++i, aPS.Next())
   {
-    if (UserBreak(aPS))
-    {
-      return;
-    }
     const TopoDS_Shape& aS = myDS->Shape(i);
 
     // Check if History information is available for this kind of shape.
     if (!BRepTools_History::IsSupportedType(aS))
       continue;
 
+    if (UserBreak(aPS))
+    {
+      return;
+    }
+
     Standard_Boolean isModified = Standard_False;
 
     // Check if the shape has any splits
index a1d0a4920f451968511664132234078df74e63ea..6c93b786139f58a2a6a0c97d4fd87c09bab0e83e 100644 (file)
@@ -451,7 +451,7 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection(const Message_ProgressRange& t
   
   Standard_Integer aNbFace = aVFace.Length();
   Message_ProgressScope aPSParallel(aPSOuter.Next(), "Checking surface on self-intersection", aNbFace);
-  for (Standard_Integer iF = 0; iF < aVFace.Size(); ++iF)
+  for (Standard_Integer iF = 0; iF < aNbFace; ++iF)
   {
     aVFace.ChangeValue(iF).SetProgressRange(aPSParallel.Next());
   }
index 05db010e0eb608a6e5bd35cf0647e5ad35a7d69a..f8ab363c34819e5e6bc081cabcada9b172a93463 100644 (file)
 //class    : BOPAlgo_VertexSolid
 //purpose  : 
 //=======================================================================
-class BOPAlgo_VertexSolid : public BOPAlgo_ParallelAlgo  {
+class BOPAlgo_VertexSolid {
  public:
   DEFINE_STANDARD_ALLOC
   
   BOPAlgo_VertexSolid() :
-    BOPAlgo_ParallelAlgo(),
     myIV(-1), myIZ(-1), myState(TopAbs_UNKNOWN) {
   };
   //
@@ -93,9 +92,14 @@ class BOPAlgo_VertexSolid : public BOPAlgo_ParallelAlgo  {
     return myState;
   };
   //
+  void SetProgressRange(const Message_ProgressRange& theRange)
+  {
+    myProgressRange = theRange;
+  }
+  //
   virtual void Perform() {
     Message_ProgressScope aPS(myProgressRange, NULL, 1);
-    if (UserBreak(aPS))
+    if (!aPS.More())
     {
       return;
     }
@@ -120,6 +124,7 @@ class BOPAlgo_VertexSolid : public BOPAlgo_ParallelAlgo  {
   TopoDS_Vertex myV;
   TopoDS_Solid myZ;
   Handle(IntTools_Context) myContext;
+  Message_ProgressRange myProgressRange;
 };
 //=======================================================================
 typedef NCollection_Vector<BOPAlgo_VertexSolid> BOPAlgo_VectorOfVertexSolid;
@@ -129,12 +134,11 @@ typedef NCollection_Vector<BOPAlgo_VertexSolid> BOPAlgo_VectorOfVertexSolid;
 //class    : BOPAlgo_ShapeSolid
 //purpose  : 
 //=======================================================================
-class BOPAlgo_ShapeSolid: public BOPAlgo_ParallelAlgo  {
+class BOPAlgo_ShapeSolid {
  public:
   DEFINE_STANDARD_ALLOC
 
   BOPAlgo_ShapeSolid() : 
-    BOPAlgo_ParallelAlgo(),
     myIE(-1), 
     myIZ(-1), 
     myHasInterf(Standard_False), 
@@ -164,9 +168,14 @@ class BOPAlgo_ShapeSolid: public BOPAlgo_ParallelAlgo  {
     return myHasInterf;
   };
   //
+  void SetProgressRange(const Message_ProgressRange& theRange)
+  {
+    myProgressRange = theRange;
+  }
+  //
   virtual void Perform() {
     Message_ProgressScope aPS(myProgressRange, NULL, 1);
-    if (UserBreak(aPS))
+    if (!aPS.More())
     {
       return;
     }
@@ -186,6 +195,7 @@ class BOPAlgo_ShapeSolid: public BOPAlgo_ParallelAlgo  {
   Standard_Integer myIZ;
   Standard_Boolean myHasInterf;
   BOPDS_DS* myDS;
+  Message_ProgressRange myProgressRange;
 };
 //=======================================================================
 typedef NCollection_Vector<BOPAlgo_ShapeSolid> BOPAlgo_VectorOfShapeSolid;
@@ -208,7 +218,7 @@ class BOPAlgo_SolidSolid : public  BOPAlgo_ShapeSolid {
   //
   virtual void Perform() {
     Message_ProgressScope aPS(myProgressRange, NULL, 1);
-    if (UserBreak(aPS))
+    if (!aPS.More())
     {
       return;
     }
@@ -223,6 +233,8 @@ class BOPAlgo_SolidSolid : public  BOPAlgo_ShapeSolid {
       myHasInterf=myDS->HasInterfShapeSubShapes(myIE, myIZ, bFlag);
     }
   };
+protected:
+  Message_ProgressRange myProgressRange;
 };
 //=======================================================================
 typedef NCollection_Vector<BOPAlgo_SolidSolid> BOPAlgo_VectorOfSolidSolid;
@@ -401,10 +413,6 @@ void BOPAlgo_CheckerSI::PerformSZ(const TopAbs_ShapeEnum theTS, const Message_Pr
   BOPAlgo_VectorOfShapeSolid aVShapeSolid;
   //
   for (; myIterator->More(); myIterator->Next()) {
-    if (UserBreak(aPSOuter))
-    {
-      return;
-    }
     myIterator->Value(nS, nZ);
     //
     BOPAlgo_ShapeSolid& aShapeSolid=aVShapeSolid.Appended();
index dec0aae83693cac20f66de0584219fccc3985f5d..bd1cd3a420878c75e8cdd5b728c1a5c4ec0fd39f 100644 (file)
@@ -95,8 +95,9 @@ void BOPAlgo_MakerVolume::Perform(const Message_ProgressRange& theRange)
   pPF->SetGlue(myGlue);
   pPF->SetUseOBB(myUseOBB);
   pPF->Perform(aPS.Next(anInterPart));
-  if (HasErrors())
+  if (pPF->HasErrors())
   {
+    AddError(new BOPAlgo_AlertUserBreak);
     return;
   }
   //
index f371c6a79701c958751bf9bc53a0fd9e7cef4936..afe18b1e8de86dd0f36d6ee2b48f2d0341093eb1 100644 (file)
@@ -382,10 +382,6 @@ void BOPAlgo_PaveFiller::RepeatIntersection (const Message_ProgressRange& theRan
   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;
index 65f15f879b7e920fbfde234ee23c83c729afed02..aa1e7545629014e673c5a7e5252e214c3eafc48a 100644 (file)
@@ -130,7 +130,7 @@ void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange)
 }
 
 //=======================================================================
-// function: PerformVV
+// function: MakeSDVertices
 // purpose: 
 //=======================================================================
 Standard_Integer BOPAlgo_PaveFiller::MakeSDVertices
index b82966efdb7f5f7085112805def3b7bb96075e58..c91453ec4ff7864b0f90440a81a5503913acfe87 100644 (file)
@@ -286,7 +286,7 @@ void BOPAlgo_PaveFiller::IntersectVE
   aNbVE = aVVE.Length();
 
   Message_ProgressScope aPS(aPSOuter.Next(9), "Performing Vertex-Edge intersection", aNbVE);
-  for (i = 0; i < aVVE.Length(); i++)
+  for (i = 0; i < aNbVE; i++)
   {
     BOPAlgo_VertexEdge& aVESolver = aVVE.ChangeValue(i);
     aVESolver.SetProgressRange(aPS.Next());
@@ -295,7 +295,7 @@ void BOPAlgo_PaveFiller::IntersectVE
   //=============================================================
   BOPTools_Parallel::Perform (myRunParallel, aVVE, myContext);
   //=============================================================
-  if (HasErrors())
+  if (UserBreak(aPSOuter))
   {
     return;
   }
@@ -334,10 +334,6 @@ void BOPAlgo_PaveFiller::IntersectVE
     BOPDS_ListOfPaveBlock::Iterator itPB (aLPB);
     for (; itPB.More(); itPB.Next())
     {
-      if (UserBreak(aPSOuter))
-      {
-        return;
-      }
       aPB = itPB.Value();
       Standard_Real aT1, aT2;
       aPB->Range (aT1, aT2);
@@ -359,10 +355,6 @@ void BOPAlgo_PaveFiller::IntersectVE
       const TColStd_ListOfInteger& aLI = aDMVSD.Find(aPair);
       TColStd_ListIteratorOfListOfInteger aItLI(aLI);
       for (; aItLI.More(); aItLI.Next()) {
-        if (UserBreak(aPSOuter))
-        {
-          return;
-        }
         const Standard_Integer nVOld = aItLI.Value();
         // 3. Create interference V/E
         BOPDS_InterfVE& aVE = aVEs.Appended();
index 9eb030eeb6dfc0b12fce018019f07f7da7fe0fc3..0d31a176bfe7c0da993fb7808e0f5e6cf81f4d08 100644 (file)
@@ -238,10 +238,6 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
       //
       aIt2.Initialize(aLPB2);
       for (; aIt2.More(); aIt2.Next()) {
-        if (UserBreak(aPSOuter))
-        {
-          return;
-        }
         Bnd_Box aBB2;
         //
         Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue();
@@ -285,7 +281,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
   //======================================================
   BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
   //======================================================
-  if (HasErrors())
+  if (UserBreak(aPSOuter))
   {
     return;
   }
@@ -624,10 +620,6 @@ 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);
@@ -963,16 +955,16 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
   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)
     {
       if (myDS->HasInterf(i))
         myDS->InitPaveBlocksForVertex(i);
     }
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
   }
   // Fill the connection map from bounding vertices to pave blocks
   // having those bounding vertices
@@ -984,10 +976,6 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
 
   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
@@ -1000,7 +988,10 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
     if (aSI.HasFlag())
       // Degenerated edge
       continue;
-
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
     const BOPDS_ListOfPaveBlock& aLPB = myDS->PaveBlocks(i);
     BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB);
     for (; aItLPB.More(); aItLPB.Next())
@@ -1157,7 +1148,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
     return;
 
   // close preparation step
-  aPSOuter.Next(0.7).Close();
+  aPSOuter.Next(0.7);
 
   aPBMap.Clear();
   aMPBFence.Clear();
@@ -1172,7 +1163,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
 
   // Perform intersection of the found pairs
   BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
-  if (HasErrors())
+  if (UserBreak(aPSOuter))
   {
     return;
   }
index 0eca3667a7f7f686ba15f8dd1cb927762390270e..6b5287a0224a688fbc7363fa0fcceac26e42d1c4 100644 (file)
@@ -238,7 +238,7 @@ void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange)
   //================================================================
   BOPTools_Parallel::Perform (myRunParallel, aVVF, myContext);
   //================================================================
-  if (HasErrors())
+  if (UserBreak(aPSOuter))
   {
     return;
   }
index 77b8c718dfa9113ea6ad9ee7cccd4cd6f72976d0..827135c9b415f652ea8a92fd755f57f4deec156a 100644 (file)
@@ -310,7 +310,7 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange)
   //=================================================================
   BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
   //=================================================================
-  if (HasErrors())
+  if (UserBreak(aPSOuter))
   {
     return;
   }
@@ -782,10 +782,6 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const Message_ProgressRange& theRange)
   const Standard_Integer aNbS = myDS->NbSourceShapes();
   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
@@ -799,6 +795,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const Message_ProgressRange& theRange)
       // Degenerated edge
       continue;
 
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     const BOPDS_ListOfPaveBlock& aLPB = myDS->PaveBlocks(nE);
     BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB);
     for (; aItLPB.More(); aItLPB.Next())
@@ -835,10 +835,6 @@ 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))
     {
@@ -846,6 +842,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
       if (!aPB->HasShrunkData())
         continue;
     }
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
 
     Standard_Real f, l;
     Bnd_Box aPBBox;
@@ -867,10 +867,6 @@ 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
@@ -880,6 +876,11 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
       // Face has no face info
       continue;
 
+    if (UserBreak(aPSOuter))
+    {
+      return;
+    }
+
     const Bnd_Box& aBoxF = aSI.Box();
     BOPTools_BoxTreeSelector aSelector;
     aSelector.SetBox(Bnd_Tools::Bnd2BVH(aBoxF));
@@ -1072,7 +1073,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
   }
 
   // close preparation step
-  aPSOuter.Next(0.7).Close();
+  aPSOuter.Next(0.7);
 
   aPBMap.Clear();
   anAlloc->Reset();
@@ -1085,7 +1086,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB
   }
   // Perform intersection of the found pairs
   BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
-  if (HasErrors())
+  if (UserBreak(aPSOuter))
   {
     return;
   }
index 46e4fa1d42f083677c1c1a0ec7bf91bf7800d724..51558709ab1ac30a6c0453e0f0ddbb62ec69af97 100644 (file)
@@ -330,7 +330,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
   //
   Standard_Integer k, aNbFaceFace = aVFaceFace.Length();;
   Message_ProgressScope aPS(aPSOuter.Next(), "Performing Face-Face intersection", aNbFaceFace);
-  for (k = 0; k < aVFaceFace.Size(); k++)
+  for (k = 0; k < aNbFaceFace; k++)
   {
     BOPAlgo_FaceFace& aFaceFace = aVFaceFace.ChangeValue(k);
     aFaceFace.SetProgressRange(aPS.Next());
@@ -338,7 +338,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
   //======================================================
   // Perform intersection
   BOPTools_Parallel::Perform (myRunParallel, aVFaceFace);
-  if (HasErrors())
+  if (UserBreak(aPSOuter))
   {
     return;
   }
@@ -3704,10 +3704,6 @@ void BOPAlgo_PaveFiller::PutSEInOtherFaces(const Message_ProgressRange& theRange
   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)
index 1a2ab61bbbacbc1dadf396157b314a17ed25d288..d71031252d5be3f4b59c49105561446a69ee278c 100644 (file)
@@ -80,10 +80,6 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
   //
   aNb=myDS->NbSourceShapes();
   for (nE=0; nE<aNb; ++nE) {
-    if (UserBreak(aPSOuter))
-    {
-      return;
-    }
     const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
     if (aSIE.ShapeType()==TopAbs_EDGE) {
       if (aSIE.HasFlag(nF)) {
@@ -137,6 +133,10 @@ void BOPAlgo_PaveFiller::ProcessDE(const Message_ProgressRange& theRange)
           aPBD->SetEdge(nEn);
         }
       }
+      if (UserBreak(aPSOuter))
+      {
+        return;
+      }
     }
   }
 }
index f792974d4c5d266679f82e69c08300bd20dc6b0e..e889a5c5144e917a6084417dc0a9d0beda245e78 100644 (file)
@@ -203,14 +203,14 @@ void BOPAlgo_Section::BuildSection(const Message_ProgressRange& theRange)
   // 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;
     }
+    if (UserBreak(aPS))
+    {
+      return;
+    }
     //
     const BOPDS_FaceInfo& aFI=myDS->FaceInfo(i);
     //
@@ -254,10 +254,6 @@ void BOPAlgo_Section::BuildSection(const Message_ProgressRange& theRange)
   //
   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()) {
@@ -362,10 +358,6 @@ void BOPAlgo_Section::BuildSection(const Message_ProgressRange& theRange)
   //
   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) {
index 735b83eda14a3f3081e714981ffa085d6d1f04f1..e350c63c829769d802578f25226a2ed654bb494c 100644 (file)
@@ -97,8 +97,9 @@ void BOPAlgo_Splitter::Perform(const Message_ProgressRange& theRange)
   //
   Message_ProgressScope aPS(theRange, "Performing Split operation", 10);
   pPF->Perform(aPS.Next(9));
-  if (HasErrors())
+  if (pPF->HasErrors())
   {
+    AddError(new BOPAlgo_AlertUserBreak);
     return;
   }
   //
index 8bc5b551d9f5d4b83df9e318adc6670046386603..c102ed7c530fb9fa6aa381bb0b6e62f693704662 100644 (file)
@@ -1338,7 +1338,7 @@ void BOPAlgo_FillIn3DParts::Perform()
       MapEdgesAndFaces(aVShapeBox(aIVec(k)).Shape(), aMEFP, anAlloc);
   }
 
-  aPSOuter.Next().Close();
+  aPSOuter.Next();
 
   // Map of Edge-Face connection, necessary for solid classification.
   // It will be filled when first classification is performed.
@@ -1588,7 +1588,7 @@ void BOPAlgo_Tools::ClassifyFaces(const TopTools_ListOfShape& theFaces,
   }
 
   // Close preparation task
-  aPSOuter.Next().Close();
+  aPSOuter.Next();
   // Set progress range for each task to be run in parallel
   Standard_Integer aNbS = aVFIP.Length();
   Message_ProgressScope aPSParallel(aPSOuter.Next(9), "Classification of faces relatively solids", aNbS);
index 13ad4f919b8462b3ca08d758e4e6ecc59f1a4617..b85f70110ee28c9d8c14802df5da415f07bf56fb 100644 (file)
@@ -573,9 +573,9 @@ Standard_Integer buildbop(Draw_Interpretor& di,
 
   // Create new report for the operation
   Handle(Message_Report) aReport = new Message_Report;
-
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
   // Build specific operation
-  pBuilder->BuildBOP(aLObjects, aLTools, anOp, aReport);
+  pBuilder->BuildBOP(aLObjects, aLTools, anOp, aProgress->Start(), aReport);
 
   // Report alerts of the operation
   BOPTest::ReportAlerts(aReport);
index d89a00906478939d21400e0b456eabb16e3399d1..740a7fa66bdd236f11f7dd9d1345f8106086bdbb 100644 (file)
@@ -113,7 +113,6 @@ void BRepAlgoAPI_BuilderAlgo::Build(const Message_ProgressRange& theRange)
 //=======================================================================
 void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange)
 {
-  Message_ProgressScope aPS(theRange, NULL, 1);
   if (!myIsIntersectionNeeded)
     return;
 
@@ -134,7 +133,7 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg
   // Set Face/Face intersection options to the intersection algorithm
   SetAttributes();
   // Perform intersection
-  myDSFiller->Perform(aPS.Next());
+  myDSFiller->Perform(theRange);
   // Check for the errors during intersection
   GetReport()->Merge(myDSFiller->GetReport());
 }
index eb44aca877d31308653be7a5e8ba9405db7ba28e..65f605bf7417d6eaa0dd874f0af9ea2913f0d1f0 100644 (file)
@@ -722,7 +722,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
     TopTools_ListOfShape aLO, aLT;
     aLO.Append(Sol1);
     aLT.Append(Sol2);
-    aBuilder.BuildBOP(aLO, aLT, BOPAlgo_CUT);
+    aBuilder.BuildBOP(aLO, aLT, BOPAlgo_CUT, Message_ProgressRange());
     if (!aBuilder.HasErrors())
     {
       TopoDS_Solid aCutMin;
@@ -769,7 +769,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
 
         aLO.Clear();
         aLO.Append(aCutMin);
-        aGluer.BuildBOP(aLO, State1, aLT, State2);
+        aGluer.BuildBOP(aLO, State1, aLT, State2, Message_ProgressRange());
 
         if (!aGluer.HasErrors())
         {
@@ -791,7 +791,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B,
     aLO.Append(Sol1);
     aLT.Append(Sol2);
 
-    aBuilder.BuildBOP(aLO, State1, aLT, State2);
+    aBuilder.BuildBOP(aLO, State1, aLT, State2, Message_ProgressRange());
     if (aBuilder.HasErrors())
       return Standard_False;