Salome HOME
Generalize "Cancel Compute" mechanism to be able to report
[modules/smesh.git] / src / SMESH / SMESH_Algo.cxx
index 98e8af4691b3b2f2b5afc5a69591cdffc01c91cf..b92726fb176b1920009eda5c2c9818be6eb1536c 100644 (file)
@@ -682,11 +682,17 @@ bool SMESH_Algo::Compute(SMESH_Mesh & /*aMesh*/, SMESH_MesherHelper* /*aHelper*/
   return error( COMPERR_BAD_INPUT_MESH, "Mesh built on shape expected");
 }
 
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+//=======================================================================
+//function : CancelCompute
+//purpose  : Sets _computeCanceled to true. It's usage depends on
+//  *        implementation of a particular mesher.
+//=======================================================================
+
 void SMESH_Algo::CancelCompute()
 {
+  _computeCanceled = true;
+  _error = COMPERR_CANCELED;
 }
-#endif
 
 //================================================================================
 /*!
@@ -748,6 +754,8 @@ void SMESH_Algo::InitComputeError()
     if ( (*elem)->GetID() < 1 )
       delete *elem;
   _badInputElements.clear();
+
+  _computeCanceled = false;
 }
 
 //================================================================================