Version: 6.3.1
Public Types | Public Member Functions | Protected Attributes | Private Member Functions

VISU_Vtk2MedConvertor Class Reference

The general main of the class VISU_Vtk2MedConvertor is converting from one or several VTK files to the one MED file... More...

#include <VISU_Vtk2MedConvertor.hxx>

Public Types

typedef std::vector< std::stringTVectorString
typedef std::vector< double > TVectorDouble
typedef std::vector< int > TCellIds
typedef std::map
< MED::EGeometrieElement,
TCellIds
TGeom2CellIds

Public Member Functions

 VISU_Vtk2MedConvertor ()
 Constructor

  • Sets default output mesh name
  • Sets default version of output MED file.
  • Sets default ignoring fields list
  • Sets default points and cells ids mapping field names.

 VISU_Vtk2MedConvertor (const std::string theMEDFileName, const std::string theFirstVTKFileName)
 Constructor

  • Sets default output mesh name
  • Sets default version of output MED file.
  • Sets default ignoring fields list
  • Sets default points and cells ids mapping field names.

 VISU_Vtk2MedConvertor (const std::string theMEDFileName, const std::string theFirstVTKFileName, const TVectorString theDataVTKFileNames)
 Constructor

  • Sets default output mesh name
  • Sets default version of output MED file.
  • Sets default ignoring fields list
  • Sets default points and cells ids mapping field names.

void setMEDFileName (const std::string theFileName)
 Sets the output MED file name.
std::string getMEDFileName () const
 Gets the output MED file name.
void setFirstVTKFileName (const std::string theFileName)
 Sets the first input vtk file name.
std::string getFirstVTKFileName () const
 Fets the first input vtk file name.
void setDataVTKFileNames (const TVectorString theFileNames)
 Sets list of vtk file names, which will be using as values on points and cells.
void getDataVTKFileNames (TVectorString &) const
 Gets list of vtk file names, which will be using as values on points and cells.
void setVersion (const MED::EVersion theVersion)
 Sets version of the output MED file MED.V2_2(is default) or MED.V2_1.
MED::EVersion getVersion () const
 Gets version of the output MED file MED.V2_2(is default) or MED.V2_1.
void setMeshName (const std::string theMeshName)
 Sets output mesh name. ("vtk2med" - default)
std::string getMeshName () const
 Gets output mesh name. ("vtk2med" - default)
void addToIgnoringFieldList (const std::string &theFieldName)
 Adds field names, which used as specific fields with ids or elements (or something else). (Default: "VISU_CELLS_MAPPER","VISU_POINTS_MAPPER","VISU_FILED")
void eraseFromIgnoringFieldList (const std::string &theFieldName)
 Erases field names which used as specific fields with ids or elements (or something else)
const std::set< std::string > & getIgnoringFieldList () const
 Gets list of field names which used as specific fields with ids or elements.
void setCellDataFieldNameIDS (const std::string &theFieldName)
 Sets field name with cell ids (Default - VISU_CELLS_MAPPER)
const std::stringgetCellDataFieldNameIDS () const
 Gets field name with cell ids (Default - VISU_CELLS_MAPPER)
void setPointDataFieldNameIDS (const std::string &theFieldName)
 Sets field name with point ids.
const std::stringgetPointDataFieldNameIDS () const
 Gets field name with point ids.
void setTimeStamps (const TVectorDouble &theTStamps)
 Sets values of time stamps If this array is not specified values of time stamps are generated automatically ( 0, 1, 2 ... )
void getTimeStamps (TVectorDouble &theTStamps) const
 Gets values of time stamps If this array is not specified values of time stamps are generated automatically ( 0, 1, 2 ... )
int Execute ()
 Writes data to MED file.

Protected Attributes

TVectorString myDataVTKFileNames
std::string myMEDFileName
std::string myFirstVTKFileName
MED::EVersion myVersion
std::string myMeshName
std::set< std::stringmyIgnoringFieldList
std::string myCellDataFieldNameIDS
std::string myPointDataFieldNameIDS
TVectorDouble myTStamps

Private Member Functions

void GetIdsOfCellsOfType (vtkDataSet *theInput, const int type, vtkIntArray *array)
 Retrieves identifiers of cells from input data set corresponding to given type.
int Geometry2MED (vtkDataSet *aInput, MED::PWrapper myMed, MED::PMeshInfo aMeshInfo, TGeom2CellIds &outGeom2CellIdMap)
 Converts geometry to med (private auxiliary method)
int Data2MED (std::vector< vtkDataSet * > theListForAdd, MED::PWrapper myMed, MED::PMeshInfo theMeshInfo, TGeom2CellIds &theGeom2CellIdMap)
 Converts data to med (private auxiliary method)
int CreateElements (vtkDataSet *theInput, MED::PMeshInfo theMeshInfo, MED::PWrapper theMed, vtkIntArray *theCellsMapper, MED::EEntiteMaillage theEntity, int theVTKGeom, int nbPointsInGeom, std::vector< int > &theNumberingConvertor, TGeom2CellIds &theGeom2CellIdMap)
 Creates elements (private auxiliary method)
int CreatePolygons (vtkDataSet *theInput, MED::PMeshInfo theMeshInfo, MED::PWrapper theMed, vtkIntArray *theCellsMapper, MED::EEntiteMaillage theEntity, TGeom2CellIds &theGeom2CellIdMap)
 Creates polygons (private auxiliary method)
int CreatePolyedres (vtkDataSet *theInput, MED::PMeshInfo theMeshInfo, MED::PWrapper theMed, vtkIntArray *theCellsMapper, MED::EEntiteMaillage theEntity, TGeom2CellIds &theGeom2CellIdMap)
 Creates polyedres (private auxiliary method)

Detailed Description

The VISU_Vtk2MedConvertor interface allows us to create the MED file according to VTK files in next ways:


Member Typedef Documentation

typedef std::vector<double> VISU_Vtk2MedConvertor.TVectorDouble
typedef std::vector<int> VISU_Vtk2MedConvertor.TCellIds
typedef std::map<MED::EGeometrieElement,TCellIds> VISU_Vtk2MedConvertor.TGeom2CellIds

Constructor & Destructor Documentation

VISU_Vtk2MedConvertor::VISU_Vtk2MedConvertor ( )
VISU_Vtk2MedConvertor::VISU_Vtk2MedConvertor ( const std::string  theMEDFileName,
const std::string  theFirstVTKFileName 
)
Parameters:
theMEDFileNameoutput med file name
theFirstVTKFileNamefirst vtk file name
VISU_Vtk2MedConvertor::VISU_Vtk2MedConvertor ( const std::string  theMEDFileName,
const std::string  theFirstVTKFileName,
const TVectorString  theDataVTKFileNames 
)
Parameters:
theMEDFileNameoutput med file name
theFirstVTKFileNamefirst vtk file name
theDataVTKFileNamesof vtk file names, which will be using as values on points and cells

Member Function Documentation

void VISU_Vtk2MedConvertor::setMEDFileName ( const std::string  theFileName)
Parameters:
theFileNamefile name
See also:
getMEDFileName()
string VISU_Vtk2MedConvertor::getMEDFileName ( ) const
Returns:
output MED file name
See also:
setMEDFileName()
void VISU_Vtk2MedConvertor::setFirstVTKFileName ( const std::string  theFileName)
Parameters:
theFileNamefile name
See also:
getFirstVTKFileName()
string VISU_Vtk2MedConvertor::getFirstVTKFileName ( ) const
Returns:
first input vtk file name
See also:
setFirstVTKFileName()
void VISU_Vtk2MedConvertor::setDataVTKFileNames ( const TVectorString  theFileNames)
Parameters:
theFileNameslist of vtk file names
See also:
getDataVTKFileNames()
void VISU_Vtk2MedConvertor::getDataVTKFileNames ( TVectorString theDataVTKFileNames) const
Parameters:
theFileNamesout list of vtk file names
See also:
setDataVTKFileNames()
void VISU_Vtk2MedConvertor::setVersion ( const MED::EVersion  theVersion)
Parameters:
theVersionversion of the output MED file
MED::EVersion VISU_Vtk2MedConvertor::getVersion ( ) const
Returns:
version of the output MED file
void VISU_Vtk2MedConvertor::setMeshName ( const std::string  theMeshName)
Parameters:
theMeshNamemesh name
See also:
getMeshName()

References VISU_Example_01.myMeshName.

string VISU_Vtk2MedConvertor::getMeshName ( ) const
Returns:
mesh name
See also:
setMeshName()

References VISU_Example_01.myMeshName.

void VISU_Vtk2MedConvertor::addToIgnoringFieldList ( const std::string theFieldName)
Parameters:
theFieldNamefield name
See also:
eraseFromIgnoringFieldList()
void VISU_Vtk2MedConvertor::eraseFromIgnoringFieldList ( const std::string theFieldName)
Parameters:
theFieldNamefield name
See also:
addToIgnoringFieldList()
const std::set< std::string > & VISU_Vtk2MedConvertor::getIgnoringFieldList ( ) const
Returns:
list of field names
void VISU_Vtk2MedConvertor::setCellDataFieldNameIDS ( const std::string theFieldName)
Parameters:
theFieldNamefield name
See also:
getCellDataFieldNameIDS
const string & VISU_Vtk2MedConvertor::getCellDataFieldNameIDS ( ) const
Returns:
field name
See also:
setCellDataFieldNameIDS()
void VISU_Vtk2MedConvertor::setPointDataFieldNameIDS ( const std::string theFieldName)
Parameters:
theFieldNamefield name
See also:
getPointDataFieldNameIDS()
const string & VISU_Vtk2MedConvertor::getPointDataFieldNameIDS ( ) const
Returns:
field name
See also:
setPointDataFieldNameIDS()
void VISU_Vtk2MedConvertor::setTimeStamps ( const TVectorDouble theTStamps)
Parameters:
theTStampsvector of time stamps
See also:
getTimeStamps()
void VISU_Vtk2MedConvertor::getTimeStamps ( TVectorDouble theTStamps) const
Parameters:
theTStampsout vector of time stamps
See also:
setTimeStamps()
int VISU_Vtk2MedConvertor::Execute ( )
Returns:
0 if operation has been completed successfully, 1 otherwise

References MYDEBUG, and VISU_Example_01.myMeshName.

void VISU_Vtk2MedConvertor::GetIdsOfCellsOfType ( vtkDataSet *  theInput,
const int  type,
vtkIntArray *  array 
) [private]
Parameters:
theInputinput data set
typetype
arrayout array
int VISU_Vtk2MedConvertor::Geometry2MED ( vtkDataSet *  aInput,
MED::PWrapper  myMed,
MED::PMeshInfo  aMeshInfo,
TGeom2CellIds outGeom2CellIdMap 
) [private]
Returns:
0 if operation has been completed successfully, 1 otherwise

References MYDEBUG.

int VISU_Vtk2MedConvertor::Data2MED ( std::vector< vtkDataSet * >  theListForAdd,
MED::PWrapper  myMed,
MED::PMeshInfo  theMeshInfo,
TGeom2CellIds theGeom2CellIdMap 
) [private]
Returns:
0 if operation has been completed successfully, 1 otherwise

References visu_cache.aFieldName, batchmode_visu_table.aName, VISU.ePOINT1, and MYDEBUG_VALUES.

int VISU_Vtk2MedConvertor::CreateElements ( vtkDataSet *  theInput,
MED::PMeshInfo  theMeshInfo,
MED::PWrapper  theMed,
vtkIntArray *  theCellsMapper,
MED::EEntiteMaillage  theEntity,
int  theVTKGeom,
int  nbPointsInGeom,
std::vector< int > &  theNumberingConvertor,
TGeom2CellIds theGeom2CellIdMap 
) [private]
Returns:
0 if operation has been completed successfully, 1 otherwise

References MYDEBUG, and VTK2MED().

int VISU_Vtk2MedConvertor::CreatePolygons ( vtkDataSet *  theInput,
MED::PMeshInfo  theMeshInfo,
MED::PWrapper  theMed,
vtkIntArray *  theCellsMapper,
MED::EEntiteMaillage  theEntity,
TGeom2CellIds theGeom2CellIdMap 
) [private]
Returns:
0 if operation has been completed successfully, 1 otherwise

References MYDEBUG, and VTK2MED().

int VISU_Vtk2MedConvertor::CreatePolyedres ( vtkDataSet *  theInput,
MED::PMeshInfo  theMeshInfo,
MED::PWrapper  theMed,
vtkIntArray *  theCellsMapper,
MED::EEntiteMaillage  theEntity,
TGeom2CellIds theGeom2CellIdMap 
) [private]
Returns:
0 if operation has been completed successfully, 1 otherwise

References MYDEBUG, and VTK2MED().


Field Documentation

MED::EVersion VISU_Vtk2MedConvertor.myVersion [protected]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS