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
00078
void ReplaceNthOutput(
int n,
vtkDataObject* output);
00079
00081
00087 vtkGetMacro(OutputsAreValid,
int);
00089
00090
protected:
00091 vtkEnSightReader();
00092 ~vtkEnSightReader();
00093
00094
void Execute();
00095
00098
int ReadCaseFile();
00099
00100
00101 int CaseFileRead;
00102
00105
virtual int ReadGeometryFile(
char* fileName,
int timeStep) = 0;
00106
00109
virtual int ReadMeasuredGeometryFile(
char* fileName,
int timeStep) = 0;
00110
00113
int ReadVariableFiles();
00114
00116
00118
virtual int ReadScalarsPerNode(
char* fileName,
char* description,
00119
int timeStep,
int measured = 0,
00120
int numberOfComponents = 1,
00121
int component = 0) = 0;
00123
00125
00127
virtual int ReadVectorsPerNode(
char* fileName,
char* description,
00128
int timeStep,
int measured = 0) = 0;
00130
00132
00134
virtual int ReadTensorsPerNode(
char* fileName,
char* description,
00135
int timeStep) = 0;
00137
00139
00141
virtual int ReadScalarsPerElement(
char* fileName,
char* description,
00142
int timeStep,
int numberOfComponents = 1,
00143
int component = 0) = 0;
00145
00147
00149
virtual int ReadVectorsPerElement(
char* fileName,
char* description,
00150
int timeStep) = 0;
00152
00154
00156
virtual int ReadTensorsPerElement(
char* fileName,
char* description,
00157
int timeStep) = 0;
00159
00161
00163
virtual int CreateUnstructuredGridOutput(
int partId,
00164
char line[256],
00165
const char* name) = 0;
00167
00169
00171
virtual int CreateStructuredGridOutput(
int partId,
00172
char line[256],
00173
const char* name) = 0;
00175
00177
00178 vtkSetStringMacro(GeometryFileName);
00179 vtkGetStringMacro(GeometryFileName);
00181
00183
00184 vtkSetStringMacro(MeasuredFileName);
00185 vtkGetStringMacro(MeasuredFileName);
00187
00189
00190 vtkSetStringMacro(MatchFileName);
00191 vtkGetStringMacro(MatchFileName);
00193
00195
void AddVariableFileName(
char* fileName1,
char* fileName2 = NULL);
00196
00198
void AddVariableDescription(
char* description);
00199
00201
void AddVariableType();
00202
00205
int GetElementType(
char* line);
00206
00208
void ReplaceWildcards(
char* filename,
int num);
00209
00210
00211
vtkIdList* GetCellIds(
int index,
int cellType);
00212
00213 char* MeasuredFileName;
00214 char* MatchFileName;
00215
00216
00217 vtkEnSightReaderCellIdsType* CellIds;
00218
00219
00220 vtkIdList* UnstructuredPartIds;
00221
00222 int VariableMode;
00223
00224
00225 char** VariableFileNames;
00226 char** ComplexVariableFileNames;
00227
00228
00229 vtkIdList *VariableTimeSetIds;
00230 vtkIdList *ComplexVariableTimeSetIds;
00231
00232
00233 vtkIdList *VariableFileSetIds;
00234 vtkIdList *ComplexVariableFileSetIds;
00235
00236
00237 vtkIdListCollection *TimeSetFileNameNumbers;
00238 vtkIdList *TimeSetsWithFilenameNumbers;
00239
00240
00241 vtkIdListCollection *FileSetFileNameNumbers;
00242 vtkIdList *FileSetsWithFilenameNumbers;
00243
00244
00245 vtkIdListCollection *FileSetNumberOfSteps;
00246
00247
00248 vtkIdList *TimeSetIds;
00249 vtkIdList *FileSets;
00250
00251 int GeometryTimeSet;
00252 int GeometryFileSet;
00253 int MeasuredTimeSet;
00254 int MeasuredFileSet;
00255
00256 float GeometryTimeValue;
00257 float MeasuredTimeValue;
00258
00259 int UseTimeSets;
00260 vtkSetMacro(UseTimeSets,
int);
00261 vtkGetMacro(UseTimeSets,
int);
00262 vtkBooleanMacro(UseTimeSets,
int);
00263
00264 int UseFileSets;
00265 vtkSetMacro(UseFileSets,
int);
00266 vtkGetMacro(UseFileSets,
int);
00267 vtkBooleanMacro(UseFileSets,
int);
00268
00269 int NumberOfGeometryParts;
00270
00271
void SetNumberOfOutputsInternal(
int num);
00272
00273
00274 int NumberOfMeasuredPoints;
00275 vtkIdList *MeasuredNodeIds;
00276
00277 int NumberOfNewOutputs;
00278 int OutputsAreValid;
00279 int InitialRead;
00280
00281
int CheckOutputConsistency();
00282
00283
private:
00284 vtkEnSightReader(
const vtkEnSightReader&);
00285
void operator=(
const vtkEnSightReader&);
00286 };
00287
00288
#endif