VTK  9.6.1
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
38#ifndef vtkOverlappingAMR_h
39#define vtkOverlappingAMR_h
40
41#include "vtkAMRBox.h" // For vtkAMRBox
42#include "vtkCommonDataModelModule.h" // For export macro
43#include "vtkDeprecation.h" // for VTK_DEPRECATED_IN_9_6_0
44#include "vtkUniformGridAMR.h"
45
46VTK_ABI_NAMESPACE_BEGIN
47class vtkAMRBox;
51
52class VTKCOMMONDATAMODEL_EXPORT vtkOverlappingAMR : public vtkUniformGridAMR
53{
54public:
56
60 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_OVERLAPPING_AMR; }
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
65
68 void SetOrigin(const double origin[3]);
69 double* GetOrigin();
71
73
85 void SetSpacing(unsigned int level, const double spacing[3]);
86 void GetSpacing(unsigned int level, double spacing[3]);
88
90
94 void SetAMRBox(unsigned int level, unsigned int id, const vtkAMRBox& box);
95 const vtkAMRBox& GetAMRBox(unsigned int level, unsigned int id);
97
102 void SetDataSet(unsigned int level, unsigned int idx, vtkDataSet* grid) override;
103
109 const double* GetBounds() override;
110
115 void GetBounds(unsigned int level, unsigned int id, double bb[6]);
116
120 void GetOrigin(unsigned int level, unsigned int id, double origin[3]);
121
123
128 {
129 // VTK_DEPRECATED_IN_9_6_0:
130 // We cannot use Superclass directly because this method is deprecated
131 // When removing deprecated code, please Remove this command and replace
132 // `vtkAMRDataObject` by `Superclass` in the line below.
134 }
136 {
137 // VTK_DEPRECATED_IN_9_6_0:
138 // We cannot use Superclass directly because this method is deprecated
139 // When removing deprecated code, please Remove this command and replace
140 // `vtkAMRDataObject` by `Superclass` in the line below.
142 }
143
152 void SetRefinementRatio(unsigned int level, int refRatio);
153
157 int GetRefinementRatio(unsigned int level);
158
160
165 void SetAMRBlockSourceIndex(unsigned int level, unsigned int id, int sourceId);
166 int GetAMRBlockSourceIndex(unsigned int level, unsigned int id);
168
174
179
185
191 unsigned int* GetParents(unsigned int level, unsigned int index, unsigned int& numParents);
192
198 unsigned int* GetChildren(unsigned int level, unsigned int index, unsigned int& numChildren);
199
203 void PrintParentChildInfo(unsigned int level, unsigned int index);
204
208 bool FindGrid(double q[3], unsigned int& level, unsigned int& gridId);
209
213 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use CheckValidity")
214 void Audit();
215
222 [[nodiscard]] bool CheckValidity();
223
229
235 "This function is deprecated, use GetAMRMetaData() or GetOverlappingAMRMetaData()")
236 vtkOverlappingAMRMetaData* GetAMRInfo() override { return this->GetOverlappingAMRMetaData(); }
237 VTK_DEPRECATED_IN_9_6_0("This function is deprecated, use SetAMRMetaData()")
239
240protected:
242 ~vtkOverlappingAMR() override;
243
247 void InstantiateMetaData() override;
248
249private:
250 vtkOverlappingAMR(const vtkOverlappingAMR&) = delete;
251 void operator=(const vtkOverlappingAMR&) = delete;
252};
253
254VTK_ABI_NAMESPACE_END
255#endif
Encloses a rectangular region of voxel like cells.
Definition vtkAMRBox.h:30
virtual void SetDataSet(unsigned int level, unsigned int idx, vtkDataSet *grid)
At the passed in level, set grid as the idx'th block at that level.
static vtkAMRDataObject * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
void GetBounds(double bounds[6])
Get the (min/max) bounds of the AMR domain.
superclass for composite data iterators
abstract class to specify dataset behavior
Definition vtkDataSet.h:57
a simple class to control print indentation
Definition vtkIndent.h:29
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.
static vtkOverlappingAMR * New()
static vtkInformationIdTypeKey * NUMBER_OF_BLANKED_POINTS()
static vtkOverlappingAMR * GetData(vtkInformationVector *v, int i=0)
vtkOverlappingAMRMetaData * GetAMRInfo() override
Get/Set the AMR meta data Deprecated, use Get/SetAMRMetaData or GetOverlappingAMRMetaData.
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 InstantiateMetaData() override
Create and set a new vtkOverlappingAMRMetaData as AMRMetaData.
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...
vtkOverlappingAMRMetaData * GetOverlappingAMRMetaData()
Convenience getter that get superclass MetaData and cast it to vtkOverlappingAMRMetaDat.
bool CheckValidity()
Check whether the data set is internally consistent, e.g.
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 Audit()
Deprecated, forward to CheckValidity.
void SetAMRInfo(vtkOverlappingAMRMetaData *info) override
Noop and deprecated, use GetAMRData/SetAMRMetaData instead.
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.
#define VTK_DEPRECATED_IN_9_6_0(reason)
@ VTK_OVERLAPPING_AMR
Definition vtkType.h:144