00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00031 #ifndef __vtkEnSightReader_h
00032 #define __vtkEnSightReader_h
00033
00034 #include "vtkGenericEnSightReader.h"
00035
00036 class vtkDataSetCollection;
00037 class vtkIdList;
00038 class vtkEnSightReaderCellIdsType;
00039
00040 class VTK_IO_EXPORT vtkEnSightReader : public vtkGenericEnSightReader
00041 {
00042 public:
00043 vtkTypeRevisionMacro(vtkEnSightReader, vtkGenericEnSightReader);
00044 void PrintSelf(ostream& os, vtkIndent indent);
00045
00046 void Update();
00047 void ExecuteInformation();
00048
00049
00050 enum ElementTypesList
00051 {
00052 POINT = 0,
00053 BAR2 = 1,
00054 BAR3 = 2,
00055 NSIDED = 3,
00056 TRIA3 = 4,
00057 TRIA6 = 5,
00058 QUAD4 = 6,
00059 QUAD8 = 7,
00060 TETRA4 = 8,
00061 TETRA10 = 9,
00062 PYRAMID5 = 10,
00063 PYRAMID13 = 11,
00064 HEXA8 = 12,
00065 HEXA20 = 13,
00066 PENTA6 = 14,
00067 PENTA15 = 15
00068 };
00069
00070 enum VariableTypesList
00071 {
00072 SCALAR_PER_NODE = 0,
00073 VECTOR_PER_NODE = 1,
00074 TENSOR_SYMM_PER_NODE = 2,
00075 SCALAR_PER_ELEMENT = 3,
00076 VECTOR_PER_ELEMENT = 4,
00077 TENSOR_SYMM_PER_ELEMENT = 5,
00078 SCALAR_PER_MEASURED_NODE = 6,
00079 VECTOR_PER_MEASURED_NODE = 7,
00080 COMPLEX_SCALAR_PER_NODE = 8,
00081 COMPLEX_VECTOR_PER_NODE = 9,
00082 COMPLEX_SCALAR_PER_ELEMENT = 10,
00083 COMPLEX_VECTOR_PER_ELEMENT = 11
00084 };
00085
00086
00090 void ReplaceNthOutput(int n, vtkDataObject* output);
00091
00093
00099 vtkGetMacro(OutputsAreValid, int);
00101
00102 protected:
00103 vtkEnSightReader();
00104 ~vtkEnSightReader();
00105
00106 void Execute();
00107
00110 int ReadCaseFile();
00111
00112
00113 int CaseFileRead;
00114
00117 virtual int ReadGeometryFile(char* fileName, int timeStep) = 0;
00118
00121 virtual int ReadMeasuredGeometryFile(char* fileName, int timeStep) = 0;
00122
00125 int ReadVariableFiles();
00126
00128
00130 virtual int ReadScalarsPerNode(char* fileName, char* description,
00131 int timeStep, int measured = 0,
00132 int numberOfComponents = 1,
00133 int component = 0) = 0;
00135
00137
00139 virtual int ReadVectorsPerNode(char* fileName, char* description,
00140 int timeStep, int measured = 0) = 0;
00142
00144
00146 virtual int ReadTensorsPerNode(char* fileName, char* description,
00147 int timeStep) = 0;
00149
00151
00153 virtual int ReadScalarsPerElement(char* fileName, char* description,
00154 int timeStep, int numberOfComponents = 1,
00155 int component = 0) = 0;
00157
00159
00161 virtual int ReadVectorsPerElement(char* fileName, char* description,
00162 int timeStep) = 0;
00164
00166
00168 virtual int ReadTensorsPerElement(char* fileName, char* description,
00169 int timeStep) = 0;
00171
00173
00175 virtual int CreateUnstructuredGridOutput(int partId,
00176 char line[256],
00177 const char* name) = 0;
00179
00181
00183 virtual int CreateStructuredGridOutput(int partId,
00184 char line[256],
00185 const char* name) = 0;
00187
00189
00190 vtkSetStringMacro(GeometryFileName);
00191 vtkGetStringMacro(GeometryFileName);
00193
00195
00196 vtkSetStringMacro(MeasuredFileName);
00197 vtkGetStringMacro(MeasuredFileName);
00199
00201
00202 vtkSetStringMacro(MatchFileName);
00203 vtkGetStringMacro(MatchFileName);
00205
00207 void AddVariableFileName(char* fileName1, char* fileName2 = NULL);
00208
00210 void AddVariableDescription(char* description);
00211
00213 void AddVariableType();
00214
00217 int GetElementType(char* line);
00218
00220 void ReplaceWildcards(char* filename, int num);
00221
00222
00223 vtkIdList* GetCellIds(int index, int cellType);
00224
00225 char* MeasuredFileName;
00226 char* MatchFileName;
00227
00228
00229 vtkEnSightReaderCellIdsType* CellIds;
00230
00231
00232 vtkIdList* UnstructuredPartIds;
00233
00234 int VariableMode;
00235
00236
00237 char** VariableFileNames;
00238 char** ComplexVariableFileNames;
00239
00240
00241 vtkIdList *VariableTimeSetIds;
00242 vtkIdList *ComplexVariableTimeSetIds;
00243
00244
00245 vtkIdList *VariableFileSetIds;
00246 vtkIdList *ComplexVariableFileSetIds;
00247
00248
00249 vtkIdListCollection *TimeSetFileNameNumbers;
00250 vtkIdList *TimeSetsWithFilenameNumbers;
00251
00252
00253 vtkIdListCollection *FileSetFileNameNumbers;
00254 vtkIdList *FileSetsWithFilenameNumbers;
00255
00256
00257 vtkIdListCollection *FileSetNumberOfSteps;
00258
00259
00260 vtkIdList *TimeSetIds;
00261 vtkIdList *FileSets;
00262
00263 int GeometryTimeSet;
00264 int GeometryFileSet;
00265 int MeasuredTimeSet;
00266 int MeasuredFileSet;
00267
00268 float GeometryTimeValue;
00269 float MeasuredTimeValue;
00270
00271 int UseTimeSets;
00272 vtkSetMacro(UseTimeSets, int);
00273 vtkGetMacro(UseTimeSets, int);
00274 vtkBooleanMacro(UseTimeSets, int);
00275
00276 int UseFileSets;
00277 vtkSetMacro(UseFileSets, int);
00278 vtkGetMacro(UseFileSets, int);
00279 vtkBooleanMacro(UseFileSets, int);
00280
00281 int NumberOfGeometryParts;
00282
00283 void SetNumberOfOutputsInternal(int num);
00284
00285
00286 int NumberOfMeasuredPoints;
00287
00288 int NumberOfNewOutputs;
00289 int OutputsAreValid;
00290 int InitialRead;
00291
00292 int CheckOutputConsistency();
00293
00294 private:
00295 vtkEnSightReader(const vtkEnSightReader&);
00296 void operator=(const vtkEnSightReader&);
00297 };
00298
00299 #endif