00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00023
#ifndef __vtkEnSightReader_h
00024
#define __vtkEnSightReader_h
00025
00026
#include "vtkGenericEnSightReader.h"
00027
00028
class vtkDataSetCollection;
00029
class vtkIdList;
00030
00031 class VTK_IO_EXPORT vtkEnSightReader :
public vtkGenericEnSightReader
00032 {
00033
public:
00034 vtkTypeRevisionMacro(vtkEnSightReader,
vtkGenericEnSightReader);
00035
void PrintSelf(ostream& os,
vtkIndent indent);
00036
00037
void Update();
00038
void ExecuteInformation();
00039
00040
00041 enum ElementTypesList
00042 {
00043 POINT = 0,
00044 BAR2 = 1,
00045 BAR3 = 2,
00046 NSIDED = 3,
00047 TRIA3 = 4,
00048 TRIA6 = 5,
00049 QUAD4 = 6,
00050 QUAD8 = 7,
00051 TETRA4 = 8,
00052 TETRA10 = 9,
00053 PYRAMID5 = 10,
00054 PYRAMID13 = 11,
00055 HEXA8 = 12,
00056 HEXA20 = 13,
00057 PENTA6 = 14,
00058 PENTA15 = 15
00059 };
00060
00061 enum VariableTypesList
00062 {
00063 SCALAR_PER_NODE = 0,
00064 VECTOR_PER_NODE = 1,
00065 TENSOR_SYMM_PER_NODE = 2,
00066 SCALAR_PER_ELEMENT = 3,
00067 VECTOR_PER_ELEMENT = 4,
00068 TENSOR_SYMM_PER_ELEMENT = 5,
00069 SCALAR_PER_MEASURED_NODE = 6,
00070 VECTOR_PER_MEASURED_NODE = 7,
00071 COMPLEX_SCALAR_PER_NODE = 8,
00072 COMPLEX_VECTOR_PER_NODE = 9,
00073 COMPLEX_SCALAR_PER_ELEMENT = 10,
00074 COMPLEX_VECTOR_PER_ELEMENT = 11
00075 };
00076
00077
00081
void ReplaceNthOutput(
int n,
vtkDataObject* output);
00082
00084
00090 vtkGetMacro(OutputsAreValid,
int);
00092
00093
protected:
00094 vtkEnSightReader();
00095 ~vtkEnSightReader();
00096
00097
void Execute();
00098
00101
int ReadCaseFile();
00102
00103
00104 int CaseFileRead;
00105
00108
virtual int ReadGeometryFile(
char* fileName,
int timeStep) = 0;
00109
00112
virtual int ReadMeasuredGeometryFile(
char* fileName,
int timeStep) = 0;
00113
00116
int ReadVariableFiles();
00117
00119
00121
virtual int ReadScalarsPerNode(
char* fileName,
char* description,
00122
int timeStep,
int measured = 0,
00123
int numberOfComponents = 1,
00124
int component = 0) = 0;
00126
00128
00130
virtual int ReadVectorsPerNode(
char* fileName,
char* description,
00131
int timeStep,
int measured = 0) = 0;
00133
00135
00137
virtual int ReadTensorsPerNode(
char* fileName,
char* description,
00138
int timeStep) = 0;
00140
00142
00144
virtual int ReadScalarsPerElement(
char* fileName,
char* description,
00145
int timeStep,
int numberOfComponents = 1,
00146
int component = 0) = 0;
00148
00150
00152
virtual int ReadVectorsPerElement(
char* fileName,
char* description,
00153
int timeStep) = 0;
00155
00157
00159
virtual int ReadTensorsPerElement(
char* fileName,
char* description,
00160
int timeStep) = 0;
00162
00165
virtual int CreateUnstructuredGridOutput(
int partId,
char line[256]) = 0;
00166
00169
virtual int CreateStructuredGridOutput(
int partId,
char line[256]) = 0;
00170
00172
00173 vtkSetStringMacro(GeometryFileName);
00174 vtkGetStringMacro(GeometryFileName);
00176
00178
00179 vtkSetStringMacro(MeasuredFileName);
00180 vtkGetStringMacro(MeasuredFileName);
00182
00184
00185 vtkSetStringMacro(MatchFileName);
00186 vtkGetStringMacro(MatchFileName);
00188
00190
void AddVariableFileName(
char* fileName1,
char* fileName2 = NULL);
00191
00193
void AddVariableDescription(
char* description);
00194
00196
void AddVariableType();
00197
00200
int GetElementType(
char* line);
00201
00203
void ReplaceWildcards(
char* filename,
int num);
00204
00205 char* MeasuredFileName;
00206 char* MatchFileName;
00207
00208
00209 vtkIdList*** CellIds;
00210
00211
00212 vtkIdList* UnstructuredPartIds;
00213
00214 int VariableMode;
00215
00216
00217 char** VariableFileNames;
00218 char** ComplexVariableFileNames;
00219
00220
00221 vtkIdList *VariableTimeSetIds;
00222 vtkIdList *ComplexVariableTimeSetIds;
00223
00224
00225 vtkIdList *VariableFileSetIds;
00226 vtkIdList *ComplexVariableFileSetIds;
00227
00228
00229 vtkIdListCollection *TimeSetFileNameNumbers;
00230 vtkIdList *TimeSetsWithFilenameNumbers;
00231
00232
00233 vtkIdListCollection *FileSetFileNameNumbers;
00234 vtkIdList *FileSetsWithFilenameNumbers;
00235
00236
00237 vtkIdListCollection *FileSetNumberOfSteps;
00238
00239
00240 vtkIdList *TimeSetIds;
00241 vtkIdList *FileSets;
00242
00243 int GeometryTimeSet;
00244 int GeometryFileSet;
00245 int MeasuredTimeSet;
00246 int MeasuredFileSet;
00247
00248 float GeometryTimeValue;
00249 float MeasuredTimeValue;
00250
00251 int UseTimeSets;
00252 vtkSetMacro(UseTimeSets,
int);
00253 vtkGetMacro(UseTimeSets,
int);
00254 vtkBooleanMacro(UseTimeSets,
int);
00255
00256 int UseFileSets;
00257 vtkSetMacro(UseFileSets,
int);
00258 vtkGetMacro(UseFileSets,
int);
00259 vtkBooleanMacro(UseFileSets,
int);
00260
00261 int NumberOfGeometryParts;
00262
00263
void SetNumberOfOutputsInternal(
int num);
00264
00265
00266 int NumberOfMeasuredPoints;
00267 vtkIdList *MeasuredNodeIds;
00268
00269 int NumberOfNewOutputs;
00270 int OutputsAreValid;
00271 int InitialRead;
00272
00273
int CheckOutputConsistency();
00274
00275
private:
00276 vtkEnSightReader(
const vtkEnSightReader&);
00277
void operator=(
const vtkEnSightReader&);
00278 };
00279
00280
#endif