VTK  9.3.1
vtkAMREnzoReaderInternal.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) 2000 - 2009, Lawrence Livermore National Security, LLC
3 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkAMREnzoReaderInternal_h
18 #define vtkAMREnzoReaderInternal_h
19 
20 #include "vtkABINamespace.h"
21 
22 #include "vtksys/SystemTools.hxx"
23 
24 #include <cassert> // for assert()
25 #include <string> // for STL string
26 #include <vector> // for STL vector
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkDataArray;
30 class vtkDataSet;
31 static std::string GetEnzoDirectory(const char* path)
32 {
33  return (vtksys::SystemTools::GetFilenamePath(std::string(path)));
34 }
35 
36 // ----------------------------------------------------------------------------
37 // Class vtkEnzoReaderBlock (begin)
38 // ----------------------------------------------------------------------------
39 
41 {
42 public:
43  vtkEnzoReaderBlock() { this->Init(); }
44  ~vtkEnzoReaderBlock() { this->Init(); }
45  vtkEnzoReaderBlock(const vtkEnzoReaderBlock& other) { this->DeepCopy(&other); }
47  {
48  this->DeepCopy(&other);
49  return *this;
50  }
51 
52  int Index;
53  int Level;
54  int ParentId;
55  std::vector<int> ChildrenIds;
56 
61 
66 
67  double MinBounds[3];
68  double MaxBounds[3];
69  double SubdivisionRatio[3];
70 
73 
74  void Init();
75  void DeepCopy(const vtkEnzoReaderBlock* other);
76  void GetParentWiseIds(std::vector<vtkEnzoReaderBlock>& blocks);
77  void GetLevelBasedIds(std::vector<vtkEnzoReaderBlock>& blocks);
78 };
79 
80 // ----------------------------------------------------------------------------
81 // Class vtkEnzoReaderBlock ( end )
82 // ----------------------------------------------------------------------------
83 
84 // ----------------------------------------------------------------------------
85 // Class vtkEnzoReaderInternal (begin)
86 // ----------------------------------------------------------------------------
87 
89 {
90 public:
93 
94  // number of all vtkDataSet (vtkImageData / vtkRectilinearGrid / vtkPolyData)
95  // objects that have been SUCCESSFULLY extracted and inserted to the output
96  // vtkMultiBlockDataSet (including rectilinear blocks and particle sets)
98 
104  char* FileName;
105  double DataTime;
107  // vtkAMREnzoReader * TheReader;
108 
113  std::vector<std::string> BlockAttributeNames;
114  std::vector<std::string> ParticleAttributeNames;
115  std::vector<std::string> TracerParticleAttributeNames;
116  std::vector<vtkEnzoReaderBlock> Blocks;
117 
118  void Init();
119  void ReleaseDataArray();
120  void SetFileName(char* fileName) { this->FileName = fileName; }
121  void ReadMetaData();
122  void GetAttributeNames();
123  void CheckAttributeNames();
124  void ReadBlockStructures();
125  void ReadGeneralParameters();
127  int LoadAttribute(const char* attribute, int blockIdx);
128  int GetBlockAttribute(const char* attribute, int blockIdx, vtkDataSet* pDataSet);
129  std::string GetBaseDirectory(const char* path) { return GetEnzoDirectory(path); }
130 };
131 
132 // ----------------------------------------------------------------------------
133 // Class vtkEnzoReaderInternal ( end )
134 // ----------------------------------------------------------------------------
135 
136 VTK_ABI_NAMESPACE_END
137 #endif /* vtkAMREnzoReaderInternal_h */
138 // VTK-HeaderTest-Exclude: vtkAMREnzoReaderInternal.h
std::vector< int > ChildrenIds
std::vector< std::string > ParticleAttributeNames
vtkEnzoReaderBlock(const vtkEnzoReaderBlock &other)
std::string GetBaseDirectory(const char *path)
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
std::vector< vtkEnzoReaderBlock > Blocks
std::vector< std::string > TracerParticleAttributeNames
void GetLevelBasedIds(std::vector< vtkEnzoReaderBlock > &blocks)
void SetFileName(char *fileName)
void DeepCopy(const vtkEnzoReaderBlock *other)
vtkEnzoReaderBlock & operator=(const vtkEnzoReaderBlock &other)
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
int GetBlockAttribute(const char *attribute, int blockIdx, vtkDataSet *pDataSet)
int LoadAttribute(const char *attribute, int blockIdx)
void GetParentWiseIds(std::vector< vtkEnzoReaderBlock > &blocks)
static std::string GetEnzoDirectory(const char *path)
std::vector< std::string > BlockAttributeNames