From: akaftasev Date: Thu, 18 Mar 2021 16:44:11 +0000 (+0300) Subject: 0030788: Modeling Algorithms - BRepAlgoAPI_Defeaturing does not propagate progress... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FCR30788;p=occt-copy.git 0030788: Modeling Algorithms - BRepAlgoAPI_Defeaturing does not propagate progress indicator to underlying algorithms Added progress indicator to BRepAlgoAPI_Defeaturing --- diff --git a/src/BOPAlgo/BOPAlgo_Algo.cxx b/src/BOPAlgo/BOPAlgo_Algo.cxx index 1fd54eced9..1b176fa5cb 100644 --- a/src/BOPAlgo/BOPAlgo_Algo.cxx +++ b/src/BOPAlgo/BOPAlgo_Algo.cxx @@ -48,7 +48,7 @@ BOPAlgo_Algo::~BOPAlgo_Algo() // function: CheckData // purpose: //======================================================================= -void BOPAlgo_Algo::CheckData() +void BOPAlgo_Algo::CheckData(const Message_ProgressRange& /*theRange*/) { GetReport()->Clear(Message_Fail); } diff --git a/src/BOPAlgo/BOPAlgo_Algo.hxx b/src/BOPAlgo/BOPAlgo_Algo.hxx index 029bb00e24..51a7a29a55 100644 --- a/src/BOPAlgo/BOPAlgo_Algo.hxx +++ b/src/BOPAlgo/BOPAlgo_Algo.hxx @@ -46,7 +46,7 @@ protected: Standard_EXPORT BOPAlgo_Algo(const Handle(NCollection_BaseAllocator)& theAllocator); //! Checks input data - Standard_EXPORT virtual void CheckData(); + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange); //! Checks the obtained result Standard_EXPORT virtual void CheckResult(); diff --git a/src/BOPAlgo/BOPAlgo_BOP.cxx b/src/BOPAlgo/BOPAlgo_BOP.cxx index 733df41a00..cbf1b15a18 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP.cxx @@ -119,8 +119,9 @@ BOPAlgo_Operation BOPAlgo_BOP::Operation()const //function : CheckData //purpose : //======================================================================= -void BOPAlgo_BOP::CheckData() +void BOPAlgo_BOP::CheckData(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, "Cheching data", 1); Standard_Integer i, j, aNbArgs, aNbTools; Standard_Boolean bFuse; TopTools_ListIteratorOfListOfShape aItLS; @@ -416,8 +417,9 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me myFuzzyValue = myPaveFiller->FuzzyValue(); myNonDestructive = myPaveFiller->NonDestructive(); // + Message_ProgressScope aPS(theRange, "PerformInternal", 100); // 1. CheckData - CheckData(); + CheckData(aPS.Next(5)); if (HasErrors()) { return; } @@ -437,7 +439,6 @@ void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Me } } // - Message_ProgressScope aPS(theRange, "PerformInternal", 100); NCollection_Array1 aSteps = BOPAlgo_Builder::AnalyzeProgress(); // 3. Fill Images // 3.1 Vertices diff --git a/src/BOPAlgo/BOPAlgo_BOP.hxx b/src/BOPAlgo/BOPAlgo_BOP.hxx index ee9f97ddac..4581e99116 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.hxx +++ b/src/BOPAlgo/BOPAlgo_BOP.hxx @@ -88,7 +88,7 @@ public: protected: - Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange) Standard_OVERRIDE; //! Performs calculations using prepared Filler //! object diff --git a/src/BOPAlgo/BOPAlgo_Builder.cxx b/src/BOPAlgo/BOPAlgo_Builder.cxx index 9ea9085d12..d556c5cfd8 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder.cxx @@ -137,9 +137,10 @@ void BOPAlgo_Builder::SetArguments(const TopTools_ListOfShape& theShapes) // function: CheckData // purpose: //======================================================================= -void BOPAlgo_Builder::CheckData() +void BOPAlgo_Builder::CheckData(const Message_ProgressRange& theRange) { Standard_Integer aNb = myArguments.Extent(); + Message_ProgressScope aPS(theRange, "Checking data", 1); if (aNb<2) { AddError (new BOPAlgo_AlertTooFewArguments); // too few arguments to process return; @@ -256,7 +257,7 @@ NCollection_Array1 BOPAlgo_Builder::AnalyzeProgress() aSteps(i) = 0; } - Standard_Real aPart = 100.; + Standard_Real aPart = 95.; Standard_Integer aNbV = myDS->ShapesSD().Size(); Standard_Integer aNbE = 0; Standard_Integer aNbW = 0; @@ -335,7 +336,7 @@ void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, cons // Message_ProgressScope aPS(theRange, "PerformInternal", 100); // 1. CheckData - CheckData(); + CheckData(aPS.Next(5)); if (HasErrors()) { return; } diff --git a/src/BOPAlgo/BOPAlgo_Builder.hxx b/src/BOPAlgo/BOPAlgo_Builder.hxx index 759ff84712..071861fcdb 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.hxx +++ b/src/BOPAlgo/BOPAlgo_Builder.hxx @@ -358,7 +358,7 @@ protected: //! @name Methods for building the result protected: //! @name Checking input arguments //! Checks the input data. - Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange) Standard_OVERRIDE; //! Checks if the intersection algorithm has Errors/Warnings. Standard_EXPORT void CheckFiller(); diff --git a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx index 942a66a5bb..98f35d7969 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx @@ -127,7 +127,7 @@ const TopoDS_Face& BOPAlgo_BuilderFace::Face()const //function : CheckData //purpose : //======================================================================= -void BOPAlgo_BuilderFace::CheckData() +void BOPAlgo_BuilderFace::CheckData(const Message_ProgressRange& /*theRange*/) { if (myFace.IsNull()) { AddError (new BOPAlgo_AlertNullInputShapes); @@ -141,11 +141,12 @@ void BOPAlgo_BuilderFace::CheckData() //function : Perform //purpose : //======================================================================= -void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& /*theRange*/) +void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& theRange) { GetReport()->Clear(); // - CheckData(); + Message_ProgressScope aPS(theRange, NULL, 1); + CheckData(aPS.Next()); if (HasErrors()) { return; } diff --git a/src/BOPAlgo/BOPAlgo_BuilderFace.hxx b/src/BOPAlgo/BOPAlgo_BuilderFace.hxx index 2bc2966151..a276426dac 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderFace.hxx +++ b/src/BOPAlgo/BOPAlgo_BuilderFace.hxx @@ -78,7 +78,7 @@ protected: //! Build finalized faces with internals Standard_EXPORT virtual void PerformInternalShapes() Standard_OVERRIDE; - Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange) Standard_OVERRIDE; TopoDS_Face myFace; diff --git a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx index 97618d4a16..5fc6695c26 100644 --- a/src/BOPAlgo/BOPAlgo_MakerVolume.cxx +++ b/src/BOPAlgo/BOPAlgo_MakerVolume.cxx @@ -34,8 +34,9 @@ static //function : CheckData //purpose : //======================================================================= -void BOPAlgo_MakerVolume::CheckData() +void BOPAlgo_MakerVolume::CheckData(const Message_ProgressRange& theRange) { + Message_ProgressScope aPS(theRange, "Checking data", 1); if (myArguments.IsEmpty()) { AddError (new BOPAlgo_AlertTooFewArguments); // no arguments to process return; @@ -113,7 +114,8 @@ void BOPAlgo_MakerVolume::PerformInternal1 myContext = myPaveFiller->Context(); // // 1. CheckData - CheckData(); + Message_ProgressScope aPSOuter(theRange, NULL, myIntersect ? 100 : 5); + CheckData(aPSOuter.Next(5)); if (HasErrors()) { return; } @@ -127,7 +129,7 @@ void BOPAlgo_MakerVolume::PerformInternal1 // 3. Fill Images // 3.1. Vertice if (myIntersect) { - Message_ProgressScope aPS(theRange, "PerformInternal", 100); + Message_ProgressScope aPS(aPSOuter.Next(95), "PerformInternal", 100); NCollection_Array1 aSteps = AnalyzeProgress(); FillImagesVertices(aPS.Next(aSteps(0))); diff --git a/src/BOPAlgo/BOPAlgo_MakerVolume.hxx b/src/BOPAlgo/BOPAlgo_MakerVolume.hxx index faff5c8800..d52d24b2f5 100644 --- a/src/BOPAlgo/BOPAlgo_MakerVolume.hxx +++ b/src/BOPAlgo/BOPAlgo_MakerVolume.hxx @@ -156,7 +156,7 @@ public: protected: //! Checks the data. - Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange) Standard_OVERRIDE; //! Analyze progress steps Standard_EXPORT NCollection_Array1 AnalyzeProgress() Standard_OVERRIDE; diff --git a/src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx b/src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx index 7616e1d841..6e79983e2f 100644 --- a/src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx +++ b/src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx @@ -124,7 +124,7 @@ static void FindSolid(const TopoDS_Shape& theSolIn, // function: Perform // purpose: Performs the removal of the requested faces from the input shape //======================================================================= -void BOPAlgo_RemoveFeatures::Perform(const Message_ProgressRange& /*theRange*/) +void BOPAlgo_RemoveFeatures::Perform(const Message_ProgressRange& theRange) { try { @@ -132,22 +132,30 @@ void BOPAlgo_RemoveFeatures::Perform(const Message_ProgressRange& /*theRange*/) if (HasHistory()) myHistory = new BRepTools_History(); - + Message_ProgressScope aPS(theRange, "Remove features", 100); // Check the input data - CheckData(); + CheckData(aPS.Next(5)); if (HasErrors()) return; // Prepare the faces to remove. - PrepareFeatures(); + PrepareFeatures(aPS.Next(10)); if (HasErrors()) return; // Remove the features and fill the created gaps - RemoveFeatures(); + RemoveFeatures(aPS.Next(70)); + if (HasErrors()) + { + return; + } // Update history with the removed features - UpdateHistory(); + UpdateHistory(aPS.Next(15)); + if (HasErrors()) + { + return; + } // Simplify the result SimplifyResult(); @@ -165,7 +173,7 @@ void BOPAlgo_RemoveFeatures::Perform(const Message_ProgressRange& /*theRange*/) // function: CheckData // purpose: Checks the input data on validity for the algorithm //======================================================================= -void BOPAlgo_RemoveFeatures::CheckData() +void BOPAlgo_RemoveFeatures::CheckData(const Message_ProgressRange& theRange) { // Prepare the shape to work with myShape = myInputShape; @@ -173,9 +181,10 @@ void BOPAlgo_RemoveFeatures::CheckData() // Check the type of input shape const TopAbs_ShapeEnum aType = myInputShape.ShapeType(); + Message_ProgressScope aPSOuter(theRange, "Checking data", 1); + if (aType == TopAbs_SOLID || aType == TopAbs_COMPSOLID) return; // OK - if (aType == TopAbs_COMPOUND) { TopTools_ListOfShape aShapes; @@ -193,8 +202,13 @@ void BOPAlgo_RemoveFeatures::CheckData() TopTools_ListOfShape aSolids; TopTools_ListOfShape anOtherShapes; TopTools_ListIteratorOfListOfShape aIt(aShapes); - for (; aIt.More(); aIt.Next()) + Message_ProgressScope aPS(aPSOuter.Next(), "Checking data", aShapes.Size()); + for (; aIt.More(); aIt.Next(), aPS.Next()) { + if (UserBreak(aPS)) + { + return; + } const TopoDS_Shape& aS = aIt.Value(); if (aS.ShapeType() == TopAbs_SOLID || aS.ShapeType() == TopAbs_COMPSOLID) aSolids.Append(aS); @@ -243,7 +257,7 @@ void BOPAlgo_RemoveFeatures::CheckData() // function: PrepareFeatures // purpose: Prepares the features to remove //======================================================================= -void BOPAlgo_RemoveFeatures::PrepareFeatures() +void BOPAlgo_RemoveFeatures::PrepareFeatures(const Message_ProgressRange& theRange) { // Map all sub-shapes of the input solids TopExp::MapShapes(myInputShape, myInputsMap); @@ -251,8 +265,13 @@ void BOPAlgo_RemoveFeatures::PrepareFeatures() // Collect all faces of the input shape requested for removal TopTools_ListOfShape aFacesToRemove; TopTools_ListIteratorOfListOfShape aIt(myFacesToRemove); - for (; aIt.More(); aIt.Next()) + Message_ProgressScope aPS(theRange, "Preparing the faces to remove", myFacesToRemove.Size()); + for (; aIt.More(); aIt.Next(), aPS.Next()) { + if (UserBreak(aPS)) + { + return; + } const TopoDS_Shape& aS = aIt.Value(); TopExp_Explorer anExpF(aS, TopAbs_FACE); for (; anExpF.More(); anExpF.Next()) @@ -327,12 +346,22 @@ public: //! @name Setters/Getters return myHistory; } + void SetRange(const Message_ProgressRange& theRange) + { + myRange = theRange; + } + public: //! @name Perform the operation //! Performs the extension of the adjacent faces and //! then trims the extended faces to fill the gaps void Perform() { + Message_ProgressScope aPS(myRange, NULL, 1); + if (!aPS.More()) + { + return; + } OCC_CATCH_SIGNALS try @@ -705,6 +734,7 @@ private: //! @name Fields TopoDS_Shape myFeature; //!< Feature to remove TopTools_IndexedDataMapOfShapeListOfShape* myEFMap; //!< EF Connection map to find adjacent faces TopTools_IndexedDataMapOfShapeListOfShape* myFSMap; //!< FS Connection map to find solids participating in the feature removal + Message_ProgressRange myRange; //!< Indication of progress // Results TopTools_MapOfShape myFeatureFacesMap; //!< Faces of the feature @@ -721,7 +751,7 @@ typedef NCollection_Vector VectorOfFillGap; // purpose: Remove features by filling the gaps by extension of the // adjacent faces //======================================================================= -void BOPAlgo_RemoveFeatures::RemoveFeatures() +void BOPAlgo_RemoveFeatures::RemoveFeatures(const Message_ProgressRange& theRange) { // For each feature: // - Find the faces adjacent to the feature; @@ -745,6 +775,7 @@ void BOPAlgo_RemoveFeatures::RemoveFeatures() VectorOfFillGap aVFG; // Fill the vector TopTools_ListIteratorOfListOfShape itF(myFeatures); + Message_ProgressScope aPSOuter(theRange, "Removing features", 100); for (; itF.More(); itF.Next()) { const TopoDS_Shape& aFeature = itF.Value(); @@ -753,10 +784,22 @@ void BOPAlgo_RemoveFeatures::RemoveFeatures() aFG.SetEFConnectionMap(anEFMap); aFG.SetFSConnectionMap(anFSMap); aFG.SetRunParallel(myRunParallel); + + } + const Standard_Integer aNbF = aVFG.Length(); + Message_ProgressScope aPS(aPSOuter.Next(60), "Filling gaps", aNbF); + for (Standard_Integer i = 0; i < aNbF; ++i) + { + FillGap& aFG = aVFG.ChangeValue(i); + aFG.SetRange(aPS.Next()); } // Perform the reconstruction of the adjacent faces BOPTools_Parallel::Perform (myRunParallel, aVFG); + if (UserBreak(aPS)) + { + return; + } // Even if the history is not requested, it is necessary to track: // - The solids modification after each feature removal to find @@ -769,9 +812,13 @@ void BOPAlgo_RemoveFeatures::RemoveFeatures() // Remove the features one by one. // It will allow removing the features even if there were // some problems with removal of the previous features. - const Standard_Integer aNbF = aVFG.Length(); + Message_ProgressScope aPS2(aPSOuter.Next(40), "Removing features one by one", aNbF); for (Standard_Integer i = 0; i < aNbF; ++i) { + if (UserBreak(aPS2)) + { + return; + } FillGap& aFG = aVFG(i); // No need to fill the history for solids if the history is not @@ -781,7 +828,7 @@ void BOPAlgo_RemoveFeatures::RemoveFeatures() // Perform removal of the single feature RemoveFeature(aFG.Feature(), aFG.Solids(), aFG.FeatureFacesMap(), aFG.HasAdjacentFaces(), aFG.Faces(), aFG.History(), - isSolidsHistoryNeeded); + isSolidsHistoryNeeded, aPS2.Next()); } } @@ -796,10 +843,12 @@ void BOPAlgo_RemoveFeatures::RemoveFeature const Standard_Boolean theHasAdjacentFaces, const TopTools_IndexedDataMapOfShapeListOfShape& theAdjFaces, const Handle(BRepTools_History)& theAdjFacesHistory, - const Standard_Boolean theSolidsHistoryNeeded) + const Standard_Boolean theSolidsHistoryNeeded, + const Message_ProgressRange& theRange) { Standard_Boolean bFuseShapes = Standard_True; const Standard_Integer aNbAF = theAdjFaces.Extent(); + Message_ProgressScope aPS(theRange, NULL, 1); if (aNbAF == 0) { if (theHasAdjacentFaces) @@ -869,6 +918,10 @@ void BOPAlgo_RemoveFeatures::RemoveFeature // Add reconstructed adjacent faces for (Standard_Integer i = 1; i <= aNbAF; ++i) { + if (UserBreak(aPS)) + { + return; + } const TopTools_ListOfShape& aLFA = theAdjFaces(i); if (aLFA.Extent() == 1) { @@ -898,7 +951,7 @@ void BOPAlgo_RemoveFeatures::RemoveFeature } // Build solids - aMV.Perform(); + aMV.Perform(aPS.Next()); if (aMV.HasErrors()) { // Add warning for the feature @@ -926,6 +979,10 @@ void BOPAlgo_RemoveFeatures::RemoveFeature TopTools_MapOfShape anAdjFacesSplits; for (Standard_Integer i = 1; i <= aNbAF; ++i) { + if (UserBreak(aPS)) + { + return; + } const TopoDS_Shape& aF = theAdjFaces.FindKey(i); const TopTools_ListOfShape& aLFIm = myHistory->Modified(aF); if (aLFIm.IsEmpty()) @@ -943,6 +1000,10 @@ void BOPAlgo_RemoveFeatures::RemoveFeature aNbFK = aFacesToBeKept.Extent(); for (Standard_Integer i = 1; i <= aNbFK && bValid; ++i) { + if (UserBreak(aPS)) + { + return; + } const TopoDS_Shape& aS = aFacesToBeKept(i); if (anAdjFacesSplits.Contains(aS)) continue; @@ -1029,7 +1090,7 @@ void BOPAlgo_RemoveFeatures::RemoveFeature // function: UpdateHistory // purpose: Update history with the removed features //======================================================================= -void BOPAlgo_RemoveFeatures::UpdateHistory() +void BOPAlgo_RemoveFeatures::UpdateHistory(const Message_ProgressRange& theRange) { if (!HasHistory()) return; @@ -1042,8 +1103,13 @@ void BOPAlgo_RemoveFeatures::UpdateHistory() BRepTools_History aHistory; const Standard_Integer aNbS = myInputsMap.Extent(); - for (Standard_Integer i = 1; i <= aNbS; ++i) + Message_ProgressScope aPS(theRange, "Updating history", aNbS); + for (Standard_Integer i = 1; i <= aNbS; ++i, aPS.Next()) { + if (UserBreak(aPS)) + { + return; + } const TopoDS_Shape& aS = myInputsMap(i); if (!BRepTools_History::IsSupportedType(aS)) continue; diff --git a/src/BOPAlgo/BOPAlgo_RemoveFeatures.hxx b/src/BOPAlgo/BOPAlgo_RemoveFeatures.hxx index 7db54ffa8c..41c8b81592 100644 --- a/src/BOPAlgo/BOPAlgo_RemoveFeatures.hxx +++ b/src/BOPAlgo/BOPAlgo_RemoveFeatures.hxx @@ -226,16 +226,16 @@ protected: //! @name Protected methods performing the removal //! If the input shape is not a solid, the method looks for the solids //! in and uses only them. All other shapes are simply removed. //! If no solids were found, the Error of unsupported type is returned. - Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange) Standard_OVERRIDE; //! Prepares the faces to remove: //! - Gets only faces contained in the input solids; //! - Builds connected blocks of faces creating separate features to remove. - Standard_EXPORT void PrepareFeatures(); + Standard_EXPORT void PrepareFeatures(const Message_ProgressRange& theRange); //! Removes the features and fills the created gaps by extension of the adjacent faces. //! Processes each feature separately. - Standard_EXPORT void RemoveFeatures(); + Standard_EXPORT void RemoveFeatures(const Message_ProgressRange& theRange); //! Remove the single feature from the shape. //! @param theFeature [in] The feature to remove; @@ -253,10 +253,11 @@ protected: //! @name Protected methods performing the removal const Standard_Boolean theHasAdjacentFaces, const TopTools_IndexedDataMapOfShapeListOfShape& theAdjFaces, const Handle(BRepTools_History)& theAdjFacesHistory, - const Standard_Boolean theSolidsHistoryNeeded); + const Standard_Boolean theSolidsHistoryNeeded, + const Message_ProgressRange& theRange); //! Updates history with the removed features - Standard_EXPORT void UpdateHistory(); + Standard_EXPORT void UpdateHistory(const Message_ProgressRange& theRange); //! Simplifies the result by removing extra edges and vertices created //! during removal of the features. diff --git a/src/BOPAlgo/BOPAlgo_Section.cxx b/src/BOPAlgo/BOPAlgo_Section.cxx index 1a5e060e24..5d56a4efc6 100644 --- a/src/BOPAlgo/BOPAlgo_Section.cxx +++ b/src/BOPAlgo/BOPAlgo_Section.cxx @@ -71,10 +71,11 @@ BOPAlgo_Section::~BOPAlgo_Section() //function : CheckData //purpose : //======================================================================= -void BOPAlgo_Section::CheckData() +void BOPAlgo_Section::CheckData(const Message_ProgressRange& theRange) { Standard_Integer aNbArgs; // + Message_ProgressScope aPS(theRange, "Checking data", 1); aNbArgs=myArguments.Extent(); if (!aNbArgs) { AddError (new BOPAlgo_AlertTooFewArguments); @@ -97,7 +98,7 @@ NCollection_Array1 BOPAlgo_Section::AnalyzeProgress() aSteps(i) = 0; } - Standard_Real aPart = 100.; + Standard_Real aPart = 95.; Standard_Integer aNbV = myDS->ShapesSD().Size(); Standard_Integer aNbE = 0; Standard_Integer aNbF = 0; @@ -144,8 +145,9 @@ void BOPAlgo_Section::PerformInternal1 myDS=myPaveFiller->PDS(); myContext=myPaveFiller->Context(); // + Message_ProgressScope aPS(theRange, "Building result of SECTION operation", 100); // 1. CheckData - CheckData(); + CheckData(aPS.Next(5)); if (HasErrors()) { return; } @@ -156,7 +158,6 @@ void BOPAlgo_Section::PerformInternal1 return; } // - Message_ProgressScope aPS(theRange, "Building result of SECTION operation", 100); NCollection_Array1 aSteps = AnalyzeProgress(); // 3. Fill Images // 3.1 Vertices diff --git a/src/BOPAlgo/BOPAlgo_Section.hxx b/src/BOPAlgo/BOPAlgo_Section.hxx index 89117ccbc7..9d2905b516 100644 --- a/src/BOPAlgo/BOPAlgo_Section.hxx +++ b/src/BOPAlgo/BOPAlgo_Section.hxx @@ -50,7 +50,7 @@ public: protected: //! Checks the data before performing the operation - Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange) Standard_OVERRIDE; //! Combine the result of section operation Standard_EXPORT virtual void BuildSection(const Message_ProgressRange& theRange); diff --git a/src/BOPAlgo/BOPAlgo_Splitter.cxx b/src/BOPAlgo/BOPAlgo_Splitter.cxx index 88088f2175..50642ed7a3 100644 --- a/src/BOPAlgo/BOPAlgo_Splitter.cxx +++ b/src/BOPAlgo/BOPAlgo_Splitter.cxx @@ -46,7 +46,7 @@ BOPAlgo_Splitter::~BOPAlgo_Splitter() // function: CheckData // purpose: //======================================================================= -void BOPAlgo_Splitter::CheckData() +void BOPAlgo_Splitter::CheckData(const Message_ProgressRange& /*theRange*/) { if (myArguments.IsEmpty() || (myArguments.Extent() + myTools.Extent()) < 2) { diff --git a/src/BOPAlgo/BOPAlgo_Splitter.hxx b/src/BOPAlgo/BOPAlgo_Splitter.hxx index bc3a08ee23..89603b479a 100644 --- a/src/BOPAlgo/BOPAlgo_Splitter.hxx +++ b/src/BOPAlgo/BOPAlgo_Splitter.hxx @@ -65,7 +65,7 @@ public: protected: //! Checks the input data - Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange) Standard_OVERRIDE; //! Adds images of the argument shapes into result. //! When called the for the last time (for compound) it rebuilds the result diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx index b6f2d2b205..4eeeb592c7 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter.cxx @@ -98,7 +98,7 @@ const Handle(IntTools_Context)& BOPAlgo_WireSplitter::Context() // function: CheckData // purpose: //======================================================================= -void BOPAlgo_WireSplitter::CheckData() +void BOPAlgo_WireSplitter::CheckData(const Message_ProgressRange& /*theRange*/) { if (!myWES) { AddError (new BOPAlgo_AlertNullInputShapes); @@ -109,11 +109,12 @@ void BOPAlgo_WireSplitter::CheckData() //function : Perform //purpose : //======================================================================= -void BOPAlgo_WireSplitter::Perform(const Message_ProgressRange& /*theRange*/) +void BOPAlgo_WireSplitter::Perform(const Message_ProgressRange& theRange) { GetReport()->Clear(); // - CheckData(); + Message_ProgressScope aPS(theRange, NULL, 1); + CheckData(aPS.Next()); if (HasErrors()) { return; } diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter.hxx b/src/BOPAlgo/BOPAlgo_WireSplitter.hxx index 5820ad3a93..11a6f2c7f3 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter.hxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter.hxx @@ -68,7 +68,7 @@ public: protected: - Standard_EXPORT virtual void CheckData() Standard_OVERRIDE; + Standard_EXPORT virtual void CheckData(const Message_ProgressRange& theRange) Standard_OVERRIDE; Standard_EXPORT void MakeWires(); diff --git a/src/BOPTest/BOPTest_RemoveFeaturesCommands.cxx b/src/BOPTest/BOPTest_RemoveFeaturesCommands.cxx index 7a85b1d099..2f00af4c38 100644 --- a/src/BOPTest/BOPTest_RemoveFeaturesCommands.cxx +++ b/src/BOPTest/BOPTest_RemoveFeaturesCommands.cxx @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -98,9 +99,9 @@ Standard_Integer RemoveFeatures(Draw_Interpretor& theDI, } aRF.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded()); - + Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(theDI, 1); // Perform the removal - aRF.Build(); + aRF.Build(aProgress->Start()); // Check for the errors/warnings BOPTest::ReportAlerts(aRF.GetReport()); diff --git a/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx b/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx index 2f4def8b8d..04fa1a3dbd 100644 --- a/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx +++ b/src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx @@ -21,7 +21,7 @@ //function : Build //purpose : //======================================================================= -void BRepAlgoAPI_Defeaturing::Build(const Message_ProgressRange& /*theRange*/) +void BRepAlgoAPI_Defeaturing::Build(const Message_ProgressRange& theRange) { // Set not done state for the operation NotDone(); @@ -36,7 +36,7 @@ void BRepAlgoAPI_Defeaturing::Build(const Message_ProgressRange& /*theRange*/) myFeatureRemovalTool.SetRunParallel(myRunParallel); // Perform the features removal - myFeatureRemovalTool.Perform(); + myFeatureRemovalTool.Perform(theRange); // Merge the Errors/Warnings from the features removal tool GetReport()->Merge(myFeatureRemovalTool.GetReport());