00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00019 #ifndef __vtkEnSightReader_h
00020 #define __vtkEnSightReader_h
00021
00022 #include "vtkGenericEnSightReader.h"
00023
00024 class vtkDataSetCollection;
00025 class vtkIdList;
00026 class vtkEnSightReaderCellIdsType;
00027
00028 class VTK_IO_EXPORT vtkEnSightReader : public vtkGenericEnSightReader
00029 {
00030 public:
00031 vtkTypeRevisionMacro(vtkEnSightReader, vtkGenericEnSightReader);
00032 void PrintSelf(ostream& os, vtkIndent indent);
00033
00034 void Update();
00035 void ExecuteInformation();
00036
00037
00038 enum ElementTypesList
00039 {
00040 POINT = 0,
00041 BAR2 = 1,
00042 BAR3 = 2,
00043 NSIDED = 3,
00044 TRIA3 = 4,
00045 TRIA6 = 5,
00046 QUAD4 = 6,
00047 QUAD8 = 7,
00048 TETRA4 = 8,
00049 TETRA10 = 9,
00050 PYRAMID5 = 10,
00051 PYRAMID13 = 11,
00052 HEXA8 = 12,
00053 HEXA20 = 13,
00054 PENTA6 = 14,
00055 PENTA15 = 15
00056 };
00057
00058 enum VariableTypesList
00059 {
00060 SCALAR_PER_NODE = 0,
00061 VECTOR_PER_NODE = 1,
00062 TENSOR_SYMM_PER_NODE = 2,
00063 SCALAR_PER_ELEMENT = 3,
00064 VECTOR_PER_ELEMENT = 4,
00065 TENSOR_SYMM_PER_ELEMENT = 5,
00066 SCALAR_PER_MEASURED_NODE = 6,
00067 VECTOR_PER_MEASURED_NODE = 7,
00068 COMPLEX_SCALAR_PER_NODE = 8,
00069 COMPLEX_VECTOR_PER_NODE = 9,
00070 COMPLEX_SCALAR_PER_ELEMENT = 10,
00071 COMPLEX_VECTOR_PER_ELEMENT = 11
00072 };
00073
00074 enum SectionTypeList
00075 {
00076 COORDINATES = 0,
00077 BLOCK = 1,
00078 ELEMENT = 2
00079 };
00080
00081
00085 void ReplaceNthOutput(int n, vtkDataObject* output);
00086
00088
00094 vtkGetMacro(OutputsAreValid, int);
00096
00097 protected:
00098 vtkEnSightReader();
00099 ~vtkEnSightReader();
00100
00101 void Execute();
00102
00105 int ReadCaseFile();
00106
00107
00108 int CaseFileRead;
00109
00112 virtual int ReadGeometryFile(const char* fileName, int timeStep) = 0;
00113
00116 virtual int ReadMeasuredGeometryFile(const char* fileName, int timeStep) = 0;
00117
00120 int ReadVariableFiles();
00121
00123
00125 virtual int ReadScalarsPerNode(const char* fileName, const char* description,
00126 int timeStep, int measured = 0,
00127 int numberOfComponents = 1,
00128 int component = 0) = 0;
00130
00132
00134 virtual int ReadVectorsPerNode(const char* fileName, const char* description,
00135 int timeStep, int measured = 0) = 0;
00137
00139
00141 virtual int ReadTensorsPerNode(const char* fileName, const char* description,
00142 int timeStep) = 0;
00144
00146
00148 virtual int ReadScalarsPerElement(const char* fileName, const char* description,
00149 int timeStep, int numberOfComponents = 1,
00150 int component = 0) = 0;
00152
00154
00156 virtual int ReadVectorsPerElement(const char* fileName, const char* description,
00157 int timeStep) = 0;
00159
00161
00163 virtual int ReadTensorsPerElement(const char* fileName, const char* description,
00164 int timeStep) = 0;
00166
00168
00170 virtual int CreateUnstructuredGridOutput(int partId,
00171 char line[80],
00172 const char* name) = 0;
00174
00176
00178 virtual int CreateStructuredGridOutput(int partId,
00179 char line[80],
00180 const char* name) = 0;
00182
00184
00185 vtkSetStringMacro(GeometryFileName);
00186 vtkGetStringMacro(GeometryFileName);
00188
00190
00191 vtkSetStringMacro(MeasuredFileName);
00192 vtkGetStringMacro(MeasuredFileName);
00194
00196
00197 vtkSetStringMacro(MatchFileName);
00198 vtkGetStringMacro(MatchFileName);
00200
00202 void AddVariableFileName(const char* fileName1, const char* fileName2 = NULL);
00203
00205 void AddVariableDescription(const char* description);
00206
00208 void AddVariableType();
00209
00212 int GetElementType(const char* line);
00213
00216 int GetSectionType(const char *line);
00217
00219 void ReplaceWildcards(char* filename, int num);
00220
00221
00222 vtkIdList* GetCellIds(int index, int cellType);
00223
00224 char* MeasuredFileName;
00225 char* MatchFileName;
00226
00227
00228 vtkEnSightReaderCellIdsType* CellIds;
00229
00230
00231 vtkIdList* UnstructuredPartIds;
00232
00233 int VariableMode;
00234
00235
00236 char** VariableFileNames;
00237 char** ComplexVariableFileNames;
00238
00239
00240 vtkIdList *VariableTimeSetIds;
00241 vtkIdList *ComplexVariableTimeSetIds;
00242
00243
00244 vtkIdList *VariableFileSetIds;
00245 vtkIdList *ComplexVariableFileSetIds;
00246
00247
00248 vtkIdListCollection *TimeSetFileNameNumbers;
00249 vtkIdList *TimeSetsWithFilenameNumbers;
00250
00251
00252 vtkIdListCollection *FileSetFileNameNumbers;
00253 vtkIdList *FileSetsWithFilenameNumbers;
00254
00255
00256 vtkIdListCollection *FileSetNumberOfSteps;
00257
00258
00259 vtkIdList *TimeSetIds;
00260 vtkIdList *FileSets;
00261
00262 int GeometryTimeSet;
00263 int GeometryFileSet;
00264 int MeasuredTimeSet;
00265 int MeasuredFileSet;
00266
00267 float GeometryTimeValue;
00268 float MeasuredTimeValue;
00269
00270 int UseTimeSets;
00271 vtkSetMacro(UseTimeSets, int);
00272 vtkGetMacro(UseTimeSets, int);
00273 vtkBooleanMacro(UseTimeSets, int);
00274
00275 int UseFileSets;
00276 vtkSetMacro(UseFileSets, int);
00277 vtkGetMacro(UseFileSets, int);
00278 vtkBooleanMacro(UseFileSets, int);
00279
00280 int NumberOfGeometryParts;
00281
00282 void SetNumberOfOutputsInternal(int num);
00283
00284
00285 int NumberOfMeasuredPoints;
00286
00287 int NumberOfNewOutputs;
00288 int OutputsAreValid;
00289 int InitialRead;
00290
00291 int CheckOutputConsistency();
00292
00293 private:
00294 vtkEnSightReader(const vtkEnSightReader&);
00295 void operator=(const vtkEnSightReader&);
00296 };
00297
00298 #endif