VTK  9.3.0
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
31 #ifndef vtkOverlappingAMR_h
32 #define vtkOverlappingAMR_h
33 
34 #include "vtkCommonDataModelModule.h" // For export macro
35 #include "vtkUniformGridAMR.h"
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 class vtkAMRBox;
40 class vtkUniformGrid;
41 class vtkAMRInformation;
43 
44 class VTKCOMMONDATAMODEL_EXPORT vtkOverlappingAMR : public vtkUniformGridAMR
45 {
46 public:
48 
52  int GetDataObjectType() override { return VTK_OVERLAPPING_AMR; }
53 
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
61 
63 
66  void SetOrigin(const double origin[3]);
67  double* GetOrigin();
69 
71 
74  void SetSpacing(unsigned int level, const double spacing[3]);
75  void GetSpacing(unsigned int level, double spacing[3]);
77 
79 
82  void SetAMRBox(unsigned int level, unsigned int id, const vtkAMRBox& box);
83  const vtkAMRBox& GetAMRBox(unsigned int level, unsigned int id);
85 
89  void GetBounds(unsigned int level, unsigned int id, double bb[6]);
90 
94  void GetOrigin(unsigned int level, unsigned int id, double origin[3]);
95 
97 
102  {
104  }
106  {
108  }
109 
118  void SetRefinementRatio(unsigned int level, int refRatio);
119 
123  int GetRefinementRatio(unsigned int level);
124 
126 
130  void SetAMRBlockSourceIndex(unsigned int level, unsigned int id, int sourceId);
131  int GetAMRBlockSourceIndex(unsigned int level, unsigned int id);
133 
138 
143 
149 
155  unsigned int* GetParents(unsigned int level, unsigned int index, unsigned int& numParents);
156 
162  unsigned int* GetChildren(unsigned int level, unsigned int index, unsigned int& numChildren);
163 
167  void PrintParentChildInfo(unsigned int level, unsigned int index);
168 
169  // Unhide superclass method
170  void GetBounds(double b[6]) { Superclass::GetBounds(b); }
171 
175  bool FindGrid(double q[3], unsigned int& level, unsigned int& gridId);
176 
180  vtkAMRInformation* GetAMRInfo() override { return Superclass::GetAMRInfo(); }
181  void SetAMRInfo(vtkAMRInformation* info) override { return Superclass::SetAMRInfo(info); }
182 
184 
189  void Audit();
190 
191 protected:
193  ~vtkOverlappingAMR() override;
195 
196 private:
197  vtkOverlappingAMR(const vtkOverlappingAMR&) = delete;
198  void operator=(const vtkOverlappingAMR&) = delete;
199 };
200 
201 VTK_ABI_NAMESPACE_END
202 #endif
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:38
Meta data that describes the structure of an AMR data set.
superclass for composite data iterators
void GetBounds(double bounds[6])
Return the geometric bounding box in the form (xmin,xmax, ymin,ymax, zmin,zmax).
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for vtkIdType values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
hierarchical dataset of vtkUniformGrids
int GetRefinementRatio(unsigned int level)
Returns the refinement of a given level.
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by the user).
~vtkOverlappingAMR() override
Check whether the data set is internally consistent, e.g.
void SetAMRBox(unsigned int level, unsigned int id, const vtkAMRBox &box)
Set/Get the AMRBox for a given block.
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.
void GetBounds(double b[6])
bool HasChildrenInformation()
Return whether parent child information has been generated.
static vtkOverlappingAMR * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
void GetBounds(unsigned int level, unsigned int id, double bb[6])
Returns the bounding information of a data set.
unsigned int * GetParents(unsigned int level, unsigned int index, unsigned int &numParents)
Return a pointer to Parents of a block.
double * GetOrigin()
Get/Set the global origin of the amr data set.
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 SetAMRInfo(vtkAMRInformation *info) override
Get/Set the meta AMR meta info.
const vtkAMRBox & GetAMRBox(unsigned int level, unsigned int id)
Set/Get the AMRBox for a given block.
unsigned int * GetChildren(unsigned int level, unsigned int index, unsigned int &numChildren)
Return a pointer to Children of a block.
static vtkOverlappingAMR * SafeDownCast(vtkObjectBase *o)
int GetDataObjectType() override
Return class name of data type (see vtkType.h for definitions).
void SetSpacing(unsigned int level, const double spacing[3])
Get/Set the grid spacing at a given level.
static vtkOverlappingAMR * GetData(vtkInformationVector *v, int i=0)
vtkAMRInformation * GetAMRInfo() override
Get/Set the internal representation of amr meta meta data.
void GetOrigin(unsigned int level, unsigned int id, double origin[3])
Returns the origin of an AMR block.
static vtkOverlappingAMR * New()
void SetRefinementRatio(unsigned int level, int refRatio)
Sets the refinement of a given level.
static vtkInformationIdTypeKey * NUMBER_OF_BLANKED_POINTS()
void Audit()
Check whether the data set is internally consistent, e.g.
void SetOrigin(const double origin[3])
Get/Set the global origin of the amr data set.
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...
vtkOverlappingAMR()
Check whether the data set is internally consistent, e.g.
a concrete implementation of vtkCompositeDataSet
image data with blanking
vtkSmartPointer< vtkDataArray > GetData(const Ioss::GroupingEntity *entity, const std::string &fieldname, Ioss::Transform *transform=nullptr, Cache *cache=nullptr, const std::string &cachekey=std::string())
Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity.
@ info
Definition: vtkX3D.h:376
@ level
Definition: vtkX3D.h:395
@ spacing
Definition: vtkX3D.h:481
@ index
Definition: vtkX3D.h:246
#define VTK_OVERLAPPING_AMR
Definition: vtkType.h:96
#define VTK_NEWINSTANCE