VTK  9.7.1
vtkH5PartReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (C) CSCS - Swiss National Supercomputing Centre
3 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkH5PartReader_h
20 #define vtkH5PartReader_h
21 
22 #include "vtkIOH5partModule.h" // for export macro
23 #include "vtkPolyDataAlgorithm.h"
24 
25 #include <string> // for string
26 #include <vector> // for vector
27 
28 VTK_ABI_NAMESPACE_BEGIN
30 class VTKIOH5PART_EXPORT vtkH5PartReader : public vtkPolyDataAlgorithm
31 {
32 public:
33  static vtkH5PartReader* New();
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
38 
41  void SetFileName(VTK_FILEPATH char* filename);
42  vtkGetFilePathMacro(FileName);
44 
46 
49  vtkGetStringMacro(Xarray);
50  vtkSetStringMacro(Xarray);
52 
54 
57  vtkGetStringMacro(Yarray);
58  vtkSetStringMacro(Yarray);
60 
62 
65  vtkGetStringMacro(Zarray);
66  vtkSetStringMacro(Zarray);
68 
70 
78  vtkSetMacro(GenerateVertexCells, int);
79  vtkGetMacro(GenerateVertexCells, int);
80  vtkBooleanMacro(GenerateVertexCells, int);
82 
84 
89  vtkSetMacro(CombineVectorComponents, int);
90  vtkGetMacro(CombineVectorComponents, int);
91  vtkBooleanMacro(CombineVectorComponents, int);
93 
95 
104  vtkSetMacro(MaskOutOfTimeRangeOutput, int);
105  vtkGetMacro(MaskOutOfTimeRangeOutput, int);
106  vtkBooleanMacro(MaskOutOfTimeRangeOutput, int);
108 
110 
120  int GetNumberOfPointArrays();
121  const char* GetPointArrayName(int index);
122  int GetPointArrayStatus(const char* name);
123  void SetPointArrayStatus(const char* name, int status);
124  void DisableAll();
125  void EnableAll();
126  void Disable(const char* name);
127  void Enable(const char* name);
128 
129  int GetNumberOfPointArrayStatusArrays() { return GetNumberOfPointArrays(); }
130  const char* GetPointArrayStatusArrayName(int index) { return GetPointArrayName(index); }
131  int GetPointArrayStatusArrayStatus(const char* name) { return GetPointArrayStatus(name); }
132  void SetPointArrayStatusArrayStatus(const char* name, int status)
133  {
134  this->SetPointArrayStatus(name, status);
135  }
136 
138 
140  int GetNumberOfCoordinateArrays() { return GetNumberOfPointArrays(); }
141  const char* GetCoordinateArrayName(int index) { return GetPointArrayName(index); }
142  int GetCoordinateArrayStatus(const char* name);
143  void SetCoordinateArrayStatus(const char* name, int status);
145 
146 protected:
147  vtkH5PartReader();
148  ~vtkH5PartReader() override;
149  //
152  int OpenFile();
153  void CloseFile();
154  // void CopyIntoCoords(int offset, vtkDataArray *source, vtkDataArray *dest);
155  // returns 0 if no, returns 1,2,3,45 etc for the first, second...
156  // example : if CombineVectorComponents is true, then
157  // velocity_0 returns 1, velocity_1 returns 2 etc
158  // if CombineVectorComponents is false, then
159  // velocity_0 returns 0, velocity_1 returns 0 etc
160  int IndexOfVectorComponent(const char* name);
161 
162  std::string NameOfVectorComponent(const char* name);
163 
164  //
165  // Internal Variables
166  //
167  char* FileName;
169  int TimeStep;
174  uintptr_t H5FileId;
179  //
180  char* Xarray;
181  char* Yarray;
182  char* Zarray;
183 
184  std::vector<double> TimeStepValues;
185 
186  // To allow paraview gui to enable/disable scalar reading
188 
189 private:
190  vtkH5PartReader(const vtkH5PartReader&) = delete;
191  void operator=(const vtkH5PartReader&) = delete;
192 };
193 
194 VTK_ABI_NAMESPACE_END
195 #endif
vtkTimeStamp FileModifiedTime
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkTimeStamp FileOpenedTime
record modification and/or execution time
Definition: vtkTimeStamp.h:24
Read H5Part particle files.
int GetPointArrayStatusArrayStatus(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
int GetNumberOfCoordinateArrays()
static vtkPolyDataAlgorithm * New()
void SetPointArrayStatusArrayStatus(const char *name, int status)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Store on/off settings for data arrays, etc.
const char * GetPointArrayStatusArrayName(int index)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
int GetNumberOfPointArrayStatusArrays()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
#define VTK_FILEPATH
std::vector< double > TimeStepValues
Store zero or more vtkInformation instances.
vtkDataArraySelection * PointDataArraySelection
const char * GetCoordinateArrayName(int index)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.