VTK  9.0.1
vtkUniformGridAMR.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHierarchicalBoxDataSet.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 =========================================================================*/
15 //
16 // .SECTION Description
17 // vtkUniformGridAMR is a concrete implementation of
18 // vtkCompositeDataSet. The dataset type is restricted to
19 // vtkUniformGrid.
20 
21 #ifndef vtkUniformGridAMR_h
22 #define vtkUniformGridAMR_h
23 
24 #include "vtkCommonDataModelModule.h" // For export macro
25 #include "vtkCompositeDataSet.h"
26 
28 class vtkUniformGrid;
29 class vtkAMRInformation;
31 
32 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGridAMR : public vtkCompositeDataSet
33 {
34 public:
37 
38  // Description:
39  // Return a new iterator (the iterator has to be deleted by the user).
41 
42  // Description:
43  // Return class name of data type (see vtkType.h for definitions).
44  int GetDataObjectType() override { return VTK_UNIFORM_GRID_AMR; }
45 
46  // Description: // Print internal states
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
49  // Description:
50  // Restore data object to initial
51  void Initialize() override;
52 
53  // Description:
54  // Initialize the AMR.
55  virtual void Initialize(int numLevels, const int* blocksPerLevel);
56 
57  // Description:
58  // Set/Get the data description of this uniform grid instance,
59  // e.g. VTK_XYZ_GRID
60  void SetGridDescription(int gridDescription);
62 
63  // Description:
64  // Return the number of levels
65  unsigned int GetNumberOfLevels();
66 
67  // Description:
68  // Return the total number of blocks, including nullptr blocks
69  virtual unsigned int GetTotalNumberOfBlocks();
70 
71  // Description:
72  // Returns the number of datasets at the given level, including null blocks
73  unsigned int GetNumberOfDataSets(const unsigned int level);
74 
75  // Description:
76  // Retrieve the bounds of the AMR domain
77  void GetBounds(double bounds[6]);
78  const double* GetBounds();
79  void GetMin(double min[3]);
80  void GetMax(double max[3]);
81 
82  // Description:
83  // Unhiding superclass method.
84  void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
85 
86  // Description:
87  // At the passed in level, set grid as the idx'th block at that level.
88  // idx must be less than the number of data sets at that level.
89  virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid* grid);
90 
91  // Description:
92  // Return the data set pointed to by iter
94 
95  // Description:
96  // Get the data set using the index pair
97  vtkUniformGrid* GetDataSet(unsigned int level, unsigned int idx);
98 
99  // Description:
100  // Retrieves the composite index associated with the data at the given
101  // (level,index) pair.
102  int GetCompositeIndex(const unsigned int level, const unsigned int index);
103 
104  // Description:
105  // Givenes the composite Idx (as set by SetCompositeIdx) this method returns the
106  // corresponding level and dataset index within the level.
107  void GetLevelAndIndex(const unsigned int compositeIdx, unsigned int& level, unsigned int& idx);
108 
109  // Description:
110  // Override ShallowCopy/DeepCopy and CopyStructure
111  void ShallowCopy(vtkDataObject* src) override;
112  void DeepCopy(vtkDataObject* src) override;
113  void CopyStructure(vtkCompositeDataSet* src) override;
114 
115  // Retrieve an instance of this class from an information object.
118 
119 protected:
121  ~vtkUniformGridAMR() override;
122 
123  // Description:
124  // Get/Set the meta AMR meta data
125  vtkGetObjectMacro(AMRData, vtkAMRDataInternals);
126 
129  double Bounds[6];
130 
131  // Description:
132  // Get/Set the meta AMR meta data
133  vtkGetObjectMacro(AMRInfo, vtkAMRInformation);
135 
136 private:
137  vtkUniformGridAMR(const vtkUniformGridAMR&) = delete;
138  void operator=(const vtkUniformGridAMR&) = delete;
139 
141 };
142 
143 #endif
vtkUniformGridAMR::GetGridDescription
int GetGridDescription()
vtkUniformGridAMR::GetCompositeIndex
int GetCompositeIndex(const unsigned int level, const unsigned int index)
vtkUniformGridAMR::AMRData
vtkAMRDataInternals * AMRData
Definition: vtkUniformGridAMR.h:128
vtkUniformGridAMR::New
static vtkUniformGridAMR * New()
vtkUniformGridAMR::ShallowCopy
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkAMRInformation
Meta data that describes the structure of an AMR data set.
Definition: vtkAMRInformation.h:48
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkUniformGridAMR::vtkUniformGridAMR
vtkUniformGridAMR()
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:35
vtkUniformGridAMR::Initialize
void Initialize() override
Restore data object to initial state,.
vtkUniformGridAMR::SetAMRInfo
virtual void SetAMRInfo(vtkAMRInformation *)
vtkCompositeDataSet
abstract superclass for composite (multi-block or AMR) datasets
Definition: vtkCompositeDataSet.h:46
vtkUniformGridAMR::GetBounds
void GetBounds(double bounds[6])
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:31
vtkUniformGridAMR::Initialize
virtual void Initialize(int numLevels, const int *blocksPerLevel)
vtkUniformGridAMR::GetNumberOfDataSets
unsigned int GetNumberOfDataSets(const unsigned int level)
vtkX3D::level
@ level
Definition: vtkX3D.h:401
vtkUniformGridAMRDataIterator
subclass of vtkCompositeDataIterator with API to get current level and dataset index.
Definition: vtkUniformGridAMRDataIterator.h:36
vtkUniformGridAMR::GetNumberOfLevels
unsigned int GetNumberOfLevels()
vtkUniformGridAMR::GetDataSet
vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter) override
Returns the dataset located at the positiong pointed by the iterator.
vtkCompositeDataIterator
superclass for composite data iterators
Definition: vtkCompositeDataIterator.h:36
vtkUniformGridAMR::CopyStructure
void CopyStructure(vtkCompositeDataSet *src) override
Copies the tree structure from the input.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkUniformGridAMR::GetMin
void GetMin(double min[3])
vtkUniformGridAMR::GetDataObjectType
int GetDataObjectType() override
Return class name of data type (see vtkType.h for definitions).
Definition: vtkUniformGridAMR.h:44
vtkUniformGridAMR::NewIterator
vtkCompositeDataIterator * NewIterator() override
Return a new iterator (the iterator has to be deleted by user).
vtkUniformGridAMR::GetMax
void GetMax(double max[3])
vtkUniformGridAMR::AMRInfo
vtkAMRInformation * AMRInfo
Definition: vtkUniformGridAMR.h:125
vtkUniformGridAMR::GetLevelAndIndex
void GetLevelAndIndex(const unsigned int compositeIdx, unsigned int &level, unsigned int &idx)
vtkUniformGridAMR::GetTotalNumberOfBlocks
virtual unsigned int GetTotalNumberOfBlocks()
vtkCompositeDataSet.h
vtkUniformGridAMR::DeepCopy
void DeepCopy(vtkDataObject *src) override
vtkUniformGridAMR::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkUniformGridAMR::SetDataSet
void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj) override
Sets the data set at the location pointed by the iterator.
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkUniformGridAMR::~vtkUniformGridAMR
~vtkUniformGridAMR() override
VTK_UNIFORM_GRID_AMR
#define VTK_UNIFORM_GRID_AMR
Definition: vtkType.h:114
vtkUniformGridAMR
Definition: vtkUniformGridAMR.h:33
vtkUniformGridAMR::SetDataSet
virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid *grid)
VTK_NEWINSTANCE
#define VTK_NEWINSTANCE
Definition: vtkWrappingHints.h:42
vtkUniformGridAMR::GetData
static vtkUniformGridAMR * GetData(vtkInformationVector *v, int i=0)
vtkUniformGridAMR::GetData
static vtkUniformGridAMR * GetData(vtkInformation *info)
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:60
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkUniformGridAMR::GetBounds
const double * GetBounds()
vtkUniformGridAMR::SetGridDescription
void SetGridDescription(int gridDescription)
vtkAMRDataInternals
container of vtkUniformGrid for an AMR data set
Definition: vtkAMRDataInternals.h:36
vtkUniformGridAMR::GetDataSet
vtkUniformGrid * GetDataSet(unsigned int level, unsigned int idx)