VTK  9.3.20240417
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 struct H5PartFile;
29 
30 VTK_ABI_NAMESPACE_BEGIN
32 class VTKIOH5PART_EXPORT vtkH5PartReader : public vtkPolyDataAlgorithm
33 {
34 public:
35  static vtkH5PartReader* New();
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
43  void SetFileName(VTK_FILEPATH char* filename);
46 
48 
51  vtkGetStringMacro(Xarray);
52  vtkSetStringMacro(Xarray);
54 
56 
59  vtkGetStringMacro(Yarray);
60  vtkSetStringMacro(Yarray);
62 
64 
67  vtkGetStringMacro(Zarray);
68  vtkSetStringMacro(Zarray);
70 
72 
80  vtkSetMacro(GenerateVertexCells, int);
81  vtkGetMacro(GenerateVertexCells, int);
82  vtkBooleanMacro(GenerateVertexCells, int);
84 
86 
91  vtkSetMacro(CombineVectorComponents, int);
92  vtkGetMacro(CombineVectorComponents, int);
93  vtkBooleanMacro(CombineVectorComponents, int);
95 
97 
106  vtkSetMacro(MaskOutOfTimeRangeOutput, int);
107  vtkGetMacro(MaskOutOfTimeRangeOutput, int);
108  vtkBooleanMacro(MaskOutOfTimeRangeOutput, int);
110 
112 
123  const char* GetPointArrayName(int index);
124  int GetPointArrayStatus(const char* name);
125  void SetPointArrayStatus(const char* name, int status);
126  void DisableAll();
127  void EnableAll();
128  void Disable(const char* name);
129  void Enable(const char* name);
130 
131  int GetNumberOfPointArrayStatusArrays() { return GetNumberOfPointArrays(); }
132  const char* GetPointArrayStatusArrayName(int index) { return GetPointArrayName(index); }
133  int GetPointArrayStatusArrayStatus(const char* name) { return GetPointArrayStatus(name); }
134  void SetPointArrayStatusArrayStatus(const char* name, int status)
135  {
136  this->SetPointArrayStatus(name, status);
137  }
138 
140 
142  int GetNumberOfCoordinateArrays() { return GetNumberOfPointArrays(); }
143  const char* GetCoordinateArrayName(int index) { return GetPointArrayName(index); }
144  int GetCoordinateArrayStatus(const char* name);
145  void SetCoordinateArrayStatus(const char* name, int status);
147 
148 protected:
150  ~vtkH5PartReader() override;
151  //
154  int OpenFile();
155  void CloseFile();
156  // void CopyIntoCoords(int offset, vtkDataArray *source, vtkDataArray *dest);
157  // returns 0 if no, returns 1,2,3,45 etc for the first, second...
158  // example : if CombineVectorComponents is true, then
159  // velocity_0 returns 1, velocity_1 returns 2 etc
160  // if CombineVectorComponents is false, then
161  // velocity_0 returns 0, velocity_1 returns 0 etc
162  int IndexOfVectorComponent(const char* name);
163 
165 
166  //
167  // Internal Variables
168  //
169  char* FileName;
171  int TimeStep;
176  H5PartFile* H5FileId;
181  //
182  char* Xarray;
183  char* Yarray;
184  char* Zarray;
185 
186  std::vector<double> TimeStepValues;
187 
188  // To allow paraview gui to enable/disable scalar reading
190 
191 private:
192  vtkH5PartReader(const vtkH5PartReader&) = delete;
193  void operator=(const vtkH5PartReader&) = delete;
194 };
195 
196 VTK_ABI_NAMESPACE_END
197 #endif
Store on/off settings for data arrays, etc.
Read H5Part particle files.
int GetNumberOfPointArrayStatusArrays()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
int GetNumberOfCoordinateArrays()
void DisableAll()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
void SetFileName(VTK_FILEPATH char *filename)
Specify file name.
void SetPointArrayStatus(const char *name, int status)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
void Enable(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
const char * GetPointArrayName(int index)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
void SetCoordinateArrayStatus(const char *name, int status)
H5PartFile * H5FileId
void EnableAll()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
int IndexOfVectorComponent(const char *name)
int GetPointArrayStatusArrayStatus(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTimeStamp FileOpenedTime
const char * GetPointArrayStatusArrayName(int index)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
static vtkH5PartReader * New()
std::vector< double > TimeStepValues
const char * GetCoordinateArrayName(int index)
vtkGetFilePathMacro(FileName)
Specify file name.
int GetNumberOfPointArrays()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
~vtkH5PartReader() override
std::string NameOfVectorComponent(const char *name)
void Disable(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
int GetCoordinateArrayStatus(const char *name)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkTimeStamp FileModifiedTime
vtkDataArraySelection * PointDataArraySelection
int GetPointArrayStatus(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
void SetPointArrayStatusArrayStatus(const char *name, int status)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
record modification and/or execution time
Definition: vtkTimeStamp.h:44
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
@ string
Definition: vtkX3D.h:490
#define VTK_FILEPATH