VTK  9.2.6
H5RageAdaptor.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: H5RageAdaptor.h
5
6 Copyright (c) Kitware, Inc.
7 All rights reserved.
8 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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#ifndef H5RageAdaptor_h
16#define H5RageAdaptor_h
17
19#include "vtkIOH5RageModule.h" // For export macro
20
21#include <cstdint> // for std::int64_t
22#include <string> // for std::string
23#include <vector> // for std::vector
24
26class vtkImageData;
28
29class VTKIOH5RAGE_EXPORT H5RageAdaptor
30{
31public:
34
35 int InitializeGlobal(const char* DescFile);
36 void LoadVariableData(vtkImageData* data, int timeStep, vtkDataArraySelection* cellSelection);
37 template <class T>
38 void ConvertHDFData(int ndims, int* dims_out, T* hdfData);
39
40 int GetNumberOfTimeSteps() { return this->NumberOfTimeSteps; }
41 double GetTimeStep(int step) { return this->TimeSteps[step]; }
42
43 int GetNumberOfVariables() { return (int)this->VariableName.size(); }
44 const char* GetVariableName(int indx) { return this->VariableName[indx].c_str(); }
45
46 int GetWholeExtent(int ext) { return this->WholeExtent[ext]; }
47 int GetSubExtent(int ext) { return this->SubExtent[ext]; }
48 int GetDimension(int dim) { return this->Dimension[dim]; }
49 double GetOrigin(int dim) { return this->Origin[dim]; }
50 double GetSpacing(int dim) { return this->Spacing[dim]; }
51
52protected:
53 // Collect the metadata
54 int CollectMetaData(const char* H5RageFileName);
55 int ParseH5RageFile(const char* H5RageFileName);
56 std::string TrimString(const std::string& str);
57
58 // Used in parallel reader and load balancing
60 int Rank;
62
63 // Time series of hdf files
64 std::vector<std::string> HdfFileName; // all hdf files
65
66 // Time step information retrieved from hdf filenames
68 double* TimeSteps;
69
70 // Geometry information for sharing data with other processors
73
74 int WholeExtent[6]; // Size of image
75 int SubExtent[6]; // Size of image this processor
76 int Dimension[3]; // Dimension of image
77 double Origin[3]; // Physical origin
78 double Spacing[3]; // Physical spacing
79
81 int64_t TotalTuples;
83
84 // Variable information retrieved from hdf filenames
86 std::vector<std::string> VariableName;
87};
88
89#endif
90
91// VTK-HeaderTest-Exclude: H5RageAdaptor.h
int ** ExtentSchedule
void LoadVariableData(vtkImageData *data, int timeStep, vtkDataArraySelection *cellSelection)
int GetWholeExtent(int ext)
double * TimeSteps
int GetNumberOfTimeSteps()
std::vector< std::string > HdfFileName
int GetSubExtent(int ext)
std::vector< std::string > VariableName
int CollectMetaData(const char *H5RageFileName)
std::string TrimString(const std::string &str)
int64_t TotalTuples
const char * GetVariableName(int indx)
int ParseH5RageFile(const char *H5RageFileName)
int GetNumberOfVariables()
int InitializeGlobal(const char *DescFile)
int64_t * NumberOfTuples
double GetOrigin(int dim)
H5RageAdaptor(vtkMultiProcessController *ctrl)
double GetSpacing(int dim)
vtkMultiProcessController * Controller
double GetTimeStep(int step)
void ConvertHDFData(int ndims, int *dims_out, T *hdfData)
int GetDimension(int dim)
Store on/off settings for data arrays, etc.
topologically and geometrically regular array of data
Multiprocessing communication superclass.