Implement Cancel Compute (begin)

This commit is contained in:
adam 2011-03-17 08:40:57 +00:00
parent d992d85973
commit 5142df035d
3 changed files with 37 additions and 0 deletions

View File

@ -269,6 +269,12 @@ module SMESH
in GEOM::GEOM_Object theSubObject )
raises ( SALOME::SALOME_Exception );
/*!
* Cancel a computation.
*/
void CancelCompute( in SMESH_Mesh theMesh,
in GEOM::GEOM_Object theSubObject );
/*!
* Return true if hypotheses are defined well
*/

View File

@ -1433,6 +1433,9 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh,
myLocShape = SMESH_Mesh::PseudoShape();
// call implementation compute
::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
#ifdef WITH_SMESH_CANCEL_COMPUTE
myGen.PrepareCompute( myLocMesh, myLocShape);
#endif
bool ok = myGen.Compute( myLocMesh, myLocShape);
meshServant->CreateGroupServants(); // algos can create groups (issue 0020918)
myLocMesh.GetMeshDS()->Modified();
@ -1451,6 +1454,29 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh,
return false;
}
//=============================================================================
/*!
* SMESH_Gen_i::CancelCompute
*
* Cancel Compute mesh on a shape
*/
//=============================================================================
void SMESH_Gen_i::CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject )
{
#ifdef WITH_SMESH_CANCEL_COMPUTE
SMESH_Mesh_i* meshServant = dynamic_cast<SMESH_Mesh_i*>( GetServant( theMesh ).in() );
::SMESH_Mesh& myLocMesh = meshServant->GetImpl();
TopoDS_Shape myLocShape;
if(theMesh->HasShapeToMesh())
myLocShape = GeomObjectToShape( theShapeObject );
else
myLocShape = SMESH_Mesh::PseudoShape();
myGen.CancelCompute( myLocMesh, myLocShape);
#endif
}
//=============================================================================
/*!
* SMESH_Gen_i::Precompute

View File

@ -245,6 +245,11 @@ public:
CORBA::Boolean Compute( SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject )
throw ( SALOME::SALOME_Exception );
// Cancel Compute mesh on a shape
void CancelCompute( SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject );
/*!
* \brief Return errors of mesh computation
*/