0025113: Mesh - Progress indication and user break functionality for BRepMesh component
[occt.git] / src / BRepMesh / BRepMesh_DelaunayNodeInsertionMeshAlgo.hxx
index ccbe552..d9f46e9 100644 (file)
@@ -85,23 +85,29 @@ protected:
   }
 
   //! Perfroms processing of generated mesh. Generates surface nodes and inserts them into structure.
-  virtual void postProcessMesh(BRepMesh_Delaun& theMesher) Standard_OVERRIDE
+  virtual void postProcessMesh (BRepMesh_Delaun& theMesher,
+                                const Message_ProgressRange& theRange) Standard_OVERRIDE
   {
-    InsertionBaseClass::postProcessMesh(theMesher);
+    if (!theRange.More())
+    {
+      return;
+    }
+    InsertionBaseClass::postProcessMesh (theMesher, Message_ProgressRange()); // shouldn't be range passed here?
 
     if (!myIsPreProcessSurfaceNodes)
     {
       const Handle(IMeshData::ListOfPnt2d) aSurfaceNodes =
         this->getRangeSplitter().GenerateSurfaceNodes(this->getParameters());
 
-      insertNodes(aSurfaceNodes, theMesher);
+      insertNodes(aSurfaceNodes, theMesher, theRange);
     }
   }
 
   //! Inserts nodes into mesh.
   Standard_Boolean insertNodes(
     const Handle(IMeshData::ListOfPnt2d)& theNodes,
-    BRepMesh_Delaun&                      theMesher)
+    BRepMesh_Delaun&                      theMesher,
+    const Message_ProgressRange&          theRange)
   {
     if (theNodes.IsNull() || theNodes->IsEmpty())
     {
@@ -120,7 +126,11 @@ protected:
       }
     }
 
-    theMesher.AddVertices(aVertexIndexes);
+    theMesher.AddVertices (aVertexIndexes, theRange);
+    if (!theRange.More())
+    {
+      return Standard_False;
+    }
     return !aVertexIndexes.IsEmpty();
   }