]> OCCT Git - occt-copy.git/commitdiff
0030788: Modeling Algorithms - BRepAlgoAPI_Defeaturing does not propagate progress... CR30788
authorakaftasev <akaftasev@opencascade.com>
Thu, 18 Mar 2021 16:44:11 +0000 (19:44 +0300)
committerakaftasev <akaftasev@opencascade.com>
Fri, 7 May 2021 10:50:33 +0000 (13:50 +0300)
Added progress indicator to BRepAlgoAPI_Defeaturing

20 files changed:
src/BOPAlgo/BOPAlgo_Algo.cxx
src/BOPAlgo/BOPAlgo_Algo.hxx
src/BOPAlgo/BOPAlgo_BOP.cxx
src/BOPAlgo/BOPAlgo_BOP.hxx
src/BOPAlgo/BOPAlgo_Builder.cxx
src/BOPAlgo/BOPAlgo_Builder.hxx
src/BOPAlgo/BOPAlgo_BuilderFace.cxx
src/BOPAlgo/BOPAlgo_BuilderFace.hxx
src/BOPAlgo/BOPAlgo_MakerVolume.cxx
src/BOPAlgo/BOPAlgo_MakerVolume.hxx
src/BOPAlgo/BOPAlgo_RemoveFeatures.cxx
src/BOPAlgo/BOPAlgo_RemoveFeatures.hxx
src/BOPAlgo/BOPAlgo_Section.cxx
src/BOPAlgo/BOPAlgo_Section.hxx
src/BOPAlgo/BOPAlgo_Splitter.cxx
src/BOPAlgo/BOPAlgo_Splitter.hxx
src/BOPAlgo/BOPAlgo_WireSplitter.cxx
src/BOPAlgo/BOPAlgo_WireSplitter.hxx
src/BOPTest/BOPTest_RemoveFeaturesCommands.cxx
src/BRepAlgoAPI/BRepAlgoAPI_Defeaturing.cxx

index 1fd54eced92a78520eba97607d3e40777ed12aaa..1b176fa5cb064d8f787e083d6abef92be8487a1c 100644 (file)
@@ -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);
 }
index 029bb00e24fb08fb2977032486c16edd19362495..51a7a29a556c4f717167a24d45e3d90d3e688541 100644 (file)
@@ -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();
index 733df41a0040b171a98d7d33aa35b25b02495f9f..cbf1b15a18a74d96ed2d6d5993076268ac02ae89 100644 (file)
@@ -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<Standard_Real> aSteps = BOPAlgo_Builder::AnalyzeProgress();
   // 3. Fill Images
   // 3.1 Vertices
index ee9f97ddacfbb6a917f45afd7bc071b1317401b3..4581e991169586aae79604bfda9ce8f3c8bdf119 100644 (file)
@@ -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 <thePF>
index 9ea9085d12cd8f9e2453df3812237d052f68f156..d556c5cfd80ddca625b67b19e7042be3b47369bb 100644 (file)
@@ -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<Standard_Real> 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;
   }
index 759ff847123a4e18c1d7151f67a7370d1dbb1231..071861fcdb5f84f551a3b2dfb10857e5646c661d 100644 (file)
@@ -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();
index 942a66a5bbfa742aeaa54feecf11e5ef526d5aee..98f35d79697c4e8ee4fdf2ce91118ab26688023d 100644 (file)
@@ -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;
   }
index 2bc29661517802c760115d2b70a868e1d24fd16b..a276426dac91a987a78c554b6b9565cafb26d8a1 100644 (file)
@@ -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;
index 97618d4a161f2143116eeede229e73863ee68066..5fc6695c26993edaa4173efa78e3458476b3262f 100644 (file)
@@ -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<Standard_Real> aSteps = AnalyzeProgress();
 
     FillImagesVertices(aPS.Next(aSteps(0)));
index faff5c8800653824b71e579cace97abd71efba7e..d52d24b2f553a3d6f811d524d178eb1d9673cec1 100644 (file)
@@ -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<Standard_Real> AnalyzeProgress() Standard_OVERRIDE;
index 7616e1d84146b5777040d7baf8aa8685f4bfef92..6e79983e2fc297daf7c5ae8cd18306d4e78a7a3b 100644 (file)
@@ -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<FillGap> 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;
index 7db54ffa8cb130606daa7315ad3eb9f14db9a811..41c8b81592db8091a5f88a7b90aa7eb3e79dc796 100644 (file)
@@ -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 <myInputShape> 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.
index 1a5e060e2487fdf4ab7c531d87ec874587603bd7..5d56a4efc64516a915523e6ac30a65149ed84b36 100644 (file)
@@ -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<Standard_Real> 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<Standard_Real> aSteps = AnalyzeProgress();
   // 3. Fill Images
   // 3.1 Vertices
index 89117ccbc7213ff4c2ef870cbf2e5feb476fa13a..9d2905b516033e17854fc5cd7ba17624e8676bff 100644 (file)
@@ -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);
index 88088f2175e82be7207fee6e6c1e3e74de8f4710..50642ed7a3fa0c17801ffdd03fca118effdae2b9 100644 (file)
@@ -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) {
index bc3a08ee23997682ea74b71e220ec6642cddcd39..89603b479a519da1b24a725cd2a350aa6bf80685 100644 (file)
@@ -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
index b6f2d2b20519a7700b8d4b8c4ef18c7a6464232f..4eeeb592c75256d213b82f40e2caf0d04e964cdb 100644 (file)
@@ -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;
   }
index 5820ad3a93586071ee00751c9e4908e103e049c1..11a6f2c7f3a07e27d276684103b24722eb941d5a 100644 (file)
@@ -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();
 
index 7a85b1d099d1eda455ab6d7b15ee278c7725bcf7..2f00af4c383e73ab909819a7629acd3e65317032 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <DBRep.hxx>
 #include <Draw.hxx>
+#include <Draw_ProgressIndicator.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Compound.hxx>
@@ -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());
index 2f4def8b8d62701566daa93b5109d20dac2c396f..04fa1a3dbd3c625ad35896edc0ef68074ff85ad9 100644 (file)
@@ -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());