VTK  9.3.20240423
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
28VTK_ABI_NAMESPACE_BEGIN
29class vtkDataArray;
30class vtkDataSet;
31static 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{
42public:
43 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;
55 std::vector<int> ChildrenIds;
56
61
66
67 double MinBounds[3];
68 double MaxBounds[3];
70
71 std::string BlockFileName;
72 std::string ParticleFileName;
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{
90public:
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
109 std::string DirectoryName;
110 std::string MajorFileName;
111 std::string BoundaryFileName;
112 std::string HierarchyFileName;
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();
120 void SetFileName(char* fileName) { this->FileName = fileName; }
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
136VTK_ABI_NAMESPACE_END
137#endif /* vtkAMREnzoReaderInternal_h */
138// VTK-HeaderTest-Exclude: vtkAMREnzoReaderInternal.h
abstract superclass for arrays of numeric data
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
vtkEnzoReaderBlock & operator=(const vtkEnzoReaderBlock &other)
void GetParentWiseIds(std::vector< vtkEnzoReaderBlock > &blocks)
void DeepCopy(const vtkEnzoReaderBlock *other)
std::vector< int > ChildrenIds
void GetLevelBasedIds(std::vector< vtkEnzoReaderBlock > &blocks)
vtkEnzoReaderBlock(const vtkEnzoReaderBlock &other)
std::string GetBaseDirectory(const char *path)
std::vector< std::string > BlockAttributeNames
std::vector< std::string > TracerParticleAttributeNames
int LoadAttribute(const char *attribute, int blockIdx)
void SetFileName(char *fileName)
int GetBlockAttribute(const char *attribute, int blockIdx, vtkDataSet *pDataSet)
std::vector< vtkEnzoReaderBlock > Blocks
std::vector< std::string > ParticleAttributeNames
static std::string GetEnzoDirectory(const char *path)