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::SMESH_Mesh_ptr CreateEmptyMesh()
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 )
throw ( SALOME::SALOME_Exception );
SMESH::DriverMED_ReadStatus& theStatus )
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 )
throw ( SALOME::SALOME_Exception );
SMESH::DriverMED_ReadStatus& theStatus )
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
SMESH::SMESH_Mesh_ptr CopyMesh(SMESH::SMESH_IDSource_ptr meshPart,
const char* meshName,