From 855a03e106c2deb2d7b13f412221657256263413 Mon Sep 17 00:00:00 2001 From: akaftasev Date: Thu, 18 Mar 2021 19:44:11 +0300 Subject: [PATCH] 0021264: Modeling Algorithms - Progress indicator for Boolean operations Update BOP commands to use progress indicator Deleted wrong usage of progress indicator from bop operations --- src/BOPAlgo/BOPAlgo_Algo.hxx | 3 +- src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx | 65 +++++--- src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.hxx | 2 +- src/BOPAlgo/BOPAlgo_BOP.cxx | 72 +++++---- src/BOPAlgo/BOPAlgo_BOP.hxx | 6 +- src/BOPAlgo/BOPAlgo_Builder.cxx | 63 ++++---- src/BOPAlgo/BOPAlgo_Builder.hxx | 20 +-- src/BOPAlgo/BOPAlgo_BuilderFace.cxx | 22 ++- src/BOPAlgo/BOPAlgo_BuilderFace.hxx | 2 +- src/BOPAlgo/BOPAlgo_BuilderSolid.cxx | 22 ++- src/BOPAlgo/BOPAlgo_BuilderSolid.hxx | 2 +- src/BOPAlgo/BOPAlgo_Builder_1.cxx | 36 ++++- src/BOPAlgo/BOPAlgo_Builder_2.cxx | 37 ++--- src/BOPAlgo/BOPAlgo_Builder_3.cxx | 21 ++- src/BOPAlgo/BOPAlgo_CellsBuilder.cxx | 7 +- src/BOPAlgo/BOPAlgo_CellsBuilder.hxx | 2 +- src/BOPAlgo/BOPAlgo_CheckerSI.cxx | 22 +-- src/BOPAlgo/BOPAlgo_CheckerSI.hxx | 4 +- src/BOPAlgo/BOPAlgo_MakerVolume.cxx | 44 +++--- src/BOPAlgo/BOPAlgo_MakerVolume.hxx | 4 +- src/BOPAlgo/BOPAlgo_Options.cxx | 26 ---- src/BOPAlgo/BOPAlgo_Options.hxx | 17 --- src/BOPAlgo/BOPAlgo_PaveFiller.cxx | 139 +++++++++++++----- src/BOPAlgo/BOPAlgo_PaveFiller.hxx | 39 ++--- src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx | 15 +- src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx | 52 +++++-- src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx | 107 +++++++++++--- src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx | 42 ++++-- src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx | 103 ++++++++++--- src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx | 101 ++++++++++--- src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx | 100 +++++++++---- src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx | 2 +- src/BOPAlgo/BOPAlgo_RemoveFeatures.hxx | 2 +- src/BOPAlgo/BOPAlgo_Section.cxx | 34 ++++- src/BOPAlgo/BOPAlgo_Section.hxx | 4 +- src/BOPAlgo/BOPAlgo_ShellSplitter.cxx | 2 +- src/BOPAlgo/BOPAlgo_ShellSplitter.hxx | 2 +- src/BOPAlgo/BOPAlgo_Splitter.cxx | 16 +- src/BOPAlgo/BOPAlgo_Splitter.hxx | 2 +- src/BOPAlgo/BOPAlgo_Tools.cxx | 9 +- src/BOPAlgo/BOPAlgo_WireSplitter.cxx | 2 +- src/BOPAlgo/BOPAlgo_WireSplitter.hxx | 2 +- src/BOPTest/BOPTest_APICommands.cxx | 26 +++- src/BOPTest/BOPTest_BOPCommands.cxx | 66 +++++++-- src/BOPTest/BOPTest_CellsCommands.cxx | 11 +- src/BOPTest/BOPTest_CheckCommands.cxx | 18 ++- src/BOPTest/BOPTest_PartitionCommands.cxx | 17 ++- src/BRepAlgo/BRepAlgo_Section.cxx | 2 +- src/BRepAlgo/BRepAlgo_Section.hxx | 2 +- src/BRepAlgoAPI/BRepAlgoAPI_Algo.hxx | 1 - .../BRepAlgoAPI_BooleanOperation.cxx | 15 +- .../BRepAlgoAPI_BooleanOperation.hxx | 2 +- src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx | 26 ++-- src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.hxx | 6 +- src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx | 23 +-- src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx | 11 +- src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx | 12 +- src/BRepAlgoAPI/BRepAlgoAPI_Cut.hxx | 7 +- src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx | 2 +- src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.hxx | 2 +- src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx | 12 +- src/BRepAlgoAPI/BRepAlgoAPI_Fuse.hxx | 6 +- src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx | 5 +- src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx | 2 +- src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx | 9 +- src/BRepAlgoAPI/BRepAlgoAPI_Splitter.hxx | 2 +- .../BRepBuilderAPI_MakeShape.cxx | 2 +- .../BRepBuilderAPI_MakeShape.hxx | 3 +- src/BRepFeat/BRepFeat_Builder.cxx | 18 ++- src/BRepFeat/BRepFeat_Builder.hxx | 2 +- src/BRepFeat/BRepFeat_Gluer.cxx | 2 +- src/BRepFeat/BRepFeat_Gluer.hxx | 2 +- src/BRepFeat/BRepFeat_SplitShape.cxx | 2 +- src/BRepFeat/BRepFeat_SplitShape.hxx | 2 +- .../BRepFilletAPI_MakeChamfer.cxx | 2 +- .../BRepFilletAPI_MakeChamfer.hxx | 2 +- .../BRepFilletAPI_MakeFillet.cxx | 2 +- .../BRepFilletAPI_MakeFillet.hxx | 2 +- .../BRepFilletAPI_MakeFillet2d.cxx | 2 +- .../BRepFilletAPI_MakeFillet2d.hxx | 2 +- .../BRepOffsetAPI_DraftAngle.cxx | 2 +- .../BRepOffsetAPI_DraftAngle.hxx | 2 +- .../BRepOffsetAPI_MakeEvolved.cxx | 2 +- .../BRepOffsetAPI_MakeEvolved.hxx | 2 +- .../BRepOffsetAPI_MakeFilling.cxx | 2 +- .../BRepOffsetAPI_MakeFilling.hxx | 2 +- .../BRepOffsetAPI_MakeOffset.cxx | 2 +- .../BRepOffsetAPI_MakeOffset.hxx | 2 +- .../BRepOffsetAPI_MakeOffsetShape.cxx | 2 +- .../BRepOffsetAPI_MakeOffsetShape.hxx | 2 +- src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.cxx | 2 +- src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx | 2 +- .../BRepOffsetAPI_MakePipeShell.cxx | 2 +- .../BRepOffsetAPI_MakePipeShell.hxx | 2 +- .../BRepOffsetAPI_MakeThickSolid.cxx | 2 +- .../BRepOffsetAPI_MakeThickSolid.hxx | 2 +- .../BRepOffsetAPI_MiddlePath.cxx | 2 +- .../BRepOffsetAPI_MiddlePath.hxx | 2 +- .../BRepOffsetAPI_NormalProjection.cxx | 2 +- .../BRepOffsetAPI_NormalProjection.hxx | 2 +- .../BRepOffsetAPI_ThruSections.cxx | 2 +- .../BRepOffsetAPI_ThruSections.hxx | 2 +- src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx | 2 +- src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.hxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakeBox.hxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.cxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.hxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakePrism.cxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakePrism.hxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakeRevol.hxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx | 2 +- src/BRepPrimAPI/BRepPrimAPI_MakeWedge.hxx | 2 +- src/BRepTest/BRepTest_FilletCommands.cxx | 21 ++- src/IntTools/IntTools_BeanFaceIntersector.cxx | 5 +- src/IntTools/IntTools_BeanFaceIntersector.hxx | 1 + src/IntTools/IntTools_EdgeFace.hxx | 1 + src/IntTools/IntTools_FaceFace.cxx | 4 +- src/IntTools/IntTools_FaceFace.hxx | 3 +- .../ShapeConstruct_MakeTriangulation.cxx | 2 +- .../ShapeConstruct_MakeTriangulation.hxx | 2 +- 122 files changed, 1150 insertions(+), 561 deletions(-) diff --git a/src/BOPAlgo/BOPAlgo_Algo.hxx b/src/BOPAlgo/BOPAlgo_Algo.hxx index fb62632d28..2af11c6e78 100644 --- a/src/BOPAlgo/BOPAlgo_Algo.hxx +++ b/src/BOPAlgo/BOPAlgo_Algo.hxx @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -31,7 +32,7 @@ public: DEFINE_STANDARD_ALLOC - Standard_EXPORT virtual void Perform() = 0; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) = 0; protected: diff --git a/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx b/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx index e92da635d8..008e2560ff 100644 --- a/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx +++ b/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx @@ -151,81 +151,99 @@ void BOPAlgo_ArgumentAnalyzer::Prepare() // function: Perform // purpose: // ================================================================================ -void BOPAlgo_ArgumentAnalyzer::Perform() +void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, "Analyze", 1); try { OCC_CATCH_SIGNALS myResult.Clear(); - // - UserBreak(); - // + if (!aPS.More()) + { + return; + } // 1. Prepare Prepare(); // - UserBreak(); - // // 2. Test types if(myArgumentTypeMode) { TestTypes(); + if (!aPS.More()) + { + return; + } } // - UserBreak(); - // // 3. Test self-interference if(mySelfInterMode) { TestSelfInterferences(); + if (!aPS.More()) + { + return; + } } // - UserBreak(); - // // 4. Test small edges if(mySmallEdgeMode) { if(!(!myResult.IsEmpty() && myStopOnFirst)) TestSmallEdge(); + if (!aPS.More()) + { + return; + } } // - UserBreak(); - // // 5. Test possibility to rebuild faces if(myRebuildFaceMode) { if(!(!myResult.IsEmpty() && myStopOnFirst)) TestRebuildFace(); + if (!aPS.More()) + { + return; + } } // - UserBreak(); - // // 6. Test tangent if(myTangentMode) { - if(!(!myResult.IsEmpty() && myStopOnFirst)) + if (!(!myResult.IsEmpty() && myStopOnFirst)) + { TestTangent(); + if (!aPS.More()) + { + return; + } + } } // - UserBreak(); - // // 7. Test merge vertices if(myMergeVertexMode) { if(!(!myResult.IsEmpty() && myStopOnFirst)) TestMergeVertex(); + if (!aPS.More()) + { + return; + } } // - UserBreak(); - // // 8. Test merge edges if(myMergeEdgeMode) { if(!(!myResult.IsEmpty() && myStopOnFirst)) TestMergeEdge(); + if (!aPS.More()) + { + return; + } } // - UserBreak(); - // // 9. Test shapes continuity if(myContinuityMode) { if(!(!myResult.IsEmpty() && myStopOnFirst)) TestContinuity(); + if (!aPS.More()) + { + return; + } } // - UserBreak(); - // // 10. Test validity of the curves on the surfaces if(myCurveOnSurfaceMode) { if(!(!myResult.IsEmpty() && myStopOnFirst)) @@ -357,7 +375,6 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences() aChecker.SetNonDestructive(Standard_True); aChecker.SetRunParallel(myRunParallel); aChecker.SetFuzzyValue(myFuzzyValue); - aChecker.SetProgressIndicator(*myProgressScope); // aChecker.Perform(); Standard_Boolean hasError = aChecker.HasErrors(); diff --git a/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.hxx b/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.hxx index b26d3d2c3c..fa2f528da4 100644 --- a/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.hxx +++ b/src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.hxx @@ -97,7 +97,7 @@ Standard_EXPORT virtual ~BOPAlgo_ArgumentAnalyzer(); Standard_Boolean& CurveOnSurfaceMode(); //! performs analysis - Standard_EXPORT void Perform(); + Standard_EXPORT void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()); //! result of test Standard_EXPORT Standard_Boolean HasFaulty() const; diff --git a/src/BOPAlgo/BOPAlgo_BOP.cxx b/src/BOPAlgo/BOPAlgo_BOP.cxx index b3367e2eb0..bd0eb4220c 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP.cxx @@ -353,7 +353,7 @@ void BOPAlgo_BOP::BuildResult(const TopAbs_ShapeEnum theType) //function : Perform //purpose : //======================================================================= -void BOPAlgo_BOP::Perform() +void BOPAlgo_BOP::Perform(const Message_ProgressRange& theRange) { Handle(NCollection_BaseAllocator) aAllocator; BOPAlgo_PaveFiller* pPF; @@ -387,25 +387,27 @@ void BOPAlgo_BOP::Perform() pPF=new BOPAlgo_PaveFiller(aAllocator); pPF->SetArguments(aLS); pPF->SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - pPF->SetProgressIndicator(*myProgressScope); - } + Message_ProgressScope aPS(theRange, "BOPAlgo_BOP::Perform()", 10); + pPF->SetFuzzyValue(myFuzzyValue); pPF->SetNonDestructive(myNonDestructive); pPF->SetGlue(myGlue); pPF->SetUseOBB(myUseOBB); // - pPF->Perform(); + pPF->Perform(aPS.Next(9)); // + if (!aPS.More()) + { + return; + } myEntryPoint=1; - PerformInternal(*pPF); + PerformInternal(*pPF, aPS.Next(1)); } //======================================================================= //function : PerformInternal1 //purpose : //======================================================================= -void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) +void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange) { myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller; myDS=myPaveFiller->PDS(); @@ -434,10 +436,11 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } } // + Message_ProgressScope aPS(theRange, "PerformInternal", 100); // 3. Fill Images // 3.1 Vertices - FillImagesVertices(); - if (HasErrors()) { + FillImagesVertices(aPS.Next(5)); // 5 + if (HasErrors() || !aPS.More()) { return; } // @@ -446,8 +449,8 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) return; } // 3.2 Edges - FillImagesEdges(); - if (HasErrors()) { + FillImagesEdges(aPS.Next(5)); // 10 + if (HasErrors() || !aPS.More()) { return; } // @@ -457,8 +460,8 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // // 3.3 Wires - FillImagesContainers(TopAbs_WIRE); - if (HasErrors()) { + FillImagesContainers(TopAbs_WIRE, aPS.Next(10)); // 20 + if (HasErrors() || !aPS.More()) { return; } // @@ -468,19 +471,19 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // // 3.4 Faces - FillImagesFaces(); - if (HasErrors()) { + FillImagesFaces(aPS.Next(30)); // 50 + if (HasErrors() || !aPS.More()) { return; } - + BuildResult(TopAbs_FACE); if (HasErrors()) { return; } // // 3.5 Shells - FillImagesContainers(TopAbs_SHELL); - if (HasErrors()) { + FillImagesContainers(TopAbs_SHELL, aPS.Next(10)); // 60 + if (HasErrors() || !aPS.More()) { return; } // @@ -490,8 +493,8 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // // 3.6 Solids - FillImagesSolids(); - if (HasErrors()) { + FillImagesSolids(aPS.Next(5)); // 65 + if (HasErrors() || !aPS.More()) { return; } // @@ -501,8 +504,8 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // // 3.7 CompSolids - FillImagesContainers(TopAbs_COMPSOLID); - if (HasErrors()) { + FillImagesContainers(TopAbs_COMPSOLID, aPS.Next(10)); // 75 + if (HasErrors() || !aPS.More()) { return; } // @@ -512,8 +515,8 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // // 3.8 Compounds - FillImagesCompounds(); - if (HasErrors()) { + FillImagesCompounds(aPS.Next(10)); // 85 + if (HasErrors() || !aPS.More()) { return; } // @@ -523,8 +526,8 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // // 4.BuildShape; - BuildShape(); - if (HasErrors()) { + BuildShape(aPS.Next(15)); // 100 + if (HasErrors() || !aPS.More()) { return; } // @@ -768,8 +771,9 @@ void BOPAlgo_BOP::BuildRC() //function : BuildShape //purpose : //======================================================================= -void BOPAlgo_BOP::BuildShape() +void BOPAlgo_BOP::BuildShape(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, "BuildShape", 1); if (myDims[0] == 3 && myDims[1] == 3) { // For the Boolean operation on solids we need to check first @@ -830,6 +834,10 @@ void BOPAlgo_BOP::BuildShape() TopTools_MapOfShape aMInpFence; aItLS.Initialize(aLSC); for (; aItLS.More(); aItLS.Next()) { + if (!aPS.More()) + { + return; + } const TopoDS_Shape& aSC = aItLS.Value(); aMInpFence.Add(aSC); // @@ -837,6 +845,10 @@ void BOPAlgo_BOP::BuildShape() // aIt.Initialize(aSC); for (; aIt.More(); aIt.Next()) { + if (!aPS.More()) + { + return; + } const TopoDS_Shape& aS = aIt.Value(); if (myImages.IsBound(aS)) { const TopTools_ListOfShape& aLSIm = myImages.Find(aS); @@ -935,6 +947,10 @@ void BOPAlgo_BOP::BuildShape() aItLS.Initialize(aLSNonCont); for (; aItLS.More(); aItLS.Next()) { + if (!aPS.More()) + { + return; + } const TopoDS_Shape& aS = aItLS.Value(); if (myImages.IsBound(aS)) { diff --git a/src/BOPAlgo/BOPAlgo_BOP.hxx b/src/BOPAlgo/BOPAlgo_BOP.hxx index 4598262348..12f5e9bd2a 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.hxx +++ b/src/BOPAlgo/BOPAlgo_BOP.hxx @@ -84,7 +84,7 @@ public: Standard_EXPORT BOPAlgo_Operation Operation() const; - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; protected: @@ -92,11 +92,11 @@ protected: //! Performs calculations using prepared Filler //! object - Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE; + Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; Standard_EXPORT virtual void BuildResult (const TopAbs_ShapeEnum theType) Standard_OVERRIDE; - Standard_EXPORT void BuildShape(); + Standard_EXPORT void BuildShape(const Message_ProgressRange& theRange); Standard_EXPORT void BuildRC(); diff --git a/src/BOPAlgo/BOPAlgo_Builder.cxx b/src/BOPAlgo/BOPAlgo_Builder.cxx index 7ef864a1b6..cbce0d660b 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder.cxx @@ -177,7 +177,7 @@ void BOPAlgo_Builder::Prepare() //function : Perform //purpose : //======================================================================= -void BOPAlgo_Builder::Perform() +void BOPAlgo_Builder::Perform(const Message_ProgressRange& theRange) { GetReport()->Clear(); // @@ -195,25 +195,26 @@ void BOPAlgo_Builder::Perform() // pPF->SetArguments(myArguments); pPF->SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - pPF->SetProgressIndicator(*myProgressScope); - } + Message_ProgressScope aPS(theRange, "BOPAlgo_Builder::Perform()", 10); pPF->SetFuzzyValue(myFuzzyValue); pPF->SetNonDestructive(myNonDestructive); pPF->SetGlue(myGlue); pPF->SetUseOBB(myUseOBB); // - pPF->Perform(); + pPF->Perform(aPS.Next(9)); // + if (!aPS.More()) + { + return; + } myEntryPoint=1; - PerformInternal(*pPF); + PerformInternal(*pPF, aPS.Next(1)); } //======================================================================= //function : PerformWithFiller //purpose : //======================================================================= -void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller) +void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange) { GetReport()->Clear(); myEntryPoint=0; @@ -221,19 +222,20 @@ void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller) myFuzzyValue = theFiller.FuzzyValue(); myGlue = theFiller.Glue(); myUseOBB = theFiller.UseOBB(); - PerformInternal(theFiller); + Message_ProgressScope aPS(theRange, NULL, 1); + PerformInternal(theFiller, aPS.Next()); } //======================================================================= //function : PerformInternal //purpose : //======================================================================= -void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller) +void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange) { GetReport()->Clear(); // try { OCC_CATCH_SIGNALS - PerformInternal1(theFiller); + PerformInternal1(theFiller, theRange); } // catch (Standard_Failure const&) { @@ -244,7 +246,7 @@ void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller) //function : PerformInternal1 //purpose : //======================================================================= -void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) +void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange) { myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller; myDS=myPaveFiller->PDS(); @@ -252,6 +254,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) myFuzzyValue = myPaveFiller->FuzzyValue(); myNonDestructive = myPaveFiller->NonDestructive(); // + Message_ProgressScope aPS(theRange, "PerformInternal", 100); // 1. CheckData CheckData(); if (HasErrors()) { @@ -266,8 +269,8 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) // // 3. Fill Images // 3.1 Vertice - FillImagesVertices(); - if (HasErrors()) { + FillImagesVertices(aPS.Next(10)); // 10 + if (HasErrors() || !aPS.More()) { return; } // @@ -276,8 +279,8 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) return; } // 3.2 Edges - FillImagesEdges(); - if (HasErrors()) { + FillImagesEdges(aPS.Next(10)); // 20 + if (HasErrors() || !aPS.More()) { return; } // @@ -287,8 +290,8 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // // 3.3 Wires - FillImagesContainers(TopAbs_WIRE); - if (HasErrors()) { + FillImagesContainers(TopAbs_WIRE, aPS.Next(10)); // 30 + if (HasErrors() || !aPS.More()) { return; } // @@ -298,8 +301,8 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // 3.4 Faces - FillImagesFaces(); - if (HasErrors()) { + FillImagesFaces(aPS.Next(30)); // 60 + if (HasErrors() || !aPS.More()) { return; } // @@ -308,8 +311,8 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) return; } // 3.5 Shells - FillImagesContainers(TopAbs_SHELL); - if (HasErrors()) { + FillImagesContainers(TopAbs_SHELL, aPS.Next(10)); // 70 + if (HasErrors() || !aPS.More()) { return; } @@ -318,8 +321,8 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) return; } // 3.6 Solids - FillImagesSolids(); - if (HasErrors()) { + FillImagesSolids(aPS.Next(10)); // 80 + if (HasErrors() || !aPS.More()) { return; } @@ -328,8 +331,8 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) return; } // 3.7 CompSolids - FillImagesContainers(TopAbs_COMPSOLID); - if (HasErrors()) { + FillImagesContainers(TopAbs_COMPSOLID, aPS.Next(10)); // 90 + if (HasErrors() || !aPS.More()) { return; } @@ -339,8 +342,8 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) } // 3.8 Compounds - FillImagesCompounds(); - if (HasErrors()) { + FillImagesCompounds(aPS.Next(10)); // 100 + if (HasErrors() || !aPS.More()) { return; } @@ -635,10 +638,6 @@ void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects, aBS.SetRunParallel(myRunParallel); aBS.SetContext(myContext); aBS.SetFuzzyValue(myFuzzyValue); - if (myProgressScope != NULL) - { - aBS.SetProgressIndicator(*myProgressScope); - } aBS.Perform(); // Resulting solids diff --git a/src/BOPAlgo/BOPAlgo_Builder.hxx b/src/BOPAlgo/BOPAlgo_Builder.hxx index 2d8d1e97c9..d20ca1beb3 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.hxx +++ b/src/BOPAlgo/BOPAlgo_Builder.hxx @@ -169,11 +169,11 @@ public: //! @name Performing the operation //! Performs the operation. //! The intersection will be performed also. - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Performs the operation with the prepared filler. //! The intersection will not be performed in this case. - Standard_EXPORT virtual void PerformWithFiller (const BOPAlgo_PaveFiller& theFiller); + Standard_EXPORT virtual void PerformWithFiller (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange = Message_ProgressRange()); public: //! @name BOPs on open solids @@ -339,12 +339,12 @@ protected: //! @name Methods for building the result //! Performs the building of the result. //! The method calls the PerformInternal1() method surrounded by a try-catch block. - Standard_EXPORT virtual void PerformInternal (const BOPAlgo_PaveFiller& thePF); + Standard_EXPORT virtual void PerformInternal (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange = Message_ProgressRange()); //! Performs the building of the result. //! To build the result of any other operation //! it will be necessary to override this method. - Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF); + Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange = Message_ProgressRange()); //! Builds the result of operation. //! The method is called for each of the arguments type and @@ -367,19 +367,19 @@ protected: //! @name Checking input arguments protected: //! @name Fill Images of VERTICES //! Fills the images of vertices. - Standard_EXPORT void FillImagesVertices(); + Standard_EXPORT void FillImagesVertices(const Message_ProgressRange& theRange); protected: //! @name Fill Images of EDGES //! Fills the images of edges. - Standard_EXPORT void FillImagesEdges(); + Standard_EXPORT void FillImagesEdges(const Message_ProgressRange& theRange); protected: //! @name Fill Images of CONTAINERS //! Fills the images of containers (WIRES/SHELLS/COMPSOLID). - Standard_EXPORT void FillImagesContainers (const TopAbs_ShapeEnum theType); + Standard_EXPORT void FillImagesContainers (const TopAbs_ShapeEnum theType, const Message_ProgressRange& theRange); //! Builds the image of the given container using the splits //! of its sub-shapes. @@ -393,7 +393,7 @@ protected: //! @name Fill Images of FACES //! 1. Build the splits of faces; //! 2. Find SD faces; //! 3. Add internal vertices (if any) to faces. - Standard_EXPORT void FillImagesFaces(); + Standard_EXPORT void FillImagesFaces(const Message_ProgressRange& theRange); //! Builds the splits of faces using the information from the //! intersection stage stored in Data Structure. @@ -416,7 +416,7 @@ protected: //! @name Fill Images of SOLIDS //! 2. Find faces from other arguments located inside the solids; //! 3. Build splits of solid using the inside faces; //! 4. Fill internal shapes for the splits (Wires and vertices). - Standard_EXPORT void FillImagesSolids(); + Standard_EXPORT void FillImagesSolids(const Message_ProgressRange& theRange); //! Builds the draft solid by rebuilding the shells of the solid //! with the splits of faces. @@ -439,7 +439,7 @@ protected: //! @name Fill Images of SOLIDS protected: //! @name Fill Images of COMPOUNDS //! Fills the images of compounds. - Standard_EXPORT void FillImagesCompounds(); + Standard_EXPORT void FillImagesCompounds(const Message_ProgressRange& theRange); //! Builds the image of the given compound. Standard_EXPORT void FillImagesCompound (const TopoDS_Shape& theS, diff --git a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx index 8fe38f13ff..f4ddc32c8d 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx @@ -141,7 +141,7 @@ void BOPAlgo_BuilderFace::CheckData() //function : Perform //purpose : //======================================================================= -void BOPAlgo_BuilderFace::Perform() +void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& theRange) { GetReport()->Clear(); // @@ -150,28 +150,40 @@ void BOPAlgo_BuilderFace::Perform() return; } // - UserBreak(); + if (!theRange.More()) + { + return; + } // PerformShapesToAvoid(); if (HasErrors()) { return; } // - UserBreak(); + if (!theRange.More()) + { + return; + } // PerformLoops(); if (HasErrors()) { return; } // - UserBreak(); + if (!theRange.More()) + { + return; + } // PerformAreas(); if (HasErrors()) { return; } // - UserBreak(); + if (!theRange.More()) + { + return; + } // PerformInternalShapes(); if (HasErrors()) { diff --git a/src/BOPAlgo/BOPAlgo_BuilderFace.hxx b/src/BOPAlgo/BOPAlgo_BuilderFace.hxx index 4ded4e6cc3..2bc2966151 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderFace.hxx +++ b/src/BOPAlgo/BOPAlgo_BuilderFace.hxx @@ -54,7 +54,7 @@ Standard_EXPORT virtual ~BOPAlgo_BuilderFace(); Standard_EXPORT const TopoDS_Face& Face() const; //! Performs the algorithm - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; Standard_EXPORT TopAbs_Orientation Orientation() const; diff --git a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx index a024a4f2ca..fac47dd9e1 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx @@ -106,7 +106,7 @@ BOPAlgo_BuilderSolid::~BOPAlgo_BuilderSolid() //function : Perform //purpose : //======================================================================= -void BOPAlgo_BuilderSolid::Perform() +void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& theRange) { GetReport()->Clear(); // @@ -130,28 +130,40 @@ void BOPAlgo_BuilderSolid::Perform() aBB.Add(aC, aF); } // - UserBreak(); + if (!theRange.More()) + { + return; + } // PerformShapesToAvoid(); if (HasErrors()) { return; } // - UserBreak(); + if (!theRange.More()) + { + return; + } // PerformLoops(); if (HasErrors()) { return; } // - UserBreak(); + if (!theRange.More()) + { + return; + } // PerformAreas(); if (HasErrors()) { return; } // - UserBreak(); + if (!theRange.More()) + { + return; + } // PerformInternalShapes(); if (HasErrors()) { diff --git a/src/BOPAlgo/BOPAlgo_BuilderSolid.hxx b/src/BOPAlgo/BOPAlgo_BuilderSolid.hxx index 756d1861e8..787c806cfb 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderSolid.hxx +++ b/src/BOPAlgo/BOPAlgo_BuilderSolid.hxx @@ -96,7 +96,7 @@ public: //! @name Constructors public: //! @name Performing the operation //! Performs the construction of the solids from the given faces - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; public: //! @name Getting the bounding boxes of the created solids diff --git a/src/BOPAlgo/BOPAlgo_Builder_1.cxx b/src/BOPAlgo/BOPAlgo_Builder_1.cxx index 90767d6982..3b1bf36250 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_1.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_1.cxx @@ -38,11 +38,16 @@ //function : FillImagesVertices //purpose : //======================================================================= -void BOPAlgo_Builder::FillImagesVertices() +void BOPAlgo_Builder::FillImagesVertices(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, "FillImagesVertices", myDS->ShapesSD().Size()); TColStd_DataMapIteratorOfDataMapOfIntegerInteger aIt(myDS->ShapesSD()); - for (; aIt.More(); aIt.Next()) + for (; aIt.More(); aIt.Next(), aPS.Next()) { + if (!aPS.More()) + { + return; + } Standard_Integer nV = aIt.Key(); Standard_Integer nVSD = aIt.Value(); @@ -63,10 +68,15 @@ void BOPAlgo_Builder::FillImagesVertices() //function : FillImagesEdges //purpose : //======================================================================= - void BOPAlgo_Builder::FillImagesEdges() + void BOPAlgo_Builder::FillImagesEdges(const Message_ProgressRange& theRange) { Standard_Integer i, aNbS = myDS->NbSourceShapes(); - for (i = 0; i < aNbS; ++i) { + Message_ProgressScope aPS(theRange, "FillImagesEdges", aNbS); + for (i = 0; i < aNbS; ++i, aPS.Next()) { + if (!aPS.More()) + { + return; + } const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i); if (aSI.ShapeType() != TopAbs_EDGE) { continue; @@ -149,13 +159,18 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType) // function: FillImagesContainers // purpose: //======================================================================= - void BOPAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType) + void BOPAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType, const Message_ProgressRange& theRange) { Standard_Integer i, aNbS; TopTools_MapOfShape aMFP(100, myAllocator); // aNbS=myDS->NbSourceShapes(); - for (i=0; iShapeInfo(i); if (aSI.ShapeType()==theType) { const TopoDS_Shape& aC=aSI.Shape(); @@ -167,13 +182,18 @@ void BOPAlgo_Builder::BuildResult(const TopAbs_ShapeEnum theType) // function: FillImagesCompounds // purpose: //======================================================================= - void BOPAlgo_Builder::FillImagesCompounds() + void BOPAlgo_Builder::FillImagesCompounds(const Message_ProgressRange& theRange) { Standard_Integer i, aNbS; TopTools_MapOfShape aMFP(100, myAllocator); // aNbS=myDS->NbSourceShapes(); - for (i=0; iShapeInfo(i); if (aSI.ShapeType()==TopAbs_COMPOUND) { const TopoDS_Shape& aC=aSI.Shape(); diff --git a/src/BOPAlgo/BOPAlgo_Builder_2.cxx b/src/BOPAlgo/BOPAlgo_Builder_2.cxx index a0a2fc870c..3464b3de39 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_2.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_2.cxx @@ -102,8 +102,11 @@ class BOPAlgo_PairOfShapeBoolean : public BOPAlgo_Algo { return myContext; } // - virtual void Perform() { - BOPAlgo_Algo::UserBreak(); + virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) { + if (!theRange.More()) + { + return; + } // const TopoDS_Face& aFj=*((TopoDS_Face*)&myShape1); const TopoDS_Face& aFk=*((TopoDS_Face*)&myShape2); @@ -169,10 +172,13 @@ class BOPAlgo_VFI : public BOPAlgo_Algo { return myContext; } // - virtual void Perform() { + virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) { Standard_Real aT1, aT2, dummy; // - BOPAlgo_Algo::UserBreak(); + if (!theRange.More()) + { + return; + } Standard_Integer iFlag = myContext->ComputeVF(myV, myF, aT1, aT2, dummy, myFuzzyValue); myIsInternal = (iFlag == 0); @@ -191,10 +197,19 @@ typedef NCollection_Vector BOPAlgo_VectorOfVFI; //function : FillImagesFaces //purpose : //======================================================================= -void BOPAlgo_Builder::FillImagesFaces() +void BOPAlgo_Builder::FillImagesFaces(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, "FillImagesFaces", 1); BuildSplitFaces(); + if (!aPS.More()) + { + return; + } FillSameDomainFaces(); + if (!aPS.More()) + { + return; + } FillInternalVertices(); } //======================================================================= @@ -450,10 +465,6 @@ void BOPAlgo_Builder::BuildSplitFaces() aBF.SetFace(aF); aBF.SetShapes(aLE); aBF.SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - aBF.SetProgressIndicator(*myProgressScope); - } // }// for (i=0; iNbSourceShapes(); for (i=0; iShapeInfo(i); if (aSI.ShapeType()==TopAbs_SOLID) { bHasSolids=!bHasSolids; @@ -96,8 +101,16 @@ void BOPAlgo_Builder::FillImagesSolids() TopTools_DataMapOfShapeShape aDraftSolids; // Find all IN faces for all IN faces FillIn3DParts(aDraftSolids); + if (!aPS.More()) + { + return; + } // Build split of the solids BuildSplitSolids(aDraftSolids); + if (!aPS.More()) + { + return; + } // Fill solids with internal parts FillInternalShapes(); } @@ -432,10 +445,6 @@ void BOPAlgo_Builder::BuildSplitSolids(TopTools_DataMapOfShapeShape& theDraftSol aBS.SetSolid(aSolid); aBS.SetShapes(aSFS); aBS.SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - aBS.SetProgressIndicator(*myProgressScope); - } }//for (i=0; i, and index all parts. - Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE; + Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Indexes the parts for quick access to the arguments. Standard_EXPORT void IndexParts(); diff --git a/src/BOPAlgo/BOPAlgo_CheckerSI.cxx b/src/BOPAlgo/BOPAlgo_CheckerSI.cxx index 93e4a0645c..f52c1e56df 100644 --- a/src/BOPAlgo/BOPAlgo_CheckerSI.cxx +++ b/src/BOPAlgo/BOPAlgo_CheckerSI.cxx @@ -88,8 +88,11 @@ class BOPAlgo_FaceSelfIntersect : return myTolF; } // - virtual void Perform() { - BOPAlgo_Algo::UserBreak(); + virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) { + if (!theRange.More()) + { + return; + } IntTools_FaceFace::Perform(myF, myF); } // @@ -140,7 +143,7 @@ void BOPAlgo_CheckerSI::SetLevelOfCheck(const Standard_Integer theLevel) //function : Init //purpose : //======================================================================= -void BOPAlgo_CheckerSI::Init() +void BOPAlgo_CheckerSI::Init(const Message_ProgressRange& /*theRange*/) { Clear(); // @@ -164,7 +167,7 @@ void BOPAlgo_CheckerSI::Init() //function : Perform //purpose : //======================================================================= -void BOPAlgo_CheckerSI::Perform() +void BOPAlgo_CheckerSI::Perform(const Message_ProgressRange& theRange) { try { OCC_CATCH_SIGNALS @@ -175,7 +178,11 @@ void BOPAlgo_CheckerSI::Perform() } // // Perform intersection of sub shapes - BOPAlgo_PaveFiller::Perform(); + BOPAlgo_PaveFiller::Perform(theRange); + if (!theRange.More()) + { + return; + } // CheckFaceSelfIntersection(); @@ -431,11 +438,6 @@ void BOPAlgo_CheckerSI::CheckFaceSelfIntersection() aFaceSelfIntersect.SetIndex(i); aFaceSelfIntersect.SetFace(aF); aFaceSelfIntersect.SetTolF(aTolF); - // - if (myProgressScope != NULL) - { - aFaceSelfIntersect.SetProgressIndicator(*myProgressScope); - } } Standard_Integer aNbFace = aVFace.Length(); diff --git a/src/BOPAlgo/BOPAlgo_CheckerSI.hxx b/src/BOPAlgo/BOPAlgo_CheckerSI.hxx index da10832f5a..3e8701149f 100644 --- a/src/BOPAlgo/BOPAlgo_CheckerSI.hxx +++ b/src/BOPAlgo/BOPAlgo_CheckerSI.hxx @@ -46,7 +46,7 @@ public: Standard_EXPORT BOPAlgo_CheckerSI(); Standard_EXPORT virtual ~BOPAlgo_CheckerSI(); - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Sets the level of checking shape on self-interference.
//! It defines which interferences will be checked:
@@ -64,7 +64,7 @@ public: protected: - Standard_EXPORT virtual void Init() Standard_OVERRIDE; + Standard_EXPORT virtual void Init(const Message_ProgressRange& theRange) Standard_OVERRIDE; //! Treats the intersection results Standard_EXPORT void PostTreat(); diff --git a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx index 2ea86e8783..f0071d2ede 100644 --- a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx +++ b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx @@ -48,7 +48,7 @@ void BOPAlgo_MakerVolume::CheckData() //function : Perform //purpose : //======================================================================= -void BOPAlgo_MakerVolume::Perform() +void BOPAlgo_MakerVolume::Perform(const Message_ProgressRange& theRange) { GetReport()->Clear(); // @@ -86,18 +86,19 @@ void BOPAlgo_MakerVolume::Perform() } // pPF->SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - pPF->SetProgressIndicator(*myProgressScope); - } pPF->SetFuzzyValue(myFuzzyValue); pPF->SetNonDestructive(myNonDestructive); pPF->SetGlue(myGlue); pPF->SetUseOBB(myUseOBB); - pPF->Perform(); + Message_ProgressScope aPS(theRange, "MakerVolume", 10); + pPF->Perform(aPS.Next(9)); + if (!aPS.More()) + { + return; + } // myEntryPoint = 1; - PerformInternal(*pPF); + PerformInternal(*pPF, aPS.Next(1)); } //======================================================================= @@ -105,7 +106,7 @@ void BOPAlgo_MakerVolume::Perform() //purpose : //======================================================================= void BOPAlgo_MakerVolume::PerformInternal1 - (const BOPAlgo_PaveFiller& theFiller) + (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange) { myPaveFiller = (BOPAlgo_PaveFiller*)&theFiller; myDS = myPaveFiller->PDS(); @@ -126,26 +127,31 @@ void BOPAlgo_MakerVolume::PerformInternal1 // 3. Fill Images // 3.1. Vertice if (myIntersect) { - FillImagesVertices(); - if (HasErrors()) { + Message_ProgressScope aPS(theRange, "PerformInternal", 100); + FillImagesVertices(aPS.Next(15)); // 15 + if (HasErrors() || !aPS.More()) { return; } // 3.2. Edges - FillImagesEdges(); - if (HasErrors()) { + FillImagesEdges(aPS.Next(15)); // 30 + if (HasErrors() || !aPS.More()) { return; } // 3.3. Wires - FillImagesContainers(TopAbs_WIRE); - if (HasErrors()) { + FillImagesContainers(TopAbs_WIRE, aPS.Next(20)); // 50 + if (HasErrors() || !aPS.More()) { return; } // 3.4. Faces - FillImagesFaces(); - if (HasErrors()) { + FillImagesFaces(aPS.Next(50)); // 100 + if (HasErrors() || !aPS.More()) { return; } } + else + { + Message_ProgressScope aPS(theRange, NULL, 1); + } // // 4. Collect faces CollectFaces(); @@ -187,7 +193,6 @@ void BOPAlgo_MakerVolume::PerformInternal1 //======================================================================= void BOPAlgo_MakerVolume::CollectFaces() { - UserBreak(); // Standard_Integer i, aNbShapes; TopTools_ListIteratorOfListOfShape aIt; @@ -226,7 +231,6 @@ void BOPAlgo_MakerVolume::CollectFaces() //======================================================================= void BOPAlgo_MakerVolume::MakeBox(TopTools_MapOfShape& theBoxFaces) { - UserBreak(); // Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt; // @@ -253,7 +257,6 @@ void BOPAlgo_MakerVolume::MakeBox(TopTools_MapOfShape& theBoxFaces) //======================================================================= void BOPAlgo_MakerVolume::BuildSolids(TopTools_ListOfShape& theLSR) { - UserBreak(); // BOPAlgo_BuilderSolid aBS; // @@ -279,7 +282,6 @@ void BOPAlgo_MakerVolume::BuildSolids(TopTools_ListOfShape& theLSR) void BOPAlgo_MakerVolume::RemoveBox(TopTools_ListOfShape& theLSR, const TopTools_MapOfShape& theBoxFaces) { - UserBreak(); // TopTools_ListIteratorOfListOfShape aIt; TopExp_Explorer aExp; @@ -336,8 +338,6 @@ void BOPAlgo_MakerVolume::FillInternalShapes(const TopTools_ListOfShape& theLSR) return; } - UserBreak(); - // Get all non-compound shapes TopTools_ListOfShape aLSC; // Fence map diff --git a/src/BOPAlgo/BOPAlgo_MakerVolume.hxx b/src/BOPAlgo/BOPAlgo_MakerVolume.hxx index a17424363b..6763df030c 100644 --- a/src/BOPAlgo/BOPAlgo_MakerVolume.hxx +++ b/src/BOPAlgo/BOPAlgo_MakerVolume.hxx @@ -151,7 +151,7 @@ public: } //! Performs the operation. - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; protected: @@ -159,7 +159,7 @@ protected: Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; //! Performs the operation. - Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE; + Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Collects all faces. Standard_EXPORT void CollectFaces(); diff --git a/src/BOPAlgo/BOPAlgo_Options.cxx b/src/BOPAlgo/BOPAlgo_Options.cxx index 34da6bcd3b..47898205b7 100644 --- a/src/BOPAlgo/BOPAlgo_Options.cxx +++ b/src/BOPAlgo/BOPAlgo_Options.cxx @@ -52,7 +52,6 @@ BOPAlgo_Options::BOPAlgo_Options() myReport(new Message_Report), myRunParallel(myGlobalRunParallel), myFuzzyValue(Precision::Confusion()), - myProgressScope(0L), myUseOBB(Standard_False) { BOPAlgo_LoadMessages(); @@ -69,7 +68,6 @@ BOPAlgo_Options::BOPAlgo_Options myReport(new Message_Report), myRunParallel(myGlobalRunParallel), myFuzzyValue(Precision::Confusion()), - myProgressScope(0L), myUseOBB(Standard_False) { BOPAlgo_LoadMessages(); @@ -129,27 +127,3 @@ void BOPAlgo_Options::SetFuzzyValue(const Standard_Real theFuzz) myFuzzyValue = Max(theFuzz, Precision::Confusion()); } - -//======================================================================= -//function : SetProgressIndicator -//purpose : -//======================================================================= -void BOPAlgo_Options::SetProgressIndicator - (const Message_ProgressScope& theScope) -{ - myProgressScope = &theScope; -} - -//======================================================================= -//function : UserBreak -//purpose : -//======================================================================= -void BOPAlgo_Options::UserBreak() const -{ - if (!myProgressScope) { - return; - } - if (myProgressScope->UserBreak()) { - throw Standard_NotImplemented("BOPAlgo_Options::UserBreak(), method is not implemented"); - } -} diff --git a/src/BOPAlgo/BOPAlgo_Options.hxx b/src/BOPAlgo/BOPAlgo_Options.hxx index 6043fec316..120fc9a071 100644 --- a/src/BOPAlgo/BOPAlgo_Options.hxx +++ b/src/BOPAlgo/BOPAlgo_Options.hxx @@ -20,8 +20,6 @@ #include -class Message_ProgressScope; - //! The class provides the following options for the algorithms in Boolean Component: //! - *Memory allocation tool* - tool for memory allocations; //! - *Error and warning reporting* - allows recording warnings and errors occurred @@ -30,8 +28,6 @@ class Message_ProgressScope; //! - *Parallel processing mode* - provides the possibility to perform operation in parallel mode; //! - *Fuzzy tolerance* - additional tolerance for the operation to detect //! touching or coinciding cases; -//! - *Progress indicator* - provides interface to track the progress of -//! operation and stop the operation by user's break. //! - *Using the Oriented Bounding Boxes* - Allows using the Oriented Bounding Boxes of the shapes //! for filtering the intersections. //! @@ -152,12 +148,6 @@ public: return myFuzzyValue; } -public: - //!@name Progress indicator - - //! Set the Progress Indicator object. - Standard_EXPORT void SetProgressIndicator(const Message_ProgressScope& theProgress); - public: //!@name Usage of Oriented Bounding boxes @@ -173,19 +163,12 @@ public: return myUseOBB; } -protected: - - //! Breaks the execution if the break signal - //! is indicated by myProgressIndicator. - Standard_EXPORT void UserBreak() const; - protected: Handle(NCollection_BaseAllocator) myAllocator; Handle(Message_Report) myReport; Standard_Boolean myRunParallel; Standard_Real myFuzzyValue; - const Message_ProgressScope* myProgressScope; Standard_Boolean myUseOBB; }; diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx index faf4ce3ee9..a6c3ac701a 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cxx @@ -177,8 +177,9 @@ void BOPAlgo_PaveFiller::SetSectionAttribute // function: Init // purpose: //======================================================================= -void BOPAlgo_PaveFiller::Init() +void BOPAlgo_PaveFiller::Init(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, "Init", 1); if (!myArguments.Extent()) { AddError (new BOPAlgo_AlertTooFewArguments); return; @@ -186,6 +187,10 @@ void BOPAlgo_PaveFiller::Init() // TopTools_ListIteratorOfListOfShape aIt(myArguments); for (; aIt.More(); aIt.Next()) { + if (!aPS.More()) + { + return; + } if (aIt.Value().IsNull()) { AddError (new BOPAlgo_AlertNullInputShapes); return; @@ -212,16 +217,62 @@ void BOPAlgo_PaveFiller::Init() // 4 NonDestructive flag SetNonDestructive(); } + +void BOPAlgo_PaveFiller::AnalyzeProgress(std::vector& theCounts) +{ + theCounts.clear(); + + Standard_Real aPart = 84; + + myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX); + Standard_Real aPerformVVSize = myIterator->ExpectedLength(); + + myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE); + Standard_Real aPerformVESize = myIterator->ExpectedLength(); + + myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE); + Standard_Real aPerformEESize = myIterator->ExpectedLength(); + + myIterator->Initialize(TopAbs_VERTEX, TopAbs_FACE); + Standard_Real aPerformVFSize = myIterator->ExpectedLength(); + + myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE); + Standard_Real aPerformEFSize = myIterator->ExpectedLength(); + + myIterator->Initialize(TopAbs_FACE, TopAbs_FACE); + Standard_Real aPerformFFSize = myIterator->ExpectedLength(); + + Standard_Real aSum = 1.5*aPerformVVSize + 1.5*aPerformVESize + aPerformEESize + 1.5*aPerformVFSize + 2.5*aPerformEFSize + 30*aPerformFFSize; + if (aSum == 0) + { + theCounts.push_back(0); + theCounts.push_back(0); + theCounts.push_back(0); + theCounts.push_back(0); + theCounts.push_back(0); + theCounts.push_back(0); + theCounts.push_back(0); + return; + } + theCounts.push_back(aPart * aPerformVVSize / aSum); // VV step - 0 + theCounts.push_back(aPart * aPerformVESize / aSum); // VE - 1 + theCounts.push_back(aPart * aPerformEESize / aSum); // EE - 2 + theCounts.push_back(aPart * aPerformVFSize / aSum); // VF - 3 + theCounts.push_back(aPart * 2.5*aPerformEFSize / aSum); // EF - 4 + theCounts.push_back(aPart * 30*aPerformFFSize / aSum); // FF - 5 + theCounts.push_back(0.5*(theCounts[0] + theCounts[1] + theCounts[3])); // - 6 +} + //======================================================================= // function: Perform // purpose: //======================================================================= -void BOPAlgo_PaveFiller::Perform() +void BOPAlgo_PaveFiller::Perform(const Message_ProgressRange& theRange) { try { OCC_CATCH_SIGNALS - // - PerformInternal(); + // + PerformInternal(theRange); } // catch (Standard_Failure const&) { @@ -232,64 +283,77 @@ void BOPAlgo_PaveFiller::Perform() // function: PerformInternal // purpose: //======================================================================= -void BOPAlgo_PaveFiller::PerformInternal() +void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange) { - Init(); + Message_ProgressScope aPS(theRange, "Pave filler perform", 100); + + Init(aPS.Next(2)); // 1 - const = 2 if (HasErrors()) { return; } // - Prepare(); - if (HasErrors()) { + Prepare(aPS.Next(3)); // 2 - const = 3 + if (HasErrors() || !aPS.More()) { return; } // 00 - PerformVV(); - if (HasErrors()) { + std::vector aSteps; + AnalyzeProgress(aSteps); + + PerformVV(aPS.Next(aSteps[0])); // 3 - myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX); + if (HasErrors() || !aPS.More()) { return; } // 01 - PerformVE(); - if (HasErrors()) { + PerformVE(aPS.Next(aSteps[1])); // 4 - myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE); + if (HasErrors() || !aPS.More()) { return; } // UpdatePaveBlocksWithSDVertices(); // 11 - PerformEE(); - if (HasErrors()) { + PerformEE(aPS.Next(aSteps[2])); // 5 - myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE); + if (HasErrors() || !aPS.More()) { return; } UpdatePaveBlocksWithSDVertices(); // 02 - PerformVF(); + PerformVF(aPS.Next(aSteps[3])); // 6 - vertex-face if (HasErrors()) { return; } UpdatePaveBlocksWithSDVertices(); // 12 - PerformEF(); - if (HasErrors()) { + PerformEF(aPS.Next(aSteps[4])); // 7 - edge-face + if (HasErrors() || !aPS.More()) { return; } + UpdatePaveBlocksWithSDVertices(); UpdateInterfsWithSDVertices(); // Repeat Intersection with increased vertices - RepeatIntersection(); - if (HasErrors()) + RepeatIntersection(aPS.Next(aSteps[6])); // 8 - vf+ve+vv + if (HasErrors() || !aPS.More()) return; - // Force intersection of edges after increase // of the tolerance values of their vertices - ForceInterfEE(); + ForceInterfEE(aPS.Next(2)); // 9 - EE const = 2 + if (!aPS.More()) + { + return; + } // Force Edge/Face intersection after increase // of the tolerance values of their vertices - ForceInterfEF(); + ForceInterfEF(aPS.Next(3)); // 10 - EF const = 3 + if (!aPS.More()) + { + return; + } // // 22 - PerformFF(); - if (HasErrors()) { + PerformFF(aPS.Next(aSteps[5])); // 11 - FF + if (HasErrors() || !aPS.More()) { return; } // @@ -297,15 +361,15 @@ void BOPAlgo_PaveFiller::PerformInternal() // myDS->RefineFaceInfoIn(); // - MakeSplitEdges(); - if (HasErrors()) { + MakeSplitEdges(aPS.Next(2)); // 12 - const = 2 + if (HasErrors() || !aPS.More()) { return; } // UpdatePaveBlocksWithSDVertices(); // - MakeBlocks(); - if (HasErrors()) { + MakeBlocks(aPS.Next(2)); // 13 - const = 2 + if (HasErrors() || !aPS.More()) { return; } // @@ -317,8 +381,8 @@ void BOPAlgo_PaveFiller::PerformInternal() // RemoveMicroEdges(); // - MakePCurves(); - if (HasErrors()) { + MakePCurves(aPS.Next(2)); // 14 - const = 2 + if (HasErrors() || !aPS.More()) { return; } // @@ -332,7 +396,7 @@ void BOPAlgo_PaveFiller::PerformInternal() // function: RepeatIntersection // purpose: //======================================================================= -void BOPAlgo_PaveFiller::RepeatIntersection() +void BOPAlgo_PaveFiller::RepeatIntersection(const Message_ProgressRange& theRange) { // Find all vertices with increased tolerance TColStd_MapOfInteger anExtraInterfMap; @@ -365,18 +429,19 @@ void BOPAlgo_PaveFiller::RepeatIntersection() myIterator->IntersectExt(anExtraInterfMap); // Perform intersections with vertices - PerformVV(); - if (HasErrors()) + Message_ProgressScope aPS(theRange, "Repeat intersection", 15); + PerformVV(aPS.Next(5)); + if (HasErrors() || !aPS.More()) return; UpdatePaveBlocksWithSDVertices(); - PerformVE(); - if (HasErrors()) + PerformVE(aPS.Next(5)); + if (HasErrors() || !aPS.More()) return; UpdatePaveBlocksWithSDVertices(); - PerformVF(); - if (HasErrors()) + PerformVF(aPS.Next(5)); + if (HasErrors() || !aPS.More()) return; UpdatePaveBlocksWithSDVertices(); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.hxx b/src/BOPAlgo/BOPAlgo_PaveFiller.hxx index 307f2e5031..5eee1f375f 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.hxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.hxx @@ -158,7 +158,9 @@ public: //! a copy of a sub-shape is created in the result if it is needed to be updated. Standard_EXPORT Standard_Boolean NonDestructive() const; - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT void AnalyzeProgress(std::vector& theCounts); + + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; @@ -204,20 +206,21 @@ protected: Standard_EXPORT Standard_Boolean IsPrimary() const; - Standard_EXPORT virtual void PerformInternal(); + Standard_EXPORT virtual void PerformInternal(const Message_ProgressRange& theRange); Standard_EXPORT virtual void Clear() Standard_OVERRIDE; - Standard_EXPORT virtual void Init(); + Standard_EXPORT virtual void Init(const Message_ProgressRange& theRange); - Standard_EXPORT void Prepare(); + Standard_EXPORT void Prepare(const Message_ProgressRange& theRange); - Standard_EXPORT virtual void PerformVV(); + Standard_EXPORT virtual void PerformVV(const Message_ProgressRange& theRange); - Standard_EXPORT virtual void PerformVE(); + Standard_EXPORT virtual void PerformVE(const Message_ProgressRange& theRange); //! Performs the intersection of the vertices with edges. Standard_EXPORT void IntersectVE(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theVEPairs, + const Message_ProgressRange& theRange, const Standard_Boolean bAddInterfs = Standard_True); //! Splits the Pave Blocks of the given edges with the extra paves.
@@ -231,24 +234,24 @@ protected: Standard_EXPORT void SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges, const Standard_Boolean theAddInterfs); - Standard_EXPORT virtual void PerformVF(); + Standard_EXPORT virtual void PerformVF(const Message_ProgressRange& theRange); - Standard_EXPORT virtual void PerformEE(); + Standard_EXPORT virtual void PerformEE(const Message_ProgressRange& theRange); - Standard_EXPORT virtual void PerformEF(); + Standard_EXPORT virtual void PerformEF(const Message_ProgressRange& theRange); - Standard_EXPORT virtual void PerformFF(); + Standard_EXPORT virtual void PerformFF(const Message_ProgressRange& theRange); Standard_EXPORT void TreatVerticesEE(); Standard_EXPORT void MakeSDVerticesFF(const TColStd_DataMapOfIntegerListOfInteger& aDMVLV, TColStd_DataMapOfIntegerInteger& theDMNewSD); - Standard_EXPORT void MakeSplitEdges(); + Standard_EXPORT void MakeSplitEdges(const Message_ProgressRange& theRange); - Standard_EXPORT void MakeBlocks(); + Standard_EXPORT void MakeBlocks(const Message_ProgressRange& theRange); - Standard_EXPORT void MakePCurves(); + Standard_EXPORT void MakePCurves(const Message_ProgressRange& theRange); Standard_EXPORT Standard_Integer MakeSDVertices(const TColStd_ListOfInteger& theVertIndices, const Standard_Boolean theAddInterfs = 1); @@ -269,6 +272,7 @@ protected: //! Performs intersection of new vertices, obtained in E/E and E/F intersections Standard_EXPORT void PerformNewVertices(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, const Handle(NCollection_BaseAllocator)& theAllocator, + const Message_ProgressRange& theRange, const Standard_Boolean theIsEEIntersection = Standard_True); Standard_EXPORT Standard_Boolean CheckFacePaves (const TopoDS_Vertex& theVnew, @@ -564,7 +568,7 @@ protected: //! If the intersection says that the section edge is lying on the face //! it will be added into FaceInfo structure of the face as IN edge //! and will be used for splitting. - Standard_EXPORT void PutSEInOtherFaces(); + Standard_EXPORT void PutSEInOtherFaces(const Message_ProgressRange& theRange); //! Analyzes the results of interferences of sub-shapes of the shapes //! looking for self-interfering entities by the following rules:
@@ -581,22 +585,23 @@ protected: const TopoDS_Shape& theS2); //! Repeat intersection of sub-shapes with increased vertices. - Standard_EXPORT void RepeatIntersection(); + Standard_EXPORT void RepeatIntersection(const Message_ProgressRange& theRange); //! Updates vertices of CommonBlocks with real tolerance of CB. Standard_EXPORT void UpdateVerticesOfCB(); //! The method looks for the additional common blocks among pairs of edges //! with the same bounding vertices. - Standard_EXPORT void ForceInterfEE(); + Standard_EXPORT void ForceInterfEE(const Message_ProgressRange& theRange); //! The method looks for the additional edge/face common blocks //! among pairs of edge/face having the same vertices. - Standard_EXPORT void ForceInterfEF(); + Standard_EXPORT void ForceInterfEF(const Message_ProgressRange& theRange); //! Performs intersection of given pave blocks //! with all faces from arguments. Standard_EXPORT void ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB, + const Message_ProgressRange& theRange, const Standard_Boolean theAddInterf); //! When all section edges are created and no increase of the tolerance diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx index 6c27314ce3..a07ecad761 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_1.cxx @@ -44,7 +44,7 @@ // function: PerformVV // purpose: //======================================================================= -void BOPAlgo_PaveFiller::PerformVV() +void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange) { Standard_Integer n1, n2, iFlag, aSize; Handle(NCollection_BaseAllocator) aAllocator; @@ -65,7 +65,12 @@ void BOPAlgo_PaveFiller::PerformVV() NCollection_List aMBlocks(aAllocator); // // 1. Map V/LV + Message_ProgressScope aPS(theRange, "PerformVV", 1); for (; myIterator->More(); myIterator->Next()) { + if (!aPS.More()) + { + return; + } myIterator->Value(n1, n2); // if (myDS->HasInterf(n1, n2)) @@ -96,6 +101,10 @@ void BOPAlgo_PaveFiller::PerformVV() // 3. Make vertices NCollection_List::Iterator aItB(aMBlocks); for (; aItB.More(); aItB.Next()) { + if (!aPS.More()) + { + return; + } const TColStd_ListOfInteger& aLI = aItB.Value(); MakeSDVertices(aLI); } @@ -105,6 +114,10 @@ void BOPAlgo_PaveFiller::PerformVV() TColStd_DataMapOfIntegerInteger& aDMII=myDS->ShapesSD(); aItDMII.Initialize(aDMII); for (; aItDMII.More(); aItDMII.Next()) { + if (!aPS.More()) + { + return; + } n1=aItDMII.Key(); myDS->InitPaveBlocksForVertex(n1); } diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx index ee6b573d59..a9d45fa0b5 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx @@ -48,7 +48,8 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo { BOPAlgo_VertexEdge() : BOPAlgo_Algo(), - myIV(-1), myIE(-1), myFlag(-1), myT(-1.), myTolVNew(-1.) { + myIV(-1), myIE(-1), myFlag(-1), myT(-1.), myTolVNew(-1.), + myRange() { }; // virtual ~BOPAlgo_VertexEdge(){ @@ -109,9 +110,17 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo { const Handle(BOPDS_PaveBlock)& PaveBlock() const { return myPB; } + void SetRange(const Message_ProgressRange& theRange) + { + myRange = theRange; + } // - virtual void Perform() { - BOPAlgo_Algo::UserBreak(); + virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) { + Message_ProgressScope aPS(myRange, NULL, 1); + if (!aPS.More()) + { + return; + } try { OCC_CATCH_SIGNALS @@ -134,6 +143,8 @@ class BOPAlgo_VertexEdge : public BOPAlgo_Algo { TopoDS_Edge myE; Handle(IntTools_Context) myContext; Handle(BOPDS_PaveBlock) myPB; +private: + Message_ProgressRange myRange; }; //======================================================================= typedef NCollection_Vector BOPAlgo_VectorOfVertexEdge; @@ -142,7 +153,7 @@ typedef NCollection_Vector BOPAlgo_VectorOfVertexEdge; // function: PerformVE // purpose: //======================================================================= -void BOPAlgo_PaveFiller::PerformVE() +void BOPAlgo_PaveFiller::PerformVE(const Message_ProgressRange& theRange) { FillShrunkData(TopAbs_VERTEX, TopAbs_EDGE); // @@ -192,7 +203,8 @@ void BOPAlgo_PaveFiller::PerformVE() pLV->Append(nV); } // - IntersectVE(aMVEPairs); + Message_ProgressScope aPS(theRange, NULL, 1); + IntersectVE(aMVEPairs, aPS.Next()); } //======================================================================= @@ -201,6 +213,7 @@ void BOPAlgo_PaveFiller::PerformVE() //======================================================================= void BOPAlgo_PaveFiller::IntersectVE (const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theVEPairs, + const Message_ProgressRange& theRange, const Standard_Boolean theAddInterfs) { Standard_Integer i, aNbVE = theVEPairs.Extent(); @@ -221,7 +234,12 @@ void BOPAlgo_PaveFiller::IntersectVE // intersection of the same SD vertex with edge NCollection_DataMap aDMVSD; // + Message_ProgressScope aPSOuter(theRange, "IntersectVE", 10); for (i = 1; i <= aNbVE; ++i) { + if (!aPSOuter.More()) + { + return; + } const Handle(BOPDS_PaveBlock)& aPB = theVEPairs.FindKey(i); Standard_Integer nE = aPB->OriginalEdge(); // @@ -264,24 +282,36 @@ void BOPAlgo_PaveFiller::IntersectVE aVESolver.SetEdge(aE); aVESolver.SetPaveBlock(aPB); aVESolver.SetFuzzyValue(myFuzzyValue); - if (myProgressScope != NULL) - { - aVESolver.SetProgressIndicator(*myProgressScope); - } } } // + aNbVE = aVVE.Length(); + + Message_ProgressScope aPS(aPSOuter.Next(9), "Intersect vertex-edge", aNbVE); + for (i = 0; i < aVVE.Length(); i++) + { + BOPAlgo_VertexEdge& aVESolver = aVVE.ChangeValue(i); + aVESolver.SetRange(aPS.Next()); + } // Perform intersection //============================================================= BOPTools_Parallel::Perform (myRunParallel, aVVE, myContext); //============================================================= + if (!aPSOuter.More()) + { + return; + } // // Keep the modified edges for further update TColStd_MapOfInteger aMEdges; // // Analyze intersections - aNbVE = aVVE.Length(); - for (i = 0; i < aNbVE; ++i) { + Message_ProgressScope aPS2(aPSOuter.Next(1), "Analyze intersections", aNbVE); + for (i = 0; i < aNbVE; ++i, aPS2.Next()) { + if (!aPS2.More()) + { + return; + } const BOPAlgo_VertexEdge& aVESolver = aVVE(i); if (aVESolver.Flag() != 0) { if (aVESolver.HasErrors()) diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index 0c0835ecbe..f0bed4f576 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -68,7 +68,8 @@ class BOPAlgo_EdgeEdge : // BOPAlgo_EdgeEdge(): IntTools_EdgeEdge(), - BOPAlgo_Algo() { + BOPAlgo_Algo(), + myRange() { }; // virtual ~BOPAlgo_EdgeEdge(){ @@ -101,8 +102,17 @@ class BOPAlgo_EdgeEdge : IntTools_EdgeEdge::SetFuzzyValue(theFuzz); } // - virtual void Perform() { - BOPAlgo_Algo::UserBreak(); + void SetRange(const Message_ProgressRange& theRange) + { + myRange = theRange; + } + // + virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) { + Message_ProgressScope aPS(myRange, NULL, 1); + if (!aPS.More()) + { + return; + } TopoDS_Edge anE1 = myEdge1, anE2 = myEdge2; Standard_Boolean hasTrsf = false; try @@ -146,6 +156,8 @@ class BOPAlgo_EdgeEdge : Handle(BOPDS_PaveBlock) myPB2; Bnd_Box myBox1; Bnd_Box myBox2; +private: + Message_ProgressRange myRange; }; // //======================================================================= @@ -155,7 +167,7 @@ typedef NCollection_Vector BOPAlgo_VectorOfEdgeEdge; // function: PerformEE // purpose: //======================================================================= -void BOPAlgo_PaveFiller::PerformEE() +void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange) { FillShrunkData(TopAbs_EDGE, TopAbs_EDGE); // @@ -186,7 +198,12 @@ void BOPAlgo_PaveFiller::PerformEE() BOPDS_VectorOfInterfEE& aEEs=myDS->InterfEE(); aEEs.SetIncrement(iSize); // + Message_ProgressScope aPSOuter(theRange, "PerformEE", 10); for (; myIterator->More(); myIterator->Next()) { + if (!aPSOuter.More()) + { + return; + } myIterator->Value(nE1, nE2); // const BOPDS_ShapeInfo& aSIE1=myDS->ShapeInfo(nE1); @@ -253,20 +270,32 @@ void BOPAlgo_PaveFiller::PerformEE() anEdgeEdge.SetEdge2(aE2, aT21, aT22); anEdgeEdge.SetBoxes (aBB1, aBB2); anEdgeEdge.SetFuzzyValue(myFuzzyValue); - if (myProgressScope != NULL) - { - anEdgeEdge.SetProgressIndicator(*myProgressScope); - } }//for (; aIt2.More(); aIt2.Next()) { }//for (; aIt1.More(); aIt1.Next()) { }//for (; myIterator->More(); myIterator->Next()) { // aNbEdgeEdge=aVEdgeEdge.Length(); + + Message_ProgressScope aPS1(aPSOuter.Next(8), "Edge-edge perform", aNbEdgeEdge); + for (k = 0; k < aNbEdgeEdge; k++) + { + BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge.ChangeValue(k); + anEdgeEdge.SetRange(aPS1.Next()); + } //====================================================== BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge); //====================================================== + if (!aPSOuter.More()) + { + return; + } // - for (k = 0; k < aNbEdgeEdge; ++k) { + Message_ProgressScope aPS2(aPSOuter.Next(1), "Post-treatment", aNbEdgeEdge); + for (k = 0; k < aNbEdgeEdge; ++k, aPS2.Next()) { + if (!aPS2.More()) + { + return; + } Bnd_Box aBB1, aBB2; // BOPAlgo_EdgeEdge& anEdgeEdge=aVEdgeEdge(k); @@ -331,6 +360,10 @@ void BOPAlgo_PaveFiller::PerformEE() } // for (i=1; i<=aNbCPrts; ++i) { + if (!aPS2.More()) + { + return; + } const IntTools_CommonPrt& aCPart=aCPrts(i); // const TopoDS_Edge& aE1=aCPart.Edge1(); @@ -519,7 +552,7 @@ void BOPAlgo_PaveFiller::PerformEE() // Update vertices of common blocks with real CB tolerances UpdateVerticesOfCB(); - PerformNewVertices(aMVCPB, aAllocator); + PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(1)); // if (aMEdges.Extent()) { Standard_Integer aNbV = aMVCPB.Extent(); @@ -546,6 +579,7 @@ void BOPAlgo_PaveFiller::PerformEE() void BOPAlgo_PaveFiller::PerformNewVertices (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, const Handle(NCollection_BaseAllocator)& theAllocator, + const Message_ProgressRange& theRange, const Standard_Boolean bIsEEIntersection) { Standard_Integer aNbV = theMVCPB.Extent(); @@ -563,8 +597,14 @@ void BOPAlgo_PaveFiller::PerformNewVertices BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE(); BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF(); // + // 4. Compute Extra Paves and split Pave blocks by the Extra paves + Message_ProgressScope aPS(theRange, NULL, 1); Standard_Integer i, aNb = aImages.Extent(); for (i = 1; i <= aNb; ++i) { + if (!aPS.More()) + { + return; + } const TopoDS_Vertex& aV = TopoDS::Vertex(aImages.FindKey(i)); const TopTools_ListOfShape& aLVSD = aImages.FindFromIndex(i); // @@ -593,6 +633,10 @@ void BOPAlgo_PaveFiller::PerformNewVertices // 3. Map PaveBlock/ListOfVertices to add to this PaveBlock ->aMPBLI BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator); for (i = 1; i <= aNbV; ++i) { + if (!aPS.More()) + { + return; + } const BOPDS_CoupleOfPaveBlocks& aCPB = theMVCPB.FindFromIndex(i); Standard_Integer iV = aCPB.Index(); // @@ -610,9 +654,8 @@ void BOPAlgo_PaveFiller::PerformNewVertices } } } - // // 4. Compute Extra Paves and split Pave blocks by the Extra paves - IntersectVE(aMPBLI, Standard_False); + IntersectVE(aMPBLI, aPS.Next(), Standard_False); } //======================================================================= //function : TreatNewVertices @@ -898,7 +941,7 @@ void BOPAlgo_PaveFiller::UpdateVerticesOfCB() //function : ForceInterfEE //purpose : //======================================================================= -void BOPAlgo_PaveFiller::ForceInterfEE() +void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) { // Now that we have vertices increased and unified, try to find additional // common blocks among the pairs of edges. @@ -919,7 +962,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE() myDS->InitPaveBlocksForVertex(i); } } - + Message_ProgressScope aPSOuter(theRange, "ForceInterfEE", 10); // Fill the connection map from bounding vertices to pave blocks // having those bounding vertices NCollection_IndexedDataMapShapeInfo(i); if (aSI.ShapeType() != TopAbs_EDGE) // Not an edge @@ -976,6 +1023,10 @@ void BOPAlgo_PaveFiller::ForceInterfEE() for (Standard_Integer i = 1; i <= aNbPB; ++i) { + if (!aPSOuter.More()) + { + return; + } const BOPDS_ListOfPaveBlock& aLPB = aPBMap(i); if (aLPB.Extent() < 2) continue; @@ -998,6 +1049,10 @@ void BOPAlgo_PaveFiller::ForceInterfEE() BOPDS_ListIteratorOfListOfPaveBlock aItLPB1(aLPB); for (; aItLPB1.More(); aItLPB1.Next()) { + if (!aPSOuter.More()) + { + return; + } const Handle(BOPDS_PaveBlock)& aPB1 = aItLPB1.Value(); const Handle(BOPDS_CommonBlock)& aCB1 = myDS->CommonBlock(aPB1); const Standard_Integer nE1 = aPB1->OriginalEdge(); @@ -1086,10 +1141,6 @@ void BOPAlgo_PaveFiller::ForceInterfEE() { anEdgeEdge.SetFuzzyValue(myFuzzyValue); } - if (myProgressScope != NULL) - { - anEdgeEdge.SetProgressIndicator(*myProgressScope); - } } } } @@ -1102,9 +1153,19 @@ void BOPAlgo_PaveFiller::ForceInterfEE() aMPBFence.Clear(); anAlloc->Reset(); + Message_ProgressScope aPS(aPSOuter.Next(9), "Intersection edge-edge", aNbPairs); + for (Standard_Integer i = 0; i < aNbPairs; i++) + { + BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge.ChangeValue(i); + anEdgeEdge.SetRange(aPS.Next()); + } + // Perform intersection of the found pairs BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge); - + if (!aPSOuter.More()) + { + return; + } BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE(); if (aEEs.IsEmpty()) aEEs.SetIncrement(10); @@ -1113,9 +1174,13 @@ void BOPAlgo_PaveFiller::ForceInterfEE() // intersection type only. BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock aMPBLPB(1, anAlloc); - - for (Standard_Integer i = 0; i < aNbPairs; ++i) + Message_ProgressScope aPS1(aPSOuter.Next(1), "Analyze the results of intersection", aNbPairs); + for (Standard_Integer i = 0; i < aNbPairs; ++i, aPS1.Next()) { + if (!aPS1.More()) + { + return; + } BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge(i); if (!anEdgeEdge.IsDone() || anEdgeEdge.HasErrors()) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx index 9a289ddf6d..4d948c6593 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx @@ -50,7 +50,7 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo { BOPAlgo_VertexFace() : BOPAlgo_Algo(), myIV(-1), myIF(-1), - myFlag(-1), myT1(-1.), myT2(-1.), myTolVNew(-1.) { + myFlag(-1), myT1(-1.), myT2(-1.), myTolVNew(-1.), myRange() { } // virtual ~BOPAlgo_VertexFace(){ @@ -106,8 +106,17 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo { return myContext; } // - virtual void Perform() { - BOPAlgo_Algo::UserBreak(); + void SetRange(const Message_ProgressRange& theRange) + { + myRange = theRange; + } + // + virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) { + Message_ProgressScope aPS(myRange, NULL, 1); + if (!aPS.More()) + { + return; + } try { OCC_CATCH_SIGNALS @@ -130,6 +139,8 @@ class BOPAlgo_VertexFace : public BOPAlgo_Algo { TopoDS_Vertex myV; TopoDS_Face myF; Handle(IntTools_Context) myContext; +private: + Message_ProgressRange myRange; }; //======================================================================= typedef NCollection_Vector BOPAlgo_VectorOfVertexFace; @@ -138,7 +149,7 @@ typedef NCollection_Vector BOPAlgo_VectorOfVertexFace; // function: PerformVF // purpose: //======================================================================= -void BOPAlgo_PaveFiller::PerformVF() +void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange) { myIterator->Initialize(TopAbs_VERTEX, TopAbs_FACE); Standard_Integer iSize = myIterator->ExpectedLength(); @@ -217,18 +228,31 @@ void BOPAlgo_PaveFiller::PerformVF() aVertexFace.SetVertex(aV); aVertexFace.SetFace(aF); aVertexFace.SetFuzzyValue(myFuzzyValue); - if (myProgressScope != NULL) - { - aVertexFace.SetProgressIndicator(*myProgressScope); - } + }//for (; myIterator->More(); myIterator->Next()) { // aNbVF=aVVF.Length(); + Message_ProgressScope aPSOuter(theRange, "PerformVF", 10); + Message_ProgressScope aPS(aPSOuter.Next(9), "Vertex-face perform", aNbVF); + for (k = 0; k < aNbVF; k++) + { + BOPAlgo_VertexFace& aVertexFace = aVVF.ChangeValue(k); + aVertexFace.SetRange(aPS.Next()); + } //================================================================ BOPTools_Parallel::Perform (myRunParallel, aVVF, myContext); //================================================================ + if (!aPSOuter.More()) + { + return; + } // - for (k=0; k < aNbVF; ++k) { + Message_ProgressScope aPS2(aPSOuter.Next(1), "Post treatment", aNbVF); + for (k=0; k < aNbVF; ++k, aPS2.Next()) { + if (!aPS2.More()) + { + return; + } const BOPAlgo_VertexFace& aVertexFace=aVVF(k); // iFlag=aVertexFace.Flag(); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index aebd4882d4..92c940fa95 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -67,7 +67,8 @@ class BOPAlgo_EdgeFace : BOPAlgo_EdgeFace() : IntTools_EdgeFace(), BOPAlgo_Algo(), - myIE(-1), myIF(-1) { + myIE(-1), myIF(-1), + myRange() { }; // virtual ~BOPAlgo_EdgeFace(){ @@ -112,8 +113,17 @@ class BOPAlgo_EdgeFace : myBox2 = theBox2; } // - virtual void Perform() { - BOPAlgo_Algo::UserBreak(); + void SetProgress (const Message_ProgressRange& theRange) + { + myRange = theRange; + } + // + virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) { + Message_ProgressScope aPS(myRange, NULL, 1); + if (!aPS.More()) + { + return; + } TopoDS_Face aFace = myFace; TopoDS_Edge anEdge = myEdge; Standard_Boolean hasTrsf = false; @@ -158,6 +168,9 @@ class BOPAlgo_EdgeFace : Handle(BOPDS_PaveBlock) myPB; Bnd_Box myBox1; Bnd_Box myBox2; + +private: + Message_ProgressRange myRange; }; // //======================================================================= @@ -167,7 +180,7 @@ typedef NCollection_Vector BOPAlgo_VectorOfEdgeFace; //function : PerformEF //purpose : //======================================================================= -void BOPAlgo_PaveFiller::PerformEF() +void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) { FillShrunkData(TopAbs_EDGE, TopAbs_FACE); // @@ -268,20 +281,17 @@ void BOPAlgo_PaveFiller::PerformEF() aEdgeFace.SetBoxes (myDS->ShapeInfo(nE).Box(), myDS->ShapeInfo (nF).Box()); aEdgeFace.SetFuzzyValue(myFuzzyValue); aEdgeFace.UseQuickCoincidenceCheck(bExpressCompute); - // + IntTools_Range aSR(aTS1, aTS2); - IntTools_Range anewSR=aSR; + IntTools_Range anewSR = aSR; BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, anewSR); aEdgeFace.SetNewSR(anewSR); // IntTools_Range aPBRange(aT1, aT2); aSR = aPBRange; BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange); - aEdgeFace.SetRange (aPBRange); - if (myProgressScope != NULL) - { - aEdgeFace.SetProgressIndicator(*myProgressScope); - } + aEdgeFace.SetRange(aPBRange); + // // Save the pair to avoid their forced intersection BOPDS_MapOfPaveBlock* pMPB = myFPBDone.ChangeSeek(nF); if (!pMPB) @@ -291,11 +301,27 @@ void BOPAlgo_PaveFiller::PerformEF() }//for (; myIterator->More(); myIterator->Next()) { // aNbEdgeFace=aVEdgeFace.Length(); + Message_ProgressScope aPSOuter(theRange, "PerformEF", 10); + Message_ProgressScope aPS1(aPSOuter.Next(8), "Edge-face perform", aNbEdgeFace); + for (Standard_Integer index = 0; index < aNbEdgeFace; index++) + { + BOPAlgo_EdgeFace& aEdgeFace = aVEdgeFace.ChangeValue(index); + aEdgeFace.SetProgress(aPS1.Next()); + } //================================================================= BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext); //================================================================= + if (!aPSOuter.More()) + { + return; + } // - for (k=0; k < aNbEdgeFace; ++k) { + Message_ProgressScope aPS2(aPSOuter.Next(1), "Post-treatment", aNbEdgeFace); + for (k=0; k < aNbEdgeFace; ++k, aPS2.Next()) { + if (!aPS2.More()) + { + return; + } BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace(k); if (!aEdgeFace.IsDone() || aEdgeFace.HasErrors()) { // Warn about failed intersection of sub-shapes @@ -524,7 +550,11 @@ void BOPAlgo_PaveFiller::PerformEF() //========================================= BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator, myDS, myContext); UpdateVerticesOfCB(); - PerformNewVertices(aMVCPB, aAllocator, Standard_False); + PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(1), Standard_False); + if (!aPSOuter.More()) + { + return; + } // // Update FaceInfoIn for all faces having EF common parts myDS->UpdateFaceInfoIn (aMIEFC); @@ -733,7 +763,7 @@ void BOPAlgo_PaveFiller::ReduceIntersectionRange(const Standard_Integer theV1, //function : ForceInterfEF //purpose : //======================================================================= -void BOPAlgo_PaveFiller::ForceInterfEF() +void BOPAlgo_PaveFiller::ForceInterfEF(const Message_ProgressRange& theRange) { if (!myIsPrimary) return; @@ -747,8 +777,13 @@ void BOPAlgo_PaveFiller::ForceInterfEF() // Collect all pave blocks BOPDS_IndexedMapOfPaveBlock aMPB; const Standard_Integer aNbS = myDS->NbSourceShapes(); + Message_ProgressScope aPS(theRange, NULL, 1); for (Standard_Integer nE = 0; nE < aNbS; ++nE) { + if (!aPS.More()) + { + return; + } const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(nE); if (aSI.ShapeType() != TopAbs_EDGE) // Not an edge @@ -773,7 +808,8 @@ void BOPAlgo_PaveFiller::ForceInterfEF() } // Perform intersection of collected pave blocks with faces - ForceInterfEF(aMPB, Standard_True); + + ForceInterfEF(aMPB, aPS.Next(), Standard_True); } //======================================================================= @@ -781,11 +817,12 @@ void BOPAlgo_PaveFiller::ForceInterfEF() //purpose : //======================================================================= void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB, + const Message_ProgressRange& theRange, const Standard_Boolean theAddInterf) { if (theMPB.IsEmpty()) return; - + Message_ProgressScope aPSOuter(theRange, "ForceInterfEF", 10); // Fill the tree with bounding boxes of the pave blocks BOPTools_BoxTree aBBTree; @@ -795,6 +832,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB Standard_Integer aNbPB = theMPB.Extent(); for (Standard_Integer iPB = 1; iPB <= aNbPB; ++iPB) { + if (!aPSOuter.More()) + { + return; + } Handle(BOPDS_PaveBlock) aPB = theMPB(iPB); if (!aPB->HasShrunkData() || !myDS->IsValidShrunkData(aPB)) { @@ -823,6 +864,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB const Standard_Integer aNbS = myDS->NbSourceShapes(); for (Standard_Integer nF = 0; nF < aNbS; ++nF) { + if (!aPSOuter.More()) + { + return; + } const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(nF); if (aSI.ShapeType() != TopAbs_FACE) // Not a face @@ -878,6 +923,10 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB TColStd_ListOfInteger::Iterator itLIPB(aLIPB); for (; itLIPB.More(); itLIPB.Next()) { + if (!aPSOuter.More()) + { + return; + } const Handle(BOPDS_PaveBlock)& aPB = aPBMap(itLIPB.Value()); if (pMPBF[0]->Contains(aPB) || pMPBF[1]->Contains(aPB) || @@ -1013,10 +1062,6 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB aEdgeFace.SetFuzzyValue(myFuzzyValue + aTolAdd); aEdgeFace.UseQuickCoincidenceCheck(Standard_True); aEdgeFace.SetRange(IntTools_Range(aPB->Pave1().Parameter(), aPB->Pave2().Parameter())); - if (myProgressScope != NULL) - { - aEdgeFace.SetProgressIndicator(*myProgressScope); - } } } } @@ -1028,8 +1073,18 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB aPBMap.Clear(); anAlloc->Reset(); + Message_ProgressScope aPS(aPSOuter.Next(9), "Force intersection edge-face", aNbEFs); + for (Standard_Integer i = 0; i < aNbEFs; i++) + { + BOPAlgo_EdgeFace& aEdgeFace = aVEdgeFace.ChangeValue(i); + aEdgeFace.SetProgress(aPS.Next()); + } // Perform intersection of the found pairs BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext); + if (!aPSOuter.More()) + { + return; + } BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF(); if (theAddInterf && aEFs.IsEmpty()) @@ -1040,9 +1095,13 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB // Collect all pairs for common block creation BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(1, anAlloc); - - for (Standard_Integer i = 0; i < aNbEFs; ++i) + Message_ProgressScope aPS1(aPSOuter.Next(1), "Analyze the results of force intersection", aNbEFs); + for (Standard_Integer i = 0; i < aNbEFs; ++i, aPS1.Next()) { + if (!aPS1.More()) + { + return; + } BOPAlgo_EdgeFace& anEdgeFace = aVEdgeFace(i); if (!anEdgeFace.IsDone() || anEdgeFace.HasErrors()) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index 27a79abca2..603b73674d 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -100,7 +100,8 @@ class BOPAlgo_FaceFace : BOPAlgo_FaceFace() : IntTools_FaceFace(), BOPAlgo_Algo(), - myIF1(-1), myIF2(-1), myTolFF(1.e-7) { + myIF1(-1), myIF2(-1), myTolFF(1.e-7), + myRange() { } // virtual ~BOPAlgo_FaceFace() { @@ -150,10 +151,19 @@ class BOPAlgo_FaceFace : IntTools_FaceFace::SetFuzzyValue(theFuzz); } // + void SetProgress(const Message_ProgressRange& theRange) + { + myRange = theRange; + } + // const gp_Trsf& Trsf() const { return myTrsf; } // - virtual void Perform() { - BOPAlgo_Algo::UserBreak(); + virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) { + Message_ProgressScope aPS(myRange, NULL, 1); + if (!aPS.More()) + { + return; + } try { OCC_CATCH_SIGNALS @@ -180,7 +190,7 @@ class BOPAlgo_FaceFace : myTrsf = aTrsf.Inverted(); } - IntTools_FaceFace::Perform (aF1, aF2); + IntTools_FaceFace::Perform (aF1, aF2, aPS.Next()); } catch (Standard_Failure const&) { @@ -221,6 +231,9 @@ class BOPAlgo_FaceFace : Bnd_Box myBox1; Bnd_Box myBox2; gp_Trsf myTrsf; + + private: + Message_ProgressRange myRange; }; // //======================================================================= @@ -231,7 +244,7 @@ typedef NCollection_Vector BOPAlgo_VectorOfFaceFace; //function : PerformFF //purpose : //======================================================================= -void BOPAlgo_PaveFiller::PerformFF() +void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) { myIterator->Initialize(TopAbs_FACE, TopAbs_FACE); Standard_Integer iSize = myIterator->ExpectedLength(); @@ -256,6 +269,7 @@ void BOPAlgo_PaveFiller::PerformFF() BOPAlgo_VectorOfFaceFace aVFaceFace; Standard_Integer nF1, nF2; // + Message_ProgressScope aPSOuter(theRange, "PerformFF", 10); for (; myIterator->More(); myIterator->Next()) { myIterator->Value(nF1, nF2); @@ -269,6 +283,10 @@ void BOPAlgo_PaveFiller::PerformFF() // Initialize interferences myIterator->Initialize(TopAbs_FACE, TopAbs_FACE); for (; myIterator->More(); myIterator->Next()) { + if (!aPSOuter.More()) + { + return; + } myIterator->Value(nF1, nF2); if (myGlue == BOPAlgo_GlueOff) @@ -308,10 +326,6 @@ void BOPAlgo_PaveFiller::PerformFF() // aFaceFace.SetParameters(bApprox, bCompC2D1, bCompC2D2, anApproxTol); aFaceFace.SetFuzzyValue(myFuzzyValue); - if (myProgressScope != NULL) - { - aFaceFace.SetProgressIndicator(*myProgressScope); - } } else { // for the Glue mode just add all interferences of that type @@ -322,13 +336,29 @@ void BOPAlgo_PaveFiller::PerformFF() } }//for (; myIterator->More(); myIterator->Next()) { // + Standard_Integer k, aNbFaceFace = aVFaceFace.Length();; + Message_ProgressScope aPS1(aPSOuter.Next(9), "Face-face perform", aNbFaceFace); + for (k = 0; k < aVFaceFace.Size(); k++) + { + BOPAlgo_FaceFace& aFaceFace = aVFaceFace.ChangeValue(k); + aFaceFace.SetProgress(aPS1.Next()); + } //====================================================== // Perform intersection BOPTools_Parallel::Perform (myRunParallel, aVFaceFace); + if (!aPSOuter.More()) + { + return; + } //====================================================== // Treatment of the results - Standard_Integer k, aNbFaceFace = aVFaceFace.Length(); - for (k = 0; k < aNbFaceFace; ++k) { + + Message_ProgressScope aPS2(aPSOuter.Next(1), "Treatment of the results", aNbFaceFace); + for (k = 0; k < aNbFaceFace; ++k, aPS2.Next()) { + if (!aPS2.More()) + { + return; + } BOPAlgo_FaceFace& aFaceFace = aVFaceFace(k); aFaceFace.Indices(nF1, nF2); if (!aFaceFace.IsDone() || aFaceFace.HasErrors()) { @@ -376,6 +406,10 @@ void BOPAlgo_PaveFiller::PerformFF() // BOPDS_VectorOfCurve& aVNC = aFF.ChangeCurves(); for (Standard_Integer i = 1; i <= aNbCurves; ++i) { + if (!aPS2.More()) + { + return; + } Bnd_Box aBox; const IntTools_Curve& aIC = aCvsX(i); Standard_Boolean bIsValid = IntTools_Tools::CheckCurve(aIC, aBox); @@ -392,6 +426,10 @@ void BOPAlgo_PaveFiller::PerformFF() // Points BOPDS_VectorOfPoint& aVNP = aFF.ChangePoints(); for (Standard_Integer i = 1; i <= aNbPoints; ++i) { + if (!aPS2.More()) + { + return; + } const IntTools_PntOn2Faces& aPi = aPntsX(i); const gp_Pnt& aP = aPi.P1().Pnt(); // @@ -426,7 +464,7 @@ static void UpdateSavedTolerance(const BOPDS_PDS& theDS, //function : MakeBlocks //purpose : //======================================================================= -void BOPAlgo_PaveFiller::MakeBlocks() +void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) { if (myGlue != BOPAlgo_GlueOff) { return; @@ -471,9 +509,12 @@ void BOPAlgo_PaveFiller::MakeBlocks() // Map of PaveBlocks with the faces to which it has to be added BOPAlgo_DataMapOfPaveBlockListOfInteger aPBFacesMap; // + Message_ProgressScope aPS(theRange, NULL, 1); for (i=0; i BOPAlgo_VectorOfMPC; //======================================================================= class BOPAlgo_BPC { public: - BOPAlgo_BPC(){ + BOPAlgo_BPC(): + myRange() { }; // ~BOPAlgo_BPC(){ @@ -355,8 +381,17 @@ class BOPAlgo_BPC { Standard_Boolean IsToUpdate() const { return myToUpdate; } + void SetRange(const Message_ProgressRange& theRange) + { + myRange = theRange; + } // void Perform() { + Message_ProgressScope aPS(myRange, NULL, 1); + if (!aPS.More()) + { + return; + } BRepLib::BuildPCurveForEdgeOnPlane(myE, myF, myCurve, myToUpdate); }; // @@ -365,6 +400,8 @@ class BOPAlgo_BPC { TopoDS_Face myF; Handle(Geom2d_Curve) myCurve; Standard_Boolean myToUpdate; +private: + Message_ProgressRange myRange; }; //======================================================================= typedef NCollection_Vector BOPAlgo_VectorOfBPC; @@ -373,7 +410,7 @@ typedef NCollection_Vector BOPAlgo_VectorOfBPC; // function: MakeSplitEdges // purpose: //======================================================================= -void BOPAlgo_PaveFiller::MakeSplitEdges() +void BOPAlgo_PaveFiller::MakeSplitEdges(const Message_ProgressRange& theRange) { BOPDS_VectorOfListOfPaveBlock& aPBP=myDS->ChangePaveBlocksPool(); Standard_Integer aNbPBP = aPBP.Length(); @@ -484,17 +521,23 @@ void BOPAlgo_PaveFiller::MakeSplitEdges() aBSE.SetCommonBlock(aCB); } aBSE.SetDS(myDS); - if (myProgressScope != NULL) - { - aBSE.SetProgressIndicator(*myProgressScope); - } } // for (; aItPB.More(); aItPB.Next()) { } // for (i=0; iPDS(); @@ -106,10 +106,11 @@ void BOPAlgo_Section::PerformInternal1 return; } // + Message_ProgressScope aPS(theRange, "PerformInternal", 100); // 3. Fill Images // 3.1 Vertices - FillImagesVertices(); - if (HasErrors()) { + FillImagesVertices(aPS.Next(30)); // 30 + if (HasErrors() || !aPS.More()) { return; } // @@ -118,8 +119,8 @@ void BOPAlgo_Section::PerformInternal1 return; } // 3.2 Edges - FillImagesEdges(); - if (HasErrors()) { + FillImagesEdges(aPS.Next(35)); // 65 + if (HasErrors() || !aPS.More()) { return; } // @@ -128,9 +129,9 @@ void BOPAlgo_Section::PerformInternal1 return; } // 4. Section - BuildSection(); + BuildSection(aPS.Next(35)); // 100 // - if (HasErrors()) { + if (HasErrors() || !aPS.More()) { return; } // 5.History @@ -146,8 +147,9 @@ void BOPAlgo_Section::PerformInternal1 //function : BuildSection //purpose : //======================================================================= -void BOPAlgo_Section::BuildSection() +void BOPAlgo_Section::BuildSection(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, "BuildSection", 1); Standard_Integer i, aNbMS, aNbLE; Standard_Integer j, nE, nV, aNb, aNbF, aNbPBSc; TopoDS_Shape aRC, aRC1; @@ -170,6 +172,10 @@ void BOPAlgo_Section::BuildSection() // 1. aRC1 aNb=myDS->NbSourceShapes(); for (i=0; iShapeInfo(i); if (aSI.ShapeType()!=TopAbs_FACE) { continue; @@ -217,6 +223,10 @@ void BOPAlgo_Section::BuildSection() // aNb=aPBP.Size(); for (i=0; i aLS aIt.Initialize(aLSA); for (; aIt.More(); aIt.Next()) { + if (!aPS.More()) + { + return; + } const TopoDS_Shape& aSA=aIt.Value(); // aLS.Clear(); @@ -317,6 +331,10 @@ void BOPAlgo_Section::BuildSection() // aNbMS=aMSI.Extent(); for (i=1; i<=aNbMS; ++i) { + if (!aPS.More()) + { + return; + } const TopoDS_Shape& aV=aMSI.FindKey(i); const Standard_Integer& iCnt=aMSI.FindFromIndex(i); if (iCnt>1) { diff --git a/src/BOPAlgo/BOPAlgo_Section.hxx b/src/BOPAlgo/BOPAlgo_Section.hxx index 588b4b3062..7a157b6918 100644 --- a/src/BOPAlgo/BOPAlgo_Section.hxx +++ b/src/BOPAlgo/BOPAlgo_Section.hxx @@ -53,10 +53,10 @@ protected: Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; //! Combine the result of section operation - Standard_EXPORT virtual void BuildSection(); + Standard_EXPORT virtual void BuildSection(const Message_ProgressRange& theRange); //! Performs calculations using prepared Filler object - Standard_EXPORT virtual void PerformInternal1(const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE; + Standard_EXPORT virtual void PerformInternal1(const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; private: diff --git a/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx b/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx index 108d44f408..033d441246 100644 --- a/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_ShellSplitter.cxx @@ -133,7 +133,7 @@ const TopTools_ListOfShape& BOPAlgo_ShellSplitter::Shells()const //function : Perform //purpose : //======================================================================= -void BOPAlgo_ShellSplitter::Perform() +void BOPAlgo_ShellSplitter::Perform(const Message_ProgressRange& /*theRange*/) { GetReport()->Clear(); // diff --git a/src/BOPAlgo/BOPAlgo_ShellSplitter.hxx b/src/BOPAlgo/BOPAlgo_ShellSplitter.hxx index 95ef70540e..8f2d42cb5c 100644 --- a/src/BOPAlgo/BOPAlgo_ShellSplitter.hxx +++ b/src/BOPAlgo/BOPAlgo_ShellSplitter.hxx @@ -51,7 +51,7 @@ Standard_EXPORT virtual ~BOPAlgo_ShellSplitter(); Standard_EXPORT const TopTools_ListOfShape& StartElements() const; //! performs the algorithm - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! returns the loops Standard_EXPORT const TopTools_ListOfShape& Shells() const; diff --git a/src/BOPAlgo/BOPAlgo_Splitter.cxx b/src/BOPAlgo/BOPAlgo_Splitter.cxx index dc53bef848..b185e9915b 100644 --- a/src/BOPAlgo/BOPAlgo_Splitter.cxx +++ b/src/BOPAlgo/BOPAlgo_Splitter.cxx @@ -62,7 +62,7 @@ void BOPAlgo_Splitter::CheckData() //function : Perform //purpose : //======================================================================= -void BOPAlgo_Splitter::Perform() +void BOPAlgo_Splitter::Perform(const Message_ProgressRange& theRange) { GetReport()->Clear(); // @@ -89,19 +89,21 @@ void BOPAlgo_Splitter::Perform() BOPAlgo_PaveFiller *pPF = new BOPAlgo_PaveFiller(); pPF->SetArguments(aLS); pPF->SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - pPF->SetProgressIndicator(*myProgressScope); - } + pPF->SetFuzzyValue(myFuzzyValue); pPF->SetNonDestructive(myNonDestructive); pPF->SetGlue(myGlue); pPF->SetUseOBB(myUseOBB); // - pPF->Perform(); + Message_ProgressScope aPS(theRange, "BOPAlgo_Splitter", 10); + pPF->Perform(aPS.Next(9)); + if (!aPS.More()) + { + return; + } // myEntryPoint = 1; - PerformInternal(*pPF); + PerformInternal(*pPF, aPS.Next(1)); } //======================================================================= diff --git a/src/BOPAlgo/BOPAlgo_Splitter.hxx b/src/BOPAlgo/BOPAlgo_Splitter.hxx index 67189f3160..bc3a08ee23 100644 --- a/src/BOPAlgo/BOPAlgo_Splitter.hxx +++ b/src/BOPAlgo/BOPAlgo_Splitter.hxx @@ -60,7 +60,7 @@ public: Standard_EXPORT BOPAlgo_Splitter(const Handle(NCollection_BaseAllocator)& theAllocator); //! Performs the operation - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; protected: diff --git a/src/BOPAlgo/BOPAlgo_Tools.cxx b/src/BOPAlgo/BOPAlgo_Tools.cxx index e5f3c071a2..7ebc11a7f8 100644 --- a/src/BOPAlgo/BOPAlgo_Tools.cxx +++ b/src/BOPAlgo/BOPAlgo_Tools.cxx @@ -1219,7 +1219,7 @@ public: } //! Performs the classification - virtual void Perform(); + virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()); //! Returns the faces classified as IN for solid const TopTools_ListOfShape& InFaces() const @@ -1260,9 +1260,12 @@ private: //function : BOPAlgo_FillIn3DParts::Perform //purpose : //======================================================================= -void BOPAlgo_FillIn3DParts::Perform() +void BOPAlgo_FillIn3DParts::Perform(const Message_ProgressRange& theRange) { - BOPAlgo_Algo::UserBreak(); + if (!theRange.More()) + { + return; + } myInFaces.Clear(); diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx index 9302342c52..b6f2d2b205 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx @@ -109,7 +109,7 @@ void BOPAlgo_WireSplitter::CheckData() //function : Perform //purpose : //======================================================================= -void BOPAlgo_WireSplitter::Perform() +void BOPAlgo_WireSplitter::Perform(const Message_ProgressRange& /*theRange*/) { GetReport()->Clear(); // diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter.hxx b/src/BOPAlgo/BOPAlgo_WireSplitter.hxx index 2c54dd78e3..5820ad3a93 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter.hxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter.hxx @@ -58,7 +58,7 @@ public: //! Returns the context Standard_EXPORT const Handle(IntTools_Context)& Context(); - Standard_EXPORT virtual void Perform() Standard_OVERRIDE; + Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; static void MakeWire(TopTools_ListOfShape& theLE, TopoDS_Wire& theW); diff --git a/src/BOPTest/BOPTest_APICommands.cxx b/src/BOPTest/BOPTest_APICommands.cxx index 6a90550cec..22bf96229a 100644 --- a/src/BOPTest/BOPTest_APICommands.cxx +++ b/src/BOPTest/BOPTest_APICommands.cxx @@ -29,6 +29,8 @@ #include #include +#include + #include #include @@ -130,7 +132,13 @@ Standard_Integer bapibop(Draw_Interpretor& di, pBuilder->SetUseOBB(BOPTest_Objects::UseOBB()); pBuilder->SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); // - pBuilder->Build(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + pBuilder->Build(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } pBuilder->SimplifyResult(BOPTest_Objects::UnifyEdges(), BOPTest_Objects::UnifyFaces(), BOPTest_Objects::Angular()); @@ -197,7 +205,13 @@ Standard_Integer bapibuild(Draw_Interpretor& di, aBuilder.SetUseOBB(BOPTest_Objects::UseOBB()); aBuilder.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); // - aBuilder.Build(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + aBuilder.Build(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } aBuilder.SimplifyResult(BOPTest_Objects::UnifyEdges(), BOPTest_Objects::UnifyFaces(), BOPTest_Objects::Angular()); @@ -257,7 +271,13 @@ Standard_Integer bapisplit(Draw_Interpretor& di, aSplitter.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); // // performing operation - aSplitter.Build(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + aSplitter.Build(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } aSplitter.SimplifyResult(BOPTest_Objects::UnifyEdges(), BOPTest_Objects::UnifyFaces(), BOPTest_Objects::Angular()); diff --git a/src/BOPTest/BOPTest_BOPCommands.cxx b/src/BOPTest/BOPTest_BOPCommands.cxx index edf17415e2..6581f6cc4a 100644 --- a/src/BOPTest/BOPTest_BOPCommands.cxx +++ b/src/BOPTest/BOPTest_BOPCommands.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include // @@ -145,6 +146,7 @@ Standard_Integer bop(Draw_Interpretor& di, bRunParallel=BOPTest_Objects::RunParallel(); bNonDestructive = BOPTest_Objects::NonDestructive(); BOPAlgo_GlueEnum aGlue = BOPTest_Objects::Glue(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); // aLC.Append(aS1); aLC.Append(aS2); @@ -164,7 +166,12 @@ Standard_Integer bop(Draw_Interpretor& di, pPF->SetGlue(aGlue); pPF->SetUseOBB(BOPTest_Objects::UseOBB()); // - pPF->Perform(); + pPF->Perform(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } BOPTest::ReportAlerts(pPF->GetReport()); // return 0; @@ -247,6 +254,7 @@ Standard_Integer bopsmt(Draw_Interpretor& di, } // bRunParallel=BOPTest_Objects::RunParallel(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); // const TopoDS_Shape& aS1=aLC.First(); const TopoDS_Shape& aS2=aLC.Last(); @@ -258,7 +266,12 @@ Standard_Integer bopsmt(Draw_Interpretor& di, aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted()); aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); // - aBOP.PerformWithFiller(*pPF); + aBOP.PerformWithFiller(*pPF, aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } BOPTest::ReportAlerts(aBOP.GetReport()); // Store the history of Boolean operation into the session @@ -325,7 +338,13 @@ Standard_Integer bopsection(Draw_Interpretor& di, aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted()); aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); // - aBOP.PerformWithFiller(*pPF); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + aBOP.PerformWithFiller(*pPF, aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } BOPTest::ReportAlerts(aBOP.GetReport()); // Store the history of Section operation into the session @@ -436,6 +455,7 @@ Standard_Integer bsection(Draw_Interpretor& di, // BRepAlgoAPI_Section aSec(aS1, aS2, Standard_False); // + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); aSec.Approximation(bApp); aSec.ComputePCurveOn1(bPC1); aSec.ComputePCurveOn2(bPC2); @@ -446,8 +466,12 @@ Standard_Integer bsection(Draw_Interpretor& di, aSec.SetGlue(aGlue); aSec.SetUseOBB(BOPTest_Objects::UseOBB()); // - aSec.Build(); - + aSec.Build(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } // Store the history of Section operation into the session if (BRepTest_Objects::IsHistoryNeeded()) BRepTest_Objects::SetHistory(aSec.History()); @@ -521,7 +545,14 @@ Standard_Integer bsmt (Draw_Interpretor& di, aPF.SetGlue(aGlue); aPF.SetUseOBB(BOPTest_Objects::UseOBB()); // - aPF.Perform(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + Message_ProgressScope aPS(aProgress->Start(), "BOP", 10); + aPF.Perform(aPS.Next(9)); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } BOPTest::ReportAlerts(aPF.GetReport()); if (aPF.HasErrors()) { return 0; @@ -537,7 +568,12 @@ Standard_Integer bsmt (Draw_Interpretor& di, aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted()); aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); // - aBOP.PerformWithFiller(aPF); + aBOP.PerformWithFiller(aPF, aPS.Next(1)); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } BOPTest::ReportAlerts(aBOP.GetReport()); // Store the history of Boolean operation into the session @@ -649,7 +685,13 @@ Standard_Integer bopcurves (Draw_Interpretor& di, aFF.SetList(aListOfPnts); aFF.SetFuzzyValue (BOPTest_Objects::FuzzyValue()); // - aFF.Perform (aF1, aF2); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + aFF.Perform (aF1, aF2, aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } // anIsDone=aFF.IsDone(); if (!anIsDone) { @@ -852,7 +894,13 @@ Standard_Integer mkvolume(Draw_Interpretor& di, Standard_Integer n, const char** aMV.SetUseOBB(BOPTest_Objects::UseOBB()); aMV.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); // - aMV.Perform(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + aMV.Perform(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } BOPTest::ReportAlerts(aMV.GetReport()); // Store the history of Volume Maker into the session diff --git a/src/BOPTest/BOPTest_CellsCommands.cxx b/src/BOPTest/BOPTest_CellsCommands.cxx index 6ff33c655f..495e6d42c5 100644 --- a/src/BOPTest/BOPTest_CellsCommands.cxx +++ b/src/BOPTest/BOPTest_CellsCommands.cxx @@ -25,6 +25,8 @@ #include +#include + static Standard_Integer bcbuild (Draw_Interpretor&, Standard_Integer, const char**); static Standard_Integer bcaddall (Draw_Interpretor&, Standard_Integer, const char**); static Standard_Integer bcremoveall (Draw_Interpretor&, Standard_Integer, const char**); @@ -116,9 +118,14 @@ Standard_Integer bcbuild(Draw_Interpretor& di, aCBuilder.SetUseOBB(BOPTest_Objects::UseOBB()); aCBuilder.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); // - aCBuilder.PerformWithFiller(aPF); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + aCBuilder.PerformWithFiller(aPF, aProgress->Start()); BOPTest::ReportAlerts(aCBuilder.GetReport()); - + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } // Store the history of the Cells Builder into the session if (BRepTest_Objects::IsHistoryNeeded()) BRepTest_Objects::SetHistory(aCBuilder.Arguments(), aCBuilder); diff --git a/src/BOPTest/BOPTest_CheckCommands.cxx b/src/BOPTest/BOPTest_CheckCommands.cxx index 83ccd18a47..0a7fe66a58 100644 --- a/src/BOPTest/BOPTest_CheckCommands.cxx +++ b/src/BOPTest/BOPTest_CheckCommands.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -243,7 +244,13 @@ Standard_Integer bopcheck (Draw_Interpretor& di, OSD_Timer aTimer; aTimer.Start(); // - aChecker.Perform(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + aChecker.Perform(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } // aTimer.Stop(); // @@ -549,9 +556,14 @@ Standard_Integer bopargcheck (Draw_Interpretor& di, } } + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); // run checker - aChecker.Perform(); - + aChecker.Perform(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } // process result of checking if(!aChecker.HasFaulty()) { di << "Shape(s) seem(s) to be valid for BOP." << "\n"; diff --git a/src/BOPTest/BOPTest_PartitionCommands.cxx b/src/BOPTest/BOPTest_PartitionCommands.cxx index ebbb605d21..06d93ba586 100644 --- a/src/BOPTest/BOPTest_PartitionCommands.cxx +++ b/src/BOPTest/BOPTest_PartitionCommands.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -138,7 +139,13 @@ Standard_Integer bfillds(Draw_Interpretor& di, OSD_Timer aTimer; aTimer.Start(); // - aPF.Perform(); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + aPF.Perform(aProgress->Start()); + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 0; + } BOPTest::ReportAlerts(aPF.GetReport()); if (aPF.HasErrors()) { return 0; @@ -404,8 +411,14 @@ Standard_Integer bsplit(Draw_Interpretor& di, aTimer.Start(); // // perform the operation - pSplitter->PerformWithFiller(aPF); + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + pSplitter->PerformWithFiller(aPF, aProgress->Start()); // + if (aProgress->UserBreak()) + { + di << "Error: User break"; + return 0; + } aTimer.Stop(); BOPTest::ReportAlerts(pSplitter->GetReport()); diff --git a/src/BRepAlgo/BRepAlgo_Section.cxx b/src/BRepAlgo/BRepAlgo_Section.cxx index 1e9b3672c0..cc713e63fa 100644 --- a/src/BRepAlgo/BRepAlgo_Section.cxx +++ b/src/BRepAlgo/BRepAlgo_Section.cxx @@ -269,7 +269,7 @@ Standard_DISABLE_DEPRECATION_WARNINGS //function : Build //purpose : compute the section //======================================================================= - void BRepAlgo_Section::Build() + void BRepAlgo_Section::Build(const Message_ProgressRange& /*theRange*/) { if (myS1Changed || myS2Changed || diff --git a/src/BRepAlgo/BRepAlgo_Section.hxx b/src/BRepAlgo/BRepAlgo_Section.hxx index 20b80f1831..ba5f98247f 100644 --- a/src/BRepAlgo/BRepAlgo_Section.hxx +++ b/src/BRepAlgo/BRepAlgo_Section.hxx @@ -264,7 +264,7 @@ public: //! You may also have combined these computation //! options: look at the example given above to illustrate //! the use of the constructors. - Standard_EXPORT void Build() Standard_OVERRIDE; + Standard_EXPORT void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Identifies the ancestor faces of the new //! intersection edge E resulting from the last diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Algo.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Algo.hxx index 1511ee4645..5ff5a9e8aa 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Algo.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Algo.hxx @@ -53,7 +53,6 @@ public: using BOPAlgo_Options::DumpWarnings; using BOPAlgo_Options::ClearWarnings; using BOPAlgo_Options::GetReport; - using BOPAlgo_Options::SetProgressIndicator; using BOPAlgo_Options::SetUseOBB; protected: diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx index 969b9be10d..34fd3eef99 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.cxx @@ -138,7 +138,7 @@ BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation //function : Build //purpose : //======================================================================= -void BRepAlgoAPI_BooleanOperation::Build() +void BRepAlgoAPI_BooleanOperation::Build(const Message_ProgressRange& theRange) { // Set Not Done status by default NotDone(); @@ -167,6 +167,7 @@ void BRepAlgoAPI_BooleanOperation::Build() } } + Message_ProgressScope aPS(theRange, NULL, myIsIntersectionNeeded ? 10 : 1); // If necessary perform intersection of the argument shapes if (myIsIntersectionNeeded) { @@ -176,7 +177,7 @@ void BRepAlgoAPI_BooleanOperation::Build() aLArgs.Append(it.Value()); // Perform intersection - IntersectShapes(aLArgs); + IntersectShapes(aLArgs, aPS.Next(9)); if (HasErrors()) { if (aDumpOper.IsDump()) @@ -186,6 +187,10 @@ void BRepAlgoAPI_BooleanOperation::Build() } return; } + if (!aPS.More()) + { + return; + } } // Builder Initialization @@ -203,7 +208,11 @@ void BRepAlgoAPI_BooleanOperation::Build() } // Build the result - BuildResult(); + BuildResult(aPS.Next(1)); + if (!aPS.More()) + { + return; + } if (aDumpOper.IsDump()) { Standard_Boolean isDumpRes = myShape.IsNull() || diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.hxx index b298efa54a..7ab0800f56 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_BooleanOperation.hxx @@ -110,7 +110,7 @@ public: //! @name Setting/Getting the type of Boolean operation public: //! @name Performing the operation //! Performs the Boolean operation. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; protected: //! @name Constructors diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx index 4e310b2f6d..09a841b7dc 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.cxx @@ -87,7 +87,7 @@ void BRepAlgoAPI_BuilderAlgo::Clear() //function : Build //purpose : //======================================================================= -void BRepAlgoAPI_BuilderAlgo::Build() +void BRepAlgoAPI_BuilderAlgo::Build(const Message_ProgressRange& theRange) { // Setting not done status NotDone(); @@ -102,16 +102,16 @@ void BRepAlgoAPI_BuilderAlgo::Build() myBuilder = new BOPAlgo_Builder(myAllocator); // Set arguments to builder myBuilder->SetArguments(myArguments); - + Message_ProgressScope aPS(theRange, NULL, 1); // Build the result basing on intersection results - BuildResult(); + BuildResult(aPS.Next()); } //======================================================================= //function : IntersectShapes //purpose : Intersects the given shapes with the intersection tool //======================================================================= -void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs) +void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange) { if (!myIsIntersectionNeeded) return; @@ -125,18 +125,16 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg myDSFiller->SetArguments(theArgs); // Set options for intersection myDSFiller->SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - myDSFiller->SetProgressIndicator(*myProgressScope); - } + myDSFiller->SetFuzzyValue(myFuzzyValue); myDSFiller->SetNonDestructive(myNonDestructive); myDSFiller->SetGlue(myGlue); myDSFiller->SetUseOBB(myUseOBB); // Set Face/Face intersection options to the intersection algorithm SetAttributes(); + Message_ProgressScope aPS(theRange, NULL, 1); // Perform intersection - myDSFiller->Perform(); + myDSFiller->Perform(aPS.Next()); // Check for the errors during intersection GetReport()->Merge(myDSFiller->GetReport()); } @@ -144,18 +142,16 @@ void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArg //function : BuildResult //purpose : Builds the result shape //======================================================================= -void BRepAlgoAPI_BuilderAlgo::BuildResult() +void BRepAlgoAPI_BuilderAlgo::BuildResult(const Message_ProgressRange& theRange) { // Set options to the builder myBuilder->SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - myBuilder->SetProgressIndicator(*myProgressScope); - } + myBuilder->SetCheckInverted(myCheckInverted); myBuilder->SetToFillHistory(myFillHistory); // Perform building of the result with pre-calculated intersections - myBuilder->PerformWithFiller(*myDSFiller); + Message_ProgressScope aPS(theRange, NULL, 1); + myBuilder->PerformWithFiller(*myDSFiller, aPS.Next()); // Merge the warnings of the Building part GetReport()->Merge(myBuilder->GetReport()); // Check for the errors diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.hxx index d8cc474de3..742485afda 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_BuilderAlgo.hxx @@ -138,7 +138,7 @@ public: //! @name Setting options public: //! @name Performing the operation //! Performs the algorithm - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; public: //! @name Result simplification @@ -250,10 +250,10 @@ protected: //! @name Setting options to the Intersection tool protected: //! @name Protected methods for shapes intersection and building result //! Intersects the given shapes with the intersection tool - Standard_EXPORT void IntersectShapes(const TopTools_ListOfShape& theArgs); + Standard_EXPORT void IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange = Message_ProgressRange()); //! Builds the resulting shape - Standard_EXPORT void BuildResult(); + Standard_EXPORT void BuildResult(const Message_ProgressRange& theRange = Message_ProgressRange()); protected: //! @name Clearing the contents of the algorithm diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx index 3dc0098779..de15f1c761 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Check.cxx @@ -38,7 +38,8 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check() //======================================================================= BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS, const Standard_Boolean bTestSE, - const Standard_Boolean bTestSI) + const Standard_Boolean bTestSI, + const Message_ProgressRange& theRange) : BOPAlgo_Options(), myS1(theS), @@ -46,7 +47,7 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS, myTestSI(bTestSI), myOperation(BOPAlgo_UNKNOWN) { - Perform(); + Perform(theRange); } //======================================================================= @@ -57,7 +58,8 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, const BOPAlgo_Operation theOp, const Standard_Boolean bTestSE, - const Standard_Boolean bTestSI) + const Standard_Boolean bTestSI, + const Message_ProgressRange& theRange) : BOPAlgo_Options(), myS1(theS1), @@ -66,7 +68,7 @@ BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS1, myTestSI(bTestSI), myOperation(theOp) { - Perform(); + Perform(theRange); } //======================================================================= @@ -81,7 +83,7 @@ BRepAlgoAPI_Check::~BRepAlgoAPI_Check() //function : Perform //purpose : //======================================================================= -void BRepAlgoAPI_Check::Perform() +void BRepAlgoAPI_Check::Perform(const Message_ProgressRange& theRange) { // Check the incompatibility of shapes types, small edges and self-interference BOPAlgo_ArgumentAnalyzer anAnalyzer; @@ -94,13 +96,14 @@ void BRepAlgoAPI_Check::Perform() anAnalyzer.SelfInterMode() = myTestSI; // Set options from BOPAlgo_Options anAnalyzer.SetRunParallel(myRunParallel); - if (myProgressScope != NULL) - { - anAnalyzer.SetProgressIndicator(*myProgressScope); - } anAnalyzer.SetFuzzyValue(myFuzzyValue); // Perform the check - anAnalyzer.Perform(); + Message_ProgressScope aPS(theRange, NULL, 1); + anAnalyzer.Perform(aPS.Next()); + if (!aPS.More()) + { + return; + } // Get the results myFaultyShapes = anAnalyzer.GetCheckResult(); diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx index e3ded7899c..38b954db81 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Check.hxx @@ -26,6 +26,7 @@ #include #include #include +#include //! The class Check provides a diagnostic tool for checking the validity @@ -66,9 +67,11 @@ public: //! @name Constructors //! on small edges or not; by default it is set to TRUE; //! @param bTestSI [in] - flag which specifies whether to check the shape //! on self-interference or not; by default it is set to TRUE; + //! @param theRange [in] - parameter to use progrs indicator Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS, const Standard_Boolean bTestSE = Standard_True, - const Standard_Boolean bTestSI = Standard_True); + const Standard_Boolean bTestSI = Standard_True, + const Message_ProgressRange& theRange = Message_ProgressRange()); //! Constructor for checking the couple of shapes. //! Additionally to the validity checks of each given shape, @@ -83,11 +86,13 @@ public: //! @name Constructors //! on small edges or not; by default it is set to TRUE; //! @param bTestSI [in] - flag which specifies whether to check the shape //! on self-interference or not; by default it is set to TRUE; + //! @param theRange [in] - parameter to use progrs indicator Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS1, const TopoDS_Shape& theS2, const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN, const Standard_Boolean bTestSE = Standard_True, - const Standard_Boolean bTestSI = Standard_True); + const Standard_Boolean bTestSI = Standard_True, + const Message_ProgressRange& theRange = Message_ProgressRange()); public: //! @name Initializing the algorithm @@ -141,7 +146,7 @@ public: //! @name Initializing the algorithm public: //! @name Performing the operation //! Performs the check. - Standard_EXPORT void Perform(); + Standard_EXPORT void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()); public: //! @name Getting the results. diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx index f2a3d4fdd1..09186489c0 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Cut.cxx @@ -52,11 +52,13 @@ BRepAlgoAPI_Cut::~BRepAlgoAPI_Cut() //purpose : //======================================================================= BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1, - const TopoDS_Shape& S2) + const TopoDS_Shape& S2, + const Message_ProgressRange& theRange) : BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_CUT) { - Build(); + Message_ProgressScope aPS(theRange, "Cut", 1); + Build(aPS.Next()); } //======================================================================= //function : BRepAlgoAPI_Cut @@ -65,10 +67,12 @@ BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1, BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF, - const Standard_Boolean bFWD) + const Standard_Boolean bFWD, + const Message_ProgressRange& theRange) : BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, (bFWD) ? BOPAlgo_CUT : BOPAlgo_CUT21) { - Build(); + Message_ProgressScope aPS(theRange, "Cut", 1); + Build(aPS.Next()); } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Cut.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Cut.hxx index b5255bb089..41dba20286 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Cut.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Cut.hxx @@ -50,7 +50,8 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Cut(); //! -tool //! - the type of the operation //! Obsolete - Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2); + Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2, + const Message_ProgressRange& theRange = Message_ProgressRange()); //! Constructor with two shapes //! -argument @@ -58,7 +59,9 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Cut(); //! - the type of the operation //! - PaveFiller object that is carried out //! Obsolete - Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF, const Standard_Boolean bFWD = Standard_True); + Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF, + const Standard_Boolean bFWD = Standard_True, + const Message_ProgressRange& theRange = Message_ProgressRange()); diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx index 272a876a94..2f4def8b8d 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx @@ -21,7 +21,7 @@ //function : Build //purpose : //======================================================================= -void BRepAlgoAPI_Defeaturing::Build() +void BRepAlgoAPI_Defeaturing::Build(const Message_ProgressRange& /*theRange*/) { // Set not done state for the operation NotDone(); diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.hxx index 43258f9548..a547766f76 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.hxx @@ -157,7 +157,7 @@ public: //! @name Setting input data for the algorithm public: //! @name Performing the operation //! Performs the operation - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; public: //! @name History Methods diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx index 1e24153be7..dd0f9488b4 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.cxx @@ -52,11 +52,13 @@ BRepAlgoAPI_Fuse::~BRepAlgoAPI_Fuse() //purpose : //======================================================================= BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, - const TopoDS_Shape& S2) + const TopoDS_Shape& S2, + const Message_ProgressRange& theRange) : BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_FUSE) { - Build(); + Message_ProgressScope aPS(theRange, "Fuse", 1); + Build(aPS.Next()); } //======================================================================= //function : BRepAlgoAPI_Fuse @@ -64,9 +66,11 @@ BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, //======================================================================= BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2, - const BOPAlgo_PaveFiller& aDSF) + const BOPAlgo_PaveFiller& aDSF, + const Message_ProgressRange& theRange) : BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, BOPAlgo_FUSE) { - Build(); + Message_ProgressScope aPS(theRange, "Fuse", 1); + Build(aPS.Next()); } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.hxx index 52dd5dc89e..53fd176773 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Fuse.hxx @@ -49,7 +49,8 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Fuse(); //! -tool //! - the type of the operation //! Obsolete - Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2); + Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2, + const Message_ProgressRange& theRange = Message_ProgressRange()); //! Constructor with two shapes //! -argument @@ -57,7 +58,8 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Fuse(); //! - the type of the operation //! - PaveFiller object that is carried out //! Obsolete - Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF); + Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF, + const Message_ProgressRange& theRange = Message_ProgressRange()); diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx index 2e59aaf5f4..407dee4cb7 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Section.cxx @@ -271,9 +271,10 @@ void BRepAlgoAPI_Section::SetAttributes() //function : Build //purpose : //======================================================================= -void BRepAlgoAPI_Section::Build() +void BRepAlgoAPI_Section::Build(const Message_ProgressRange& theRange) { - BRepAlgoAPI_BooleanOperation::Build(); + Message_ProgressScope aPS(theRange, NULL, 1); + BRepAlgoAPI_BooleanOperation::Build(aPS.Next()); } //======================================================================= //function : HasAncestorFaceOn1 diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx index 2582d5705a..78e525f8b7 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Section.hxx @@ -158,7 +158,7 @@ Standard_EXPORT virtual ~BRepAlgoAPI_Section(); //! Performs the algorithm //! Filling interference Data Structure (if it is necessary) //! Building the result of the operation. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! get the face of the first part giving section edge . diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx index 4a0fd00d70..e943e96918 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.cxx @@ -35,7 +35,7 @@ BRepAlgoAPI_Splitter::BRepAlgoAPI_Splitter(const BOPAlgo_PaveFiller& thePF) // function: Build // purpose: //======================================================================= -void BRepAlgoAPI_Splitter::Build() +void BRepAlgoAPI_Splitter::Build(const Message_ProgressRange& theRange) { // Set Not Done status by default NotDone(); @@ -50,6 +50,7 @@ void BRepAlgoAPI_Splitter::Build() } // If necessary perform intersection of the argument shapes + Message_ProgressScope aPS(theRange, NULL, myIsIntersectionNeeded ? 10 : 1); if (myIsIntersectionNeeded) { // Combine Arguments and Tools for intersection into a single list @@ -58,8 +59,8 @@ void BRepAlgoAPI_Splitter::Build() aLArgs.Append(it.Value()); // Perform intersection - IntersectShapes(aLArgs); - if (HasErrors()) + IntersectShapes(aLArgs, aPS.Next(9)); + if (HasErrors() || !aPS.More()) return; } @@ -69,5 +70,5 @@ void BRepAlgoAPI_Splitter::Build() ((BOPAlgo_Splitter*)myBuilder)->SetTools(myTools); // Build result shape basing on the intersection results - BuildResult(); + BuildResult(aPS.Next(1)); } diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.hxx b/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.hxx index 97288441d2..eed0680760 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.hxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Splitter.hxx @@ -82,7 +82,7 @@ public: //! @name Performing the operation //! Performs the Split operation. //! Performs the intersection of the argument shapes (both objects and tools) //! and splits objects by the tools. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; protected: //! @name Fields diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.cxx index ba27b58772..2ff0a1454c 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.cxx @@ -36,7 +36,7 @@ BRepBuilderAPI_MakeShape::BRepBuilderAPI_MakeShape() //purpose : //======================================================================= -void BRepBuilderAPI_MakeShape::Build() +void BRepBuilderAPI_MakeShape::Build(const Message_ProgressRange& /*theRange*/) { } diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.hxx b/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.hxx index 7536e26b13..d7d6b5ec91 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.hxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.hxx @@ -25,6 +25,7 @@ #include #include #include +#include class StdFail_NotDone; class TopoDS_Shape; @@ -42,7 +43,7 @@ public: //! This is called by Shape(). It does nothing but //! may be redefined. - Standard_EXPORT virtual void Build(); + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()); //! Returns a shape built by the shape construction algorithm. //! Raises exception StdFail_NotDone if the shape was not built. diff --git a/src/BRepFeat/BRepFeat_Builder.cxx b/src/BRepFeat/BRepFeat_Builder.cxx index 4a6635ea55..02cb5f5e3f 100644 --- a/src/BRepFeat/BRepFeat_Builder.cxx +++ b/src/BRepFeat/BRepFeat_Builder.cxx @@ -213,23 +213,25 @@ //function : PerformResult //purpose : //======================================================================= - void BRepFeat_Builder::PerformResult() + void BRepFeat_Builder::PerformResult(const Message_ProgressRange& theRange) { myOperation = myFuse ? BOPAlgo_FUSE : BOPAlgo_CUT; // + Message_ProgressScope aPSOuter(theRange, NULL, 2); if (!myShapes.IsEmpty()) { + Message_ProgressScope aPS(aPSOuter.Next(), "BRepFeat_Builder", 100); // Prepare(); // RebuildFaces(); // - FillImagesContainers(TopAbs_SHELL); - if (HasErrors()) { + FillImagesContainers(TopAbs_SHELL, aPS.Next(30)); + if (HasErrors() || !aPS.More()) { return; } // - FillImagesSolids(); - if (HasErrors()) { + FillImagesSolids(aPS.Next(30)); + if (HasErrors() || !aPS.More()) { return; } // @@ -240,8 +242,8 @@ return; } // - FillImagesCompounds(); - if (HasErrors()) { + FillImagesCompounds(aPS.Next(40)); + if (HasErrors() || !aPS.More()) { return; } // @@ -251,7 +253,7 @@ } } // - BuildShape(); + BuildShape(aPSOuter.Next()); } //======================================================================= diff --git a/src/BRepFeat/BRepFeat_Builder.hxx b/src/BRepFeat/BRepFeat_Builder.hxx index a9a96a03b5..9807e582c8 100644 --- a/src/BRepFeat/BRepFeat_Builder.hxx +++ b/src/BRepFeat/BRepFeat_Builder.hxx @@ -89,7 +89,7 @@ Standard_EXPORT virtual ~BRepFeat_Builder(); //! Main function to build the result of the //! local operation required. - Standard_EXPORT void PerformResult(); + Standard_EXPORT void PerformResult(const Message_ProgressRange& theRange = Message_ProgressRange()); //! Rebuilds faces in accordance with the kept parts of the tool. Standard_EXPORT void RebuildFaces(); diff --git a/src/BRepFeat/BRepFeat_Gluer.cxx b/src/BRepFeat/BRepFeat_Gluer.cxx index a6f9c836f8..b119560b4a 100644 --- a/src/BRepFeat/BRepFeat_Gluer.cxx +++ b/src/BRepFeat/BRepFeat_Gluer.cxx @@ -26,7 +26,7 @@ //function : Build //purpose : //======================================================================= -void BRepFeat_Gluer::Build() +void BRepFeat_Gluer::Build(const Message_ProgressRange& /*theRange*/) { myGluer.Perform(); if (myGluer.IsDone()) { diff --git a/src/BRepFeat/BRepFeat_Gluer.hxx b/src/BRepFeat/BRepFeat_Gluer.hxx index cd29cd033c..aba0dfe40c 100644 --- a/src/BRepFeat/BRepFeat_Gluer.hxx +++ b/src/BRepFeat/BRepFeat_Gluer.hxx @@ -91,7 +91,7 @@ public: //! This is called by Shape(). It does nothing but //! may be redefined. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! returns the status of the Face after //! the shape creation. diff --git a/src/BRepFeat/BRepFeat_SplitShape.cxx b/src/BRepFeat/BRepFeat_SplitShape.cxx index 2a559c05fa..4b5ea9399c 100644 --- a/src/BRepFeat/BRepFeat_SplitShape.cxx +++ b/src/BRepFeat/BRepFeat_SplitShape.cxx @@ -33,7 +33,7 @@ //function : Build //purpose : //======================================================================= -void BRepFeat_SplitShape::Build () +void BRepFeat_SplitShape::Build (const Message_ProgressRange& /*theRange*/) { mySShape.Perform(myWOnShape); if (mySShape.IsDone()) { diff --git a/src/BRepFeat/BRepFeat_SplitShape.hxx b/src/BRepFeat/BRepFeat_SplitShape.hxx index 1ebcce2a01..e38edf2d5e 100644 --- a/src/BRepFeat/BRepFeat_SplitShape.hxx +++ b/src/BRepFeat/BRepFeat_SplitShape.hxx @@ -109,7 +109,7 @@ public: Standard_EXPORT const TopTools_ListOfShape& Right() const; //! Builds the cut and the resulting faces and edges as well. - Standard_EXPORT void Build() Standard_OVERRIDE; + Standard_EXPORT void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns true if the shape has been deleted. Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S) Standard_OVERRIDE; diff --git a/src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx b/src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx index 25dbeb6190..85bcc71d61 100644 --- a/src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx +++ b/src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.cxx @@ -391,7 +391,7 @@ Handle(TopOpeBRepBuild_HBuilder) BRepFilletAPI_MakeChamfer::Builder()const //purpose : //======================================================================= -void BRepFilletAPI_MakeChamfer::Build() +void BRepFilletAPI_MakeChamfer::Build(const Message_ProgressRange& /*theRange*/) { myBuilder.Compute(); if (myBuilder.IsDone()){ diff --git a/src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.hxx b/src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.hxx index b395ef88fa..b13cc67e3c 100644 --- a/src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.hxx +++ b/src/BRepFilletAPI/BRepFilletAPI_MakeChamfer.hxx @@ -250,7 +250,7 @@ public: //! intersection of 4 or more edges of the shape, or //! - the intersection of the chamfer with a face which //! limits the contour is not fully contained in this face. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Reinitializes this algorithm, thus canceling the effects of the Build function. //! This function allows modifications to be made to the diff --git a/src/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx b/src/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx index 8a942e992b..54c31dafd1 100644 --- a/src/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx +++ b/src/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx @@ -528,7 +528,7 @@ Handle(TopOpeBRepBuild_HBuilder) BRepFilletAPI_MakeFillet::Builder()const //purpose : //======================================================================= -void BRepFilletAPI_MakeFillet::Build() +void BRepFilletAPI_MakeFillet::Build(const Message_ProgressRange& /*theRange*/) { myBuilder.Compute(); if(myBuilder.IsDone()) { diff --git a/src/BRepFilletAPI/BRepFilletAPI_MakeFillet.hxx b/src/BRepFilletAPI/BRepFilletAPI_MakeFillet.hxx index 8c22d8a09c..1d4dee1bab 100644 --- a/src/BRepFilletAPI/BRepFilletAPI_MakeFillet.hxx +++ b/src/BRepFilletAPI/BRepFilletAPI_MakeFillet.hxx @@ -293,7 +293,7 @@ public: //! intersection of 4 or more edges of the shape, or //! - the intersection of the fillet with a face which limits //! the contour is not fully contained in this face. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Reinitializes this algorithm, thus canceling the effects of the Build function. //! This function allows modifications to be made to the diff --git a/src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.cxx b/src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.cxx index 08926078e6..3c544d8e63 100644 --- a/src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.cxx +++ b/src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.cxx @@ -155,7 +155,7 @@ const TopoDS_Edge& BRepFilletAPI_MakeFillet2d::BasisEdge(const TopoDS_Edge& E) c //purpose : //======================================================================= -void BRepFilletAPI_MakeFillet2d::Build() +void BRepFilletAPI_MakeFillet2d::Build(const Message_ProgressRange& /*theRange*/) { // test if the operation is done if (Status() == ChFi2d_IsDone) { diff --git a/src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.hxx b/src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.hxx index 645e4b14f2..a7a3a85a26 100644 --- a/src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.hxx +++ b/src/BRepFilletAPI/BRepFilletAPI_MakeFillet2d.hxx @@ -282,7 +282,7 @@ public: ChFi2d_ConstructionError Status() const; //! Update the result and set the Done flag - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx index 50eadac75b..4e2f73ed37 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx @@ -305,7 +305,7 @@ TopoDS_Shape BRepOffsetAPI_DraftAngle::ModifiedShape //purpose : //======================================================================= -void BRepOffsetAPI_DraftAngle::Build() +void BRepOffsetAPI_DraftAngle::Build(const Message_ProgressRange& /*theRange*/) { Handle(Draft_Modification)::DownCast (myModification)->Perform(); if (!Handle(Draft_Modification)::DownCast (myModification)->IsDone()) { diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.hxx index 8fef1b0227..a74e31b3bb 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.hxx @@ -176,7 +176,7 @@ public: Standard_EXPORT const TopTools_ListOfShape& ModifiedFaces() const; //! Builds the resulting shape (redefined from MakeShape). - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; Standard_EXPORT void CorrectWires(); diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx index 1b7612b570..0fc1c6763c 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx @@ -114,7 +114,7 @@ const BRepFill_Evolved& BRepOffsetAPI_MakeEvolved::Evolved() const //function : Build //purpose : //======================================================================= -void BRepOffsetAPI_MakeEvolved::Build() +void BRepOffsetAPI_MakeEvolved::Build(const Message_ProgressRange& /*theRange*/) { if (myEvolved.IsDone()) { diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.hxx index ea2e106211..f311f4c561 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.hxx @@ -106,7 +106,7 @@ public: Standard_EXPORT const BRepFill_Evolved& Evolved() const; //! Builds the resulting shape (redefined from MakeShape). - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the shapes created from a subshape //! of the spine and a subshape diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.cxx index b8bfcbef66..5eb9909159 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.cxx @@ -144,7 +144,7 @@ Standard_Integer BRepOffsetAPI_MakeFilling::Add( const Standard_Real U, //function : Build //purpose : builds the resulting face //====================================================================== -void BRepOffsetAPI_MakeFilling::Build() +void BRepOffsetAPI_MakeFilling::Build(const Message_ProgressRange& /*theRange*/) { myFilling.Build(); myShape = myFilling.Face(); diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.hxx index 975eac073e..641633c407 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeFilling.hxx @@ -183,7 +183,7 @@ public: Standard_EXPORT Standard_Integer Add (const Standard_Real U, const Standard_Real V, const TopoDS_Face& Support, const GeomAbs_Shape Order); //! Builds the resulting faces - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Tests whether computation of the filling plate has been completed. Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx index df157f5b05..c5683e57a6 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx @@ -371,7 +371,7 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset, //purpose : //======================================================================= -void BRepOffsetAPI_MakeOffset::Build() +void BRepOffsetAPI_MakeOffset::Build(const Message_ProgressRange& /*theRange*/) { Done(); } diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.hxx index f2ea8cb646..1ab16bb1fd 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.hxx @@ -79,7 +79,7 @@ public: Standard_EXPORT void Perform (const Standard_Real Offset, const Standard_Real Alt = 0.0); //! Builds the resulting shape (redefined from MakeShape). - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! returns a list of the created shapes //! from the shape . diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.cxx index 99e6eb4a74..d00d7d1610 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.cxx @@ -90,7 +90,7 @@ const BRepOffset_MakeOffset& BRepOffsetAPI_MakeOffsetShape::MakeOffset() const //function : Build //purpose : //======================================================================= -void BRepOffsetAPI_MakeOffsetShape::Build() +void BRepOffsetAPI_MakeOffsetShape::Build(const Message_ProgressRange& /*theRange*/) { } diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.hxx index c380e1b275..1a863c1091 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.hxx @@ -120,7 +120,7 @@ public: Standard_EXPORT virtual const BRepOffset_MakeOffset& MakeOffset() const; //! Does nothing. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the list of shapes generated from the shape . Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.cxx index a4131ea8ca..3d3f80fe6e 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.cxx @@ -77,7 +77,7 @@ const BRepFill_Pipe& BRepOffsetAPI_MakePipe::Pipe() const //purpose : //======================================================================= -void BRepOffsetAPI_MakePipe::Build() +void BRepOffsetAPI_MakePipe::Build(const Message_ProgressRange& /*theRange*/) { myShape = myPipe.Shape(); //Check for emptiness of result diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx index fc49ce31eb..7e2f30f8ec 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx @@ -71,7 +71,7 @@ public: Standard_EXPORT const BRepFill_Pipe& Pipe() const; //! Builds the resulting shape (redefined from MakeShape). - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the TopoDS Shape of the bottom of the prism. Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx index ef0343c4a0..b222a52b04 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx @@ -253,7 +253,7 @@ void BRepOffsetAPI_MakePipeShell::SetMaxSegments(const Standard_Integer NewMaxSe //function :Build() //purpose : //======================================================================= - void BRepOffsetAPI_MakePipeShell::Build() + void BRepOffsetAPI_MakePipeShell::Build(const Message_ProgressRange& /*theRange*/) { Standard_Boolean Ok; Ok = myPipe->Build(); diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx index a10a9d4f31..401df7340d 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.hxx @@ -241,7 +241,7 @@ public: Standard_EXPORT void Simulate (const Standard_Integer NumberOfSection, TopTools_ListOfShape& Result); //! Builds the resulting shape (redefined from MakeShape). - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Transforms the sweeping Shell in Solid. //! If a propfile is not closed returns False diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cxx index 4376c6cd0a..5024a3dfad 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cxx @@ -89,7 +89,7 @@ void BRepOffsetAPI_MakeThickSolid::MakeThickSolidBySimple(const TopoDS_Shape& th //function : Build //purpose : //======================================================================= -void BRepOffsetAPI_MakeThickSolid::Build() +void BRepOffsetAPI_MakeThickSolid::Build(const Message_ProgressRange& /*theRange*/) { } diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.hxx index 4dc6589c3d..b15eb150f5 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.hxx @@ -113,7 +113,7 @@ public: const Standard_Boolean RemoveIntEdges = Standard_False); // Does nothing. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the list of shapes modified from the shape //! . diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx index 305c6ffdcf..67bce0849c 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx @@ -332,7 +332,7 @@ BRepOffsetAPI_MiddlePath::BRepOffsetAPI_MiddlePath(const TopoDS_Shape& aShape, //purpose : //======================================================================= -void BRepOffsetAPI_MiddlePath::Build() +void BRepOffsetAPI_MiddlePath::Build(const Message_ProgressRange& /*theRange*/) { TopTools_ListIteratorOfListOfShape itl; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.hxx index a68cb68368..68e533ca43 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.hxx @@ -43,7 +43,7 @@ public: //! a wire or a face Standard_EXPORT BRepOffsetAPI_MiddlePath(const TopoDS_Shape& aShape, const TopoDS_Shape& StartShape, const TopoDS_Shape& EndShape); - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.cxx index 08361b7a84..6d0be92578 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.cxx @@ -61,7 +61,7 @@ BRepOffsetAPI_NormalProjection::BRepOffsetAPI_NormalProjection() myNormalProjector.Compute3d(With3d); } - void BRepOffsetAPI_NormalProjection::Build() + void BRepOffsetAPI_NormalProjection::Build(const Message_ProgressRange& /*theRange*/) { myNormalProjector.Build(); myShape = myNormalProjector.Projection(); diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.hxx index 2156812b9c..4b569019e0 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_NormalProjection.hxx @@ -91,7 +91,7 @@ public: //! Builds the result of the projection as a compound of //! wires. Tries to build oriented wires. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns true if the object was correctly built by the shape //! construction algorithm. diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx index dd7eeee2e9..745eba1f38 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx @@ -339,7 +339,7 @@ void BRepOffsetAPI_ThruSections::CheckCompatibility(const Standard_Boolean check //purpose : //======================================================================= -void BRepOffsetAPI_ThruSections::Build() +void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/) { //Check set of section for right configuration of punctual sections Standard_Integer i; diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx index 79c88394d4..705939443b 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.hxx @@ -130,7 +130,7 @@ public: //! the optimization. Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const; - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the TopoDS Shape of the bottom of the loft if solid Standard_EXPORT const TopoDS_Shape& FirstShape() const; diff --git a/src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx b/src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx index 5a75797ed1..6cd21578fb 100644 --- a/src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx +++ b/src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx @@ -27,7 +27,7 @@ //function : Build //purpose : //======================================================================= -void BRepPreviewAPI_MakeBox::Build() +void BRepPreviewAPI_MakeBox::Build(const Message_ProgressRange& /*theRange*/) { gp_Pnt anLocation = myWedge.Axes().Location(); diff --git a/src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.hxx b/src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.hxx index 3cee338dc1..17c478676c 100644 --- a/src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.hxx +++ b/src/BRepPreviewAPI/BRepPreviewAPI_MakeBox.hxx @@ -34,7 +34,7 @@ public: BRepPreviewAPI_MakeBox() {} //! Creates a preview depending on point values. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; private: diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx b/src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx index 8cf9916704..52cda67cc8 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx @@ -181,7 +181,7 @@ const TopoDS_Shell& BRepPrimAPI_MakeBox::Shell() //purpose : //======================================================================= -void BRepPrimAPI_MakeBox::Build() +void BRepPrimAPI_MakeBox::Build(const Message_ProgressRange& /*theRange*/) { Solid(); } diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeBox.hxx b/src/BRepPrimAPI/BRepPrimAPI_MakeBox.hxx index dd58918ab4..26c2680cd7 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeBox.hxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeBox.hxx @@ -98,7 +98,7 @@ public: Standard_EXPORT BRepPrim_Wedge& Wedge(); //! Stores the solid in myShape. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the constructed box as a shell. Standard_EXPORT const TopoDS_Shell& Shell(); diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.cxx b/src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.cxx index 218a0b9e51..dc9d9fefe4 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.cxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.cxx @@ -51,7 +51,7 @@ const TopoDS_Shell& BRepPrimAPI_MakeOneAxis::Shell() //purpose : //======================================================================= -void BRepPrimAPI_MakeOneAxis::Build() +void BRepPrimAPI_MakeOneAxis::Build(const Message_ProgressRange& /*theRange*/) { BRep_Builder B; B.MakeSolid(TopoDS::Solid(myShape)); diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.hxx b/src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.hxx index 0bf2bd6c27..647300dde4 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.hxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeOneAxis.hxx @@ -43,7 +43,7 @@ public: Standard_EXPORT virtual Standard_Address OneAxis() = 0; //! Stores the solid in myShape. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the lateral face of the rotational primitive. Standard_EXPORT const TopoDS_Face& Face(); diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakePrism.cxx b/src/BRepPrimAPI/BRepPrimAPI_MakePrism.cxx index 18d9803257..40809742c2 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakePrism.cxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakePrism.cxx @@ -78,7 +78,7 @@ const BRepSweep_Prism& BRepPrimAPI_MakePrism::Prism()const //purpose : //======================================================================= -void BRepPrimAPI_MakePrism::Build() +void BRepPrimAPI_MakePrism::Build(const Message_ProgressRange& /*theRange*/) { myShape = myPrism.Shape(); Done(); diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakePrism.hxx b/src/BRepPrimAPI/BRepPrimAPI_MakePrism.hxx index c33de96aac..d069851b3f 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakePrism.hxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakePrism.hxx @@ -72,7 +72,7 @@ public: Standard_EXPORT const BRepSweep_Prism& Prism() const; //! Builds the resulting shape (redefined from MakeShape). - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the TopoDS Shape of the bottom of the prism. Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE; diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx b/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx index ec5a69a96e..b8e61e9b06 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.cxx @@ -109,7 +109,7 @@ const BRepSweep_Revol& BRepPrimAPI_MakeRevol::Revol() const //purpose : //======================================================================= -void BRepPrimAPI_MakeRevol::Build() +void BRepPrimAPI_MakeRevol::Build(const Message_ProgressRange& /*theRange*/) { if (myIsBuild) { diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.hxx b/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.hxx index a24adbad2b..1132df39ca 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.hxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeRevol.hxx @@ -81,7 +81,7 @@ public: Standard_EXPORT const BRepSweep_Revol& Revol() const; //! Builds the resulting shape (redefined from MakeShape). - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the first shape of the revol (coinciding with //! the generating shape). diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx b/src/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx index 0491f4f9e1..d98e4d25d8 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx @@ -119,7 +119,7 @@ const TopoDS_Shell& BRepPrimAPI_MakeWedge::Shell() //purpose : //======================================================================= -void BRepPrimAPI_MakeWedge::Build() +void BRepPrimAPI_MakeWedge::Build(const Message_ProgressRange& /*theRange*/) { BRep_Builder B; B.MakeSolid(TopoDS::Solid(myShape)); diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeWedge.hxx b/src/BRepPrimAPI/BRepPrimAPI_MakeWedge.hxx index c65b051c65..5ade9348bb 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeWedge.hxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeWedge.hxx @@ -60,7 +60,7 @@ public: Standard_EXPORT BRepPrim_Wedge& Wedge(); //! Stores the solid in myShape. - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; //! Returns the constructed box in the form of a shell. Standard_EXPORT const TopoDS_Shell& Shell(); diff --git a/src/BRepTest/BRepTest_FilletCommands.cxx b/src/BRepTest/BRepTest_FilletCommands.cxx index a9af23106d..78e52fe2e7 100644 --- a/src/BRepTest/BRepTest_FilletCommands.cxx +++ b/src/BRepTest/BRepTest_FilletCommands.cxx @@ -52,6 +52,7 @@ #include #include #include +#include #include @@ -357,23 +358,35 @@ Standard_Integer boptopoblend(Draw_Interpretor& di, Standard_Integer narg, const } BOPAlgo_PaveFiller theDSFiller; + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1); + Message_ProgressScope aPS(aProgress->Start(), NULL, 10); TopTools_ListOfShape aLS; aLS.Append(S1); aLS.Append(S2); theDSFiller.SetArguments(aLS); // - theDSFiller.Perform(); + theDSFiller.Perform(aPS.Next(8)); if (theDSFiller.HasErrors()) { Message::SendFail() << "Check types of the arguments, please"; return 1; } + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 1; + } BRepAlgoAPI_BooleanOperation* pBuilder=NULL; - if (fuse) - pBuilder = new BRepAlgoAPI_Fuse( S1, S2, theDSFiller ); + pBuilder = new BRepAlgoAPI_Fuse( S1, S2, theDSFiller, aPS.Next(2) ); else - pBuilder = new BRepAlgoAPI_Cut ( S1, S2, theDSFiller ); + pBuilder = new BRepAlgoAPI_Cut ( S1, S2, theDSFiller, Standard_True, aPS.Next(2)); + + if (aProgress->UserBreak()) + { + di << "Error: User break \n"; + return 1; + } Standard_Boolean anIsDone = pBuilder->IsDone(); if (!anIsDone) diff --git a/src/IntTools/IntTools_BeanFaceIntersector.cxx b/src/IntTools/IntTools_BeanFaceIntersector.cxx index 0909c74360..0572840b06 100644 --- a/src/IntTools/IntTools_BeanFaceIntersector.cxx +++ b/src/IntTools/IntTools_BeanFaceIntersector.cxx @@ -377,10 +377,11 @@ void IntTools_BeanFaceIntersector::Perform() if (!isLocalized) { ComputeAroundExactIntersection(); - + ComputeUsingExtremum(); - + ComputeNearRangeBoundaries(); + } myIsDone = Standard_True; diff --git a/src/IntTools/IntTools_BeanFaceIntersector.hxx b/src/IntTools/IntTools_BeanFaceIntersector.hxx index 7ee7b6e069..cb8da52172 100644 --- a/src/IntTools/IntTools_BeanFaceIntersector.hxx +++ b/src/IntTools/IntTools_BeanFaceIntersector.hxx @@ -31,6 +31,7 @@ #include #include #include +#include class Geom_Surface; class IntTools_Context; class TopoDS_Edge; diff --git a/src/IntTools/IntTools_EdgeFace.hxx b/src/IntTools/IntTools_EdgeFace.hxx index 8acc5c190e..e3b8eb1541 100644 --- a/src/IntTools/IntTools_EdgeFace.hxx +++ b/src/IntTools/IntTools_EdgeFace.hxx @@ -30,6 +30,7 @@ #include #include #include +#include class IntTools_Context; class TopoDS_Edge; class TopoDS_Face; diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index 6b4047c998..2279c91d3e 100644 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -357,8 +357,10 @@ static Standard_Boolean isTreatAnalityc(const BRepAdaptor_Surface& theBAS1, //purpose : intersect surfaces of the faces //======================================================================= void IntTools_FaceFace::Perform(const TopoDS_Face& aF1, - const TopoDS_Face& aF2) + const TopoDS_Face& aF2, + const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, NULL, 1); if (myContext.IsNull()) { myContext=new IntTools_Context; } diff --git a/src/IntTools/IntTools_FaceFace.hxx b/src/IntTools/IntTools_FaceFace.hxx index 33204ce7cc..88cd67795e 100644 --- a/src/IntTools/IntTools_FaceFace.hxx +++ b/src/IntTools/IntTools_FaceFace.hxx @@ -22,6 +22,7 @@ #include #include #include +#include #include class IntTools_Context; @@ -48,7 +49,7 @@ public: //! Intersects underliing surfaces of F1 and F2 //! Use sum of tolerance of F1 and F2 as intersection //! criteria - Standard_EXPORT void Perform (const TopoDS_Face& F1, const TopoDS_Face& F2); + Standard_EXPORT void Perform (const TopoDS_Face& F1, const TopoDS_Face& F2, const Message_ProgressRange& theRange = Message_ProgressRange()); //! Returns True if the intersection was successful diff --git a/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx b/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx index fc4bf61dbd..66fd7791a7 100644 --- a/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx +++ b/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.cxx @@ -142,7 +142,7 @@ ShapeConstruct_MakeTriangulation::ShapeConstruct_MakeTriangulation (const TopoDS //purpose : //======================================================================= - void ShapeConstruct_MakeTriangulation::Build() + void ShapeConstruct_MakeTriangulation::Build(const Message_ProgressRange& /*theRange*/) { if (myShape.IsNull()) { // Triangulate polygonal wire diff --git a/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.hxx b/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.hxx index db04bbc859..10ed234cc7 100644 --- a/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.hxx +++ b/src/ShapeConstruct/ShapeConstruct_MakeTriangulation.hxx @@ -41,7 +41,7 @@ public: Standard_EXPORT ShapeConstruct_MakeTriangulation(const TopoDS_Wire& wire, const Standard_Real prec = 0.0); - Standard_EXPORT virtual void Build() Standard_OVERRIDE; + Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE; Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE; -- 2.39.5