VTK  9.0.20210725
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 =========================================================================*/
41 #ifndef vtkH5PartReader_h
42 #define vtkH5PartReader_h
43 
44 #include "vtkIOH5partModule.h" // for export macro
45 #include "vtkPolyDataAlgorithm.h"
46 
47 #include <string> // for string
48 #include <vector> // for vector
49 
51 struct H5PartFile;
52 class VTKIOH5PART_EXPORT vtkH5PartReader : public vtkPolyDataAlgorithm
53 {
54 public:
55  static vtkH5PartReader* New();
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
60 
63  void SetFileName(char* filename);
64  vtkGetStringMacro(FileName);
66 
68 
71  vtkGetStringMacro(Xarray);
72  vtkSetStringMacro(Xarray);
74 
76 
79  vtkGetStringMacro(Yarray);
80  vtkSetStringMacro(Yarray);
82 
84 
87  vtkGetStringMacro(Zarray);
88  vtkSetStringMacro(Zarray);
90 
92 
100  vtkSetMacro(GenerateVertexCells, int);
101  vtkGetMacro(GenerateVertexCells, int);
102  vtkBooleanMacro(GenerateVertexCells, int);
104 
106 
111  vtkSetMacro(CombineVectorComponents, int);
112  vtkGetMacro(CombineVectorComponents, int);
113  vtkBooleanMacro(CombineVectorComponents, int);
115 
117 
126  vtkSetMacro(MaskOutOfTimeRangeOutput, int);
127  vtkGetMacro(MaskOutOfTimeRangeOutput, int);
128  vtkBooleanMacro(MaskOutOfTimeRangeOutput, int);
130 
132 
143  const char* GetPointArrayName(int index);
144  int GetPointArrayStatus(const char* name);
145  void SetPointArrayStatus(const char* name, int status);
146  void DisableAll();
147  void EnableAll();
148  void Disable(const char* name);
149  void Enable(const char* name);
150 
151  int GetNumberOfPointArrayStatusArrays() { return GetNumberOfPointArrays(); }
152  const char* GetPointArrayStatusArrayName(int index) { return GetPointArrayName(index); }
153  int GetPointArrayStatusArrayStatus(const char* name) { return GetPointArrayStatus(name); }
154  void SetPointArrayStatusArrayStatus(const char* name, int status)
155  {
156  this->SetPointArrayStatus(name, status);
157  }
158 
160 
162  int GetNumberOfCoordinateArrays() { return GetNumberOfPointArrays(); }
163  const char* GetCoordinateArrayName(int index) { return GetPointArrayName(index); }
164  int GetCoordinateArrayStatus(const char* name);
165  void SetCoordinateArrayStatus(const char* name, int status);
167 
168 protected:
170  ~vtkH5PartReader() override;
171  //
174  int OpenFile();
175  void CloseFile();
176  // void CopyIntoCoords(int offset, vtkDataArray *source, vtkDataArray *dest);
177  // returns 0 if no, returns 1,2,3,45 etc for the first, second...
178  // example : if CombineVectorComponents is true, then
179  // velocity_0 returns 1, velocity_1 returns 2 etc
180  // if CombineVectorComponents is false, then
181  // velocity_0 returns 0, velocity_1 returns 0 etc
182  int IndexOfVectorComponent(const char* name);
183 
185 
186  //
187  // Internal Variables
188  //
189  char* FileName;
191  int TimeStep;
196  H5PartFile* H5FileId;
201  //
202  char* Xarray;
203  char* Yarray;
204  char* Zarray;
205 
206  std::vector<double> TimeStepValues;
207 
208  // To allow paraview gui to enable/disable scalar reading
210 
211 private:
212  vtkH5PartReader(const vtkH5PartReader&) = delete;
213  void operator=(const vtkH5PartReader&) = delete;
214 };
215 
216 #endif
vtkH5PartReader::ActualTimeStep
int ActualTimeStep
Definition: vtkH5PartReader.h:192
vtkH5PartReader::OpenFile
int OpenFile()
vtkH5PartReader::DisableAll
void DisableAll()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
vtkH5PartReader::CombineVectorComponents
int CombineVectorComponents
Definition: vtkH5PartReader.h:194
vtkH5PartReader::TimeOutOfRange
int TimeOutOfRange
Definition: vtkH5PartReader.h:200
vtkH5PartReader::FileModifiedTime
vtkTimeStamp FileModifiedTime
Definition: vtkH5PartReader.h:197
vtkH5PartReader::GetCoordinateArrayName
const char * GetCoordinateArrayName(int index)
Definition: vtkH5PartReader.h:163
vtkH5PartReader::SetCoordinateArrayStatus
void SetCoordinateArrayStatus(const char *name, int status)
vtkH5PartReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkH5PartReader::H5FileId
H5PartFile * H5FileId
Definition: vtkH5PartReader.h:196
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkH5PartReader::TimeStepTolerance
double TimeStepTolerance
Definition: vtkH5PartReader.h:193
vtkH5PartReader::TimeStep
int TimeStep
Definition: vtkH5PartReader.h:191
vtkH5PartReader::GetNumberOfCoordinateArrays
int GetNumberOfCoordinateArrays()
Definition: vtkH5PartReader.h:162
vtkH5PartReader::GenerateVertexCells
int GenerateVertexCells
Definition: vtkH5PartReader.h:195
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:33
vtkH5PartReader::IndexOfVectorComponent
int IndexOfVectorComponent(const char *name)
vtkH5PartReader::Zarray
char * Zarray
Definition: vtkH5PartReader.h:204
vtkH5PartReader::TimeStepValues
std::vector< double > TimeStepValues
Definition: vtkH5PartReader.h:206
vtkH5PartReader::NumberOfTimeSteps
int NumberOfTimeSteps
Definition: vtkH5PartReader.h:190
vtkH5PartReader::SetPointArrayStatus
void SetPointArrayStatus(const char *name, int status)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
vtkH5PartReader::GetNumberOfPointArrays
int GetNumberOfPointArrays()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
vtkDataArraySelection
Store on/off settings for data arrays for a vtkSource.
Definition: vtkDataArraySelection.h:35
vtkH5PartReader::MaskOutOfTimeRangeOutput
int MaskOutOfTimeRangeOutput
Definition: vtkH5PartReader.h:199
vtkPolyDataAlgorithm.h
vtkH5PartReader::SetFileName
void SetFileName(char *filename)
Specify file name.
vtkH5PartReader
Read H5Part particle files.
Definition: vtkH5PartReader.h:53
vtkH5PartReader::Xarray
char * Xarray
Definition: vtkH5PartReader.h:202
vtkH5PartReader::New
static vtkH5PartReader * New()
vtkH5PartReader::NameOfVectorComponent
std::string NameOfVectorComponent(const char *name)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkH5PartReader::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkH5PartReader::EnableAll
void EnableAll()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
vtkH5PartReader::FileOpenedTime
vtkTimeStamp FileOpenedTime
Definition: vtkH5PartReader.h:198
vtkH5PartReader::GetCoordinateArrayStatus
int GetCoordinateArrayStatus(const char *name)
vtkH5PartReader::GetNumberOfPointArrayStatusArrays
int GetNumberOfPointArrayStatusArrays()
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
Definition: vtkH5PartReader.h:151
vtkH5PartReader::~vtkH5PartReader
~vtkH5PartReader() override
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:74
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkH5PartReader::PointDataArraySelection
vtkDataArraySelection * PointDataArraySelection
Definition: vtkH5PartReader.h:209
vtkH5PartReader::GetPointArrayStatusArrayStatus
int GetPointArrayStatusArrayStatus(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
Definition: vtkH5PartReader.h:153
vtkH5PartReader::GetPointArrayName
const char * GetPointArrayName(int index)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
vtkH5PartReader::Enable
void Enable(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
vtkH5PartReader::Yarray
char * Yarray
Definition: vtkH5PartReader.h:203
vtkH5PartReader::GetPointArrayStatusArrayName
const char * GetPointArrayStatusArrayName(int index)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
Definition: vtkH5PartReader.h:152
vtkH5PartReader::FileName
char * FileName
Definition: vtkH5PartReader.h:189
vtkH5PartReader::Disable
void Disable(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
vtkH5PartReader::GetPointArrayStatus
int GetPointArrayStatus(const char *name)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
vtkH5PartReader::vtkH5PartReader
vtkH5PartReader()
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkH5PartReader::SetPointArrayStatusArrayStatus
void SetPointArrayStatusArrayStatus(const char *name, int status)
An H5Part file may contain multiple arrays a GUI (eg Paraview) can provide a mechanism for selecting ...
Definition: vtkH5PartReader.h:154
vtkH5PartReader::CloseFile
void CloseFile()
vtkH5PartReader::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:42