VTK  9.3.1
vtkUniformGridAMR.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
13 #ifndef vtkUniformGridAMR_h
14 #define vtkUniformGridAMR_h
15 
16 #include "vtkCommonDataModelModule.h" // For export macro
17 #include "vtkCompositeDataSet.h"
18 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
19 
20 VTK_ABI_NAMESPACE_BEGIN
22 class vtkUniformGrid;
23 class vtkAMRInformation;
25 
26 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGridAMR : public vtkCompositeDataSet
27 {
28 public:
29  static vtkUniformGridAMR* New();
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
37 
41  int GetDataObjectType() override { return VTK_UNIFORM_GRID_AMR; }
42 
46  void Initialize() override;
47 
51  virtual void Initialize(int numLevels, const int* blocksPerLevel);
52 
57  void SetGridDescription(int gridDescription);
58  int GetGridDescription();
59 
63  unsigned int GetNumberOfLevels();
64 
68  virtual unsigned int GetTotalNumberOfBlocks();
69 
73  unsigned int GetNumberOfDataSets(unsigned int level);
74 
76 
79  void GetBounds(double bounds[6]);
80  const double* GetBounds();
81  void GetMin(double min[3]);
82  void GetMax(double max[3]);
84 
88  void SetDataSet(vtkCompositeDataIterator* iter, vtkDataObject* dataObj) override;
89 
94  virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid* grid);
95 
96  // Needed because, otherwise vtkCompositeData::GetDataSet(unsigned int flatIndex) is hidden.
97  using Superclass::GetDataSet;
98 
103 
107  vtkUniformGrid* GetDataSet(unsigned int level, unsigned int idx);
108 
113  int GetCompositeIndex(unsigned int level, unsigned int index);
114 
119  void GetLevelAndIndex(unsigned int compositeIdx, unsigned int& level, unsigned int& idx);
120 
122 
125  void CompositeShallowCopy(vtkCompositeDataSet* src) override;
126  void ShallowCopy(vtkDataObject* src) override;
128 
132  VTK_DEPRECATED_IN_9_3_0("Please use ShallowCopy instead.")
133  void RecursiveShallowCopy(vtkDataObject* src) override;
134 
138  void DeepCopy(vtkDataObject* src) override;
139 
143  void CopyStructure(vtkCompositeDataSet* src) override;
144 
146 
150  static vtkUniformGridAMR* GetData(vtkInformationVector* v, int i = 0);
152 
153 protected:
155  ~vtkUniformGridAMR() override;
156 
157  double Bounds[6];
158 
162  vtkGetObjectMacro(AMRData, vtkAMRDataInternals);
163 
164  vtkAMRDataInternals* AMRData;
165 
167 
170  vtkGetObjectMacro(AMRInfo, vtkAMRInformation);
171  virtual void SetAMRInfo(vtkAMRInformation*);
173 
174  vtkAMRInformation* AMRInfo;
175 
176 private:
177  vtkUniformGridAMR(const vtkUniformGridAMR&) = delete;
178  void operator=(const vtkUniformGridAMR&) = delete;
179 
181 };
182 
183 VTK_ABI_NAMESPACE_END
184 #endif
virtual void CompositeShallowCopy(vtkCompositeDataSet *src)
The goal of the method is to copy the data up to the dataset pointers only.
static vtkDataObject * New()
subclass of vtkCompositeDataIterator with API to get current level and dataset index.
Store vtkAlgorithm input/output information.
superclass for composite data iterators
void Initialize() override
Restore data object to initial state,.
virtual void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj)=0
Sets the data set at the location pointed by the iterator.
#define VTK_DEPRECATED_IN_9_3_0(reason)
abstract superclass for composite (multi-block or AMR) datasets
Meta data that describes the structure of an AMR data set.
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_UNIFORM_GRID_AMR
Definition: vtkType.h:94
void GetBounds(double bounds[6])
Return the geometric bounding box in the form (xmin,xmax, ymin,ymax, zmin,zmax).
int GetDataObjectType() override
Return class name of data type (see vtkType.h for definitions).
container of vtkUniformGrid for an AMR data set
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.
#define VTK_NEWINSTANCE
image data with blanking
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter)=0
Returns the dataset located at the position pointed by the iterator.
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:54
virtual vtkCompositeDataIterator * NewIterator()=0
Return a new iterator (the iterator has to be deleted by user).
a concrete implementation of vtkCompositeDataSet
#define max(a, b)
virtual void ShallowCopy(vtkDataObject *src)
The goal of the method is to copy the data up to the array pointers only.