]> OCCT Git - occt-copy.git/commitdiff
Some fixes for PaveFiller and another classes
authorakaftasev <akaftasev@opencascade.com>
Fri, 16 Apr 2021 13:41:39 +0000 (16:41 +0300)
committerakaftasev <akaftasev@opencascade.com>
Fri, 16 Apr 2021 13:41:39 +0000 (16:41 +0300)
src/BOPAlgo/BOPAlgo_PaveFiller.cxx
src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx

index a19c4d7e5dca35a71b77bf76d6a71bce9efa61a2..559360ca36f289c70a788d72aa9f7e822cc03d05 100644 (file)
@@ -268,22 +268,23 @@ NCollection_Array1<Standard_Real> BOPAlgo_PaveFiller::AnalyzeProgress()
   if (!myNonDestructive)
   {
     aPart -= 5;
+    // step for init
     aSteps(0) = 5;
   }
   if (!myIsPrimary)
   {
     aSum -= aStep8;
-    aSteps(8) = 0;
+    aStep8 = 0;
   }
   if (myGlue != BOPAlgo_GlueOff)
   {
-    aSteps(11) = 0;
     aSum -= aStep8;
+    aStep11 = 0;
   }
   if (myAvoidBuildPCurve)
   {
-    aSteps(12) = 0;
     aSum -= aStep12;
+    aStep12 = 0;
   }
 
   if (aSum == 0)
@@ -291,19 +292,31 @@ NCollection_Array1<Standard_Real> BOPAlgo_PaveFiller::AnalyzeProgress()
     aSteps(0) = 95.;
     return aSteps;
   }
-
+  // step for PerformVV()
   aSteps(1) = aPart * aStep1 / aSum;
+  // step for PerformVE()
   aSteps(2) = aPart * aStep2 / aSum;
+  // step for PerformEE()
   aSteps(3) = aPart * aStep3 / aSum;
+  // step for PerformVF()
   aSteps(4) = aPart * aStep4 / aSum;
+  // step for PerformEF()
   aSteps(5) = aPart * aStep5 / aSum;
+  // step for RepeatIntersection()
   aSteps(6) = aPart * aStep6 / aSum;
+  // step for ForceInterfEE()
   aSteps(7) = aPart * aStep7 / aSum;
+  // step for ForceInterfEF()
   aSteps(8) = aPart * aStep8 / aSum;
+  // step for PerformFF()
   aSteps(9) = aPart * aStep9 / aSum;
+  // step for MakeSplitEdges()
   aSteps(10) = aPart * aStep10 / aSum;
+  // step for MakeBloks()
   aSteps(11) = aPart * aStep11 / aSum;
+  // step for MakePCurves()
   aSteps(12) = aPart * aStep12 / aSum;
+
   return aSteps;
 }
 
@@ -342,36 +355,36 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange)
     a += aSteps[i];
   }
   //
-  Prepare(aPS.Next(aSteps[0]));                     // 2 - const = 3
+  Prepare(aPS.Next(aSteps[0]));
   if (HasErrors()) {
     return; 
   }
   // 00
-  PerformVV(aPS.Next(aSteps[1]));                   // 3 - myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
+  PerformVV(aPS.Next(aSteps[1]));
   if (HasErrors()) {
     return; 
   }
   // 01
-  PerformVE(aPS.Next(aSteps[2]));                  // 4 -  myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
+  PerformVE(aPS.Next(aSteps[2]));
   if (HasErrors()) {
     return; 
   }
   //
   UpdatePaveBlocksWithSDVertices();
   // 11
-  PerformEE(aPS.Next(aSteps[3]));                  // 5 -  myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE);
+  PerformEE(aPS.Next(aSteps[3]));
   if (HasErrors()) {
     return; 
   }
   UpdatePaveBlocksWithSDVertices();
   // 02
-  PerformVF(aPS.Next(aSteps[4]));                   // 6 -  vertex-face
+  PerformVF(aPS.Next(aSteps[4]));
   if (HasErrors()) {
     return; 
   }
   UpdatePaveBlocksWithSDVertices();
   // 12
-  PerformEF(aPS.Next(aSteps[5]));                  // 7 - edge-face
+  PerformEF(aPS.Next(aSteps[5]));
   if (HasErrors()) {
     return; 
   }
@@ -379,26 +392,26 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange)
   UpdateInterfsWithSDVertices();
 
   // Repeat Intersection with increased vertices
-  RepeatIntersection(aPS.Next(aSteps[6]));           // 8 -  vf+ve+vv
+  RepeatIntersection(aPS.Next(aSteps[6]));
   if (HasErrors())
     return;
   // Force intersection of edges after increase
   // of the tolerance values of their vertices
-  ForceInterfEE(aPS.Next(aSteps[7]));                 // 9 - EE    const = 2
+  ForceInterfEE(aPS.Next(aSteps[7]));
   if (HasErrors())
   {
     return;
   }
   // Force Edge/Face intersection after increase
   // of the tolerance values of their vertices
-  ForceInterfEF(aPS.Next(aSteps[8]));                      // 10 -  EF   const = 3
+  ForceInterfEF(aPS.Next(aSteps[8]));
   if (HasErrors())
   {
     return;
   }
   //
   // 22
-  PerformFF(aPS.Next(aSteps[9]));                              // 11 - FF
+  PerformFF(aPS.Next(aSteps[9]));
   if (HasErrors()) {
     return; 
   }
@@ -407,14 +420,14 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange)
   //
   myDS->RefineFaceInfoIn();
   //
-  MakeSplitEdges(aPS.Next(aSteps[10]));                           // 12 - const = 2
+  MakeSplitEdges(aPS.Next(aSteps[10]));
   if (HasErrors()) {
     return;
   }
   //
   UpdatePaveBlocksWithSDVertices();
   //
-  MakeBlocks(aPS.Next(aSteps[11]));                          // 13 - const = 2
+  MakeBlocks(aPS.Next(aSteps[11]));
   if (HasErrors()) {
     return; 
   }
@@ -427,7 +440,7 @@ void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange)
   //
   RemoveMicroEdges();
   //
-  MakePCurves(aPS.Next(aSteps[12]));                          // 14 - const = 2
+  MakePCurves(aPS.Next(aSteps[12]));
   if (HasErrors()) {
     return; 
   }
index 60020e7472046acc54bd46442df3d16e5146cc31..824bcddc265c001af050d6dc2f748586d6ec9003 100644 (file)
@@ -113,6 +113,7 @@ 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;
 
@@ -132,7 +133,6 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg
   myDSFiller->SetUseOBB(myUseOBB);
   // Set Face/Face intersection options to the intersection algorithm
   SetAttributes();
-  Message_ProgressScope aPS(theRange, NULL, 1);
   // Perform intersection
   myDSFiller->Perform(aPS.Next());
   // Check for the errors during intersection
index d4a05d0a9b1350eae0d71102df9bfb86c78860e8..86bba86eccb5b93d36532a7c7e1fc035a3f15929 100644 (file)
@@ -100,7 +100,7 @@ void BRepAlgoAPI_Check::Perform(const Message_ProgressRange& theRange)
   // Perform the check
   Message_ProgressScope aPS(theRange, NULL, 1);
   anAnalyzer.Perform(aPS.Next());
-  if (HasErrors())
+  if (UserBreak(aPS))
   {
     return;
   }
index 09186489c08fdf910da742a4e1edf3eaee81b803..ae4dc2603a0a733dcb83fff29d1b1ec0c9b6f41e 100644 (file)
@@ -57,7 +57,7 @@ BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1,
 :
   BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_CUT)
 {
-  Message_ProgressScope aPS(theRange, "Cut", 1);
+  Message_ProgressScope aPS(theRange, "Performing CUT operation", 1);
   Build(aPS.Next());
 }
 //=======================================================================
@@ -73,6 +73,6 @@ BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1,
   BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, 
                                (bFWD) ? BOPAlgo_CUT : BOPAlgo_CUT21)
 {
-  Message_ProgressScope aPS(theRange, "Cut", 1);
+  Message_ProgressScope aPS(theRange, "Performing CUT operation", 1);
   Build(aPS.Next());
 }
index dd0f9488b4b12c4775f378847ac362a36f42853d..b7e47da9798f37da23bad48cdd1000db7fd905a0 100644 (file)
@@ -57,7 +57,7 @@ BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1,
 : 
   BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_FUSE)
 {
-  Message_ProgressScope aPS(theRange, "Fuse", 1);
+  Message_ProgressScope aPS(theRange, "Performing FUSE operation", 1);
   Build(aPS.Next());
 }
 //=======================================================================
@@ -71,6 +71,6 @@ BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1,
 : 
   BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, BOPAlgo_FUSE)
 {
-  Message_ProgressScope aPS(theRange, "Fuse", 1);
+  Message_ProgressScope aPS(theRange, "Performing FUSE operation", 1);
   Build(aPS.Next());
 }
index 407dee4cb7891cdc2e8d5507e61e0d06217a2422..b5a1d325d21f38eae5e048317e17d073fcfd0622 100644 (file)
@@ -273,7 +273,7 @@ void BRepAlgoAPI_Section::SetAttributes()
 //=======================================================================
 void BRepAlgoAPI_Section::Build(const Message_ProgressRange& theRange) 
 {
-  Message_ProgressScope aPS(theRange, NULL, 1);
+  Message_ProgressScope aPS(theRange, "Performing SECTION operation", 1);
   BRepAlgoAPI_BooleanOperation::Build(aPS.Next());
 }
 //=======================================================================
index cca83d831a67d17d71fc30d3f2db7679c3a8bfc1..3ccfbfd2b98e52b15b12ffc866df222d470b02b9 100644 (file)
@@ -50,7 +50,7 @@ void BRepAlgoAPI_Splitter::Build(const Message_ProgressRange& theRange)
   }
 
   // If necessary perform intersection of the argument shapes
-  Message_ProgressScope aPS(theRange, NULL, myIsIntersectionNeeded ? 10 : 1);
+  Message_ProgressScope aPS(theRange, "Performing Split operation", myIsIntersectionNeeded ? 10 : 1);
   if (myIsIntersectionNeeded)
   {
     // Combine Arguments and Tools for intersection into a single list