Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef VISU_VTK2MEDCONVERTOR_H
00024 #define VISU_VTK2MEDCONVERTOR_H
00025
00026 #include "VISUConvertor.hxx"
00027
00028 #include <MED_Common.hxx>
00029 #include <vtkIntArray.h>
00030 #include <vtkDataSet.h>
00031
00032 #include <vector>
00033 #include <map>
00034 #include <string>
00035
00036 class vtkUnstructuredGrid;
00037 class vtkIntArray;
00038
00039 class VISU_CONVERTOR_EXPORT VISU_Vtk2MedConvertor
00040 {
00041 public:
00042
00043 typedef std::vector<std::string> TVectorString;
00044 typedef std::vector<double> TVectorDouble;
00045 typedef std::vector<int> TCellIds;
00046 typedef std::map<MED::EGeometrieElement,TCellIds> TGeom2CellIds;
00047
00048 VISU_Vtk2MedConvertor();
00049
00050 VISU_Vtk2MedConvertor( const std::string theMEDFileName,
00051 const std::string theFirstVTKFileName );
00052
00053 VISU_Vtk2MedConvertor( const std::string theMEDFileName,
00054 const std::string theFirstVTKFileName,
00055 const TVectorString theDataVTKFileNames );
00056
00057
00058 void setMEDFileName( const std::string theFileName );
00059 std::string getMEDFileName() const;
00060
00061 void setFirstVTKFileName( const std::string theFileName );
00062 std::string getFirstVTKFileName() const;
00063
00064 void setDataVTKFileNames( const TVectorString theFileNames );
00065 void getDataVTKFileNames( TVectorString& ) const;
00066
00067 void setVersion( const MED::EVersion theVersion );
00068 MED::EVersion getVersion() const;
00069
00070 void setMeshName( const std::string theMeshName );
00071 std::string getMeshName() const;
00072
00073 void addToIgnoringFieldList( const std::string& theFieldName );
00074 void eraseFromIgnoringFieldList( const std::string& theFieldName );
00075 const std::set<std::string>& getIgnoringFieldList() const;
00076
00077 void setCellDataFieldNameIDS( const std::string& theFieldName );
00078 const std::string& getCellDataFieldNameIDS() const;
00079
00080 void setPointDataFieldNameIDS( const std::string& theFieldName );
00081 const std::string& getPointDataFieldNameIDS() const;
00082
00083 void setTimeStamps( const TVectorDouble& theTStamps );
00084 void getTimeStamps( TVectorDouble& theTStamps ) const;
00085
00086 int Execute();
00087
00088 protected:
00089
00090 TVectorString myDataVTKFileNames;
00091 std::string myMEDFileName;
00092 std::string myFirstVTKFileName;
00093 MED::EVersion myVersion;
00094 std::string myMeshName;
00095 std::set<std::string> myIgnoringFieldList;
00096 std::string myCellDataFieldNameIDS;
00097 std::string myPointDataFieldNameIDS;
00098 TVectorDouble myTStamps;
00099
00100 private:
00101
00102
00103 void
00104 GetIdsOfCellsOfType( vtkDataSet* theInput,
00105 const int type,
00106 vtkIntArray *array );
00107
00108
00109
00110
00111 int
00112 Geometry2MED( vtkDataSet* aInput,
00113 MED::PWrapper myMed,
00114 MED::PMeshInfo aMeshInfo,
00115 TGeom2CellIds& outGeom2CellIdMap );
00116
00117
00118
00119 int
00120 Data2MED( std::vector<vtkDataSet*> theListForAdd,
00121 MED::PWrapper myMed,
00122 MED::PMeshInfo theMeshInfo,
00123 TGeom2CellIds& theGeom2CellIdMap );
00124
00125
00126
00127 int
00128 CreateElements( vtkDataSet* theInput,
00129 MED::PMeshInfo theMeshInfo,
00130 MED::PWrapper theMed,
00131 vtkIntArray* theCellsMapper,
00132 MED::EEntiteMaillage theEntity,
00133 int theVTKGeom,
00134 int nbPointsInGeom,
00135 std::vector<int>& theNumberingConvertor,
00136 TGeom2CellIds& theGeom2CellIdMap );
00137
00138
00139
00140 int
00141 CreatePolygons( vtkDataSet* theInput,
00142 MED::PMeshInfo theMeshInfo,
00143 MED::PWrapper theMed,
00144 vtkIntArray* theCellsMapper,
00145 MED::EEntiteMaillage theEntity,
00146 TGeom2CellIds& theGeom2CellIdMap );
00147
00148
00149
00150 int
00151 CreatePolyedres( vtkDataSet* theInput,
00152 MED::PMeshInfo theMeshInfo,
00153 MED::PWrapper theMed,
00154 vtkIntArray* theCellsMapper,
00155 MED::EEntiteMaillage theEntity,
00156 TGeom2CellIds& theGeom2CellIdMap );
00157
00158 };
00159
00160 #endif // VISU_VTK2MEDCONVERTOR_H