boolean HasDuplicatedGroupNamesMED();
/*!
- * Export Mesh to a MED Format file
+ * Export a Mesh to MED file.
* @params
- * - file : name of the MED file
+ * - fileName : name of the MED file
* - auto_groups : boolean parameter for creating/not creating
* the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
* the typical use is auto_groups=false.
* - 3D in the rest cases.
* If @a autoDimension is @c false, the space dimension is always 3.
*/
- void ExportToMEDX( in string file,
- in boolean auto_groups,
- in boolean overwrite,
- in boolean autoDimension) raises (SALOME::SALOME_Exception);
+ void ExportMED( in string fileName,
+ in boolean auto_groups,
+ in boolean overwrite,
+ in boolean autoDimension) raises (SALOME::SALOME_Exception);
/*!
* Export a [part of] Mesh into a MED file
* @params
* - meshPart : a part of mesh to store
- * - file : name of the MED file
+ * - fileName : name of the MED file
* - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
* - autoDimension : if @c True, a space dimension for export is defined by mesh
* configuration; for example a planar mesh lying on XOY plane
* - 's' stands for _solids_ field.
*/
void ExportPartToMED( in SMESH_IDSource meshPart,
- in string file,
+ in string fileName,
in boolean auto_groups,
in boolean overwrite,
in boolean autoDimension,
in GEOM::ListOfFields fields,
in string geomAssocFields ) raises (SALOME::SALOME_Exception);
- /*!
- * Export Mesh to a MED file
- * Works, just the same as ExportToMEDX, with overwrite parameter equal to true.
- * The method is kept in order to support old functionality
- */
- void ExportToMED( in string file, in boolean auto_groups )
- raises (SALOME::SALOME_Exception);
-
- /*!
- * Export Mesh to MED file.
- * This method is deprecated; it is kept only to support old functionality.
- * Works exactly as ExportToMED method.
- */
- void ExportMED( in string file, in boolean auto_groups )
- raises (SALOME::SALOME_Exception);
-
/*!
* Export Mesh to SAUV formatted file
* Write a temporary med file and use med2sauv
const QString& geoAssFields = aFieldList[ aMeshIndex ].second;
const bool hasFields = ( fields.length() || !geoAssFields.isEmpty() );
if ( !hasFields && aMeshOrGroup->_is_equivalent( aMeshItem ))
- aMeshItem->ExportToMEDX( aFilename.toUtf8().data(), toCreateGroups,
- toOverwrite && aMeshIndex == 0, toFindOutDim );
+ aMeshItem->ExportMED( aFilename.toUtf8().data(), toCreateGroups,
+ toOverwrite && aMeshIndex == 0, toFindOutDim );
else
aMeshItem->ExportPartToMED( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups,
toOverwrite && aMeshIndex == 0, toFindOutDim,
// ----------------------------------------------------------------------
else if ( theCommand->MethodStartsFrom( "Export" ))
{
- if ( method == "ExportToMED" || // ExportToMED() --> ExportMED()
- method == "ExportToMEDX" ) // ExportToMEDX() --> ExportMED()
+ if ( method == "ExportToMED" || // ExportToMED() --> ExportMED()
+ method == "ExportToMEDX" || // ExportToMEDX() --> ExportMED()
+ method == "ExportMED" )
{
theCommand->SetMethod( "ExportMED" );
// filter out deprecated version parameter
//================================================================================
/*!
- * \brief Export to med file
+ * \brief Export to MED file
*/
//================================================================================
-void SMESH_Mesh_i::ExportToMEDX (const char* file,
- CORBA::Boolean auto_groups,
- CORBA::Boolean overwrite,
- CORBA::Boolean autoDimension)
+void SMESH_Mesh_i::ExportMED(const char* file,
+ CORBA::Boolean auto_groups,
+ CORBA::Boolean overwrite,
+ CORBA::Boolean autoDimension)
throw(SALOME::SALOME_Exception)
{
SMESH_TRY;
string aMeshName = prepareMeshNameAndGroups(file, overwrite);
_impl->ExportMED( file, aMeshName.c_str(), auto_groups, 0, autoDimension );
- TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportToMEDX( r'"
+ TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportMED( r'"
<< file << "', " << auto_groups << ", "
<< overwrite << ", "
<< autoDimension << " )";
SMESH_CATCH( SMESH::throwCorbaException );
}
-//================================================================================
-/*!
- * \brief Export a mesh to a med file
- */
-//================================================================================
-
-void SMESH_Mesh_i::ExportToMED (const char* file,
- CORBA::Boolean auto_groups)
- throw(SALOME::SALOME_Exception)
-{
- ExportToMEDX(file, auto_groups, true);
-}
-
-//================================================================================
-/*!
- * \brief Export a mesh to a med file
- */
-//================================================================================
-
-void SMESH_Mesh_i::ExportMED (const char* file,
- CORBA::Boolean auto_groups)
- throw(SALOME::SALOME_Exception)
-{
- ExportToMEDX(file, auto_groups, true);
-}
-
//================================================================================
/*!
* \brief Export a mesh to a SAUV file
*/
CORBA::Boolean HasDuplicatedGroupNamesMED();
- void ExportToMEDX( const char* file,
- CORBA::Boolean auto_groups,
- CORBA::Boolean overwrite,
- CORBA::Boolean autoDimension=true) throw (SALOME::SALOME_Exception);
- void ExportToMED ( const char* file,
- CORBA::Boolean auto_groups ) throw (SALOME::SALOME_Exception);
- void ExportMED ( const char* file,
- CORBA::Boolean auto_groups ) throw (SALOME::SALOME_Exception);
+ void ExportMED( const char* file,
+ CORBA::Boolean auto_groups,
+ CORBA::Boolean overwrite,
+ CORBA::Boolean autoDimension = true) throw (SALOME::SALOME_Exception);
void ExportSAUV( const char* file, CORBA::Boolean auto_groups ) throw (SALOME::SALOME_Exception);
CORBA::Long NbPolygons()
throw (SALOME::SALOME_Exception);
- CORBA::Long NbPolygonsOfOrder(SMESH::ElementOrder order=SMESH::ORDER_ANY)
+ CORBA::Long NbPolygonsOfOrder(SMESH::ElementOrder order = SMESH::ORDER_ANY)
throw (SALOME::SALOME_Exception);
CORBA::Long NbVolumes()
# process positional arguments
args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]] # backward compatibility
fileName = args[0]
- auto_groups = args[1] if len(args) > 1 else 0
- overwrite = args[2] if len(args) > 2 else 1
+ auto_groups = args[1] if len(args) > 1 else False
+ overwrite = args[2] if len(args) > 2 else True
meshPart = args[3] if len(args) > 3 else None
autoDimension = args[4] if len(args) > 4 else True
fields = args[5] if len(args) > 5 else []
self.mesh.ExportPartToMED( meshPart, fileName, auto_groups, overwrite, autoDimension,
fields, geomAssocFields)
else:
- self.mesh.ExportToMEDX(fileName, auto_groups, overwrite, autoDimension)
+ self.mesh.ExportMED(fileName, auto_groups, overwrite, autoDimension)
## Export the mesh in a file in SAUV format
# @param f is the file name
# If @a autoDimension is @c False, the space dimension is always 3.
# @ingroup l2_impexp
def ExportToMED(self, *args, **kwargs):
+ print "WARNING: ExportToMED() is deprecated, use ExportMED() instead"
# process positional arguments
args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]] # backward compatibility
fileName = args[0]
- opt = args[1] if len(args) > 1 else 0
- overwrite = args[2] if len(args) > 2 else 1
+ auto_groups = args[1] if len(args) > 1 else False
+ overwrite = args[2] if len(args) > 2 else True
autoDimension = args[3] if len(args) > 3 else True
# process keywords arguments
- opt = kwargs.get("opt", opt)
+ auto_groups = kwargs.get("opt", auto_groups) # old keyword name
+ auto_groups = kwargs.get("auto_groups", auto_groups) # new keyword name
overwrite = kwargs.get("overwrite", overwrite)
autoDimension = kwargs.get("autoDimension", autoDimension)
# invoke engine's function
- self.mesh.ExportToMEDX(fileName, opt, overwrite, autoDimension)
+ self.mesh.ExportMED(fileName, auto_groups, overwrite, autoDimension)
+
+ ## Deprecated, used only for compatibility! Please, use ExportMED() method instead.
+ # Export the mesh in a file in MED format
+ # allowing to overwrite the file if it exists or add the exported data to its contents
+ # @param fileName the file name
+ # @param opt boolean parameter for creating/not creating
+ # the groups Group_On_All_Nodes, Group_On_All_Faces, ...
+ # @param overwrite boolean parameter for overwriting/not overwriting the file
+ # @param autoDimension if @c True (default), a space dimension of a MED mesh can be either
+ # - 1D if all mesh nodes lie on OX coordinate axis, or
+ # - 2D if all mesh nodes lie on XOY coordinate plane, or
+ # - 3D in the rest cases.<br>
+ # If @a autoDimension is @c False, the space dimension is always 3.
+ # @ingroup l2_impexp
+ def ExportToMEDX(self, *args, **kwargs):
+ print "WARNING: ExportToMEDX() is deprecated, use ExportMED() instead"
+ # process positional arguments
+ args = [i for i in args if i not in [SMESH.MED_V2_1, SMESH.MED_V2_2]] # backward compatibility
+ fileName = args[0]
+ auto_groups = args[1] if len(args) > 1 else False
+ overwrite = args[2] if len(args) > 2 else True
+ autoDimension = args[3] if len(args) > 3 else True
+ # process keywords arguments
+ auto_groups = kwargs.get("auto_groups", auto_groups)
+ overwrite = kwargs.get("overwrite", overwrite)
+ autoDimension = kwargs.get("autoDimension", autoDimension)
+ # invoke engine's function
+ self.mesh.ExportMED(fileName, auto_groups, overwrite, autoDimension)
# Operations with groups:
# ----------------------
Maillage.ExportMED(outFile)
smesh.SetName(Maillage.GetMesh(), 'MAILLAGE_FISSURE')
except:
- print 'ExportToMEDX() failed. Invalid file name?'
+ print 'ExportMED() failed. Invalid file name?'
## Set names of Mesh objects
Maillage.ExportMED(outFile)
smesh.SetName(Maillage.GetMesh(), 'MAILLAGE_FISSURE')
except:
- print 'ExportToMEDX() failed. Invalid file name?'
+ print 'ExportMED() failed. Invalid file name?'
if salome.sg.hasDesktop():
Maillage.ExportMED(outFile)
smesh.SetName(Maillage.GetMesh(), 'MAILLAGE_FISSURE')
except:
- print 'ExportToMEDX() failed. Invalid file name?'
+ print 'ExportMED() failed. Invalid file name?'
## Set names of Mesh objects
name. This returns the filename.
'''
filename=str("/tmp/padder_inputfile_"+meshName+".med")
- meshObject.ExportToMEDX( filename, 0, 1, 1 )
+ meshObject.ExportMED(filename, False, True, True)
return filename
def clear(self):