VTK  9.5.20250929
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
77#ifndef vtkOverlappingAMR_h
78#define vtkOverlappingAMR_h
79
80#include "vtkAMRBox.h" // For vtkAMRBox
81#include "vtkCommonDataModelModule.h" // For export macro
82#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_6_0
83#include "vtkUniformGridAMR.h"
84
85VTK_ABI_NAMESPACE_BEGIN
86class vtkAMRBox;
90
91class VTKCOMMONDATAMODEL_EXPORT vtkOverlappingAMR : public vtkUniformGridAMR
92{
93public:
95
99 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_OVERLAPPING_AMR; }
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::SetDataSet;
140 void SetDataSet(unsigned int level, unsigned int idx, vtkDataSet* grid) override;
141
142 using Superclass::GetBounds;
147 const double* GetBounds() override;
148
153 void GetBounds(unsigned int level, unsigned int id, double bb[6]);
154
158 void GetOrigin(unsigned int level, unsigned int id, double origin[3]);
159
161
166 {
167 // VTK_DEPRECATED_IN_9_6_0:
168 // We cannot use Superclass directly because this method is deprecated
169 // When removing deprecated code, please Remove this command and replace
170 // `vtkAMRDataObject` by `Superclass` in the line below.
172 }
174 {
175 // VTK_DEPRECATED_IN_9_6_0:
176 // We cannot use Superclass directly because this method is deprecated
177 // When removing deprecated code, please Remove this command and replace
178 // `vtkAMRDataObject` by `Superclass` in the line below.
180 }
181
190 void SetRefinementRatio(unsigned int level, int refRatio);
191
195 int GetRefinementRatio(unsigned int level);
196
198
203 void SetAMRBlockSourceIndex(unsigned int level, unsigned int id, int sourceId);
204 int GetAMRBlockSourceIndex(unsigned int level, unsigned int id);
206
212
217
223
229 unsigned int* GetParents(unsigned int level, unsigned int index, unsigned int& numParents);
230
236 unsigned int* GetChildren(unsigned int level, unsigned int index, unsigned int& numChildren);
237
241 void PrintParentChildInfo(unsigned int level, unsigned int index);
242
246 bool FindGrid(double q[3], unsigned int& level, unsigned int& gridId);
247
251 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use CheckValidity")
252 void Audit();
253
260 [[nodiscard]] bool CheckValidity();
261
266 [[nodiscard]] vtkOverlappingAMRMetaData* GetOverlappingAMRMetaData();
267
273 "This function is deprecated, use GetAMRMetaData() or GetOverlappingAMRMetaData()")
274 vtkOverlappingAMRMetaData* GetAMRInfo() override { return this->GetOverlappingAMRMetaData(); }
275 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use SetAMRMetaData()")
276 void SetAMRInfo(vtkOverlappingAMRMetaData* info) override;
277
278protected:
280 ~vtkOverlappingAMR() override;
281
285 void InstantiateMetaData() override;
286
287private:
288 vtkOverlappingAMR(const vtkOverlappingAMR&) = delete;
289 void operator=(const vtkOverlappingAMR&) = delete;
290};
291
292VTK_ABI_NAMESPACE_END
293#endif
Encloses a rectangular region of voxel like cells.
Definition vtkAMRBox.h:69
static vtkAMRDataObject * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
superclass for composite data iterators
abstract class to specify dataset behavior
Definition vtkDataSet.h:165
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 vtkCartesianGrid 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, SetDataSet should have been called on this specific l...
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 SetDataSet(unsigned int level, unsigned int idx, vtkDataSet *grid) override
Call Superclass::SetDataSet then set bounds on the provided level and idx.
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.
Legacy, empty shell inheriting vtkAMRDataObject.
#define VTK_DEPRECATED_IN_9_6_0(reason)
@ VTK_OVERLAPPING_AMR
Definition vtkType.h:111