]> OCCT Git - occt-copy.git/commitdiff
another remarks CR21264_2
authorakaftasev <akaftasev@opencascade.com>
Tue, 31 Aug 2021 14:53:17 +0000 (17:53 +0300)
committerakaftasev <akaftasev@opencascade.com>
Tue, 31 Aug 2021 14:53:17 +0000 (17:53 +0300)
dox/upgrade/upgrade.md
src/BOPAlgo/BOPAlgo_Algo.hxx
src/BOPAlgo/BOPAlgo_BOP.cxx
src/BOPAlgo/BOPAlgo_Builder.hxx
src/BOPAlgo/BOPAlgo_Builder_1.cxx
src/BOPAlgo/BOPAlgo_Builder_2.cxx
src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx
src/BOPAlgo/BOPAlgo_MakerVolume.cxx
src/BOPAlgo/BOPAlgo_Splitter.cxx
tests/bugs/modalg_7/bug21264 [new file with mode: 0644]

index b5f57b58389488a6f551e95d363cf49de8d33982..24233e8740a4141567d604a0b9bcfaac27ed03e9 100644 (file)
@@ -2253,3 +2253,13 @@ Access to an OCAF label via its entry is accelerated. In order to activate it, c
 The method *TDF_Tool::Label()*, which returns a label by an entry, becomes faster for about 10 .. 20 times.
 It has sense for applications, which use an entry as a unique key to access the data in OCAF tree.
 Also, the method *TDF_Tool::Entry()*, which returns an entry for a label, is accelerated as well.
+
+@subsection upgrade_occt760_bop_progress_indicator Progress indicator in Boolean operations
+
+Method SetProgressIndicator() has been removed due to Progress indicator mechanism refactoring.
+To enable progress indicator and user break in Boolean operations user has to pass progress range as a parameter to Perform or Build method.
+For example:
+~~~~
+Handle(Message_ProgressIndicator) aProgress = new Message_ProgressIndicator();
+BRepAlgoApi_Cut(S1, S2, aProgress->Start()); // method Start() create range for usage in cut algorithm
+~~~~
index 8043b06bd15f46cf4eb0a98b1bbceb0e86626de6..d65caf18782af4ae0e0f815a4452262d12c43e17 100644 (file)
@@ -125,7 +125,7 @@ public:
   //! Returns modifiable steps
   TColStd_Array1OfReal& ChangeSteps() { return mySteps; }
 
-  //! Assign the value theSteps to theOperation
+  //! Assign the value theStep to theOperation
   void SetStep(const Standard_Integer theOperation, const Standard_Real theStep)
   {
     if (theOperation >= mySteps.Lower() && theOperation <= mySteps.Upper())
index de8e7ebf23ea0b0f8992da7b2907b8656ead1589..f4e31259a3c4adecf5a5b7e33cf48d0c25910a35 100644 (file)
@@ -410,6 +410,7 @@ void BOPAlgo_BOP::Perform(const Message_ProgressRange& theRange)
 //=======================================================================
 void BOPAlgo_BOP::fillPIConstants (const Standard_Real theWhole, BOPAlgo_PISteps& theSteps) const
 {
+  BOPAlgo_Builder::fillPIConstants(theWhole, theSteps);
   theSteps.SetStep (PIOperation_BuildShape, (myOperation == BOPAlgo_FUSE ? 10. : 5.) * theWhole / 100.);
 }
 
index 8d23567638cd10d5401b5decca9980e300451744..1d908c79bc3c32dc4b51f1a4b6481359c4c54513 100644 (file)
@@ -212,11 +212,11 @@ public: //! @name BOPs on open solids
   //! - BOPAlgo_AlertUnknownShape - the shape is unknown for the operation.
   //!
   //! Parameters:
-  //! @param theObjects   - The group of Objects for BOP;
-  //! @param theObjState  - State for objects faces to pass into result;
-  //! @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.
+  //! @param theObjects     - The group of Objects for BOP;
+  //! @param theObjState    - State for objects faces to pass into result;
+  //! @param theTools       - The group of Tools for BOP;
+  //! @param theToolsState  - 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,
index 125f91c5aba7b96ad0090ed93dad94da9b5033c2..f343f9d2747bbe03a9c040b514904c2590c33b2d 100644 (file)
@@ -111,10 +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;
-      }
+    }
+    if (UserBreak(aPS))
+    {
+      return;
     }
   }
 }
index 5611cc04f7f2c8b014813143e6e5b51d9c9ee02d..186cd8839968ea8dae0f8e515836df6f70085a04 100644 (file)
@@ -125,7 +125,7 @@ typedef NCollection_Vector<BOPAlgo_PairOfShapeBoolean> BOPAlgo_VectorOfPairOfSha
 
 //=======================================================================
 //class   : BOPAlgo_SplitFace
-//purpose : Auxiliary class to extend BOPAlgo_BuilderSolid with progress support
+//purpose : Auxiliary class to extend BOPAlgo_BuilderFace with progress support
 //=======================================================================
 class BOPAlgo_SplitFace : public BOPAlgo_BuilderFace
 {
index f8ab363c34819e5e6bc081cabcada9b172a93463..d607cba5735f3d25770f67078f5a2d7bbbe1421b 100644 (file)
@@ -233,8 +233,6 @@ class BOPAlgo_SolidSolid : public  BOPAlgo_ShapeSolid {
       myHasInterf=myDS->HasInterfShapeSubShapes(myIE, myIZ, bFlag);
     }
   };
-protected:
-  Message_ProgressRange myProgressRange;
 };
 //=======================================================================
 typedef NCollection_Vector<BOPAlgo_SolidSolid> BOPAlgo_VectorOfSolidSolid;
index bd1cd3a420878c75e8cdd5b728c1a5c4ec0fd39f..8ad6fc0db4e4d40244dff7ca98b7e1641084c910 100644 (file)
@@ -97,7 +97,6 @@ void BOPAlgo_MakerVolume::Perform(const Message_ProgressRange& theRange)
   pPF->Perform(aPS.Next(anInterPart));
   if (pPF->HasErrors())
   {
-    AddError(new BOPAlgo_AlertUserBreak);
     return;
   }
   //
index e350c63c829769d802578f25226a2ed654bb494c..a79e2fe310a220c149cc61d469d17080e68a1bd4 100644 (file)
@@ -99,7 +99,6 @@ void BOPAlgo_Splitter::Perform(const Message_ProgressRange& theRange)
   pPF->Perform(aPS.Next(9));
   if (pPF->HasErrors())
   {
-    AddError(new BOPAlgo_AlertUserBreak);
     return;
   }
   //
diff --git a/tests/bugs/modalg_7/bug21264 b/tests/bugs/modalg_7/bug21264
new file mode 100644 (file)
index 0000000..30f898b
--- /dev/null
@@ -0,0 +1,117 @@
+puts "============================================"
+puts "0021264: Modeling Algorithms - Progress indicator for Boolean operations"
+puts "============================================"
+puts ""
+proc isTracked { theOutput } {
+  if {![regexp "Progress" $theOutput]} {
+    puts "Error: progress is not tracked"
+  }
+}
+XProgress +t
+box b1 10 10 10
+box b2 5 5 5 10 10 10
+
+# check that progress is tracked for boolean operations
+# bop + operations
+
+set log [bop b1 b2]
+isTracked $log
+set log [bopfuse r]
+isTracked $log
+set log [bopcommon r]
+isTracked $log
+set log [bopcut r]
+isTracked $log
+set log [boptuc r]
+isTracked $log
+set log [bopsection r]
+isTracked $log
+
+# b[operation]
+set log [bfuse r b1 b2]
+isTracked $log
+set log [bcommon r b1 b2]
+isTracked $log
+set log [bcut r b1 b2]
+isTracked $log
+set log [btuc r b1 b2]
+isTracked $log
+set log [bsection r b1 b2]
+isTracked $log
+
+  
+# bfillds + bbop
+
+bclearobjects
+bcleartools
+baddobjects b1
+baddtools b2
+set log [bfillds]
+isTracked $log
+set log [bbop r 0]
+isTracked $log
+set log [bbop r 1]
+isTracked $log
+
+set log [bbop r 2]
+isTracked $log
+set log [bbop r 3]
+isTracked $log
+set log [bbop r 4]
+isTracked $log
+set log [bbuild r]
+isTracked $log
+set log [bsplit r]
+isTracked $log
+
+# API
+set log [bapibop r 0]
+isTracked $log
+
+set log [bapibop r 1]
+isTracked $log
+set log [bapibop r 2]
+isTracked $log
+set log [bapibop r 3]
+isTracked $log
+set log [bapibop r 4]
+isTracked $log
+
+set log [bapibuild r]
+isTracked $log
+
+set log [bapisplit r]
+isTracked $log
+
+# bopcheck
+
+set log [bopcheck r]
+isTracked $log