VTK  9.4.20251007
vtkUniformGridAMR.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
12
13#ifndef vtkUniformGridAMR_h
14#define vtkUniformGridAMR_h
15
16#include "vtkCommonDataModelModule.h" // For export macro
17#include "vtkCompositeDataSet.h"
18#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
19
20VTK_ABI_NAMESPACE_BEGIN
22class vtkUniformGrid;
25
26class VTKCOMMONDATAMODEL_EXPORT vtkUniformGridAMR : public vtkCompositeDataSet
27{
28public:
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
37
41 int GetDataObjectType() override { return VTK_UNIFORM_GRID_AMR; }
42
46 void Initialize() override;
47
51 virtual void Initialize(int numLevels, const int* blocksPerLevel);
52
57 void SetGridDescription(int gridDescription);
59
63 unsigned int GetNumberOfLevels();
64
68 virtual unsigned int GetTotalNumberOfBlocks();
69
73 unsigned int GetNumberOfDataSets(unsigned int level);
74
76
79 void GetBounds(double bounds[6]);
80 const double* GetBounds();
81 void GetMin(double min[3]);
82 void GetMax(double max[3]);
84
88 void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
89
94 virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid* grid);
95
96 // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
98
103
107 vtkUniformGrid* GetDataSet(unsigned int level, unsigned int idx);
108
113 int GetCompositeIndex(unsigned int level, unsigned int index);
114
119 void GetLevelAndIndex(unsigned int compositeIdx, unsigned int& level, unsigned int& idx);
120
122
126 void ShallowCopy(vtkDataObject* src) override;
128
132 VTK_DEPRECATED_IN_9_3_0("Please use ShallowCopy instead.")
134
138 void DeepCopy(vtkDataObject* src) override;
139
144
146
152
153protected:
155 ~vtkUniformGridAMR() override;
156
157 double Bounds[6];
158
160
163 vtkGetObjectMacro(AMRData, vtkAMRDataInternals);
166
168
170
173 vtkGetObjectMacro(AMRInfo, vtkAMRInformation);
176
178
179private:
180 vtkUniformGridAMR(const vtkUniformGridAMR&) = delete;
181 void operator=(const vtkUniformGridAMR&) = delete;
182
184};
185
186VTK_ABI_NAMESPACE_END
187#endif
container of vtkUniformGrid for an AMR data set
Meta data that describes the structure of an AMR data set.
superclass for composite data iterators
virtual vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter)=0
Returns the dataset located at the position pointed by the iterator.
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
void GetMin(double min[3])
Get the (min/max) bounds of the AMR domain.
vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter) override
Get the data set pointed to by iter.
virtual void SetAMRData(vtkAMRDataInternals *)
Get/Set the meta AMR meta data.
virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid *grid)
At the passed in level, set grid as the idx'th block at that level.
vtkAMRDataInternals * AMRData
static vtkUniformGridAMR * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
void ShallowCopy(vtkDataObject *src) override
ShallowCopy.
void GetLevelAndIndex(unsigned int compositeIdx, unsigned int &level, unsigned int &idx)
Given the compositeIdx (as set by SetCompositeIdx) this method returns the corresponding level and da...
virtual void Initialize(int numLevels, const int *blocksPerLevel)
Initialize the AMR with a specified number of levels and the blocks per level.
unsigned int GetNumberOfLevels()
Get number of levels.
void GetMax(double max[3])
Get the (min/max) bounds of the AMR domain.
void DeepCopy(vtkDataObject *src) override
DeepCopy.
int GetDataObjectType() override
Return class name of data type (see vtkType.h for definitions).
void Initialize() override
Restore data object to initial state.
void CompositeShallowCopy(vtkCompositeDataSet *src) override
ShallowCopy.
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by the user).
void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj) override
Overriding superclass method.
vtkUniformGrid * GetDataSet(unsigned int level, unsigned int idx)
Get the data set using the (level, index) pair.
void GetBounds(double bounds[6])
Get the (min/max) bounds of the AMR domain.
unsigned int GetNumberOfDataSets(unsigned int level)
Get the number of datasets at the given level, including null blocks.
static vtkUniformGridAMR * New()
void CopyStructure(vtkCompositeDataSet *src) override
CopyStructure.
const double * GetBounds()
Get the (min/max) bounds of the AMR domain.
void RecursiveShallowCopy(vtkDataObject *src) override
Deprecated RecursiveShallowCopy method, uses ShallowCopy.
virtual void SetAMRInfo(vtkAMRInformation *)
Get/Set the meta AMR meta info.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAMRInformation * AMRInfo
void SetGridDescription(int gridDescription)
Set/Get the data description of this uniform grid instance, e.g.
virtual unsigned int GetTotalNumberOfBlocks()
Get the total number of blocks, including nullptr blocks.
friend class vtkUniformGridAMRDataIterator
int GetCompositeIndex(unsigned int level, unsigned int index)
Retrieves the composite index associated with the data at the given (level,index) pair.
image data with blanking
#define VTK_DEPRECATED_IN_9_3_0(reason)
#define VTK_UNIFORM_GRID_AMR
Definition vtkType.h:94
#define VTK_NEWINSTANCE
#define max(a, b)