VTK  9.5.20251029
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 void PrintSelf(ostream& os, vtkIndent indent) override;
102
104
107 void SetOrigin(const double origin[3]);
108 double* GetOrigin();
110
112
124 void SetSpacing(unsigned int level, const double spacing[3]);
125 void GetSpacing(unsigned int level, double spacing[3]);
127
129
133 void SetAMRBox(unsigned int level, unsigned int id, const vtkAMRBox& box);
134 const vtkAMRBox& GetAMRBox(unsigned int level, unsigned int id);
136
137 using Superclass::SetDataSet;
141 void SetDataSet(unsigned int level, unsigned int idx, vtkDataSet* grid) override;
142
143 using Superclass::GetBounds;
148 const double* GetBounds() override;
149
154 void GetBounds(unsigned int level, unsigned int id, double bb[6]);
155
159 void GetOrigin(unsigned int level, unsigned int id, double origin[3]);
160
162
167 {
168 // VTK_DEPRECATED_IN_9_6_0:
169 // We cannot use Superclass directly because this method is deprecated
170 // When removing deprecated code, please Remove this command and replace
171 // `vtkAMRDataObject` by `Superclass` in the line below.
173 }
175 {
176 // VTK_DEPRECATED_IN_9_6_0:
177 // We cannot use Superclass directly because this method is deprecated
178 // When removing deprecated code, please Remove this command and replace
179 // `vtkAMRDataObject` by `Superclass` in the line below.
181 }
182
191 void SetRefinementRatio(unsigned int level, int refRatio);
192
196 int GetRefinementRatio(unsigned int level);
197
199
204 void SetAMRBlockSourceIndex(unsigned int level, unsigned int id, int sourceId);
205 int GetAMRBlockSourceIndex(unsigned int level, unsigned int id);
207
213
218
224
230 unsigned int* GetParents(unsigned int level, unsigned int index, unsigned int& numParents);
231
237 unsigned int* GetChildren(unsigned int level, unsigned int index, unsigned int& numChildren);
238
242 void PrintParentChildInfo(unsigned int level, unsigned int index);
243
247 bool FindGrid(double q[3], unsigned int& level, unsigned int& gridId);
248
252 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use CheckValidity")
253 void Audit();
254
261 [[nodiscard]] bool CheckValidity();
262
267 [[nodiscard]] vtkOverlappingAMRMetaData* GetOverlappingAMRMetaData();
268
274 "This function is deprecated, use GetAMRMetaData() or GetOverlappingAMRMetaData()")
275 vtkOverlappingAMRMetaData* GetAMRInfo() override { return this->GetOverlappingAMRMetaData(); }
276 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use SetAMRMetaData()")
277 void SetAMRInfo(vtkOverlappingAMRMetaData* info) override;
278
279protected:
281 ~vtkOverlappingAMR() override;
282
286 void InstantiateMetaData() override;
287
288private:
289 vtkOverlappingAMR(const vtkOverlappingAMR&) = delete;
290 void operator=(const vtkOverlappingAMR&) = delete;
291};
292
293VTK_ABI_NAMESPACE_END
294#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:166
a simple class to control print indentation
Definition vtkIndent.h:108
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 PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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:144