mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-14 21:10:33 +05:00
021382: EDF 1985 SMESH: Read/write of .mesh files (GMF format)
+ SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName, + SMESH::ComputeError_out theError)
This commit is contained in:
parent
1cf0520025
commit
bbc0ed28d2
@ -1222,6 +1222,41 @@ SMESH::mesh_array* SMESH_Gen_i::CreateMeshesFromCGNS( const char* theFileName,
|
|||||||
return aResult._retn();
|
return aResult._retn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Create a mesh and import data from a GMF file
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
SMESH::SMESH_Mesh_ptr
|
||||||
|
SMESH_Gen_i::CreateMeshesFromGMF( const char* theFileName,
|
||||||
|
SMESH::ComputeError_out theError)
|
||||||
|
throw ( SALOME::SALOME_Exception )
|
||||||
|
{
|
||||||
|
Unexpect aCatch(SALOME_SalomeException);
|
||||||
|
|
||||||
|
SMESH::SMESH_Mesh_var aMesh = createMesh();
|
||||||
|
string aFileName = basename( theFileName );
|
||||||
|
// publish mesh in the study
|
||||||
|
if ( CanPublishInStudy( aMesh ) ) {
|
||||||
|
SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
|
||||||
|
aStudyBuilder->NewCommand(); // There is a transaction
|
||||||
|
SALOMEDS::SObject_var aSO = PublishInStudy
|
||||||
|
( myCurrentStudy, SALOMEDS::SObject::_nil(), aMesh.in(), aFileName.c_str() );
|
||||||
|
aStudyBuilder->CommitCommand();
|
||||||
|
if ( !aSO->_is_nil() ) {
|
||||||
|
// Update Python script
|
||||||
|
TPythonDump() << aSO << " = " << this << ".CreateMeshesFromGMF(r'" << theFileName << "')";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SMESH_Mesh_i* aServant = dynamic_cast<SMESH_Mesh_i*>( GetServant( aMesh ).in() );
|
||||||
|
ASSERT( aServant );
|
||||||
|
theError = aServant->ImportGMFFile( theFileName );
|
||||||
|
aServant->GetImpl().GetMeshDS()->Modified();
|
||||||
|
return aMesh._retn();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
* SMESH_Gen_i::IsReadyToCompute
|
* SMESH_Gen_i::IsReadyToCompute
|
||||||
|
@ -238,7 +238,7 @@ public:
|
|||||||
SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
|
SMESH::SMESH_Mesh_ptr CreateEmptyMesh()
|
||||||
throw ( SALOME::SALOME_Exception );
|
throw ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
// Create mesh(es) and import data from UNV fileter
|
// Create a mesh and import data from an UNV file
|
||||||
SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
|
SMESH::SMESH_Mesh_ptr CreateMeshesFromUNV( const char* theFileName )
|
||||||
throw ( SALOME::SALOME_Exception );
|
throw ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ public:
|
|||||||
SMESH::DriverMED_ReadStatus& theStatus )
|
SMESH::DriverMED_ReadStatus& theStatus )
|
||||||
throw ( SALOME::SALOME_Exception );
|
throw ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
// Create mesh(es) and import data from STL file
|
// Create a mesh and import data from a STL file
|
||||||
SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
|
SMESH::SMESH_Mesh_ptr CreateMeshesFromSTL( const char* theFileName )
|
||||||
throw ( SALOME::SALOME_Exception );
|
throw ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
@ -261,6 +261,11 @@ public:
|
|||||||
SMESH::DriverMED_ReadStatus& theStatus )
|
SMESH::DriverMED_ReadStatus& theStatus )
|
||||||
throw ( SALOME::SALOME_Exception );
|
throw ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
|
// Create a mesh and import data from a GMF file
|
||||||
|
SMESH::SMESH_Mesh_ptr CreateMeshesFromGMF( const char* theFileName,
|
||||||
|
SMESH::ComputeError_out theError)
|
||||||
|
throw ( SALOME::SALOME_Exception );
|
||||||
|
|
||||||
// Copy a part of mesh
|
// Copy a part of mesh
|
||||||
SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
|
SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
|
||||||
const char* meshName,
|
const char* meshName,
|
||||||
|
Loading…
Reference in New Issue
Block a user