VTK  9.5.20250817
vtkOverlappingAMR.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
71#ifndef vtkOverlappingAMR_h
72#define vtkOverlappingAMR_h
73
74#include "vtkAMRBox.h" // For vtkAMRBox
75#include "vtkCommonDataModelModule.h" // For export macro
76#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_6_0
77#include "vtkUniformGridAMR.h"
78
79VTK_ABI_NAMESPACE_BEGIN
80class vtkAMRBox;
82class vtkUniformGrid;
85
86class VTKCOMMONDATAMODEL_EXPORT vtkOverlappingAMR : public vtkUniformGridAMR
87{
88public:
90
94 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_OVERLAPPING_AMR; }
96
98
101 void SetOrigin(const double origin[3]);
102 double* GetOrigin();
104
106
118 void SetSpacing(unsigned int level, const double spacing[3]);
119 void GetSpacing(unsigned int level, double spacing[3]);
121
123
127 void SetAMRBox(unsigned int level, unsigned int id, const vtkAMRBox& box);
128 const vtkAMRBox& GetAMRBox(unsigned int level, unsigned int id);
130
131 using Superclass::GetBounds;
132
137 const double* GetBounds() override;
138
142 void GetBounds(unsigned int level, unsigned int id, double bb[6]);
143
147 void GetOrigin(unsigned int level, unsigned int id, double origin[3]);
148
150
155 {
156 return vtkOverlappingAMR::SafeDownCast(Superclass::GetData(info));
157 }
159 {
160 return vtkOverlappingAMR::SafeDownCast(Superclass::GetData(v, i));
161 }
162
171 void SetRefinementRatio(unsigned int level, int refRatio);
172
176 int GetRefinementRatio(unsigned int level);
177
179
184 void SetAMRBlockSourceIndex(unsigned int level, unsigned int id, int sourceId);
185 int GetAMRBlockSourceIndex(unsigned int level, unsigned int id);
187
193
198
204
210 unsigned int* GetParents(unsigned int level, unsigned int index, unsigned int& numParents);
211
217 unsigned int* GetChildren(unsigned int level, unsigned int index, unsigned int& numChildren);
218
222 void PrintParentChildInfo(unsigned int level, unsigned int index);
223
227 bool FindGrid(double q[3], unsigned int& level, unsigned int& gridId);
228
232 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use CheckValidity")
233 void Audit();
234
241 [[nodiscard]] bool CheckValidity();
242
247 [[nodiscard]] vtkOverlappingAMRMetaData* GetOverlappingAMRMetaData();
248
254 "This function is deprecated, use GetAMRMetaData() or GetOverlappingAMRMetaData()")
255 vtkOverlappingAMRMetaData* GetAMRInfo() override { return this->GetOverlappingAMRMetaData(); }
256 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use SetAMRMetaData()")
257 void SetAMRInfo(vtkOverlappingAMRMetaData* info) override;
258
259protected:
261 ~vtkOverlappingAMR() override;
262
266 void InstantiateMetaData() override;
267
268private:
269 vtkOverlappingAMR(const vtkOverlappingAMR&) = delete;
270 void operator=(const vtkOverlappingAMR&) = delete;
271};
272
273VTK_ABI_NAMESPACE_END
274#endif
Encloses a rectangular region of voxel like cells.
Definition vtkAMRBox.h:69
superclass for composite data iterators
Key for vtkIdType values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Meta data that describes the structure of an overlapping AMR data set.
a multi-resolution dataset based on vtkUniformGrid allowing overlaps
static vtkOverlappingAMR * New()
static vtkInformationIdTypeKey * NUMBER_OF_BLANKED_POINTS()
static vtkOverlappingAMR * GetData(vtkInformationVector *v, int i=0)
int GetRefinementRatio(unsigned int level)
Returns the refinement of a given level or -1 if metadata is invalid.
void SetAMRBox(unsigned int level, unsigned int id, const vtkAMRBox &box)
Set/Get the AMRBox for a given block May return invalid box in case of errors, check with vtkAMRBox::...
static vtkOverlappingAMR * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
void SetAMRBlockSourceIndex(unsigned int level, unsigned int id, int sourceId)
Set/Get the source id of a block.
int GetRefinementRatio(vtkCompositeDataIterator *iter)
Returns the refinement ratio for the position pointed by the iterator or -1 if refinement or iterator...
const vtkAMRBox & GetAMRBox(unsigned int level, unsigned int id)
Set/Get the AMRBox for a given block May return invalid box in case of errors, check with vtkAMRBox::...
bool HasChildrenInformation()
Return whether parent child information has been generated.
void GetBounds(unsigned int level, unsigned int id, double bb[6])
Returns the bounding information of a data set.
unsigned int * GetChildren(unsigned int level, unsigned int index, unsigned int &numChildren)
Return a pointer to Children of a block.
int GetDataObjectType() VTK_FUTURE_CONST override
Return class name of data type (see vtkType.h for definitions).
void GetSpacing(unsigned int level, double spacing[3])
Get/Set the grid spacing at a given level.
int GetAMRBlockSourceIndex(unsigned int level, unsigned int id)
Set/Get the source id of a block.
bool FindGrid(double q[3], unsigned int &level, unsigned int &gridId)
Given a point q, find the highest level grid that contains it.
void SetSpacing(unsigned int level, const double spacing[3])
Get/Set the grid spacing at a given level.
double * GetOrigin()
Get/Set the global origin of the amr data set.
const double * GetBounds() override
If AMRMetaData is set and superclass bounds are empty, return AMRMetaData::GetBounds,...
void GetOrigin(unsigned int level, unsigned int id, double origin[3])
Returns the origin of an AMR block.
void SetRefinementRatio(unsigned int level, int refRatio)
Sets the refinement of a given level.
void SetOrigin(const double origin[3])
Get/Set the global origin of the amr data set.
static vtkOverlappingAMR * SafeDownCast(vtkObjectBase *o)
void PrintParentChildInfo(unsigned int level, unsigned int index)
Prints the parents and children of a requested block (Debug Routine)
void GenerateParentChildInformation()
Generate the parent/child relationships - needed to be called before GetParents or GetChildren can be...
unsigned int * GetParents(unsigned int level, unsigned int index, unsigned int &numParents)
Return a pointer to Parents of a block.
a multi-resolution dataset based on vtkUniformGrid
Deprecated vtkImageData.
#define VTK_DEPRECATED_IN_9_6_0(reason)
@ VTK_OVERLAPPING_AMR
Definition vtkType.h:111