]> OCCT Git - occt-copy.git/commitdiff
0032330: Modeling Algorithms - Extend Offset algorithm with Progress Indicator and... CR32330_1
authorakaftasev <akaftasev@opencascade.com>
Thu, 18 Mar 2021 16:44:11 +0000 (19:44 +0300)
committerakaftasev <akaftasev@opencascade.com>
Fri, 13 Aug 2021 12:52:49 +0000 (15:52 +0300)
Added progress indicator to BRepOffset_MakeOffset::MakeOffsetShape()

19 files changed:
src/BRepOffset/BRepOffset_Analyse.cxx
src/BRepOffset/BRepOffset_Analyse.hxx
src/BRepOffset/BRepOffset_Error.hxx
src/BRepOffset/BRepOffset_Inter2d.cxx
src/BRepOffset/BRepOffset_Inter2d.hxx
src/BRepOffset/BRepOffset_Inter3d.cxx
src/BRepOffset/BRepOffset_Inter3d.hxx
src/BRepOffset/BRepOffset_MakeLoops.cxx
src/BRepOffset/BRepOffset_MakeLoops.hxx
src/BRepOffset/BRepOffset_MakeOffset.cxx
src/BRepOffset/BRepOffset_MakeOffset.hxx
src/BRepOffset/BRepOffset_MakeOffset_1.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeOffsetShape.hxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.cxx
src/BRepOffsetAPI/BRepOffsetAPI_MakeThickSolid.hxx
src/BRepTest/BRepTest_FeatureCommands.cxx
src/BRepTest/BRepTest_OtherCommands.cxx
src/BiTgte/BiTgte_Blend.cxx

index 20bfba9a865d2d3cae198af419723cc48416058b..33a1de3219df5172fe7686fde536610a9169f6d6 100644 (file)
@@ -140,7 +140,8 @@ static void BuildAncestors (const TopoDS_Shape&                        S,
 //purpose  : 
 //=======================================================================
 void BRepOffset_Analyse::Perform (const TopoDS_Shape& S, 
-                                  const Standard_Real Angle)
+                                  const Standard_Real Angle,
+                                  const Message_ProgressRange& theRange)
 {
   myShape = S;
   myNewFaces .Clear();
@@ -155,9 +156,14 @@ void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
   BuildAncestors (S,myAncestors);
 
   TopTools_ListOfShape aLETang;
-
   TopExp_Explorer Exp(S.Oriented(TopAbs_FORWARD),TopAbs_EDGE);
-  for ( ; Exp.More(); Exp.Next()) {
+  Message_ProgressScope aPSOuter(theRange, NULL, 2);
+  Message_ProgressScope aPS(aPSOuter.Next(), "Performing edge analyze", 1, Standard_True);
+  for ( ; Exp.More(); Exp.Next(), aPS.Next()) {
+    if (!aPS.More())
+    {
+      return;
+    }
     const TopoDS_Edge& E = TopoDS::Edge(Exp.Current());
     if (!myMapEdgeType.IsBound(E)) {
       BRepOffset_ListOfInterval LI;
@@ -196,7 +202,11 @@ void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
     }
   }
 
-  TreatTangentFaces (aLETang);
+  TreatTangentFaces (aLETang, aPSOuter.Next());
+  if (!aPSOuter.More())
+  {
+    return;
+  }
   myDone = Standard_True;
 }
 
@@ -204,7 +214,7 @@ void BRepOffset_Analyse::Perform (const TopoDS_Shape& S,
 //function : Generated
 //purpose  : 
 //=======================================================================
-void BRepOffset_Analyse::TreatTangentFaces (const TopTools_ListOfShape& theLE)
+void BRepOffset_Analyse::TreatTangentFaces (const TopTools_ListOfShape& theLE, const Message_ProgressRange& theRange)
 {
   if (theLE.IsEmpty() || myFaceOffsetMap.IsEmpty())
   {
@@ -221,8 +231,14 @@ void BRepOffset_Analyse::TreatTangentFaces (const TopTools_ListOfShape& theLE)
   // Bind vertices of the tangent edges with connected edges
   // of the face with smaller offset value
   TopTools_DataMapOfShapeShape aDMVEMin;
-  for (TopTools_ListOfShape::Iterator it (theLE); it.More(); it.Next())
+  Message_ProgressScope aPSOuter(theRange, NULL, 3);
+  Message_ProgressScope aPS1(aPSOuter.Next(), "Binding vertices with connected edges", theLE.Size());
+  for (TopTools_ListOfShape::Iterator it (theLE); it.More(); it.Next(), aPS1.Next())
   {
+    if (!aPS1.More())
+    {
+      return;
+    }
     const TopoDS_Shape& aE = it.Value();
     const TopTools_ListOfShape& aLA = Ancestors (aE);
 
@@ -266,8 +282,13 @@ void BRepOffset_Analyse::TreatTangentFaces (const TopTools_ListOfShape& theLE)
   // Create map of Face ancestors for the vertices on tangent edges
   TopTools_DataMapOfShapeListOfShape aDMVFAnc;
 
-  for (TopTools_ListOfShape::Iterator itE (theLE); itE.More(); itE.Next())
+  Message_ProgressScope aPS2(aPSOuter.Next(), "Creating map of Face ancestors", theLE.Size());
+  for (TopTools_ListOfShape::Iterator itE (theLE); itE.More(); itE.Next(), aPS2.Next())
   {
+    if (!aPS2.More())
+    {
+      return;
+    }
     const TopoDS_Shape& aE = itE.Value();
     if (!anEdgeOffsetMap.IsBound (aE))
       continue;
@@ -315,8 +336,13 @@ void BRepOffset_Analyse::TreatTangentFaces (const TopTools_ListOfShape& theLE)
   BOPTools_AlgoTools::MakeConnexityBlocks (aCETangent, TopAbs_VERTEX, TopAbs_EDGE, aLCB, aMVEMap);
 
   // Analyze each block to find co-planar edges
-  for (TopTools_ListOfListOfShape::Iterator itLCB (aLCB); itLCB.More(); itLCB.Next())
+  Message_ProgressScope aPS3(aPSOuter.Next(), "Analyzing blocks to find co-planar edges", aLCB.Size());
+  for (TopTools_ListOfListOfShape::Iterator itLCB (aLCB); itLCB.More(); itLCB.Next(), aPS3.Next())
   {
+    if (!aPS3.More())
+    {
+      return;
+    }
     const TopTools_ListOfShape& aCB = itLCB.Value();
 
     TopTools_MapOfShape aMFence;
index 51e319d2514b7dca805b3ba04eedbb354c445053..3c079c6114b4a40d5367abbe7049ef5a889632b2 100644 (file)
@@ -33,6 +33,9 @@
 #include <TopTools_DataMapOfShapeShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_MapOfShape.hxx>
+
+#include <Message_ProgressRange.hxx>
+
 class TopoDS_Shape;
 class TopoDS_Edge;
 class TopoDS_Vertex;
@@ -59,7 +62,8 @@ public: //! @name Performing analysis
 
   //! Performs the analysis
   Standard_EXPORT void Perform (const TopoDS_Shape& theS,
-                                const Standard_Real theAngle);
+                                const Standard_Real theAngle,
+                                const Message_ProgressRange& theRange = Message_ProgressRange());
 
 public: //! @name Results
 
@@ -171,7 +175,7 @@ private: //! @name Treatment of tangential cases
 
   //! Treatment of the tangential cases.
   //! @param theEdges List of edges connecting tangent faces
-  Standard_EXPORT void TreatTangentFaces (const TopTools_ListOfShape& theEdges);
+  Standard_EXPORT void TreatTangentFaces (const TopTools_ListOfShape& theEdges, const Message_ProgressRange& theRange);
 
 private: //! @name Fields
 
index c809f4a983a0b739fa1e282d28d14bf382a69d22..e5dda91fdb8c9a17720a8f8a765b42a9ef81ca1f 100644 (file)
@@ -28,7 +28,8 @@ enum BRepOffset_Error
   BRepOffset_NotConnectedShell,
   BRepOffset_CannotTrimEdges,        //!< exception while trim edges
   BRepOffset_CannotFuseVertices,     //!< exception while fuse vertices
-  BRepOffset_CannotExtentEdge        //!< exception while extent edges
+  BRepOffset_CannotExtentEdge,       //!< exception while extent edges
+  BRepOffset_UserBreak               //!< user break
 };
 
 #endif // _BRepOffset_Error_HeaderFile
index 1af28492a82028ca0ef794c253a8ea89bea5d43a..3baede8aede872b3909be4be4df8c06aa4036401 100644 (file)
@@ -1572,7 +1572,8 @@ void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)&     AsDes,
                                   const TopTools_IndexedMapOfShape& NewEdges,
                                   const Standard_Real               Tol,
                                   const TopTools_DataMapOfShapeListOfShape& theEdgeIntEdges,
-                                  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
+                                  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
+                                  const Message_ProgressRange& theRange)
 {
 #ifdef DRAW
   NbF2d++;
@@ -1600,7 +1601,12 @@ void BRepOffset_Inter2d::Compute (const Handle(BRepAlgo_AsDes)&     AsDes,
   Standard_Integer                   j, i = 1;
   BRepAdaptor_Surface BAsurf(F);
   //
-  for ( it1LE.Initialize(LE) ; it1LE.More(); it1LE.Next()) {
+  Message_ProgressScope aPS(theRange, "Computing intersection 2d", LE.Size());
+  for ( it1LE.Initialize(LE) ; it1LE.More(); it1LE.Next(), aPS.Next()) {
+    if (!aPS.More())
+    {
+      return;
+    }
     const TopoDS_Edge& E1 = TopoDS::Edge(it1LE.Value());        
     j = 1;
     it2LE.Initialize(LE);
@@ -1670,18 +1676,23 @@ Standard_Boolean BRepOffset_Inter2d::ConnexIntByInt
   TopTools_IndexedMapOfShape&   FacesWithVerts,
   BRepAlgo_Image&               theImageVV,
   TopTools_DataMapOfShapeListOfShape& theEdgeIntEdges,
-  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
+  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
+  const Message_ProgressRange& theRange)
 {  
 
   TopTools_DataMapOfShapeListOfShape MVE;
   BRepOffset_Tool::MapVertexEdges(FI,MVE);
-
+  Message_ProgressScope aPS(theRange, "Intersecting edges created from edges", 1, Standard_True);
   //---------------------
   // Extension of edges.
   //---------------------
   TopoDS_Edge  NE;
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape it(MVE);
   for  ( ; it.More(); it.Next()) {
+    if (!aPS.More())
+    {
+      return Standard_False;
+    }
     const TopTools_ListOfShape&  L = it.Value();
     Standard_Boolean   YaBuild = 0;
     TopTools_ListIteratorOfListOfShape itL(L);
@@ -1712,9 +1723,13 @@ Standard_Boolean BRepOffset_Inter2d::ConnexIntByInt
   if (MES.IsBound(FIO)) FIO = TopoDS::Face(MES(FIO));
   //
   BRepAdaptor_Surface BAsurf(FIO);
-  
+
   TopExp_Explorer exp(FI.Oriented(TopAbs_FORWARD),TopAbs_WIRE);
-  for (; exp.More(); exp.Next()) {
+  for (; exp.More(); exp.Next(), aPS.Next()) {
+    if (!aPS.More())
+    {
+      return Standard_False;
+    }
     const TopoDS_Wire&     W = TopoDS::Wire(exp.Current());
     BRepTools_WireExplorer wexp;
     Standard_Boolean       end = Standard_False ;
@@ -1871,7 +1886,8 @@ void BRepOffset_Inter2d::ConnexIntByIntInVert
   const Handle(BRepAlgo_AsDes)& AsDes2d,
   const Standard_Real           Tol,
   const BRepOffset_Analyse&     Analyse,
-  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV)
+  TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
+  const Message_ProgressRange& theRange)
 {
   TopoDS_Face           FIO = TopoDS::Face(OFI.Face());
   if (MES.IsBound(FIO)) FIO = TopoDS::Face(MES(FIO));
@@ -1886,8 +1902,13 @@ void BRepOffset_Inter2d::ConnexIntByIntInVert
   //
   BRepAdaptor_Surface BAsurf(FIO);
   //
+  Message_ProgressScope aPS(theRange, "Intersecting edges created from vertices", 1, Standard_True);
   TopExp_Explorer exp(FI.Oriented(TopAbs_FORWARD),TopAbs_WIRE);
-  for (; exp.More(); exp.Next()) {
+  for (; exp.More(); exp.Next(), aPS.Next()) {
+    if (!aPS.More())
+    {
+      return;
+    }
     const TopoDS_Wire&     W = TopoDS::Wire(exp.Current());
     //
     BRepTools_WireExplorer wexp;
index 850a674c2009e38987abb7bb180df3b5a345a61c..a2b04fb6afcaa79a8f16129a313818d21806a54b 100644 (file)
@@ -21,6 +21,7 @@
 #include <TopTools_DataMapOfShapeShape.hxx>
 #include <TopTools_DataMapOfShapeListOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <Message_ProgressRange.hxx>
 
 class BRepAlgo_AsDes;
 class BRepAlgo_Image;
@@ -49,7 +50,8 @@ public:
                                        const TopTools_IndexedMapOfShape& NewEdges, 
                                        const Standard_Real Tol,
                                        const TopTools_DataMapOfShapeListOfShape& theEdgeIntEdges,
-                                       TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
+                                       TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
+                                       const Message_ProgressRange& theRange);
 
   //! Computes the intersection between the offset edges of the <FI>.
   //! All intersection vertices will be stored in AsDes2d.
@@ -68,7 +70,8 @@ public:
                                                           TopTools_IndexedMapOfShape& FacesWithVerts,
                                                           BRepAlgo_Image& theImageVV,
                                                           TopTools_DataMapOfShapeListOfShape& theEdgeIntEdges,
-                                                          TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
+                                                          TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
+                                                          const Message_ProgressRange& theRange);
 
   //! Computes the intersection between the offset edges generated
   //! from vertices and stored into AsDes as descendants of the <FI>.
@@ -84,7 +87,8 @@ public:
                                                     const Handle(BRepAlgo_AsDes)& AsDes2d,
                                                     const Standard_Real Tol,
                                                     const BRepOffset_Analyse& Analyse,
-                                                    TopTools_IndexedDataMapOfShapeListOfShape& theDMVV);
+                                                    TopTools_IndexedDataMapOfShapeListOfShape& theDMVV,
+                                                    const Message_ProgressRange& theRange);
 
   //! Fuses the chains of vertices in the theDMVV
   //! and updates AsDes by replacing the old vertices
index 9f1ceb951d9e70dc270f6c47c23916ec39be1299..bdbbfa84b29b444bc6578e96ab3f3fddf6ea9fc1 100644 (file)
@@ -105,8 +105,9 @@ static void ExtentEdge(const TopoDS_Face& /*F*/,
 //purpose  : 
 //=======================================================================
 
-void BRepOffset_Inter3d::CompletInt(const TopTools_ListOfShape& SetOfFaces,
-                                    const BRepAlgo_Image&     InitOffsetFace)
+void BRepOffset_Inter3d::CompletInt (const TopTools_ListOfShape& SetOfFaces,
+                                     const BRepAlgo_Image&     InitOffsetFace,
+                                     const Message_ProgressRange& theRange)
 {
   //---------------------------------------------------------------
   // Calculate the intersections of offset faces 
@@ -145,9 +146,13 @@ void BRepOffset_Inter3d::CompletInt(const TopTools_ListOfShape& SetOfFaces,
   // Treat the selected pairs
   const std::vector<BOPTools_BoxPairSelector::PairIDs>& aPairs = aSelector.Pairs();
   const Standard_Integer aNbPairs = static_cast<Standard_Integer> (aPairs.size());
-
-  for (Standard_Integer iPair = 0; iPair < aNbPairs; ++iPair)
+  Message_ProgressScope aPS(theRange, "Complete intersection", aNbPairs);
+  for (Standard_Integer iPair = 0; iPair < aNbPairs; ++iPair, aPS.Next())
   {
+    if (!aPS.More())
+    {
+      return;
+    }
     const BOPTools_BoxPairSelector::PairIDs& aPair = aPairs[iPair];
 
     const TopoDS_Face& aF1 = TopoDS::Face (aMFaces.FindKey (Min (aPair.ID1, aPair.ID2)));
@@ -250,9 +255,10 @@ void BRepOffset_Inter3d::FaceInter(const TopoDS_Face& F1,
 //=======================================================================
 
 void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces*/, 
-                                        const TopoDS_Shape&         ShapeInit, 
-                                        const BRepOffset_Analyse&   Analyse, 
-                                        const BRepAlgo_Image&       InitOffsetFace)
+                                        const TopoDS_Shape&          ShapeInit, 
+                                        const BRepOffset_Analyse&    Analyse, 
+                                        const BRepAlgo_Image&        InitOffsetFace,
+                                        const Message_ProgressRange& theRange)
 {
   ChFiDS_TypeOfConcavity    OT   = ChFiDS_Concave;
   if (mySide == TopAbs_OUT) OT   = ChFiDS_Convex;
@@ -261,12 +267,17 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces
   TopoDS_Face                    F1,F2;
   TopoDS_Edge                    NullEdge;
   TopoDS_Face                    NullFace;
-
+  Message_ProgressScope aPSOuter(theRange, NULL, 2);
+  Message_ProgressScope aPSIntF(aPSOuter.Next(), "Intersection faces", 1, Standard_True);
   //---------------------------------------------------------------------
   // etape 1 : Intersection of faces // corresponding to the initial faces 
   //           separated by a concave edge if offset > 0, otherwise convex.
   //---------------------------------------------------------------------  
-  for (; Exp.More(); Exp.Next()) {
+  for (; Exp.More(); Exp.Next(), aPSIntF.Next()) {
+    if (!aPSIntF.More())
+    {
+      return;
+    }
     const TopoDS_Edge&               E = TopoDS::Edge(Exp.Current());
     const BRepOffset_ListOfInterval& L = Analyse.Type(E);
     if (!L.IsEmpty() && L.First().Type() == OT) {
@@ -294,8 +305,12 @@ void BRepOffset_Inter3d::ConnexIntByArc(const TopTools_ListOfShape& /*SetOfFaces
   //---------------------------------------------------------------------
   TopoDS_Vertex                      V[2];
   TopTools_ListIteratorOfListOfShape it; 
-  
-  for (Exp.Init(ShapeInit,TopAbs_EDGE); Exp.More(); Exp.Next()) {
+  Message_ProgressScope aPSIntT(aPSOuter.Next(), "Intersection of tubes", 1, Standard_True);
+  for (Exp.Init(ShapeInit,TopAbs_EDGE); Exp.More(); Exp.Next(), aPSIntT.Next()) {
+    if (!aPSIntT.More())
+    {
+      return;
+    }
     const TopoDS_Edge& E1 = TopoDS::Edge(Exp.Current());
     if (InitOffsetFace.HasImage(E1)) {
       //---------------------------
@@ -402,6 +417,7 @@ void BRepOffset_Inter3d::ConnexIntByInt
  TopTools_DataMapOfShapeShape&          MES,
  TopTools_DataMapOfShapeShape&          Build,
  TopTools_ListOfShape&                  Failed,
+ const Message_ProgressRange&           theRange,
  const Standard_Boolean                 bIsPlanar)
 {
   TopTools_IndexedMapOfShape VEmap;
@@ -414,6 +430,7 @@ void BRepOffset_Inter3d::ConnexIntByInt
   //
   TopExp::MapShapes (SI, TopAbs_EDGE, VEmap);
   // Take the vertices for treatment
+  Message_ProgressScope aPSOuter(theRange, NULL, 1);
   if (bIsPlanar)
   {
     aNb = VEmap.Extent();
@@ -461,6 +478,10 @@ void BRepOffset_Inter3d::ConnexIntByInt
     // Analyze faces connected through vertices
     for (i = aNb + 1, aNb = VEmap.Extent(); i <= aNb; ++i)
     {
+      if (!aPSOuter.More())
+      {
+        return;
+      }
       const TopoDS_Shape& aS = VEmap(i);
       if (aS.ShapeType() != TopAbs_VERTEX)
         continue;
@@ -561,6 +582,10 @@ void BRepOffset_Inter3d::ConnexIntByInt
   //
   aNb = VEmap.Extent();
   for (i = 1; i <= aNb; ++i) {
+    if (!aPSOuter.More())
+    {
+      return;
+    }
     const TopoDS_Shape& aS = VEmap(i);
     //
     TopoDS_Edge E;
@@ -721,7 +746,12 @@ void BRepOffset_Inter3d::ConnexIntByInt
   //
   // create unique intersection for each localized shared part
   aNb = aDMIntE.Extent();
-  for (i = 1; i <= aNb; ++i) {
+  Message_ProgressScope aPS1(aPSOuter.Next(), "Creating unique intersection", aNb);
+  for (i = 1; i <= aNb; ++i, aPS1.Next()) {
+    if (!aPS1.More())
+    {
+      return;
+    }
     const TopTools_ListOfShape& aLS = aDMIntE(i);
     if (aLS.Extent() < 2) {
       continue;
@@ -893,6 +923,7 @@ void BRepOffset_Inter3d::ContextIntByInt
  TopTools_DataMapOfShapeShape&          MES,
  TopTools_DataMapOfShapeShape&          Build,
  TopTools_ListOfShape&                  Failed,
+ const Message_ProgressRange&           theRange,
  const Standard_Boolean                 bIsPlanar)
 {
   TopTools_MapOfShape              MV;
@@ -916,7 +947,12 @@ void BRepOffset_Inter3d::ContextIntByInt
   }
   TopAbs_State Side = TopAbs_OUT;
  
-  for (i = 1; i <= aNb; i++) {
+  Message_ProgressScope aPS(theRange, NULL, aNb);
+  for (i = 1; i <= aNb; i++, aPS.Next()) {
+    if (!aPS.More())
+    {
+      return;
+    }
     const TopoDS_Face& CF  = TopoDS::Face(ContextFaces(i));
     if (ExtentContext) WCF = TopoDS::Face(MES(CF));
     else               WCF = CF;
index e9607c89c5fefb47a8c05043507cb2f6817a236a..c1db6f30bda3447725883656e53aff3bb50b3ed5 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef _BRepOffset_Inter3d_HeaderFile
 #define _BRepOffset_Inter3d_HeaderFile
 
+#include <Message_ProgressRange.hxx>
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
@@ -36,6 +37,7 @@ class TopoDS_Shape;
 class BRepOffset_Analyse;
 
 
+
 //! Computes the intersection face face in a set of faces
 //! Store the result in a SD as AsDes.
 class BRepOffset_Inter3d 
@@ -47,15 +49,15 @@ public:
   
   Standard_EXPORT BRepOffset_Inter3d(const Handle(BRepAlgo_AsDes)& AsDes, const TopAbs_State Side, const Standard_Real Tol);
   
-  Standard_EXPORT void CompletInt (const TopTools_ListOfShape& SetOfFaces, const BRepAlgo_Image& InitOffsetFace);
+  Standard_EXPORT void CompletInt (const TopTools_ListOfShape& SetOfFaces, const BRepAlgo_Image& InitOffsetFace, const Message_ProgressRange& theRange);
   
   Standard_EXPORT void FaceInter (const TopoDS_Face& F1, const TopoDS_Face& F2, const BRepAlgo_Image& InitOffsetFace);
   
-  Standard_EXPORT void ConnexIntByArc (const TopTools_ListOfShape& SetOfFaces, const TopoDS_Shape& ShapeInit, const BRepOffset_Analyse& Analyse, const BRepAlgo_Image& InitOffsetFace);
+  Standard_EXPORT void ConnexIntByArc (const TopTools_ListOfShape& SetOfFaces, const TopoDS_Shape& ShapeInit, const BRepOffset_Analyse& Analyse, const BRepAlgo_Image& InitOffsetFace, const Message_ProgressRange& theRange);
   
-  Standard_EXPORT void ConnexIntByInt (const TopoDS_Shape& SI, const BRepOffset_DataMapOfShapeOffset& MapSF, const BRepOffset_Analyse& A, TopTools_DataMapOfShapeShape& MES, TopTools_DataMapOfShapeShape& Build, TopTools_ListOfShape& Failed, const Standard_Boolean bIsPlanar = Standard_False);
+  Standard_EXPORT void ConnexIntByInt (const TopoDS_Shape& SI, const BRepOffset_DataMapOfShapeOffset& MapSF, const BRepOffset_Analyse& A, TopTools_DataMapOfShapeShape& MES, TopTools_DataMapOfShapeShape& Build, TopTools_ListOfShape& Failed, const Message_ProgressRange& theRange, const Standard_Boolean bIsPlanar = Standard_False);
   
-  Standard_EXPORT void ContextIntByInt (const TopTools_IndexedMapOfShape& ContextFaces, const Standard_Boolean ExtentContext, const BRepOffset_DataMapOfShapeOffset& MapSF, const BRepOffset_Analyse& A, TopTools_DataMapOfShapeShape& MES, TopTools_DataMapOfShapeShape& Build, TopTools_ListOfShape& Failed, const Standard_Boolean bIsPlanar = Standard_False);
+  Standard_EXPORT void ContextIntByInt (const TopTools_IndexedMapOfShape& ContextFaces, const Standard_Boolean ExtentContext, const BRepOffset_DataMapOfShapeOffset& MapSF, const BRepOffset_Analyse& A, TopTools_DataMapOfShapeShape& MES, TopTools_DataMapOfShapeShape& Build, TopTools_ListOfShape& Failed, const Message_ProgressRange& theRange, const Standard_Boolean bIsPlanar = Standard_False);
   
   Standard_EXPORT void ContextIntByArc (const TopTools_IndexedMapOfShape& ContextFaces, const Standard_Boolean ExtentContext, const BRepOffset_Analyse& Analyse, const BRepAlgo_Image& InitOffsetFace, BRepAlgo_Image& InitOffsetEdge);
   
index de5eb39747575ab94f5f58270deaf324a8846b3f..9d3e38be6b7f4207012c3897659f5def05223a75 100644 (file)
@@ -52,15 +52,21 @@ BRepOffset_MakeLoops::BRepOffset_MakeLoops()
 void BRepOffset_MakeLoops::Build(const TopTools_ListOfShape&   LF, 
                                 const Handle(BRepAlgo_AsDes)& AsDes, 
                                 BRepAlgo_Image&               Image,
-                                 BRepAlgo_Image&               theImageVV)
+                                 BRepAlgo_Image&               theImageVV,
+                                 const Message_ProgressRange&  theRange)
 {
   TopTools_ListIteratorOfListOfShape    it(LF);
   TopTools_ListIteratorOfListOfShape    itl,itLCE;
   BRepAlgo_Loop                       Loops;
   Loops.VerticesForSubstitute( myVerVerMap );
   Loops.SetImageVV (theImageVV);
-
-  for (; it.More(); it.Next()) {
+  Message_ProgressScope aPSOuter(theRange, NULL, 2);
+  Message_ProgressScope aPS1(aPSOuter.Next(), "Init loops", LF.Size());
+  for (; it.More(); it.Next(), aPS1.Next()) {
+    if (!aPS1.More())
+    {
+      return;
+    }
     const TopoDS_Face& F = TopoDS::Face(it.Value());
     //---------------------------
     // Initialization of Loops.
@@ -124,44 +130,49 @@ void BRepOffset_MakeLoops::Build(const TopTools_ListOfShape&   LF,
   if (myVerVerMap.IsEmpty())
     return;
   BRep_Builder BB;
-  for (it.Initialize( LF ); it.More(); it.Next())
+  Message_ProgressScope aPS2(aPSOuter.Next(), "Building loops", LF.Size());
+  for (it.Initialize(LF); it.More(); it.Next(), aPS2.Next())
+  {
+    if (!aPS2.More())
     {
-      TopoDS_Shape F = it.Value();
-      TopTools_ListOfShape LIF;
-      Image.LastImage( F, LIF );
-      for (itl.Initialize(LIF); itl.More(); itl.Next())
-       {
-         const TopoDS_Shape& IF = itl.Value();
-         TopExp_Explorer EdExp( IF, TopAbs_EDGE );
-         for (; EdExp.More(); EdExp.Next())
-           {
-             TopoDS_Shape E = EdExp.Current();
-             TopTools_ListOfShape VList;
-             TopoDS_Iterator VerExp( E );
-             for (; VerExp.More(); VerExp.Next())
-               VList.Append( VerExp.Value() );
-             TopTools_ListIteratorOfListOfShape itlv( VList );
-             for (; itlv.More(); itlv.Next())
-               {
-                 const TopoDS_Shape& V = itlv.Value();
-                 if (myVerVerMap.IsBound( V ))
-                   {
-                     TopoDS_Shape NewV = myVerVerMap( V );
-                     E.Free( Standard_True );
-                     NewV.Orientation( V.Orientation() );
-                     Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*) &V.TShape());
-                     Handle(BRep_TVertex)& NewTV = *((Handle(BRep_TVertex)*) &NewV.TShape());
-                     if (TV->Tolerance() > NewTV->Tolerance())
-                       NewTV->Tolerance( TV->Tolerance() );
-                     NewTV->ChangePoints().Append( TV->ChangePoints() );
-                     AsDes->Replace( V, NewV );
-                     BB.Remove( E, V );
-                     BB.Add( E, NewV );
-                   }
-               }
-           }
-       }
+      return;
     }
+    TopoDS_Shape F = it.Value();
+    TopTools_ListOfShape LIF;
+    Image.LastImage(F, LIF);
+    for (itl.Initialize(LIF); itl.More(); itl.Next())
+    {
+      const TopoDS_Shape& IF = itl.Value();
+      TopExp_Explorer EdExp(IF, TopAbs_EDGE);
+      for (; EdExp.More(); EdExp.Next())
+      {
+        TopoDS_Shape E = EdExp.Current();
+        TopTools_ListOfShape VList;
+        TopoDS_Iterator VerExp(E);
+        for (; VerExp.More(); VerExp.Next())
+          VList.Append(VerExp.Value());
+        TopTools_ListIteratorOfListOfShape itlv(VList);
+        for (; itlv.More(); itlv.Next())
+        {
+          const TopoDS_Shape& V = itlv.Value();
+          if (myVerVerMap.IsBound(V))
+          {
+            TopoDS_Shape NewV = myVerVerMap(V);
+            E.Free(Standard_True);
+            NewV.Orientation(V.Orientation());
+            Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*) &V.TShape());
+            Handle(BRep_TVertex)& NewTV = *((Handle(BRep_TVertex)*) &NewV.TShape());
+            if (TV->Tolerance() > NewTV->Tolerance())
+              NewTV->Tolerance(TV->Tolerance());
+            NewTV->ChangePoints().Append(TV->ChangePoints());
+            AsDes->Replace(V, NewV);
+            BB.Remove(E, V);
+            BB.Add(E, NewV);
+          }
+        }
+      }
+    }
+  }
 }
 
 //=======================================================================
@@ -383,7 +394,8 @@ void BRepOffset_MakeLoops::BuildOnContext(const TopTools_ListOfShape&   LContext
   
 void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape&   LF, 
                                      const Handle(BRepAlgo_AsDes)& AsDes, 
-                                     BRepAlgo_Image&               Image)
+                                     BRepAlgo_Image&               Image,
+                                      const Message_ProgressRange&  theRange)
 {
   TopTools_ListIteratorOfListOfShape itr,itl,itLCE;
   Standard_Boolean                   ToRebuild;
@@ -394,7 +406,12 @@ void BRepOffset_MakeLoops::BuildFaces(const TopTools_ListOfShape&   LF,
   //----------------------------------
   // Loop on all faces //.
   //----------------------------------
-  for (itr.Initialize(LF); itr.More(); itr.Next()) {
+  Message_ProgressScope aPS(theRange, "Building faces", LF.Size());
+  for (itr.Initialize(LF); itr.More(); itr.Next(), aPS.Next()) {
+    if (!aPS.More())
+    {
+      return;
+    }
     TopoDS_Face F = TopoDS::Face(itr.Value());
     Loops.Init(F);
     ToRebuild = Standard_False;
index 7caf1b3fe657e23a9114608804852e5e90d51820..91bddffaf8ac8aa55316cab5f5abbcdf6a1ebfb6 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef _BRepOffset_MakeLoops_HeaderFile
 #define _BRepOffset_MakeLoops_HeaderFile
 
+#include <Message_ProgressRange.hxx>
+
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
 #include <Standard_Handle.hxx>
@@ -42,7 +44,8 @@ public:
   Standard_EXPORT void Build (const TopTools_ListOfShape& LF,
                               const Handle(BRepAlgo_AsDes)& AsDes,
                               BRepAlgo_Image& Image,
-                              BRepAlgo_Image& theImageVV);
+                              BRepAlgo_Image& theImageVV,
+                              const Message_ProgressRange& theRange);
   
   Standard_EXPORT void BuildOnContext (const TopTools_ListOfShape& LContext,
                                        const BRepOffset_Analyse& Analyse,
@@ -52,7 +55,8 @@ public:
   
   Standard_EXPORT void BuildFaces (const TopTools_ListOfShape& LF,
                                    const Handle(BRepAlgo_AsDes)& AsDes,
-                                   BRepAlgo_Image& Image);
+                                   BRepAlgo_Image& Image,
+                                   const Message_ProgressRange& theRange);
 
 
 
index 2c5fe795f3f622145fa4562ce71ad4881c7b6c8e..2ae48b784a7cfe1343593069a25703c08485d5c7 100644 (file)
@@ -241,6 +241,25 @@ static void DEBVerticesControl (const TopTools_IndexedMapOfShape& NewEdges,
 }  
 #endif
 
+namespace
+{
+  //=======================================================================
+  //function : BRepOffset_PIOperation
+  //purpose  : List of operations to be supported by the Progress Indicator
+  //=======================================================================
+  enum BRepOffset_PIOperation
+  {
+    PIOperation_CheckInputData = 0,
+    PIOperation_Analyse,
+    PIOperation_BuildOffsetBy,
+    PIOperation_Intersection,
+    PIOperation_MakeMissingWalls,
+    PIOperation_MakeShells,
+    PIOperation_MakeSolid,
+    PIOperation_Sewing,
+    PIOperation_Last
+  };
+}
 
 //=======================================================================
 // static methods
@@ -581,13 +600,14 @@ BRepOffset_MakeOffset::BRepOffset_MakeOffset()
 
 BRepOffset_MakeOffset::BRepOffset_MakeOffset(const TopoDS_Shape&    S, 
                                              const Standard_Real    Offset, 
-                                             const Standard_Real    Tol, 
+                                             const Standard_Real    Tol,
                                              const BRepOffset_Mode  Mode, 
                                              const Standard_Boolean Inter, 
                                              const Standard_Boolean SelfInter, 
                                              const GeomAbs_JoinType Join,
                                              const Standard_Boolean Thickening,
-                                             const Standard_Boolean RemoveIntEdges)
+                                             const Standard_Boolean RemoveIntEdges,
+                                             const Message_ProgressRange& theRange)
 : 
 myOffset     (Offset),
 myTol        (Tol),
@@ -604,7 +624,7 @@ myDone     (Standard_False)
   myAsDes = new BRepAlgo_AsDes();
   myIsLinearizationAllowed = Standard_True;
   
-  MakeOffsetShape();
+  MakeOffsetShape(theRange);
 }
 
 
@@ -835,7 +855,7 @@ void BRepOffset_MakeOffset::SetFacesWithOffset()
 //purpose  : 
 //=======================================================================
 
-void BRepOffset_MakeOffset::MakeOffsetShape()
+void BRepOffset_MakeOffset::MakeOffsetShape(const Message_ProgressRange& theRange)
 {  
   myDone = Standard_False;
   //
@@ -857,7 +877,12 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
     RemoveCorks (myFaceComp, myFaces);
   }
 
-  if (!CheckInputData())
+  Message_ProgressScope aPS(theRange, "Making offset shape", 100);
+
+  BRepOffset_PISteps aSteps(PIOperation_Last);
+  analyzeProgress(100., aSteps);
+
+  if (!CheckInputData(aPS.Next(aSteps.GetStep(PIOperation_CheckInputData))) || myError != BRepOffset_NoError)
   {
     // There is error in input data.
     // Check Error() method.
@@ -879,7 +904,12 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
     myAnalyse.SetOffsetValue (myOffset);
     myAnalyse.SetFaceOffsetMap (myFaceOffset);
   }
-  myAnalyse.Perform(myFaceComp,TolAngle);
+  myAnalyse.Perform(myFaceComp,TolAngle, aPS.Next(aSteps.GetStep(PIOperation_Analyse)));
+  if (!aPS.More())
+  {
+    myError = BRepOffset_UserBreak;
+    return;
+  }
   //---------------------------------------------------
   // Construction of Offset from preanalysis.
   //---------------------------------------------------  
@@ -889,9 +919,9 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
   UpdateFaceOffset();
 
   if (myJoin == GeomAbs_Arc)          
-    BuildOffsetByArc();
+    BuildOffsetByArc(aPS.Next(aSteps.GetStep(PIOperation_BuildOffsetBy)));
   else if (myJoin == GeomAbs_Intersection) 
-    BuildOffsetByInter();
+    BuildOffsetByInter(aPS.Next(aSteps.GetStep(PIOperation_BuildOffsetBy)));
   if (myError != BRepOffset_NoError)
   {
     return;
@@ -903,32 +933,68 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
   //-----------------
   // Intersection 3d .
   //-----------------
+  Message_ProgressScope aPSInter(aPS.Next(aSteps.GetStep(PIOperation_Intersection)), "Intersection", 10);
   BRepOffset_Inter3d Inter(myAsDes,Side,myTol);
-  Intersection3D (Inter);
+  Intersection3D (Inter, aPSInter.Next(7));
+  if (myError != BRepOffset_NoError)
+  {
+    return;
+  }
   //-----------------
   // Intersection2D
   //-----------------
   TopTools_IndexedMapOfShape& Modif    = Inter.TouchedFaces(); 
   TopTools_IndexedMapOfShape& NewEdges = Inter.NewEdges();
 
-  if (!Modif.IsEmpty()) Intersection2D (Modif,NewEdges);
+  if (!Modif.IsEmpty())
+  {
+    Intersection2D(Modif, NewEdges, aPSInter.Next());
+    if (myError != BRepOffset_NoError)
+    {
+      return;
+    }
+  }
+
   //-------------------------------------------------------
   // Unwinding 2D and reconstruction of modified faces
   //----------------------------------------------------
-  MakeLoops (Modif);
+  MakeLoops (Modif, aPSInter.Next());
+  if (myError != BRepOffset_NoError)
+  {
+    return;
+  }
   //-----------------------------------------------------
   // Reconstruction of non modified faces sharing 
   // reconstructed edges
   //------------------------------------------------------
-  if (!Modif.IsEmpty()) MakeFaces (Modif);
+  if (!Modif.IsEmpty())
+  {
+    MakeFaces(Modif, aPSInter.Next());
+    if (myError != BRepOffset_NoError)
+    {
+      return;
+    }
+  }
+
+  aPSInter.Close();
 
   if (myThickening)
-    MakeMissingWalls();
+  {
+    MakeMissingWalls(aPS.Next(aSteps.GetStep(PIOperation_MakeMissingWalls)));
+    if (myError != BRepOffset_NoError)
+    {
+      return;
+    }
+  }
 
   //-------------------------
   // Construction of shells.
   //-------------------------
-  MakeShells ();
+  MakeShells (aPS.Next(aSteps.GetStep(PIOperation_MakeShells)));
+  if (myError != BRepOffset_NoError)
+  {
+    return;
+  }
   if (myOffsetShape.IsNull()) {
     // not done
     myDone = Standard_False;
@@ -955,8 +1021,11 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
   //----------------------
   // Creation of solids.
   //----------------------
-  MakeSolid ();
-
+  MakeSolid (aPS.Next(aSteps.GetStep(PIOperation_MakeSolid)));
+  if (myError != BRepOffset_NoError)
+  {
+    return;
+  }
   //-----------------------------
   // MAJ Tolerance edge and Vertex
   // ----------------------------
@@ -973,13 +1042,22 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
   {
     BRepBuilderAPI_Sewing aSew(myTol);
     aSew.Add(myOffsetShape);
-    aSew.Perform();
+    aSew.Perform(aPS.Next(aSteps.GetStep(PIOperation_Sewing/2)));
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     myOffsetShape = aSew.SewedShape();
 
     // Rebuild solid.
     // Offset shape expected to be really closed after sewing.
     myOffsetShape.Closed(Standard_True);
-    MakeSolid();
+    MakeSolid(aPS.Next(aSteps.GetStep(PIOperation_Sewing / 2)));
+    if (myError != BRepOffset_NoError)
+    {
+      return;
+    }
   }
 
   myDone = Standard_True;
@@ -992,12 +1070,12 @@ void BRepOffset_MakeOffset::MakeOffsetShape()
 //purpose  : 
 //=======================================================================
 
-void BRepOffset_MakeOffset::MakeThickSolid(
+void BRepOffset_MakeOffset::MakeThickSolid(const Message_ProgressRange& theRange)
 {
   //--------------------------------------------------------------
   // Construction of shell parallel to shell (initial without cap).
   //--------------------------------------------------------------
-  MakeOffsetShape ();
+  MakeOffsetShape (theRange);
 
   if (!myDone)
   {
@@ -1115,7 +1193,7 @@ const TopoDS_Shape&  BRepOffset_MakeOffset::Shape() const
 //function : MakeOffsetFaces
 //purpose  : 
 //=======================================================================
-void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF)
+void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF, const Message_ProgressRange& theRange)
 {
   Standard_Real aCurOffset;
   TopTools_ListOfShape aLF;
@@ -1126,8 +1204,14 @@ void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& the
   //
   BRepLib::SortFaces(myFaceComp, aLF);
   //
+  Message_ProgressScope aPS(theRange, "Making offset faces", aLF.Size());
   aItLF.Initialize(aLF);
-  for (; aItLF.More(); aItLF.Next()) {
+  for (; aItLF.More(); aItLF.Next(), aPS.Next()) {
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     const TopoDS_Face& aF = TopoDS::Face(aItLF.Value());
     aCurOffset = myFaceOffset.IsBound(aF) ? myFaceOffset(aF) : myOffset;
     BRepOffset_Offset OF(aF, aCurOffset, ShapeTgt, OffsetOutside, myJoin);
@@ -1175,7 +1259,7 @@ void BRepOffset_MakeOffset::MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& the
 //function : BuildOffsetByInter
 //purpose  : 
 //=======================================================================
-void BRepOffset_MakeOffset::BuildOffsetByInter()
+void BRepOffset_MakeOffset::BuildOffsetByInter(const Message_ProgressRange& theRange)
 {
 #ifdef OCCT_DEBUG
   if ( ChronBuild) {
@@ -1192,7 +1276,13 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   // Construction of faces parallel to initial faces
   //--------------------------------------------------------
   BRepOffset_DataMapOfShapeOffset MapSF;
-  MakeOffsetFaces(MapSF);
+  Message_ProgressScope aPSOuter(theRange, NULL, 100);
+  MakeOffsetFaces(MapSF, aPSOuter.Next(10));
+  if (!aPSOuter.More())
+  {
+    myError = BRepOffset_UserBreak;
+    return;
+  }
   //--------------------------------------------------------------------
   // MES   : Map of OffsetShape -> Extended Shapes.
   // Build : Map of Initial SS  -> OffsetShape build by Inter.
@@ -1212,9 +1302,19 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
 
   BRepOffset_Inter3d Inter3 (AsDes,Side,myTol);
   // Intersection between parallel faces
-  Inter3.ConnexIntByInt(myFaceComp,MapSF,myAnalyse,MES,Build,Failed,myIsPlanar);
+  Inter3.ConnexIntByInt(myFaceComp, MapSF, myAnalyse, MES, Build, Failed, aPSOuter.Next(10), myIsPlanar);
+  if (!aPSOuter.More())
+  {
+    myError = BRepOffset_UserBreak;
+    return;
+  }
   // Intersection with caps.
-  Inter3.ContextIntByInt(myFaces,ExtentContext,MapSF,myAnalyse,MES,Build,Failed,myIsPlanar);
+  Inter3.ContextIntByInt(myFaces, ExtentContext, MapSF, myAnalyse, MES, Build, Failed, aPSOuter.Next(10), myIsPlanar);
+  if (!aPSOuter.More())
+  {
+    myError = BRepOffset_UserBreak;
+    return;
+  }
 
   TopTools_ListOfShape aLFaces;
   for (Exp.Init(myFaceComp,TopAbs_FACE) ; Exp.More(); Exp.Next())
@@ -1225,7 +1325,7 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   // Extension of neighbor edges of new edges and intersection between neighbors.
   //--------------------------------------------------------------------------------
   Handle(BRepAlgo_AsDes) AsDes2d = new BRepAlgo_AsDes();
-  IntersectEdges(aLFaces, MapSF, MES, Build, AsDes, AsDes2d);
+  IntersectEdges(aLFaces, MapSF, MES, Build, AsDes, AsDes2d, aPSOuter.Next(15));
   if (myError != BRepOffset_NoError)
   {
     return;
@@ -1256,21 +1356,33 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   GetEnlargedFaces(aLFaces, MapSF, MES, aFacesOrigins, IMOE, LFE);
   //
   TopTools_ListIteratorOfListOfShape itLFE(LFE);
+  Message_ProgressScope aPS2d(aPSOuter.Next(10), NULL, LFE.Size());
   for (; itLFE.More(); itLFE.Next())
   {
     const TopoDS_Face& NEF = TopoDS::Face(itLFE.Value());
     Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(NEF);
-    BRepOffset_Inter2d::Compute(AsDes, NEF, NewEdges, aCurrFaceTol, myEdgeIntEdges, aDMVV);
+    BRepOffset_Inter2d::Compute(AsDes, NEF, NewEdges, aCurrFaceTol, myEdgeIntEdges, aDMVV, aPS2d.Next());
+    if (!aPS2d.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
   }
   //----------------------------------------------
   // Intersections 2d on caps.
   //----------------------------------------------
   Standard_Integer i;
+  Message_ProgressScope aPS2dCaps(aPSOuter.Next(10), NULL, myFaces.Extent());
   for (i = 1; i <= myFaces.Extent(); i++)
   {
     const TopoDS_Face& Cork = TopoDS::Face(myFaces(i));
     Standard_Real aCurrFaceTol = BRep_Tool::Tolerance(Cork);
-    BRepOffset_Inter2d::Compute(AsDes, Cork, NewEdges, aCurrFaceTol, myEdgeIntEdges, aDMVV);
+    BRepOffset_Inter2d::Compute(AsDes, Cork, NewEdges, aCurrFaceTol, myEdgeIntEdges, aDMVV, aPS2dCaps.Next());
+    if (!aPS2dCaps.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
   }
   //
   BRepOffset_Inter2d::FuseVertices(aDMVV, AsDes, myImageVV);
@@ -1281,7 +1393,11 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   TopTools_MapOfShape aMFDone;
   //
   if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
-    BuildSplitsOfExtendedFaces(LFE, myAnalyse, AsDes, anEdgesOrigins, aFacesOrigins, aETrimEInf, IMOE);
+    BuildSplitsOfExtendedFaces(LFE, myAnalyse, AsDes, anEdgesOrigins, aFacesOrigins, aETrimEInf, IMOE, aPSOuter.Next(10));
+    if (myError != BRepOffset_NoError)
+    {
+      return;
+    }
     //
     TopTools_ListIteratorOfListOfShape aItLF(LFE);
     for (; aItLF.More(); aItLF.Next()) {
@@ -1290,7 +1406,12 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
     }
   }
   else {
-    myMakeLoops.Build(LFE, AsDes, IMOE, myImageVV);
+    myMakeLoops.Build(LFE, AsDes, IMOE, myImageVV, aPSOuter.Next(10));
+    if (!aPSOuter.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
   }
   //
 #ifdef OCCT_DEBUG
@@ -1299,8 +1420,14 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   //---------------------------
   // MAJ SD. for faces //
   //---------------------------
-  for (TopTools_ListOfShape::Iterator it (aLFaces); it.More(); it.Next())
+  Message_ProgressScope aPS1(aPSOuter.Next(15), "MAJ SD. for faces", aLFaces.Size());
+  for (TopTools_ListOfShape::Iterator it (aLFaces); it.More(); it.Next(), aPS1.Next())
   {
+    if (!aPS1.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     const TopoDS_Shape& FI   = it.Value();
     myInitOffsetFace.SetRoot(FI);
     TopoDS_Face  OF  = MapSF(FI).Face();
@@ -1491,7 +1618,13 @@ void BRepOffset_MakeOffset::BuildOffsetByInter()
   // MAJ SD. for caps
   //---------------------------
   //TopTools_MapOfShape View; 
-  for (i = 1; i <= myFaces.Extent(); i++) {
+  Message_ProgressScope aPS2(aPSOuter.Next(10), "MAJ SD. for caps", myFaces.Extent());
+  for (i = 1; i <= myFaces.Extent(); i++, aPS2.Next()) {
+    if (!aPS2.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     const TopoDS_Shape& Cork = myFaces(i);
     const TopTools_ListOfShape& LE = AsDes->Descendant(Cork);
     for (itLF.Initialize(LE) ; itLF.More(); itLF.Next()) {
@@ -1604,7 +1737,7 @@ void BRepOffset_MakeOffset::BuildFaceComp()
 //function : BuildOffsetByArc
 //purpose  : 
 //=======================================================================
-void BRepOffset_MakeOffset::BuildOffsetByArc()
+void BRepOffset_MakeOffset::BuildOffsetByArc(const Message_ProgressRange& theRange)
 {
 #ifdef OCCT_DEBUG
   if ( ChronBuild) {
@@ -1617,19 +1750,29 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
   TopExp_Explorer Exp;
   TopTools_ListIteratorOfListOfShape itLF;
   TopTools_MapOfShape Done;
-  
+  Message_ProgressScope aPSOuter(theRange, NULL, 4);
   //--------------------------------------------------------
   // Construction of faces parallel to initial faces
   //--------------------------------------------------------
   BRepOffset_DataMapOfShapeOffset MapSF;
-  MakeOffsetFaces(MapSF);
+  MakeOffsetFaces(MapSF, aPSOuter.Next());
+  if (myError != BRepOffset_NoError)
+  {
+    return;
+  }
   //--------------------------------------------------------
   // Construction of tubes on edge.
   //--------------------------------------------------------
   ChFiDS_TypeOfConcavity OT = ChFiDS_Convex;
   if (myOffset < 0.) OT = ChFiDS_Concave; 
-   
-  for (Exp.Init(myFaceComp,TopAbs_EDGE); Exp.More(); Exp.Next()) {
+  
+  Message_ProgressScope aPS1(aPSOuter.Next(), "Constructing of tubes on edges", 1, Standard_True);
+  for (Exp.Init(myFaceComp,TopAbs_EDGE); Exp.More(); Exp.Next(), aPS1.Next()) {
+    if (!aPS1.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     const TopoDS_Edge& E = TopoDS::Edge(Exp.Current());
     if (Done.Add(E)) {
       const TopTools_ListOfShape& Anc = myAnalyse.Ancestors(E);
@@ -1697,8 +1840,13 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
   //--------------------------------------------------------
   Done.Clear();
   TopTools_ListIteratorOfListOfShape it;
-
-  for (Exp.Init(myFaceComp,TopAbs_VERTEX); Exp.More(); Exp.Next()) {
+  Message_ProgressScope aPS2(aPSOuter.Next(), "Constructing of spheres on vertex", 1, Standard_True);
+  for (Exp.Init(myFaceComp,TopAbs_VERTEX); Exp.More(); Exp.Next(), aPS2.Next()) {
+    if (!aPS2.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     const TopoDS_Vertex& V = TopoDS::Vertex (Exp.Current());
     if (Done.Add(V)) {
       const TopTools_ListOfShape& LA = myAnalyse.Ancestors(V);
@@ -1758,7 +1906,13 @@ void BRepOffset_MakeOffset::BuildOffsetByArc()
   ChFiDS_TypeOfConcavity RT = ChFiDS_Concave;
   if (myOffset < 0.) RT = ChFiDS_Convex;
   BRepOffset_DataMapIteratorOfDataMapOfShapeOffset It(MapSF);
-  for ( ; It.More(); It.Next()) {
+  Message_ProgressScope aPS3(aPSOuter.Next(), NULL, MapSF.Size());
+  for ( ; It.More(); It.Next(), aPS3.Next()) {
+    if (!aPS3.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     const TopoDS_Shape& SI = It.Key(); 
     const BRepOffset_Offset& SF = It.Value();
     if (SF.Status() == BRepOffset_Reversed ||
@@ -2449,7 +2603,7 @@ void BRepOffset_MakeOffset::CorrectConicalFaces()
 //purpose  : 
 //=======================================================================
 
-void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
+void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter, const Message_ProgressRange& theRange)
 {
 #ifdef OCCT_DEBUG
   if (ChronBuild) {
@@ -2458,7 +2612,7 @@ void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
     Clock.Start();  
   }
 #endif
-
+  Message_ProgressScope aPS(theRange, NULL, 1);
   // In the Complete Intersection mode, implemented currently for planar
   // solids only, there is no need to intersect the faces here.
   // This intersection will be performed in the method BuildShellsCompleteInter
@@ -2486,7 +2640,12 @@ void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
     //-------------
     //Complete.
     //-------------
-    Inter.CompletInt (OffsetFaces,myInitOffsetFace);
+    Inter.CompletInt (OffsetFaces,myInitOffsetFace, aPS.Next());
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     TopTools_IndexedMapOfShape& NewEdges = Inter.NewEdges();
     if (myJoin == GeomAbs_Intersection) {
       BRepOffset_Tool::CorrectOrientation (myFaceComp,NewEdges,myAsDes,myInitOffsetFace,myOffset);
@@ -2496,7 +2655,12 @@ void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
     //--------------------------------
     // Only between neighbor faces.
     //--------------------------------
-    Inter.ConnexIntByArc(OffsetFaces,myFaceComp,myAnalyse,myInitOffsetFace);
+    Inter.ConnexIntByArc(OffsetFaces,myFaceComp,myAnalyse,myInitOffsetFace, aPS.Next());
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
   }
 #ifdef OCCT_DEBUG
   if ( ChronBuild) Clock.Show();
@@ -2508,8 +2672,9 @@ void BRepOffset_MakeOffset::Intersection3D(BRepOffset_Inter3d& Inter)
 //purpose  : 
 //=======================================================================
 
-void BRepOffset_MakeOffset::Intersection2D(const TopTools_IndexedMapOfShape& Modif,
-                                           const TopTools_IndexedMapOfShape& NewEdges)
+void BRepOffset_MakeOffset::Intersection2D (const TopTools_IndexedMapOfShape& Modif,
+                                            const TopTools_IndexedMapOfShape& NewEdges,
+                                            const Message_ProgressRange&      theRange)
 {
 #ifdef OCCT_DEBUG
   if (ChronBuild) {
@@ -2528,9 +2693,15 @@ void BRepOffset_MakeOffset::Intersection2D(const TopTools_IndexedMapOfShape& Mod
   //-----------------------------------------------
   TopTools_IndexedDataMapOfShapeListOfShape aDMVV;
   Standard_Integer i;
+  Message_ProgressScope aPS(theRange, "Intersection 2D", Modif.Extent());
   for (i = 1; i <= Modif.Extent(); i++) {
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     const TopoDS_Face& F  = TopoDS::Face(Modif(i));
-    BRepOffset_Inter2d::Compute(myAsDes, F, NewEdges, myTol, myEdgeIntEdges, aDMVV);
+    BRepOffset_Inter2d::Compute(myAsDes, F, NewEdges, myTol, myEdgeIntEdges, aDMVV, aPS.Next());
   }
   //
   BRepOffset_Inter2d::FuseVertices(aDMVV, myAsDes, myImageVV);
@@ -2549,7 +2720,7 @@ void BRepOffset_MakeOffset::Intersection2D(const TopTools_IndexedMapOfShape& Mod
 //purpose  : 
 //=======================================================================
 
-void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
+void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif, const Message_ProgressRange& theRange)
 {
 #ifdef OCCT_DEBUG
   if (ChronBuild) {
@@ -2569,11 +2740,17 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
       LF.Append(Modif(i));
   }
   //
+  Message_ProgressScope aPS(theRange, NULL, 1);
   if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
-    BuildSplitsOfTrimmedFaces(LF, myAsDes, myImageOffset);
+    BuildSplitsOfTrimmedFaces(LF, myAsDes, myImageOffset, aPS.Next());
   }
   else {
-    myMakeLoops.Build(LF,myAsDes,myImageOffset,myImageVV);
+    myMakeLoops.Build(LF,myAsDes,myImageOffset,myImageVV, aPS.Next());
+  }
+  if (!aPS.More())
+  {
+    myError = BRepOffset_UserBreak;
+    return;
   }
 
   //-----------------------------------------
@@ -2597,10 +2774,11 @@ void BRepOffset_MakeOffset::MakeLoops(TopTools_IndexedMapOfShape& Modif)
 //           share edges that were reconstructed.
 //=======================================================================
 
-void BRepOffset_MakeOffset::MakeFaces(TopTools_IndexedMapOfShape& /*Modif*/)
+void BRepOffset_MakeOffset::MakeFaces (TopTools_IndexedMapOfShape& /*Modif*/,
+                                       const Message_ProgressRange& theRange)
 {
 #ifdef OCCT_DEBUG
-  if (ChronBuild) {  
+  if (ChronBuild) {
     std::cout << " RECONSTRUCTION OF FACES:" << std::endl;
     Clock.Reset();
     Clock.Start();
@@ -2619,13 +2797,18 @@ void BRepOffset_MakeOffset::MakeFaces(TopTools_IndexedMapOfShape& /*Modif*/)
     }
   }
   //
+  Message_ProgressScope aPS(theRange, NULL, 1);
   if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
-    BuildSplitsOfTrimmedFaces(LOF, myAsDes, myImageOffset);
+    BuildSplitsOfTrimmedFaces(LOF, myAsDes, myImageOffset, aPS.Next());
   }
   else {
-    myMakeLoops.BuildFaces(LOF,myAsDes,myImageOffset);
+    myMakeLoops.BuildFaces(LOF, myAsDes, myImageOffset, aPS.Next());
+  }
+  if (!aPS.More())
+  {
+    myError = BRepOffset_UserBreak;
+    return;
   }
-  
 #ifdef OCCT_DEBUG
   if ( ChronBuild) Clock.Show();
 #endif
@@ -2672,7 +2855,7 @@ static void UpdateInitOffset (BRepAlgo_Image&         myInitOffset,
 //function : MakeMissingWalls
 //purpose  : 
 //=======================================================================
-void BRepOffset_MakeOffset::MakeMissingWalls ()
+void BRepOffset_MakeOffset::MakeMissingWalls (const Message_ProgressRange& theRange)
 {
   TopTools_IndexedDataMapOfShapeListOfShape Contours; //Start vertex + list of connected edges (free boundary)
   TopTools_DataMapOfShapeShape MapEF; //Edges of contours: edge + face
@@ -2680,8 +2863,14 @@ void BRepOffset_MakeOffset::MakeMissingWalls ()
 
   FillContours(myFaceComp, myAnalyse, Contours, MapEF);
 
-  for (Standard_Integer ic = 1; ic <= Contours.Extent(); ic++)
+  Message_ProgressScope aPS(theRange, "Making missing walls", Contours.Extent());
+  for (Standard_Integer ic = 1; ic <= Contours.Extent(); ic++, aPS.Next())
   {
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     TopoDS_Vertex StartVertex = TopoDS::Vertex(Contours.FindKey(ic));
     TopoDS_Edge StartEdge;
     const TopTools_ListOfShape& aContour = Contours(ic);
@@ -3105,7 +3294,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls ()
 //purpose  : 
 //=======================================================================
 
-void BRepOffset_MakeOffset::MakeShells ()
+void BRepOffset_MakeOffset::MakeShells (const Message_ProgressRange& theRange)
 {
 #ifdef OCCT_DEBUG
   if (ChronBuild) {  
@@ -3115,12 +3304,18 @@ void BRepOffset_MakeOffset::MakeShells ()
   }
 #endif
   //
+  Message_ProgressScope aPS(theRange, "Making shells", 1);
   // Prepare list of splits of the offset faces to make the shells
   TopTools_ListOfShape aLSF;
   const TopTools_ListOfShape& R = myImageOffset.Roots();
   TopTools_ListIteratorOfListOfShape it(R);
   //
   for (; it.More(); it.Next()) {
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     TopoDS_Shape aF = it.Value();
     if (myThickening) //offsetted faces must change their orientations
       aF.Reverse();
@@ -3193,7 +3388,7 @@ void BRepOffset_MakeOffset::MakeShells ()
 //purpose  : 
 //=======================================================================
 
-void BRepOffset_MakeOffset::MakeSolid ()
+void BRepOffset_MakeOffset::MakeSolid (const Message_ProgressRange& theRange)
 {
  if (myOffsetShape.IsNull()) return;
 
@@ -3209,11 +3404,18 @@ void BRepOffset_MakeOffset::MakeSolid ()
   TopoDS_Shape                S1;
   B.MakeCompound (NC);
 
+  Message_ProgressScope aPS(theRange, "Making solid", 1);
+  
   TopoDS_Solid Sol;
   B.MakeSolid(Sol);
   Sol.Closed(Standard_True);
   Standard_Boolean aMakeSolid = (myShape.ShapeType() == TopAbs_SOLID) || myThickening;
   for (exp.Init(myOffsetShape,TopAbs_SHELL); exp.More(); exp.Next()) {
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
     TopoDS_Shell Sh = TopoDS::Shell(exp.Current());
     if (myThickening && myOffset > 0.)
       Sh.Reverse();
@@ -3714,13 +3916,13 @@ void CorrectSolid(TopoDS_Solid& theSol, TopTools_ListOfShape& theSolList)
 //function : CheckInputData
 //purpose  : Check input data for possibility of offset perform.
 //=======================================================================
-Standard_Boolean BRepOffset_MakeOffset::CheckInputData()
+Standard_Boolean BRepOffset_MakeOffset::CheckInputData(const Message_ProgressRange& theRange)
 {
   // Set initial error state.
   myError = BRepOffset_NoError;
   TopoDS_Shape aTmpShape;
   myBadShape = aTmpShape;
-
+  Message_ProgressScope aPS(theRange, NULL, 1);
   // Non-null offset.
   if (Abs(myOffset) <= myTol)
   {
@@ -3759,6 +3961,11 @@ Standard_Boolean BRepOffset_MakeOffset::CheckInputData()
   gp_Pnt2d aPnt2d;
   for( ; anExpSF.More(); anExpSF.Next())
   {
+    if (!aPS.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return Standard_False;
+    }
     const TopoDS_Face& aF = TopoDS::Face(anExpSF.Current());
 
     if (aPresenceMap.Contains(aF.TShape()))
@@ -3992,30 +4199,44 @@ void BRepOffset_MakeOffset::IntersectEdges(const TopTools_ListOfShape& theFaces,
                                            TopTools_DataMapOfShapeShape& theMES,
                                            TopTools_DataMapOfShapeShape& theBuild,
                                            Handle(BRepAlgo_AsDes)& theAsDes,
-                                           Handle(BRepAlgo_AsDes)& theAsDes2d)
+                                           Handle(BRepAlgo_AsDes)& theAsDes2d,
+                                           const Message_ProgressRange& theRange)
 {
   Standard_Real aTolF;
   TopTools_IndexedDataMapOfShapeListOfShape aDMVV;
   // intersect edges created from edges
   TopTools_IndexedMapOfShape aMFV;
+  Message_ProgressScope aPSOuter(theRange, NULL , 2);
+  Message_ProgressScope aPS1(aPSOuter.Next(), "Intersecting edges", theFaces.Size());
   for (TopTools_ListOfShape::Iterator it (theFaces); it.More(); it.Next())
   {
     const TopoDS_Face& aF  = TopoDS::Face (it.Value());
     aTolF = BRep_Tool::Tolerance (aF);
     if (!BRepOffset_Inter2d::ConnexIntByInt(aF, theMapSF(aF), theMES, theBuild, theAsDes, theAsDes2d,
-                                            myOffset, aTolF, myAnalyse, aMFV, myImageVV, myEdgeIntEdges, aDMVV))
+                                            myOffset, aTolF, myAnalyse, aMFV, myImageVV, myEdgeIntEdges, aDMVV, aPS1.Next()))
     {
       myError = BRepOffset_CannotExtentEdge;
       return;
     }
+    if (!aPS1.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
   }
   // intersect edges created from vertices
   Standard_Integer i, aNbF = aMFV.Extent();
+  Message_ProgressScope aPS2(aPSOuter.Next(), "Intersecting edges created from vertices", aNbF);
   for (i = 1; i <= aNbF; ++i) {
     const TopoDS_Face& aF = TopoDS::Face(aMFV(i));
     aTolF = BRep_Tool::Tolerance(aF);
     BRepOffset_Inter2d::ConnexIntByIntInVert
-      (aF, theMapSF(aF), theMES, theBuild, theAsDes, theAsDes2d, aTolF, myAnalyse, aDMVV);
+      (aF, theMapSF(aF), theMES, theBuild, theAsDes, theAsDes2d, aTolF, myAnalyse, aDMVV, aPS2.Next());
+    if (!aPS2.More())
+    {
+      myError = BRepOffset_UserBreak;
+      return;
+    }
   }
   //
   // fuse vertices on edges
@@ -4613,6 +4834,39 @@ Standard_Boolean GetSubShapes(const TopoDS_Shape& theShape,
   return Standard_True;
 }
 
+void BRepOffset_MakeOffset::analyzeProgress (const Standard_Real theWhole,
+                                             BRepOffset_PISteps& theSteps) const
+{
+  theSteps.SetStep(PIOperation_CheckInputData, 5.);
+  theSteps.SetStep(PIOperation_Analyse, 5.);
+  theSteps.SetStep(PIOperation_BuildOffsetBy, 40.);
+  theSteps.SetStep(PIOperation_Intersection, 25.);
+  if (myThickening)
+  {
+    theSteps.SetStep(PIOperation_MakeMissingWalls, 5.);
+  }
+  theSteps.SetStep(PIOperation_MakeShells, 5.);
+  theSteps.SetStep(PIOperation_MakeSolid, 5.);
+  if (myIsPerformSewing && myThickening)
+  {
+    theSteps.SetStep(PIOperation_Sewing, 10.);
+  }
+
+  TColStd_Array1OfReal& aSteps = theSteps.ChangeSteps();
+
+  Standard_Real aSum = 0.;
+  for (Standard_Integer i = aSteps.Lower(); i <= aSteps.Upper(); ++i)
+  {
+    aSum += aSteps(i);
+  }
+
+  // Normalize steps
+  for (Standard_Integer i = aSteps.Lower(); i <= aSteps.Upper(); ++i)
+  {
+    aSteps(i) = theWhole * aSteps(i) / aSum;
+  }
+}
+
 //=======================================================================
 //function : IsPlanar
 //purpose  : Checks if all the faces of the shape are planes
index ea99f9c92bbd6c7017b528148fc9636451f4bd4a..333190f4c2faead1c3d0b498ee796fe67cd282b3 100644 (file)
 #include <BRepOffset_MakeLoops.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <BRepOffset_DataMapOfShapeOffset.hxx>
+#include <TColStd_Array1OfReal.hxx>
+
+#include <Message_ProgressRange.hxx>
 class BRepAlgo_AsDes;
 class TopoDS_Shape;
 class TopoDS_Face;
 class BRepOffset_Analyse;
 class BRepAlgo_Image;
 class BRepOffset_Inter3d;
-
+class BRepOffset_PISteps;
 
 
 class BRepOffset_MakeOffset 
@@ -61,7 +64,8 @@ public:
                                         const Standard_Boolean SelfInter = Standard_False,
                                         const GeomAbs_JoinType Join = GeomAbs_Arc,
                                         const Standard_Boolean Thickening = Standard_False,
-                                        const Standard_Boolean RemoveIntEdges = Standard_False);
+                                        const Standard_Boolean RemoveIntEdges = Standard_False,
+                                        const Message_ProgressRange& theRange = Message_ProgressRange());
   
   Standard_EXPORT void Initialize (const TopoDS_Shape& S,
                                    const Standard_Real Offset,
@@ -85,9 +89,9 @@ public:
   //! set the offset <Off> on the Face <F>
   Standard_EXPORT void SetOffsetOnFace (const TopoDS_Face& F, const Standard_Real Off);
   
-  Standard_EXPORT void MakeOffsetShape();
+  Standard_EXPORT void MakeOffsetShape(const Message_ProgressRange& theRange = Message_ProgressRange());
   
-  Standard_EXPORT void MakeThickSolid();
+  Standard_EXPORT void MakeThickSolid(const Message_ProgressRange& theRange = Message_ProgressRange());
   
   Standard_EXPORT const BRepOffset_Analyse& GetAnalyse() const;
   
@@ -124,7 +128,7 @@ public:
   //! 3) Check continuity of input surfaces.
   //! 4) Check for normals existence on grid.
   //! @return True if possible make computations and false otherwise.
-  Standard_EXPORT Standard_Boolean CheckInputData();
+  Standard_EXPORT Standard_Boolean CheckInputData(const Message_ProgressRange& theRange);
 
   //! Return bad shape, which obtained in CheckInputData.
   Standard_EXPORT const TopoDS_Shape& GetBadShape() const;
@@ -142,7 +146,15 @@ public: //! @name History methods
 
 
 protected:
-
+  //! Analyze progress steps of the whole operation.
+  //! @param theWhole - sum of progress of all operations.
+  //! @oaram theSteps - steps of the operations supported by PI
+  //!
+  //! To use this method, one has to override the following methods:
+  //! * fillPIConstants - method filling values for constant operations.
+  //! * fillPISteps - method filling steps for the rest of operations.
+  Standard_EXPORT void analyzeProgress (const Standard_Real theWhole,
+                                        BRepOffset_PISteps& theSteps) const;
 
 private:
 
@@ -159,26 +171,28 @@ private:
   
   Standard_EXPORT void BuildFaceComp();
   
-  Standard_EXPORT void BuildOffsetByArc();
+  Standard_EXPORT void BuildOffsetByArc(const Message_ProgressRange& theRange);
   
-  Standard_EXPORT void BuildOffsetByInter();
+  Standard_EXPORT void BuildOffsetByInter(const Message_ProgressRange& theRange);
 
   //! Make Offset faces
-  Standard_EXPORT void MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF);
+  Standard_EXPORT void MakeOffsetFaces(BRepOffset_DataMapOfShapeOffset& theMapSF, const Message_ProgressRange& theRange);
 
   Standard_EXPORT void SelfInter (TopTools_MapOfShape& Modif);
   
-  Standard_EXPORT void Intersection3D (BRepOffset_Inter3d& Inter);
+  Standard_EXPORT void Intersection3D (BRepOffset_Inter3d& Inter, const Message_ProgressRange& theRange);
   
-  Standard_EXPORT void Intersection2D (const TopTools_IndexedMapOfShape& Modif, const TopTools_IndexedMapOfShape& NewEdges);
+  Standard_EXPORT void Intersection2D (const TopTools_IndexedMapOfShape& Modif, 
+                                       const TopTools_IndexedMapOfShape& NewEdges, 
+                                       const Message_ProgressRange& theRange);
   
-  Standard_EXPORT void MakeLoops (TopTools_IndexedMapOfShape& Modif);
+  Standard_EXPORT void MakeLoops (TopTools_IndexedMapOfShape& Modif, const Message_ProgressRange& theRange);
   
   Standard_EXPORT void MakeLoopsOnContext (TopTools_MapOfShape& Modif);
   
-  Standard_EXPORT void MakeFaces (TopTools_IndexedMapOfShape& Modif);
+  Standard_EXPORT void MakeFaces (TopTools_IndexedMapOfShape& Modif, const Message_ProgressRange& theRange);
   
-  Standard_EXPORT void MakeShells();
+  Standard_EXPORT void MakeShells(const Message_ProgressRange& theRange);
   
   Standard_EXPORT void SelectShells();
   
@@ -187,7 +201,7 @@ private:
   //! Replace roots in history maps
   Standard_EXPORT void ReplaceRoots();
 
-  Standard_EXPORT void MakeSolid();
+  Standard_EXPORT void MakeSolid(const Message_ProgressRange& theRange);
   
   Standard_EXPORT void ToContext (BRepOffset_DataMapOfShapeOffset& MapSF);
   
@@ -198,7 +212,7 @@ private:
   Standard_EXPORT void CorrectConicalFaces();
   
   //! Private method used to build walls for thickening the shell
-  Standard_EXPORT void MakeMissingWalls();
+  Standard_EXPORT void MakeMissingWalls(const Message_ProgressRange& theRange);
 
   //! Removes INTERNAL edges from the result
   Standard_EXPORT void RemoveInternalEdges();
@@ -209,7 +223,8 @@ private:
                                        TopTools_DataMapOfShapeShape& theMES,
                                        TopTools_DataMapOfShapeShape& theBuild,
                                        Handle(BRepAlgo_AsDes)& theAsDes,
-                                       Handle(BRepAlgo_AsDes)& theAsDes2d);
+                                       Handle(BRepAlgo_AsDes)& theAsDes2d,
+                                       const Message_ProgressRange& theRange);
 
   //! Building of the splits of the offset faces for mode Complete
   //! and joint type Intersection. This method is an advanced alternative
@@ -221,13 +236,15 @@ private:
                                                   TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
                                                   TopTools_DataMapOfShapeShape& theFacesOrigins,
                                                   TopTools_DataMapOfShapeShape& theETrimEInf,
-                                                  BRepAlgo_Image& theImage);
+                                                  BRepAlgo_Image& theImage,
+                                                  const Message_ProgressRange& theRange);
 
   //! Building of the splits of the already trimmed offset faces for mode Complete
   //! and joint type Intersection.
   Standard_EXPORT void BuildSplitsOfTrimmedFaces(const TopTools_ListOfShape& theLF,
                                                  const Handle(BRepAlgo_AsDes)& theAsDes,
-                                                 BRepAlgo_Image& theImage);
+                                                 BRepAlgo_Image& theImage,
+                                                 const Message_ProgressRange& theRange);
 
   Standard_Real myOffset;
   Standard_Real myTol;
@@ -264,4 +281,47 @@ private:
   TopTools_MapOfShape myResMap;
 };
 
+//! Class for representing the relative contribution of each step of
+//! the operation to the whole progress
+class BRepOffset_PISteps
+{
+public:
+  //! Constructor
+  BRepOffset_PISteps(const Standard_Integer theNbOp)
+    : mySteps(0, theNbOp - 1)
+  {
+    for (Standard_Integer i = 0; i < theNbOp; ++i)
+    {
+      mySteps(i) = 0.;
+    }
+  }
+
+  //! Returns the steps
+  const TColStd_Array1OfReal& Steps() const { return mySteps; }
+  //! Returns modifiable steps
+  TColStd_Array1OfReal& ChangeSteps() { return mySteps; }
+
+  //! Returns the step assigned to the operation
+  void SetStep(const Standard_Integer theOperation, const Standard_Real theStep)
+  {
+    if (theOperation >= mySteps.Lower() && theOperation <= mySteps.Upper())
+    {
+      mySteps(theOperation) = theStep;
+    }
+  }
+
+  //! Returns the step assigned to the operation
+  Standard_Real GetStep(const Standard_Integer theOperation)
+  {
+    if (theOperation < mySteps.Lower() || theOperation > mySteps.Upper())
+    {
+      return 0.;
+    }
+    return mySteps(theOperation);
+  }
+
+protected:
+  TColStd_Array1OfReal mySteps;
+};
+
 #endif // _BRepOffset_MakeOffset_HeaderFile
index 3adba98fcd45e40899b81630f1d39e1adad4d181..9766b65f7531338be97b3ac77a6914abeb3fba68 100644 (file)
@@ -396,14 +396,15 @@ namespace {
   //=======================================================================
   static void BuildSplitsOfTrimmedFace (const TopoDS_Face& theFace,
                                         const TopoDS_Shape& theEdges,
-                                        TopTools_ListOfShape& theLFImages)
+                                        TopTools_ListOfShape& theLFImages,
+                                        const Message_ProgressRange& theRange)
   {
     BOPAlgo_Splitter aSplitter;
     //
     aSplitter.AddArgument (theFace);
     aSplitter.AddArgument (theEdges);
     aSplitter.SetToFillHistory (Standard_False);
-    aSplitter.Perform();
+    aSplitter.Perform(theRange);
     if (aSplitter.HasErrors())
     {
       return;
@@ -545,18 +546,18 @@ public: //! @name Setting data
 public: //! @name Public methods to build the splits
 
   //! Build splits of already trimmed faces
-  void BuildSplitsOfTrimmedFaces();
+  void BuildSplitsOfTrimmedFaces(const Message_ProgressRange& theRange);
 
   //! Building splits of not-trimmed offset faces.
   //! For the cases in which invalidities will be found, these invalidities will be rebuilt.
-  void BuildSplitsOfExtendedFaces();
+  void BuildSplitsOfExtendedFaces(const Message_ProgressRange& theRange);
 
 private: //! @name private methods performing the job
 
 private: //! @name Intersection and post-treatment of edges
 
   //! Intersection of the trimmed edges among themselves
-  void IntersectTrimmedEdges();
+  void IntersectTrimmedEdges(const Message_ProgressRange& theRange);
 
   //! Saving connection from trimmed edges to not trimmed ones
   void UpdateIntersectedEdges (const TopTools_ListOfShape& theLA,
@@ -898,7 +899,7 @@ private:
 //function : BuildSplitsOfTrimmedFaces
 //purpose  : 
 //=======================================================================
-void BRepOffset_BuildOffsetFaces::BuildSplitsOfTrimmedFaces()
+void BRepOffset_BuildOffsetFaces::BuildSplitsOfTrimmedFaces(const Message_ProgressRange& theRange)
 {
   if (!hasData (myFaces))
   {
@@ -911,11 +912,18 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfTrimmedFaces()
     myEdgesOrigins = &anEdgesOrigins;
   }
 
+  Message_ProgressScope aPS(theRange, NULL, 2);
+
   // Fuse all edges
-  IntersectTrimmedEdges();
+  IntersectTrimmedEdges(aPS.Next());
 
+  Message_ProgressScope aPSLoop(aPS.Next(), NULL, myFaces->Size());
   for (TopTools_ListOfShape::Iterator aItLF (*myFaces); aItLF.More(); aItLF.Next())
   {
+    if (!aPSLoop.More())
+    {
+      return;
+    }
     const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
 
     TopoDS_Shape aCE;
@@ -932,7 +940,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfTrimmedFaces()
     }
 
     TopTools_ListOfShape aLFImages;
-    BuildSplitsOfTrimmedFace (aF, aCE, aLFImages);
+    BuildSplitsOfTrimmedFace (aF, aCE, aLFImages, aPSLoop.Next());
 
     myOFImages.Add (aF, aLFImages);
   }
@@ -944,7 +952,7 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfTrimmedFaces()
 //function : BuildSplitsOfExtendedFaces
 //purpose  : 
 //=======================================================================
-void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces()
+void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces(const Message_ProgressRange& theRange)
 {
   // Check input data
   if (!hasData (myFaces) || !hasData (myEdgesOrigins) || !hasData (myFacesOrigins) || !hasData (myETrimEInf))
@@ -952,9 +960,14 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces()
     return;
   }
 
-  // Fusing all trimmed offset edges to avoid self-intersections in the splits
-  IntersectTrimmedEdges();
+  Message_ProgressScope aPS(theRange, NULL, 2);
 
+  // Fusing all trimmed offset edges to avoid self-intersections in the splits
+  IntersectTrimmedEdges(aPS.Next());
+  if (!aPS.More())
+  {
+    return;
+  }
   // vertices to avoid
   TopTools_MapOfShape aVertsToAvoid;
 
@@ -963,6 +976,10 @@ void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces()
   const Standard_Integer aNbMaxAttempts = 10;
   for (Standard_Integer iCount = 0; iCount < aNbMaxAttempts; ++iCount)
   {
+    if (!aPS.More())
+    {
+      return;
+    }
     // Clear the data before further faces construction
     myInvalidFaces.Clear();
     myArtInvalidFaces.Clear();
@@ -1038,14 +1055,19 @@ void BRepOffset_BuildOffsetFaces::UpdateIntersectedEdges (const TopTools_ListOfS
 //function : IntersectTrimmedEdges
 //purpose  :
 //=======================================================================
-void BRepOffset_BuildOffsetFaces::IntersectTrimmedEdges()
+void BRepOffset_BuildOffsetFaces::IntersectTrimmedEdges(const Message_ProgressRange& theRange)
 {
   // get edges to intersect from descendants of the offset faces
   TopTools_ListOfShape aLS;
   //
+  Message_ProgressScope aPS(theRange, NULL, 2);
   TopTools_ListIteratorOfListOfShape aItLF (*myFaces);
   for (; aItLF.More(); aItLF.Next())
   {
+    if (!aPS.More())
+    {
+      return;
+    }
     const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
     //
     const TopTools_ListOfShape& aLE = myAsDes->Descendant (aF);
@@ -1075,7 +1097,7 @@ void BRepOffset_BuildOffsetFaces::IntersectTrimmedEdges()
   // perform intersection of the edges
   BOPAlgo_Builder aGFE;
   aGFE.SetArguments (aLS);
-  aGFE.Perform();
+  aGFE.Perform(aPS.Next());
   if (aGFE.HasErrors())
   {
     return;
@@ -1083,8 +1105,13 @@ void BRepOffset_BuildOffsetFaces::IntersectTrimmedEdges()
   //
   TopTools_ListOfShape aLA;
   // fill map with edges images
-  for (TopTools_ListOfShape::Iterator aIt (aLS); aIt.More(); aIt.Next())
+  Message_ProgressScope aPSLoop(aPS.Next(), NULL, aLS.Size());
+  for (TopTools_ListOfShape::Iterator aIt (aLS); aIt.More(); aIt.Next(), aPSLoop.Next())
   {
+    if (!aPSLoop.More())
+    {
+      return;
+    }
     const TopoDS_Shape& aE = aIt.Value();
     const TopTools_ListOfShape& aLEIm = aGFE.Modified (aE);
     if (aLEIm.IsEmpty())
@@ -8225,12 +8252,13 @@ void BRepOffset_BuildOffsetFaces::FillHistory()
 //=======================================================================
 void BRepOffset_MakeOffset::BuildSplitsOfTrimmedFaces (const TopTools_ListOfShape& theLF,
                                                        const Handle (BRepAlgo_AsDes)& theAsDes,
-                                                       BRepAlgo_Image& theImage)
+                                                       BRepAlgo_Image& theImage,
+                                                       const Message_ProgressRange& theRange)
 {
   BRepOffset_BuildOffsetFaces aBFTool (theImage);
   aBFTool.SetFaces (theLF);
   aBFTool.SetAsDesInfo (theAsDes);
-  aBFTool.BuildSplitsOfTrimmedFaces();
+  aBFTool.BuildSplitsOfTrimmedFaces(theRange);
 }
 
 //=======================================================================
@@ -8245,7 +8273,8 @@ void BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces (const TopTools_ListOfSha
                                                         TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
                                                         TopTools_DataMapOfShapeShape& theFacesOrigins,
                                                         TopTools_DataMapOfShapeShape& theETrimEInf,
-                                                        BRepAlgo_Image& theImage)
+                                                        BRepAlgo_Image& theImage,
+                                                        const Message_ProgressRange& theRange)
 {
   BRepOffset_BuildOffsetFaces aBFTool (theImage);
   aBFTool.SetFaces (theLF);
@@ -8254,5 +8283,5 @@ void BRepOffset_MakeOffset::BuildSplitsOfExtendedFaces (const TopTools_ListOfSha
   aBFTool.SetEdgesOrigins (theEdgesOrigins);
   aBFTool.SetFacesOrigins (theFacesOrigins);
   aBFTool.SetInfEdges (theETrimEInf);
-  aBFTool.BuildSplitsOfExtendedFaces();
+  aBFTool.BuildSplitsOfExtendedFaces(theRange);
 }
index d00d7d16106a6a55577cd4ff12eb520c1ec2ea5f..f6a5ff0a13fed2257db6b54688f9adb291269bbb 100644 (file)
@@ -41,14 +41,15 @@ void BRepOffsetAPI_MakeOffsetShape::PerformByJoin
  const Standard_Boolean Intersection,
  const Standard_Boolean SelfInter,
  const GeomAbs_JoinType Join,
- const Standard_Boolean RemoveIntEdges)
+ const Standard_Boolean RemoveIntEdges,
+ const Message_ProgressRange& theRange)
 {
   NotDone();
   myLastUsedAlgo = OffsetAlgo_JOIN;
 
   myOffsetShape.Initialize (S,Offset,Tol,Mode,Intersection,SelfInter,
                             Join, Standard_False, RemoveIntEdges);
-  myOffsetShape.MakeOffsetShape();
+  myOffsetShape.MakeOffsetShape(theRange);
 
   if (!myOffsetShape.IsDone())
     return;
index 1a863c1091c69912075b5da9323324bf2258251d..4457cb1a4e2c0e3ceb3d79b07df873782f7dc1e3 100644 (file)
@@ -114,7 +114,8 @@ public:
                                      const Standard_Boolean Intersection = Standard_False,
                                      const Standard_Boolean SelfInter = Standard_False,
                                      const GeomAbs_JoinType Join = GeomAbs_Arc,
-                                     const Standard_Boolean RemoveIntEdges = Standard_False);
+                                     const Standard_Boolean RemoveIntEdges = Standard_False,
+                                     const Message_ProgressRange& theRange = Message_ProgressRange());
 
   //! Returns instance of the unrelying intersection / arc algorithm.
   Standard_EXPORT virtual const BRepOffset_MakeOffset& MakeOffset() const;
index 5024a3dfada5898214b6b7bd8bac021519074150..5238dd920dbcceb311928dc7e5b0e841a44c3ef2 100644 (file)
@@ -41,12 +41,13 @@ void BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin
 (const TopoDS_Shape&         S,
  const TopTools_ListOfShape& ClosingFaces,
  const Standard_Real         Offset, 
- const Standard_Real         Tol, 
+ const Standard_Real         Tol,
  const BRepOffset_Mode       Mode,
  const Standard_Boolean      Intersection,
  const Standard_Boolean      SelfInter,
  const GeomAbs_JoinType      Join,
- const Standard_Boolean      RemoveIntEdges)
+ const Standard_Boolean      RemoveIntEdges,
+ const Message_ProgressRange& theRange)
 {
   NotDone();
   myLastUsedAlgo = OffsetAlgo_JOIN;
@@ -57,7 +58,7 @@ void BRepOffsetAPI_MakeThickSolid::MakeThickSolidByJoin
   for (; it.More(); it.Next())
     myOffsetShape.AddFace(TopoDS::Face(it.Value()));
 
-  myOffsetShape.MakeThickSolid();
+  myOffsetShape.MakeThickSolid(theRange);
   if (!myOffsetShape.IsDone())
     return;
 
index b15eb150f5dae7a3ffe93d846b77b9c9c53c4e87..245f7bdf7e506a7f5cad271e5f59ec76b55a4757 100644 (file)
@@ -110,7 +110,8 @@ public:
                                             const Standard_Boolean Intersection = Standard_False,
                                             const Standard_Boolean SelfInter = Standard_False,
                                             const GeomAbs_JoinType Join = GeomAbs_Arc,
-                                            const Standard_Boolean RemoveIntEdges = Standard_False);
+                                            const Standard_Boolean RemoveIntEdges = Standard_False,
+                                            const Message_ProgressRange& theRange = Message_ProgressRange());
 
   // Does nothing.
   Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
index a56e27068f003b856474294a7130f60f66c6106c..ccccc457f615092dff5a52fa81481abc5679b2c9 100644 (file)
@@ -17,6 +17,7 @@
 #include <Draw_Interpretor.hxx>
 #include <Draw_Appli.hxx>
 #include <DrawTrSurf.hxx>
+#include <Draw_ProgressIndicator.hxx>
 
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
@@ -976,10 +977,12 @@ Standard_Integer thickshell(Draw_Interpretor& theCommands,
   if (n > 5)
     Tol = Draw::Atof(a[5]);
 
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(theCommands, 1);
+
   BRepOffset_MakeOffset B;
   B.Initialize(S, Of, Tol, BRepOffset_Skin, Inter, 0, JT, Standard_True);
 
-  B.MakeOffsetShape();
+  B.MakeOffsetShape(aProgress->Start());
 
   const BRepOffset_Error aRetCode = B.Error();
   reportOffsetState(theCommands, aRetCode);
@@ -1037,8 +1040,9 @@ Standard_Integer offsetshape(Draw_Interpretor& theCommands,
     }
   }
 
-  if (!YaBouchon)  B.MakeOffsetShape();
-  else             B.MakeThickSolid();
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(theCommands, 1);
+  if (!YaBouchon)  B.MakeOffsetShape(aProgress->Start());
+  else             B.MakeThickSolid(aProgress->Start());
 
   const BRepOffset_Error aRetCode = B.Error();
   reportOffsetState(theCommands, aRetCode);
@@ -1169,10 +1173,11 @@ Standard_Integer offsetperform(Draw_Interpretor& theCommands,
 {
   if (theNArg < 2) return 1;
 
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(theCommands, 1);
   if (theYaBouchon)
-    TheOffset.MakeThickSolid();
+    TheOffset.MakeThickSolid(aProgress->Start());
   else
-    TheOffset.MakeOffsetShape();
+    TheOffset.MakeOffsetShape(aProgress->Start());
 
   if (TheOffset.IsDone())
   {
index 682d7243ea354c3afdbf4d516760b1161b7c2510..17d5d26ffd072d137b6fcc231e4c6f1dc50a4e37 100644 (file)
@@ -20,6 +20,7 @@
 #include <Draw_Interpretor.hxx>
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
+#include <Draw_ProgressIndicator.hxx>
 
 #include <string.h>
 #include <stdio.h>
@@ -392,7 +393,7 @@ Standard_Integer MakeBoss(Draw_Interpretor& , Standard_Integer , const char** a)
 //function : MakeShell
 //purpose  : 
 //=======================================================================
-Standard_Integer MakeShell(Draw_Interpretor& , Standard_Integer , const char** a)
+Standard_Integer MakeShell(Draw_Interpretor& theDI, Standard_Integer , const char** a)
 {
 
   TopoDS_Shape aShape = DBRep::Get( a[1] ); 
@@ -404,12 +405,14 @@ Standard_Integer MakeShell(Draw_Interpretor& , Standard_Integer , const char** a
   
   Standard_Real Off = -Draw::Atof( a[3] );
 
+  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(theDI, 1);
+
   BRepOffset_MakeOffset Offset;
 
   Offset.Initialize( aShape, Off,  1.0e-3, BRepOffset_Skin, 
                               Standard_True , Standard_False , GeomAbs_Arc );
   Offset.AddFace( F );
-  Offset.MakeThickSolid();
+  Offset.MakeThickSolid(aProgress->Start());
 
   if( Offset.IsDone() ) {
   //    SaveShape::Save(Offset.Shape(), "ss");
index dae680ea9e9171338dacb59b1eba53ee24eb9134..23a264dc0558a7d443606de77f29e25fd223b94f 100644 (file)
@@ -1786,7 +1786,8 @@ void BiTgte_Blend::ComputeCenters()
                                  myEdges,
                                  myTol,
                                   anEmptyMap,
-                                 aDMVV);
+                                 aDMVV,
+                                  Message_ProgressRange());
     }
   }
 
@@ -1821,7 +1822,8 @@ void BiTgte_Blend::ComputeCenters()
                                myEdges,
                                myTol,
                                 anEmptyMap,
-                               aDMVV);
+                               aDMVV,
+                                Message_ProgressRange());
   }
   //
   // fuse vertices on edges stored in AsDes
@@ -1831,7 +1833,7 @@ void BiTgte_Blend::ComputeCenters()
   // unwinding 
   // ------------
   BRepOffset_MakeLoops MakeLoops;
-  MakeLoops.Build (LOF, myAsDes, myImageOffset, anEmptyImage);
+  MakeLoops.Build (LOF, myAsDes, myImageOffset, anEmptyImage, Message_ProgressRange());
 
   // ------------------------------------------------------------
   // It is possible to unwind edges at least one ancestor which of