VTK  9.2.6
vtkH5PartReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkH5PartReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*=========================================================================
16 
17  Copyright (C) CSCS - Swiss National Supercomputing Centre.
18  You may use modify and and distribute this code freely providing
19  1) This copyright notice appears on all copies of source code
20  2) An acknowledgment appears with any substantial usage of the code
21  3) If this code is contributed to any other open source project, it
22  must not be reformatted such that the indentation, bracketing or
23  overall style is modified significantly.
24 
25  This software is distributed WITHOUT ANY WARRANTY; without even the
26  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 
28 =========================================================================*/
44 #ifndef vtkH5PartReader_h
45 #define vtkH5PartReader_h
46 
47 #include "vtkIOH5partModule.h" // for export macro
48 #include "vtkPolyDataAlgorithm.h"
49 
50 #include <string> // for string
51 #include <vector> // for vector
52 
54 struct H5PartFile;
55 class VTKIOH5PART_EXPORT vtkH5PartReader : public vtkPolyDataAlgorithm
56 {
57 public:
58  static vtkH5PartReader* New();
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
66  void SetFileName(VTK_FILEPATH char* filename);
67  vtkGetFilePathMacro(FileName);
69 
71 
74  vtkGetStringMacro(Xarray);
75  vtkSetStringMacro(Xarray);
77 
79 
82  vtkGetStringMacro(Yarray);
83  vtkSetStringMacro(Yarray);
85 
87 
90  vtkGetStringMacro(Zarray);
91  vtkSetStringMacro(Zarray);
93 
95 
103  vtkSetMacro(GenerateVertexCells, int);
104  vtkGetMacro(GenerateVertexCells, int);
105  vtkBooleanMacro(GenerateVertexCells, int);
107 
109 
114  vtkSetMacro(CombineVectorComponents, int);
115  vtkGetMacro(CombineVectorComponents, int);
116  vtkBooleanMacro(CombineVectorComponents, int);
118 
120 
129  vtkSetMacro(MaskOutOfTimeRangeOutput, int);
130  vtkGetMacro(MaskOutOfTimeRangeOutput, int);
131  vtkBooleanMacro(MaskOutOfTimeRangeOutput, int);
133 
135 
145  int GetNumberOfPointArrays();
146  const char* GetPointArrayName(int index);
147  int GetPointArrayStatus(const char* name);
148  void SetPointArrayStatus(const char* name, int status);
149  void DisableAll();
150  void EnableAll();
151  void Disable(const char* name);
152  void Enable(const char* name);
153 
154  int GetNumberOfPointArrayStatusArrays() { return GetNumberOfPointArrays(); }
155  const char* GetPointArrayStatusArrayName(int index) { return GetPointArrayName(index); }
156  int GetPointArrayStatusArrayStatus(const char* name) { return GetPointArrayStatus(name); }
157  void SetPointArrayStatusArrayStatus(const char* name, int status)
158  {
159  this->SetPointArrayStatus(name, status);
160  }
161 
163 
165  int GetNumberOfCoordinateArrays() { return GetNumberOfPointArrays(); }
166  const char* GetCoordinateArrayName(int index) { return GetPointArrayName(index); }
167  int GetCoordinateArrayStatus(const char* name);
168  void SetCoordinateArrayStatus(const char* name, int status);
170 
171 protected:
172  vtkH5PartReader();
173  ~vtkH5PartReader() override;
174  //
177  int OpenFile();
178  void CloseFile();
179  // void CopyIntoCoords(int offset, vtkDataArray *source, vtkDataArray *dest);
180  // returns 0 if no, returns 1,2,3,45 etc for the first, second...
181  // example : if CombineVectorComponents is true, then
182  // velocity_0 returns 1, velocity_1 returns 2 etc
183  // if CombineVectorComponents is false, then
184  // velocity_0 returns 0, velocity_1 returns 0 etc
185  int IndexOfVectorComponent(const char* name);
186 
187  std::string NameOfVectorComponent(const char* name);
188 
189  //
190  // Internal Variables
191  //
192  char* FileName;
194  int TimeStep;
199  H5PartFile* H5FileId;
204  //
205  char* Xarray;
206  char* Yarray;
207  char* Zarray;
208 
209  std::vector<double> TimeStepValues;
210 
211  // To allow paraview gui to enable/disable scalar reading
213 
214 private:
215  vtkH5PartReader(const vtkH5PartReader&) = delete;
216  void operator=(const vtkH5PartReader&) = delete;
217 };
218 
219 #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:35
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:39
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Store on/off settings for data arrays, etc.
H5PartFile * H5FileId
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.