]> OCCT Git - occt-copy.git/commitdiff
0025698: Implementation of progress feedback in pave filler CR25698
authorIstvan Csanady <istvancsanady@gmail.com>
Mon, 12 Jan 2015 15:40:00 +0000 (16:40 +0100)
committermsv <msv@opencascade.com>
Thu, 9 Apr 2015 12:19:50 +0000 (15:19 +0300)
src/BOPAlgo/BOPAlgo_PaveFiller.cxx

index b5fe4c6110e4e1c5325d68190c994dcf4670a1f4..6867cc10cfc46c2f01a494589845bf49c75b37d8 100644 (file)
@@ -26,6 +26,7 @@
 #include <BOPDS_DS.hxx>
 #include <BOPDS_Iterator.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <Message_ProgressIndicator.hxx>
 
 
 //=======================================================================
@@ -215,26 +216,46 @@ void BOPAlgo_PaveFiller::Perform()
 void BOPAlgo_PaveFiller::PerformInternal()
 {
   myErrorStatus=0;
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->NewScope(100.0);
+    myProgressIndicator->SetStep(100.0 / 16.0);
+  }
+
   //
   Init();
   if (myErrorStatus) {
     return; 
   }
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   //
   Prepare();
   if (myErrorStatus) {
     return; 
   }
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   // 00
   PerformVV();
   if (myErrorStatus) {
     return; 
   }
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
   // 01
   PerformVE();
   if (myErrorStatus) {
     return; 
   }
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   //
   myDS->UpdatePaveBlocks();
   // 11
@@ -242,32 +263,62 @@ void BOPAlgo_PaveFiller::PerformInternal()
   if (myErrorStatus) {
     return; 
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   // 02
   PerformVF();
   if (myErrorStatus) {
     return; 
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   // 12
   PerformEF();
   if (myErrorStatus) {
     return; 
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   //
   MakeSplitEdges();
   if (myErrorStatus) {
     return; 
   }
+
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   //
   // 22
   PerformFF();
   if (myErrorStatus) {
     return; 
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   //
   MakeBlocks();
   if (myErrorStatus) {
     return; 
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   //
   RefineFaceInfoOn();
   //
@@ -275,30 +326,59 @@ void BOPAlgo_PaveFiller::PerformInternal()
   if (myErrorStatus) {
     return; 
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   //
   ProcessDE();
   if (myErrorStatus) {
     return; 
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   //
   // 03
   PerformVZ();
   if (myErrorStatus) {
     return;
   }
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+    
   // 13
   PerformEZ();
   if (myErrorStatus) {
     return;
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   // 23
   PerformFZ();
   if (myErrorStatus) {
     return;
   }
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+  }
+  
   // 33
   PerformZZ();
   if (myErrorStatus) {
     return;
   }
-} 
+  
+  if (!myProgressIndicator.IsNull()) {
+    myProgressIndicator->Increment();
+    myProgressIndicator->EndScope();
+  }
+}