0025748: Parallel version of progress indicator
[occt.git] / src / IGESToBRep / IGESToBRep_Actor.cxx
index 620cb00..79b0de7 100644 (file)
@@ -22,7 +22,7 @@
 #include <Interface_InterfaceModel.hxx>
 #include <Interface_Macros.hxx>
 #include <Interface_Static.hxx>
-#include <Message_ProgressSentry.hxx>
+#include <Message_ProgressScope.hxx>
 #include <ShapeExtend_Explorer.hxx>
 #include <ShapeFix_ShapeTolerance.hxx>
 #include <Standard_ErrorHandler.hxx>
@@ -141,7 +141,8 @@ static void TrimTolerances (const TopoDS_Shape& shape,
 //purpose  : 
 //=======================================================================
 Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
-(const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP)
+(const Handle(Standard_Transient)& start, const Handle(Transfer_TransientProcess)& TP,
+ const Message_ProgressRange& theProgress)
 {
   DeclareAndCast(IGESData_IGESModel,mymodel,themodel);
   DeclareAndCast(IGESData_IGESEntity,ent,start);
@@ -162,7 +163,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
       (typnum == 408) || (typnum == 308)) {
 
     // Start progress scope (no need to check if progress exists -- it is safe)
-    Message_ProgressSentry aPSentry(TP->GetProgress(), "Transfer stage", 0, 2, 1);
+    Message_ProgressScope aPS(theProgress, "Transfer stage", 2);
 
     XSAlgo::AlgoContainer()->PrepareForTransfer();
     IGESToBRep_CurveAndSurface CAS;
@@ -189,22 +190,19 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
     {
       try {
         OCC_CATCH_SIGNALS
-       shape = CAS.TransferGeometry(ent);
+        shape = CAS.TransferGeometry(ent, aPS.Next());
       }
       catch(Standard_Failure const&) {
        shape.Nullify();
       }
     }
-
-    // Switch to fix stage.
-    aPSentry.Next();
     
     // fixing shape
     Handle(Standard_Transient) info;
     shape = XSAlgo::AlgoContainer()->ProcessShape( shape, theeps, CAS.GetMaxTol(), 
                                                    "read.iges.resource.name", 
                                                    "read.iges.sequence", info,
-                                                   TP->GetProgress() );
+                                                   aPS.Next());
     XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
   }