#include "DriverMED_R_SMESHDS_Mesh.h"
#include "DriverMED_W_SMESHDS_Mesh.h"
+#include "MED_Factory.hxx"
#include "SMDS_EdgePosition.hxx"
#include "SMDS_ElemIterator.hxx"
#include "SMDS_FacePosition.hxx"
#include "SMESH_Gen_i.hxx"
#include "SMESH_Group.hxx"
#include "SMESH_Group_i.hxx"
-#include "SMESH_MEDMesh_i.hxx"
#include "SMESH_MeshEditor.hxx"
#include "SMESH_MeshEditor_i.hxx"
#include "SMESH_MeshPartDS.hxx"
int major, minor, release;
if( !MED::getMEDVersion( theFileName, major, minor, release ) )
major = minor = release = -1;
- _medFileInfo = new SALOME_MED::MedFileInfo();
+ _medFileInfo = new SMESH::MedFileInfo();
_medFileInfo->fileName = theFileName;
_medFileInfo->fileSize = 0;
#ifdef WIN32
// register CORBA object for persistence
int nextId = _gen_i->RegisterObject( subMesh );
- if(MYDEBUG) MESSAGE( "Add submesh to map with id = "<< nextId);
+ if(MYDEBUG) { MESSAGE( "Add submesh to map with id = "<< nextId); }
+ else { nextId = 0; } // avoid "unused variable" warning in release mode
// to track changes of GEOM groups
addGeomGroupData( theSubShapeObject, subMesh );
// register CORBA object for persistence
int nextId = _gen_i->RegisterObject( aGroup );
- if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId);
+ if(MYDEBUG) { MESSAGE( "Add group to map with id = "<< nextId); }
+ else { nextId = 0; } // avoid "unused variable" warning in release mode
// to track changes of GEOM groups
if ( !theShape.IsNull() ) {
void SMESH_Mesh_i::ExportToMEDX (const char* file,
CORBA::Boolean auto_groups,
SMESH::MED_VERSION theVersion,
- CORBA::Boolean overwrite)
+ CORBA::Boolean overwrite,
+ CORBA::Boolean autoDimension)
throw(SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
string aMeshName = prepareMeshNameAndGroups(file, overwrite);
TPythonDump() << _this() << ".ExportToMEDX( r'"
- << file << "', " << auto_groups << ", " << theVersion << ", " << overwrite << " )";
+ << file << "', " << auto_groups << ", "
+ << theVersion << ", " << overwrite << ", "
+ << autoDimension << " )";
- _impl->ExportMED( file, aMeshName.c_str(), auto_groups, theVersion );
+ _impl->ExportMED( file, aMeshName.c_str(), auto_groups, theVersion, 0, autoDimension );
}
//================================================================================
const char* file,
CORBA::Boolean auto_groups,
::SMESH::MED_VERSION version,
- ::CORBA::Boolean overwrite)
+ ::CORBA::Boolean overwrite,
+ ::CORBA::Boolean autoDimension)
throw (SALOME::SALOME_Exception)
{
Unexpect aCatch(SALOME_SalomeException);
- if ( _preMeshInfo )
- _preMeshInfo->FullLoadFromFile();
+ TPythonDump pyDump;
- PrepareForWriting(file, overwrite);
+ if ( SMESH_Mesh_i * mesh = SMESH::DownCast< SMESH_Mesh_i* >( meshPart ))
+ {
+ mesh->ExportToMEDX( file, auto_groups, version, autoDimension );
+ }
+ else
+ {
+ if ( _preMeshInfo )
+ _preMeshInfo->FullLoadFromFile();
- string aMeshName = "Mesh";
- SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
- if ( !aStudy->_is_nil() ) {
- SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( aStudy, meshPart );
- if ( !SO->_is_nil() ) {
- CORBA::String_var name = SO->GetName();
- aMeshName = name;
+ PrepareForWriting(file, overwrite);
+
+ string aMeshName = "Mesh";
+ SALOMEDS::Study_var aStudy = _gen_i->GetCurrentStudy();
+ if ( !aStudy->_is_nil() ) {
+ SALOMEDS::SObject_wrap SO = _gen_i->ObjectToSObject( aStudy, meshPart );
+ if ( !SO->_is_nil() ) {
+ CORBA::String_var name = SO->GetName();
+ aMeshName = name;
+ }
}
+ SMESH_MeshPartDS partDS( meshPart );
+ _impl->ExportMED( file, aMeshName.c_str(), auto_groups, version, &partDS, autoDimension );
}
- SMESH_MeshPartDS partDS( meshPart );
- _impl->ExportMED( file, aMeshName.c_str(), auto_groups, version, &partDS );
-
- TPythonDump() << _this() << ".ExportPartToMED( " << meshPart << ", r'" << file << "', "
- << auto_groups << ", " << version << ", " << overwrite << " )";
+ pyDump << _this() << ".ExportPartToMED( " << meshPart << ", r'" << file << "', "
+ << auto_groups << ", " << version << ", " << overwrite << ", "
+ << autoDimension << " )";
}
//================================================================================
<< withRequiredGroups << ")";
}
-//=============================================================================
-/*!
- * Return implementation of SALOME_MED::MESH interfaces
- */
-//=============================================================================
-
-SALOME_MED::MESH_ptr SMESH_Mesh_i::GetMEDMesh()throw(SALOME::SALOME_Exception)
-{
- Unexpect aCatch(SALOME_SalomeException);
- if ( _preMeshInfo )
- _preMeshInfo->FullLoadFromFile();
-
- SMESH_MEDMesh_i *aMedMesh = new SMESH_MEDMesh_i(this);
- SALOME_MED::MESH_var aMesh = aMedMesh->_this();
- return aMesh._retn();
-}
-
//=============================================================================
CORBA::Long SMESH_Mesh_i::NbNodes()throw(SALOME::SALOME_Exception)
// register CORBA object for persistence
int nextId = _gen_i->RegisterObject( groupVar );
- if(MYDEBUG) MESSAGE( "Add group to map with id = "<< nextId);
+ if(MYDEBUG) { MESSAGE( "Add group to map with id = "<< nextId); }
+ else { nextId = 0; } // avoid "unused variable" warning in release mode
// publishing the groups in the study
if ( !aStudy->_is_nil() ) {
*/
//=============================================================================
-SALOME_MED::MedFileInfo* SMESH_Mesh_i::GetMEDFileInfo()
+SMESH::MedFileInfo* SMESH_Mesh_i::GetMEDFileInfo()
{
- SALOME_MED::MedFileInfo_var res( _medFileInfo );
+ SMESH::MedFileInfo_var res( _medFileInfo );
if ( !res.operator->() ) {
- res = new SALOME_MED::MedFileInfo;
+ res = new SMESH::MedFileInfo;
res->fileName = "";
res->fileSize = res->major = res->minor = res->release = -1;
}