VTK  9.7.20260711
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 "vtkUniformGridAMR.h"
83
84VTK_ABI_NAMESPACE_BEGIN
85class vtkAMRBox;
89
90class VTKCOMMONDATAMODEL_EXPORT vtkOverlappingAMR : public vtkUniformGridAMR
91{
92public:
94
98 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_OVERLAPPING_AMR; }
100 void PrintSelf(ostream& os, vtkIndent indent) override;
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
140 void SetDataSet(unsigned int level, unsigned int idx, vtkDataSet* grid) override;
141
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
169
177
186 void SetRefinementRatio(unsigned int level, int refRatio);
187
191 int GetRefinementRatio(unsigned int level);
192
194
199 void SetAMRBlockSourceIndex(unsigned int level, unsigned int id, int sourceId);
200 int GetAMRBlockSourceIndex(unsigned int level, unsigned int id);
202
208
213
219
225 unsigned int* GetParents(unsigned int level, unsigned int index, unsigned int& numParents);
226
232 unsigned int* GetChildren(unsigned int level, unsigned int index, unsigned int& numChildren);
233
237 void PrintParentChildInfo(unsigned int level, unsigned int index);
238
242 bool FindGrid(double q[3], unsigned int& level, unsigned int& gridId);
243
250 [[nodiscard]] bool CheckValidity();
251
257
258protected:
261
265 void InstantiateMetaData() override;
266
267private:
268 vtkOverlappingAMR(const vtkOverlappingAMR&) = delete;
269 void operator=(const vtkOverlappingAMR&) = delete;
270};
271
272VTK_ABI_NAMESPACE_END
273#endif
Encloses a rectangular region of voxel like cells.
Definition vtkAMRBox.h:69
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:165
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.
static vtkOverlappingAMR * New()
static vtkInformationIdTypeKey * NUMBER_OF_BLANKED_POINTS()
static vtkOverlappingAMR * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information vector and index.
int GetRefinementRatio(unsigned int level)
Returns the refinement of a given level or -1 if metadata is invalid.
~vtkOverlappingAMR() override
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 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.
@ VTK_OVERLAPPING_AMR
Definition vtkType.h:140