From: akaftasev Date: Tue, 31 Aug 2021 14:53:17 +0000 (+0300) Subject: another remarks X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR21264_2;p=occt-copy.git another remarks --- diff --git a/dox/upgrade/upgrade.md b/dox/upgrade/upgrade.md index b5f57b5838..24233e8740 100644 --- a/dox/upgrade/upgrade.md +++ b/dox/upgrade/upgrade.md @@ -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 +~~~~ diff --git a/src/BOPAlgo/BOPAlgo_Algo.hxx b/src/BOPAlgo/BOPAlgo_Algo.hxx index 8043b06bd1..d65caf1878 100644 --- a/src/BOPAlgo/BOPAlgo_Algo.hxx +++ b/src/BOPAlgo/BOPAlgo_Algo.hxx @@ -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()) diff --git a/src/BOPAlgo/BOPAlgo_BOP.cxx b/src/BOPAlgo/BOPAlgo_BOP.cxx index de8e7ebf23..f4e31259a3 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP.cxx @@ -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.); } diff --git a/src/BOPAlgo/BOPAlgo_Builder.hxx b/src/BOPAlgo/BOPAlgo_Builder.hxx index 8d23567638..1d908c79bc 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.hxx +++ b/src/BOPAlgo/BOPAlgo_Builder.hxx @@ -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, diff --git a/src/BOPAlgo/BOPAlgo_Builder_1.cxx b/src/BOPAlgo/BOPAlgo_Builder_1.cxx index 125f91c5ab..f343f9d274 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_1.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_1.cxx @@ -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; } } } diff --git a/src/BOPAlgo/BOPAlgo_Builder_2.cxx b/src/BOPAlgo/BOPAlgo_Builder_2.cxx index 5611cc04f7..186cd88399 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_2.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_2.cxx @@ -125,7 +125,7 @@ typedef NCollection_Vector 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 { diff --git a/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx b/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx index f8ab363c34..d607cba573 100644 --- a/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx +++ b/src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx @@ -233,8 +233,6 @@ class BOPAlgo_SolidSolid : public BOPAlgo_ShapeSolid { myHasInterf=myDS->HasInterfShapeSubShapes(myIE, myIZ, bFlag); } }; -protected: - Message_ProgressRange myProgressRange; }; //======================================================================= typedef NCollection_Vector BOPAlgo_VectorOfSolidSolid; diff --git a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx index bd1cd3a420..8ad6fc0db4 100644 --- a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx +++ b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx @@ -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; } // diff --git a/src/BOPAlgo/BOPAlgo_Splitter.cxx b/src/BOPAlgo/BOPAlgo_Splitter.cxx index e350c63c82..a79e2fe310 100644 --- a/src/BOPAlgo/BOPAlgo_Splitter.cxx +++ b/src/BOPAlgo/BOPAlgo_Splitter.cxx @@ -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 index 0000000000..30f898b775 --- /dev/null +++ b/tests/bugs/modalg_7/bug21264 @@ -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