diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index d2c6e34b70..0b5d7005d7 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -1422,3 +1422,10 @@ The history of the changing of the initial shape was corrected: @subsection upgrade_720_Change_In_RWStl Changes in STL Reader / Writer Class RWStl now uses class Poly_Triangulation for storing triangular mesh instead of StlMesh data classes; the latter have been removed. + +@subsection upgrade_720_New_Error_Warning_system_in_BOA Refactoring of the Error/Warning reporting system in Boolean Component + +The Error/Warning reporting system of the algorithms in Boolean Component (in all BOPAlgo_* and BRepAlgoAPI_* algorithms) has been refactored. +The methods returning the status of errors and warnings of the algorithms (ErrorStatus() and WarningStatus()) have been removed. +Instead use methods HasErrors() and HasWarnings() to check for presence of errors and warnings, respectively. +The full list of errors and warnings, with associated data such as problematic sub-shapes, can be obtained by method GetReport(). diff --git a/dox/user_guides/boolean_operations/boolean_operations.md b/dox/user_guides/boolean_operations/boolean_operations.md index 55da9a7fb4..db2db52ad6 100644 --- a/dox/user_guides/boolean_operations/boolean_operations.md +++ b/dox/user_guides/boolean_operations/boolean_operations.md @@ -540,6 +540,23 @@ The structure *BOPDS_FaceInfo* has the following contents. The objects of type *BOPDS_FaceInfo* are stored in one container of array type. The array allows getting the access to the information by index. This index (if exists) is stored in the field *myReference*. +@section occt_algorithms_root_classes Root Classes + +@subsection occt_algorithms_root_classes_1 Class BOPAlgo_Options +The class *BOPAlgo_Options* provides the following options for the algorithms: +* Set the appropriate memory allocator; +* Check the presence of the Errors and Warnings; +* Turn on/off the parallel processing; +* Set the additional tolerance for the operation; +* Break the operations by user request. + +@subsection occt_algorithms_root_classes_2 Class BOPAlgo_Algo + +The class *BOPAlgo_Algo* provides the base interface for all algorithms: +* Perform the operation; +* Check the input data; +* Check the result. + @section occt_algorithms_5 Intersection Part Intersection Part (IP) is used to @@ -553,17 +570,7 @@ Intersection Part (IP) is used to IP is implemented in the class *BOPAlgo_PaveFiller*. -@figure{/user_guides/boolean_operations/images/operations_image064.svg,"Diagram for Class BOPAlgo_PaveFiller",230} - -@subsection occt_algorithms_5_1a Class BOPAlgo_Algo -The class *BOPAlgo_Algo* provides the base interface for all algorithms to provide the possibility to: -* Get Error status; -* Get Warning status; -* Turn on/off the parallel processing -* Break the operations by user request -* Check data; -* Check the result; -* Set the appropriate memory allocator. +@figure{/user_guides/boolean_operations/images/operations_image064.png,"Diagram for Class BOPAlgo_PaveFiller",230} The description provided in the next paragraphs is coherent with the implementation of the method *BOPAlgo_PaveFiller::Perform()*. @@ -745,8 +752,11 @@ BP is implemented in the following classes: * *BOPAlgo_Builder* -- for the General Fuse operator (GFA). * *BOPAlgo_BOP* -- for the Boolean Operation operator (BOA). * *BOPAlgo_Section* -- for the Section operator (SA). +* *BOPAlgo_MakerVolume* -- for the Volume Maker operator. +* *BOPAlgo_Splitter* -- for the Splitter operator. +* *BOPAlgo_CellsBuilder* -- for the Cells Builder operator. -@figure{/user_guides/boolean_operations/images/operations_image020.svg,"Diagram for BP classes",300} +@figure{/user_guides/boolean_operations/images/operations_image020.png,"Diagram for BP classes",300} The class *BOPAlgo_BuilderShape* provides the interface for algorithms that have: * A Shape as the result; @@ -1088,7 +1098,7 @@ aSplitter.SetNonDestructive(bSafeMode); aSplitter.SetGlue(aGlue); // aSplitter.Perform(); //perform the operation -if (aSplitter.ErrorStatus()) { //check error status +if (aSplitter.HasErrors()) { //check error status return; } // @@ -2061,7 +2071,7 @@ aMV.SetGlue(aGlue); aMV.SetAvoidInternalShapes(bAvoidInternalShapes); // aMV.Perform(); //perform the operation -if (aMV.ErrorStatus()) { //check error status +if (aMV.HasErrors()) { //check error status return; } // @@ -2151,7 +2161,7 @@ aCBuilder.SetNonDestructive(bSafeMode); aCBuilder.SetGlue(aGlue); // aCBuilder.Perform(); // build splits of all arguments (GF) -if (aCBuilder.ErrorStatus()) { // check error status +if (aCBuilder.HasErrors()) { // check error status return; } // @@ -2804,7 +2814,6 @@ The following example illustrates how to use General Fuse operator: #include {… Standard_Boolean bRunParallel; - Standard_Integer iErr; Standard_Real aFuzzyValue; BRepAlgoAPI_BuilderAlgo aBuilder; // @@ -2841,8 +2850,7 @@ The following example illustrates how to use General Fuse operator: // // run the algorithm aBuilder.Build(); - iErr=aBuilder.ErrorStatus(); - if (iErr) { + if (aBuilder.HasErrors()) { // an error treatment return; } @@ -2945,7 +2953,7 @@ aSplitter.SetGlue(aGlueOpt); // run the algorithm aSplitter.Build(); // check error status -if (aSplitter.ErrorStatus()) { +if (aSplitter.HasErrors()) { return; } // @@ -3012,7 +3020,6 @@ The following example illustrates how to use Common operation: #include < BRepAlgoAPI_Common.hxx> {… Standard_Boolean bRunParallel; - Standard_Integer iErr; Standard_Real aFuzzyValue; BRepAlgoAPI_Common aBuilder; @@ -3052,8 +3059,7 @@ The following example illustrates how to use Common operation: // // run the algorithm aBuilder.Build(); - iErr=aBuilder.ErrorStatus(); - if (iErr) { + if (aBuilder.HasErrors()) { // an error treatment return; } @@ -3119,7 +3125,6 @@ The following example illustrates how to use Fuse operation: #include < BRepAlgoAPI_Fuse.hxx> {… Standard_Boolean bRunParallel; - Standard_Integer iErr; Standard_Real aFuzzyValue; BRepAlgoAPI_Fuse aBuilder; @@ -3159,8 +3164,7 @@ The following example illustrates how to use Fuse operation: // // run the algorithm aBuilder.Build(); - iErr=aBuilder.ErrorStatus(); - if (iErr) { + if (aBuilder.HasErrors()) { // an error treatment return; } @@ -3226,7 +3230,6 @@ The following example illustrates how to use Cut operation: #include < BRepAlgoAPI_Cut.hxx> {… Standard_Boolean bRunParallel; - Standard_Integer iErr; Standard_Real aFuzzyValue; BRepAlgoAPI_Cut aBuilder; @@ -3266,8 +3269,7 @@ The following example illustrates how to use Cut operation: // // run the algorithm aBuilder.Build(); - iErr=aBuilder.ErrorStatus(); - if (iErr) { + if (aBuilder.HasErrors()) { // an error treatment return; } @@ -3334,7 +3336,6 @@ The following example illustrates how to use Section operation: #include < BRepAlgoAPI_Section.hxx> {… Standard_Boolean bRunParallel; - Standard_Integer iErr; Standard_Real aFuzzyValue; BRepAlgoAPI_Section aBuilder; @@ -3374,8 +3375,7 @@ The following example illustrates how to use Section operation: // // run the algorithm aBuilder.Build(); - iErr=aBuilder.ErrorStatus(); - if (iErr) { + if (aBuilder.HasErrors()) { // an error treatment return; } diff --git a/dox/user_guides/boolean_operations/images/operations_image020.png b/dox/user_guides/boolean_operations/images/operations_image020.png new file mode 100644 index 0000000000..ab193885c5 Binary files /dev/null and b/dox/user_guides/boolean_operations/images/operations_image020.png differ diff --git a/dox/user_guides/boolean_operations/images/operations_image020.svg b/dox/user_guides/boolean_operations/images/operations_image020.svg deleted file mode 100644 index 6a63c0f6d2..0000000000 --- a/dox/user_guides/boolean_operations/images/operations_image020.svg +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - BOPAlgo_BuilderShape - - - - BOPAlgo_Algo - - - - BOPAlgo_Builder - - - - - - BOPAlgo_BOP - - - BOPAlgo_Section - - - - - diff --git a/dox/user_guides/boolean_operations/images/operations_image064.png b/dox/user_guides/boolean_operations/images/operations_image064.png new file mode 100644 index 0000000000..adf1ef34c4 Binary files /dev/null and b/dox/user_guides/boolean_operations/images/operations_image064.png differ diff --git a/dox/user_guides/boolean_operations/images/operations_image064.svg b/dox/user_guides/boolean_operations/images/operations_image064.svg deleted file mode 100644 index b1000b4996..0000000000 --- a/dox/user_guides/boolean_operations/images/operations_image064.svg +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - BOPAlgo_Algo - - - - - - - BOPAlgo_PaveFiller - - - - - - - - - diff --git a/dox/user_guides/boolean_operations/images/operations_image065.png b/dox/user_guides/boolean_operations/images/operations_image065.png index 53161ce848..d026161786 100644 Binary files a/dox/user_guides/boolean_operations/images/operations_image065.png and b/dox/user_guides/boolean_operations/images/operations_image065.png differ diff --git a/src/BOPAlgo/BOPAlgo_MakerVolume.hxx b/src/BOPAlgo/BOPAlgo_MakerVolume.hxx index f4ea8e06e6..9ad6924dc5 100644 --- a/src/BOPAlgo/BOPAlgo_MakerVolume.hxx +++ b/src/BOPAlgo/BOPAlgo_MakerVolume.hxx @@ -102,8 +102,8 @@ class BOPAlgo_PaveFiller; //! aMV.SetIntersect(bIntersect); //intersect or not the shapes from //! // //! aMV.Perform(); //perform the operation -//! if (aMV.ErrorStatus()) { //check error status -//! return; +//! if (aMV.HasErrors()) { //check error status +//! return; //! } //! // //! const TopoDS_Shape& aResult = aMV.Shape(); //result of the operation