VTK  9.2.6
vtkUniformGridAMR.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkUniformGridAMR.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #ifndef vtkUniformGridAMR_h
26 #define vtkUniformGridAMR_h
27 
28 #include "vtkCommonDataModelModule.h" // For export macro
29 #include "vtkCompositeDataSet.h"
30 
32 class vtkUniformGrid;
33 class vtkAMRInformation;
35 
36 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGridAMR : public vtkCompositeDataSet
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
47 
51  int GetDataObjectType() override { return VTK_UNIFORM_GRID_AMR; }
52 
56  void Initialize() override;
57 
61  virtual void Initialize(int numLevels, const int* blocksPerLevel);
62 
67  void SetGridDescription(int gridDescription);
69 
73  unsigned int GetNumberOfLevels();
74 
78  virtual unsigned int GetTotalNumberOfBlocks();
79 
83  unsigned int GetNumberOfDataSets(const unsigned int level);
84 
86 
89  void GetBounds(double bounds[6]);
90  const double* GetBounds();
91  void GetMin(double min[3]);
92  void GetMax(double max[3]);
94 
98  void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
99 
104  virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid* grid);
105 
106  // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
107  using Superclass::GetDataSet;
108 
113 
117  vtkUniformGrid* GetDataSet(unsigned int level, unsigned int idx);
118 
123  int GetCompositeIndex(const unsigned int level, const unsigned int index);
124 
129  void GetLevelAndIndex(const unsigned int compositeIdx, unsigned int& level, unsigned int& idx);
130 
132 
135  void ShallowCopy(vtkDataObject* src) override;
136  void RecursiveShallowCopy(vtkDataObject* src) override;
138 
142  void DeepCopy(vtkDataObject* src) override;
143 
147  void CopyStructure(vtkCompositeDataSet* src) override;
148 
150 
156 
157 protected:
159  ~vtkUniformGridAMR() override;
160 
161  double Bounds[6];
162 
166  vtkGetObjectMacro(AMRData, vtkAMRDataInternals);
167 
169 
171 
174  vtkGetObjectMacro(AMRInfo, vtkAMRInformation);
177 
179 
180 private:
181  vtkUniformGridAMR(const vtkUniformGridAMR&) = delete;
182  void operator=(const vtkUniformGridAMR&) = delete;
183 
185 };
186 
187 #endif
container of vtkUniformGrid for an AMR data set
Meta data that describes the structure of an AMR data set.
superclass for composite data iterators
abstract superclass for composite (multi-block or AMR) datasets
general representation of visualization data
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
subclass of vtkCompositeDataIterator with API to get current level and dataset index.
a concrete implementation of vtkCompositeDataSet
void GetMin(double min[3])
Get the (min/max) bounds of the AMR domain.
void GetLevelAndIndex(const unsigned int compositeIdx, unsigned int &level, unsigned int &idx)
Given the compositeIdx (as set by SetCompositeIdx) this method returns the corresponding level and da...
vtkUniformGrid * GetDataSet(unsigned int level, unsigned int idx)
Get the data set using the (level, index) pair.
virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid *grid)
At the passed in level, set grid as the idx'th block at that level.
vtkAMRDataInternals * AMRData
void ShallowCopy(vtkDataObject *src) override
ShallowCopy.
static vtkUniformGridAMR * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter) override
Get the data set pointed to by iter.
unsigned int GetNumberOfDataSets(const unsigned int level)
Get the number of datasets at the given level, including null blocks.
static vtkUniformGridAMR * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
virtual void Initialize(int numLevels, const int *blocksPerLevel)
Initialize the AMR with a specified number of levels and the blocks per level.
unsigned int GetNumberOfLevels()
Get number of levels.
void GetMax(double max[3])
Get the (min/max) bounds of the AMR domain.
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by the user).
void DeepCopy(vtkDataObject *src) override
DeepCopy.
int GetDataObjectType() override
Return class name of data type (see vtkType.h for definitions).
void Initialize() override
Restore data object to initial state.
const double * GetBounds()
Get the (min/max) bounds of the AMR domain.
void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj) override
Overriding superclass method.
static vtkUniformGridAMR * New()
void GetBounds(double bounds[6])
Get the (min/max) bounds of the AMR domain.
void CopyStructure(vtkCompositeDataSet *src) override
CopyStructure.
void RecursiveShallowCopy(vtkDataObject *src) override
ShallowCopy.
virtual void SetAMRInfo(vtkAMRInformation *)
Get/Set the meta AMR meta info.
~vtkUniformGridAMR() override
int GetCompositeIndex(const unsigned int level, const unsigned int index)
Retrieves the composite index associated with the data at the given (level,index) pair.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAMRInformation * AMRInfo
void SetGridDescription(int gridDescription)
Set/Get the data description of this uniform grid instance, e.g.
virtual unsigned int GetTotalNumberOfBlocks()
Get the total number of blocks, including nullptr blocks.
image data with blanking
@ info
Definition: vtkX3D.h:382
@ level
Definition: vtkX3D.h:401
@ index
Definition: vtkX3D.h:252
#define VTK_UNIFORM_GRID_AMR
Definition: vtkType.h:106
#define VTK_NEWINSTANCE
#define max(a, b)