VTK  9.5.20250718
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
101
103
106 void SetOrigin(const double origin[3]);
107 double* GetOrigin();
109
111
123 void SetSpacing(unsigned int level, const double spacing[3]);
124 void GetSpacing(unsigned int level, double spacing[3]);
126
128
132 void SetAMRBox(unsigned int level, unsigned int id, const vtkAMRBox& box);
133 const vtkAMRBox& GetAMRBox(unsigned int level, unsigned int id);
135
136 using Superclass::GetBounds;
137
142 const double* GetBounds() override;
143
147 void GetBounds(unsigned int level, unsigned int id, double bb[6]);
148
152 void GetOrigin(unsigned int level, unsigned int id, double origin[3]);
153
155
160 {
161 return vtkOverlappingAMR::SafeDownCast(Superclass::GetData(info));
162 }
164 {
165 return vtkOverlappingAMR::SafeDownCast(Superclass::GetData(v, i));
166 }
167
176 void SetRefinementRatio(unsigned int level, int refRatio);
177
181 int GetRefinementRatio(unsigned int level);
182
184
189 void SetAMRBlockSourceIndex(unsigned int level, unsigned int id, int sourceId);
190 int GetAMRBlockSourceIndex(unsigned int level, unsigned int id);
192
198
203
209
215 unsigned int* GetParents(unsigned int level, unsigned int index, unsigned int& numParents);
216
222 unsigned int* GetChildren(unsigned int level, unsigned int index, unsigned int& numChildren);
223
227 void PrintParentChildInfo(unsigned int level, unsigned int index);
228
232 bool FindGrid(double q[3], unsigned int& level, unsigned int& gridId);
233
237 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use CheckValidity")
238 void Audit();
239
246 [[nodiscard]] bool CheckValidity();
247
252 [[nodiscard]] vtkOverlappingAMRMetaData* GetOverlappingAMRMetaData();
253
259 "This function is deprecated, use GetAMRMetaData() or GetOverlappingAMRMetaData()")
260 vtkOverlappingAMRMetaData* GetAMRInfo() override { return this->GetOverlappingAMRMetaData(); }
261 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use SetAMRMetaData()")
262 void SetAMRInfo(vtkOverlappingAMRMetaData* info) override;
263
264protected:
266 ~vtkOverlappingAMR() override;
267
271 void InstantiateMetaData() override;
272
273private:
274 vtkOverlappingAMR(const vtkOverlappingAMR&) = delete;
275 void operator=(const vtkOverlappingAMR&) = delete;
276};
277
278VTK_ABI_NAMESPACE_END
279#endif
Encloses a rectangular region of voxel like cells.
Definition vtkAMRBox.h:68
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 is invalid.
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.
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by the user).
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
image data with blanking
#define VTK_DEPRECATED_IN_9_6_0(reason)
@ VTK_OVERLAPPING_AMR
Definition vtkType.h:111
#define VTK_NEWINSTANCE