21 #ifndef __MEDFILEFIELDREPRESENTATIONTREE_HXX__
22 #define __MEDFILEFIELDREPRESENTATIONTREE_HXX__
24 #include "MEDFileMesh.hxx"
25 #include "MEDFileField.hxx"
33 class vtkQuadratureSchemeDefinition;
34 class vtkMutableDirectedGraph;
35 class vtkUnstructuredGrid;
36 class vtkRectilinearGrid;
37 class vtkStructuredGrid;
38 class vtkVariantArray;
50 vtkIdTypeArray *
findOrCreate(
const MEDCoupling::MEDFileFieldGlobsReal *globs,
const std::vector<std::string>& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds,
bool& isNew,
ExportedTinyInfo *internalInfo)
const;
54 vtkIdTypeArray *
isExisting(
const std::vector<std::string>& locsReallyUsed, vtkDoubleArray *vtkd)
const;
55 vtkIdTypeArray *
createNew(
const MEDCoupling::MEDFileFieldGlobsReal *globs,
const std::vector<std::string>& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds,
ExportedTinyInfo *internalInfo)
const;
58 mutable std::vector< std::vector<std::string> >
_loc_names;
60 mutable std::vector<vtkIdTypeArray *>
_elgas;
62 mutable std::vector< std::vector< std::pair< vtkQuadratureSchemeDefinition *, unsigned char > > >
_defs;
72 void setId(
int&
id)
const;
73 void feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names)
const;
74 void computeFullNameInLeaves(
const std::string& tsName,
const std::string& meshName,
const std::string& comSupStr)
const;
75 bool getStatus()
const;
76 bool setStatus(
bool status)
const;
77 std::string getZeName()
const;
78 const char *getZeNameC()
const;
79 void appendFields(
const MEDTimeReq *tr,
const MEDCoupling::MEDFileFieldGlobsReal *globs,
const MEDCoupling::MEDMeshMultiLev *mml,
const MEDCoupling::MEDFileMeshStruct *mst, vtkDataSet *ds,
ExportedTinyInfo *internalInfo)
const;
80 void appendELGAIfAny(vtkDataSet *ds)
const;
82 static const char ZE_SEP[];
83 static const char TS_STR[];
84 static const char COM_SUP_STR[];
85 static const char FAMILY_ID_CELL_NAME[];
86 static const char NUM_ID_CELL_NAME[];
87 static const char FAMILY_ID_NODE_NAME[];
88 static const char NUM_ID_NODE_NAME[];
89 static const char GLOBAL_NODE_ID_NAME[];
103 const MEDCoupling::MCAuto<MEDCoupling::MEDFileFastCellSupportComparator>& fsp);
106 void setId(
int&
id)
const;
107 std::string getMeshName()
const;
108 int getNumberOfArrays()
const;
109 int getNumberOfTS()
const;
110 void feedSIL(
const MEDCoupling::MEDFileMeshes *ms,
const std::string& meshName, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names)
const;
111 void computeFullNameInLeaves(
const std::string& tsName,
const std::string& meshName,
const std::string& comSupStr)
const;
112 bool containId(
int id)
const;
113 bool containZeName(
const char *name,
int&
id)
const;
114 void dumpState(std::map<std::string,bool>& status)
const;
115 bool isActivated()
const;
116 void printMySelf(std::ostream& os)
const;
117 void activateAllArrays()
const;
119 std::vector<double> getTimeSteps(
const TimeKeeper& tk)
const;
120 std::vector< std::pair<int,int> > getTimeStepsInCoarseMEDFileFormat(std::vector<double>& ts)
const;
121 std::string getHumanReadableOverviewOfTS()
const;
122 vtkDataSet *buildVTKInstanceNoTimeInterpolation(
const MEDTimeReq *tr,
const MEDCoupling::MEDFileFieldGlobsReal *globs,
const MEDCoupling::MEDFileMeshes *meshes,
ExportedTinyInfo *internalInfo=0)
const;
124 vtkUnstructuredGrid *buildVTKInstanceNoTimeInterpolationUnstructured(MEDCoupling::MEDUMeshMultiLev *mm)
const;
125 vtkRectilinearGrid *buildVTKInstanceNoTimeInterpolationCartesian(MEDCoupling::MEDCMeshMultiLev *mm)
const;
126 vtkStructuredGrid *buildVTKInstanceNoTimeInterpolationCurveLinear(MEDCoupling::MEDCurveLinearMeshMultiLev *mm)
const;
127 void appendFields(
const MEDTimeReq *tr,
const MEDCoupling::MEDFileFieldGlobsReal *globs,
const MEDCoupling::MEDMeshMultiLev *mml,
const MEDCoupling::MEDFileMeshes *meshes, vtkDataSet *ds,
ExportedTinyInfo *internalInfo=0)
const;
129 std::vector<MEDFileFieldRepresentationLeavesArrays>
_arrays;
130 MEDCoupling::MCAuto<MEDCoupling::MEDFileFastCellSupportComparator>
_fsp;
138 int getNumberOfLeavesArrays()
const;
139 void assignIds()
const;
140 void activateTheFirst()
const;
141 void computeFullNameInLeaves()
const;
142 void feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names)
const;
143 std::string getActiveMeshName()
const;
144 std::string feedSILForFamsAndGrps(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector<std::string>& names)
const;
145 std::string getNameOf(
int id)
const;
146 const char *getNameOfC(
int id)
const;
147 bool getStatusOf(
int id)
const;
148 int getIdHavingZeName(
const char *name)
const;
149 bool changeStatusOfAndUpdateToHaveCoherentVTKDataSet(
int id,
bool status)
const;
150 int getMaxNumberOfTimeSteps()
const;
152 std::string getDftMeshName()
const;
153 std::vector<double> getTimeSteps(
int& lev0,
const TimeKeeper& tk)
const;
154 vtkDataSet *buildVTKInstance(
bool isStdOrMode,
double timeReq, std::string& meshName,
const TimeKeeper& tk,
ExportedTinyInfo *internalInfo=0)
const;
155 void printMySelf(std::ostream& os)
const;
156 std::map<std::string,bool> dumpState()
const;
158 void loadMainStructureOfFile(
const char *fileName,
bool isMEDOrSauv,
int iPart,
int nbOfParts);
159 void loadInMemory(MEDCoupling::MEDFileFields *fields, MEDCoupling::MEDFileMeshes *meshes);
160 void removeEmptyLeaves();
162 static bool IsFieldMeshRegardingInfo(
const std::vector<std::string>& compInfos);
163 static std::string PostProcessFieldName(
const std::string& fullFieldName);
165 static const char ROOT_OF_GRPS_IN_TREE[];
166 static const char ROOT_OF_FAM_IDS_IN_TREE[];
167 static const char COMPO_STR_TO_LOCATE_MESH_DA[];
171 static MEDCoupling::MEDFileFields *BuildFieldFromMeshes(
const MEDCoupling::MEDFileMeshes *ms);
172 static void AppendFieldFromMeshes(
const MEDCoupling::MEDFileMeshes *ms, MEDCoupling::MEDFileFields *ret);
173 static std::string BuildAUniqueArrayNameForMesh(
const std::string& meshName,
const MEDCoupling::MEDFileFields *ret);
174 static std::vector<std::string> SplitFieldNameIntoParts(
const std::string& fullFieldName,
char sep);
177 std::vector< std::vector< std::vector< MEDFileFieldRepresentationLeaves > > >
_data_structure;
178 MEDCoupling::MCAuto<MEDCoupling::MEDFileMeshes>
_ms;
179 MEDCoupling::MCAuto<MEDCoupling::MEDFileFields>
_fields;
188 std::vector<double> getTimeStepsRegardingPolicy(
const std::vector< std::pair<int,int> >& tsPairs,
const std::vector<double>& ts)
const;
189 int getTimeStepIdFrom(
double timeReq)
const;
191 void printSelf(std::ostream& oss)
const;
192 std::vector<bool> getTheVectOfBool()
const;
194 void setMaxNumberOfTimeSteps(
int maxNumberOfTS);
196 std::vector<double> getTimeStepsRegardingPolicy0(
const std::vector< std::pair<int,int> >& tsPairs,
const std::vector<double>& ts)
const;
197 std::vector<double> getTimeStepsRegardingPolicy1(
const std::vector< std::pair<int,int> >& tsPairs,
const std::vector<double>& ts)
const;
198 std::vector<double> processedUsingPairOfIds(
const std::vector< std::pair<int,int> >& tsPairs)
const;