VTK  9.3.0
vtkEnSightReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
8 #ifndef vtkEnSightReader_h
9 #define vtkEnSightReader_h
10 
12 #include "vtkIOEnSightModule.h" // For export macro
13 
14 VTK_ABI_NAMESPACE_BEGIN
15 class vtkDataSet;
17 class vtkEnSightReaderCellIdsType;
18 class vtkIdList;
20 
21 class VTKIOENSIGHT_EXPORT vtkEnSightReader : public vtkGenericEnSightReader
22 {
23 public:
25  void PrintSelf(ostream& os, vtkIndent indent) override;
26 
28  {
29  POINT = 0,
30  BAR2 = 1,
31  BAR3 = 2,
32  NSIDED = 3,
33  TRIA3 = 4,
34  TRIA6 = 5,
35  QUAD4 = 6,
36  QUAD8 = 7,
37  NFACED = 8,
38  TETRA4 = 9,
39  TETRA10 = 10,
40  PYRAMID5 = 11,
41  PYRAMID13 = 12,
42  HEXA8 = 13,
43  HEXA20 = 14,
44  PENTA6 = 15,
45  PENTA15 = 16,
46  NUMBER_OF_ELEMENT_TYPES = 17
47  };
48 
50  {
51  SCALAR_PER_NODE = 0,
52  VECTOR_PER_NODE = 1,
53  TENSOR_SYMM_PER_NODE = 2,
54  SCALAR_PER_ELEMENT = 3,
55  VECTOR_PER_ELEMENT = 4,
56  TENSOR_SYMM_PER_ELEMENT = 5,
57  SCALAR_PER_MEASURED_NODE = 6,
58  VECTOR_PER_MEASURED_NODE = 7,
59  COMPLEX_SCALAR_PER_NODE = 8,
60  COMPLEX_VECTOR_PER_NODE = 9,
61  COMPLEX_SCALAR_PER_ELEMENT = 10,
62  COMPLEX_VECTOR_PER_ELEMENT = 11,
63  TENSOR_ASYM_PER_NODE = 12,
64  TENSOR_ASYM_PER_ELEMENT = 13
65  };
66 
68  {
69  COORDINATES = 0,
70  BLOCK = 1,
71  ELEMENT = 2
72  };
73 
75 
79  vtkGetFilePathMacro(MeasuredFileName);
81 
83 
87  vtkGetFilePathMacro(MatchFileName);
89 
90 protected:
92  ~vtkEnSightReader() override;
93 
96 
97  void ClearForNewCaseFileName() override;
98 
100 
103  vtkSetFilePathMacro(MeasuredFileName);
105 
107 
110  vtkSetFilePathMacro(MatchFileName);
112 
114 
118  int ReadCaseFileGeometry(char* line);
119  int ReadCaseFileVariable(char* line);
120  int ReadCaseFileTime(char* line);
121  int ReadCaseFileFile(char* line);
122  int ReadCaseFileScripts(char* line);
123 
125 
126  // set in UpdateInformation to value returned from ReadCaseFile
128 
132  virtual int ReadGeometryFile(
133  const char* fileName, int timeStep, vtkMultiBlockDataSet* output) = 0;
134 
140  const char* fileName, int timeStep, vtkMultiBlockDataSet* output) = 0;
141 
146 
151  virtual int ReadScalarsPerNode(const char* fileName, const char* description, int timeStep,
152  vtkMultiBlockDataSet* output, int measured = 0, int numberOfComponents = 1,
153  int component = 0) = 0;
154 
159  virtual int ReadVectorsPerNode(const char* fileName, const char* description, int timeStep,
160  vtkMultiBlockDataSet* output, int measured = 0) = 0;
161 
167  const char* fileName, const char* description, int timeStep, vtkMultiBlockDataSet* output) = 0;
168 
173  virtual int ReadTensorsPerNode(
174  const char* fileName, const char* description, int timeStep, vtkMultiBlockDataSet* output) = 0;
175 
180  virtual int ReadScalarsPerElement(const char* fileName, const char* description, int timeStep,
181  vtkMultiBlockDataSet* output, int numberOfComponents = 1, int component = 0) = 0;
182 
188  const char* fileName, const char* description, int timeStep, vtkMultiBlockDataSet* output) = 0;
189 
195  const char* fileName, const char* description, int timeStep, vtkMultiBlockDataSet* output) = 0;
196 
202  const char* fileName, const char* description, int timeStep, vtkMultiBlockDataSet* output) = 0;
203 
209  int partId, char line[80], const char* name, vtkMultiBlockDataSet* output) = 0;
210 
216  int partId, char line[80], const char* name, vtkMultiBlockDataSet* output) = 0;
217 
221  void AddVariableFileName(const char* fileName1, const char* fileName2 = nullptr);
222 
227 
232 
237  int GetElementType(const char* line);
238 
243  int GetSectionType(const char* line);
244 
248  void RemoveLeadingBlanks(char* line);
249 
250  // Get the vtkIdList for the given output index and cell type.
251  vtkIdList* GetCellIds(int index, int cellType);
252 
257  void AddToBlock(vtkMultiBlockDataSet* output, unsigned int blockNo, vtkDataSet* dataset);
258 
263  vtkDataSet* GetDataSetFromBlock(vtkMultiBlockDataSet* output, unsigned int blockNo);
264 
268  void SetBlockName(vtkMultiBlockDataSet* output, unsigned int blockNo, const char* name);
269 
271  char* MatchFileName; // may not actually be necessary to read this file
272 
273  // pointer to lists of vtkIdLists (cell ids per element type per part)
274  vtkEnSightReaderCellIdsType* CellIds;
275 
276  // part ids of unstructured outputs
278 
280 
281  // pointers to lists of filenames
282  char** VariableFileNames; // non-complex
284 
285  // array of time sets
288 
289  // array of file sets
292 
293  // collection of filename numbers per time set
296 
297  // collection of filename numbers per file set
300 
301  // collection of number of steps per file per file set
303 
304  // ids of the time and file sets
307 
312 
315 
317  vtkSetMacro(UseTimeSets, vtkTypeBool);
318  vtkGetMacro(UseTimeSets, vtkTypeBool);
319  vtkBooleanMacro(UseTimeSets, vtkTypeBool);
320 
322  vtkSetMacro(UseFileSets, vtkTypeBool);
323  vtkGetMacro(UseFileSets, vtkTypeBool);
324  vtkBooleanMacro(UseFileSets, vtkTypeBool);
325 
327 
328  // global list of points for measured geometry
330 
333 
335 
337 
338 private:
339  vtkEnSightReader(const vtkEnSightReader&) = delete;
340  void operator=(const vtkEnSightReader&) = delete;
341 };
342 
343 VTK_ABI_NAMESPACE_END
344 #endif
maintain an unordered list of dataset objects
abstract class to specify dataset behavior
Definition: vtkDataSet.h:53
superclass for EnSight file readers
int GetSectionType(const char *line)
Determine the section type from a line read a file.
vtkIdList * ComplexVariableFileSetIds
virtual int ReadTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read tensors per element for this dataset.
vtkIdList * UnstructuredPartIds
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkTypeBool UseTimeSets
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
virtual int ReadVectorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read vectors per element for this dataset.
vtkIdList * FileSets
vtkIdList * GetCellIds(int index, int cellType)
vtkIdListCollection * FileSetFileNameNumbers
vtkTypeBool UseFileSets
void AddToBlock(vtkMultiBlockDataSet *output, unsigned int blockNo, vtkDataSet *dataset)
Convenience method use to convert the readers from VTK 5 multiblock API to the current composite data...
int GetElementType(const char *line)
Determine the element type from a line read a file.
virtual int CreateUnstructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
Read an unstructured part (partId) from the geometry file and create a vtkUnstructuredGrid output.
virtual int ReadVectorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0)=0
Read vectors per node for this dataset.
void SetBlockName(vtkMultiBlockDataSet *output, unsigned int blockNo, const char *name)
Set the name of a block.
vtkGetFilePathMacro(MeasuredFileName)
Get the Measured file name.
void AddVariableType()
Record the variable type for the variable line just read.
vtkIdList * VariableTimeSetIds
vtkIdListCollection * FileSetNumberOfSteps
void AddVariableDescription(const char *description)
Add another description to the list for a particular variable type.
int ReadCaseFileTime(char *line)
Read the case file.
vtkIdList * FileSetsWithFilenameNumbers
virtual int ReadAsymmetricTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read asymmetric tensors per node for this dataset.
vtkEnSightReaderCellIdsType * CellIds
virtual int ReadAsymmetricTensorsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read asymmetric tensors per element for this dataset.
virtual int ReadScalarsPerElement(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int numberOfComponents=1, int component=0)=0
Read scalars per element for this dataset.
int ReadCaseFileVariable(char *line)
Read the case file.
int CheckOutputConsistency()
virtual int CreateStructuredGridOutput(int partId, char line[80], const char *name, vtkMultiBlockDataSet *output)=0
Read a structured part from the geometry file and create a vtkStructuredGridOutput.
int ReadCaseFileScripts(char *line)
Read the case file.
vtkGetFilePathMacro(MatchFileName)
Get the Match file name.
vtkIdList * VariableFileSetIds
virtual int ReadMeasuredGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
Read the measured geometry file.
int ReadCaseFile()
Read the case file.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSetFilePathMacro(MeasuredFileName)
Set the Measured file name.
char ** ComplexVariableFileNames
vtkIdList * ComplexVariableTimeSetIds
~vtkEnSightReader() override
vtkIdList * TimeSetsWithFilenameNumbers
virtual int ReadScalarsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output, int measured=0, int numberOfComponents=1, int component=0)=0
Read scalars per node for this dataset.
vtkIdListCollection * TimeSetFileNameNumbers
int ReadCaseFileFile(char *line)
Read the case file.
vtkDataSet * GetDataSetFromBlock(vtkMultiBlockDataSet *output, unsigned int blockNo)
Convenience method use to convert the readers from VTK 5 multiblock API to the current composite data...
void ClearForNewCaseFileName() override
Clear data structures such that setting a new case file name works.
int ReadVariableFiles(vtkMultiBlockDataSet *output)
Read the variable files.
int ReadCaseFileGeometry(char *line)
Read the case file.
vtkSetFilePathMacro(MatchFileName)
Set the Match file name.
vtkIdList * TimeSetIds
void RemoveLeadingBlanks(char *line)
Remove leading blank spaces from a string.
virtual int ReadGeometryFile(const char *fileName, int timeStep, vtkMultiBlockDataSet *output)=0
Read the geometry file.
virtual int ReadTensorsPerNode(const char *fileName, const char *description, int timeStep, vtkMultiBlockDataSet *output)=0
Read tensors per node for this dataset.
void AddVariableFileName(const char *fileName1, const char *fileName2=nullptr)
Add another file name to the list for a particular variable type.
class to read any type of EnSight files
maintain an ordered list of IdList objects
list of point or cell ids
Definition: vtkIdList.h:23
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
@ component
Definition: vtkX3D.h:175
@ description
Definition: vtkX3D.h:322
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
int vtkTypeBool
Definition: vtkABI.h:64