Add CreateEmptyMesh()

This commit is contained in:
eap 2006-05-04 13:47:24 +00:00
parent e018834cab
commit a6ffc9023c
2 changed files with 35 additions and 0 deletions

View File

@ -637,6 +637,37 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateMesh( GEOM::GEOM_Object_ptr theShapeObj
return mesh._retn();
}
//=============================================================================
/*!
* SMESH_Gen_i::CreateEmptyMesh
*
* Create empty mesh
*/
//=============================================================================
SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CreateEmptyMesh()
throw ( SALOME::SALOME_Exception )
{
Unexpect aCatch(SALOME_SalomeException);
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::CreateMesh" );
// create mesh
SMESH::SMESH_Mesh_var mesh = this->createMesh();
// publish mesh in the study
if ( CanPublishInStudy( mesh ) ) {
SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
SALOMEDS::SObject_var aSO = PublishMesh( myCurrentStudy, mesh.in() );
aStudyBuilder->CommitCommand();
if ( !aSO->_is_nil() ) {
// Update Python script
TPythonDump() << aSO << " = " << this << ".CreateEmptyMesh()";
}
}
return mesh._retn();
}
//=============================================================================
/*!
* SMESH_Gen_i::CreateMeshFromUNV

View File

@ -192,6 +192,10 @@ public:
SMESH::SMESH_Mesh_ptr CreateMesh( GEOM::GEOM_Object_ptr theShapeObject )
throw ( SALOME::SALOME_Exception );
// Create empty mesh
SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
throw ( SALOME::SALOME_Exception );
// Create mesh(es) and import data from UNV file
SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
throw ( SALOME::SALOME_Exception );