VTK
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 
22 #ifndef vtkUniformGridAMR_h
23 #define vtkUniformGridAMR_h
24 
25 #include "vtkCommonDataModelModule.h" // For export macro
26 #include "vtkCompositeDataSet.h"
27 
29 class vtkUniformGrid;
30 class vtkAMRInformation;
32 
34 {
35 public:
36  static vtkUniformGridAMR *New();
38 
39  // Description:
40  // Return a new iterator (the iterator has to be deleted by the user).
42 
43  // Description:
44  // Return class name of data type (see vtkType.h for definitions).
45  virtual int GetDataObjectType() {return VTK_UNIFORM_GRID_AMR;}
46 
47  // Description: // Print internal states
48  void PrintSelf(ostream& os, vtkIndent indent);
49 
50  // Description:
51  // Restore data object to initial
52  virtual void Initialize();
53 
54  // Description:
55  // Initialize the AMR.
56  virtual void Initialize(int numLevels, const int * blocksPerLevel);
57 
58  // Description:
59  // Set/Get the data description of this uniform grid instance,
60  // e.g. VTK_XYZ_GRID
61  void SetGridDescription(int gridDescription);
62  int GetGridDescription();
63 
64  // Description:
65  // Return the number of levels
66  unsigned int GetNumberOfLevels();
67 
68  // Description:
69  // Return the total number of blocks, including NULL blocks
70  virtual unsigned int GetTotalNumberOfBlocks();
71 
72  // Description:
73  // Returns the number of datasets at the given level, including null blocks
74  unsigned int GetNumberOfDataSets(const unsigned int level);
75 
76  // Description:
77  // Retrieve the bounds of the AMR domain
78  void GetBounds(double bounds[6]);
79  const double* GetBounds();
80  void GetMin(double min[3]);
81  void GetMax(double max[3]);
82 
83  // Description:
84  // Unhiding superclass method.
85  virtual void SetDataSet(
86  vtkCompositeDataIterator* iter, vtkDataObject* dataObj);
87 
88  // Description:
89  // At the passed in level, set grid as the idx'th block at that level.
90  // idx must be less than the number of data sets at that level.
91  virtual void SetDataSet(unsigned int level, unsigned int idx, vtkUniformGrid *grid);
92 
93  // Description:
94  // Return the data set pointed to by iter
96 
97  // Description:
98  // Get the data set using the index pair
99  vtkUniformGrid* GetDataSet(unsigned int level, unsigned int idx);
100 
101  // Description:
102  // Retrieves the composite index associated with the data at the given
103  // (level,index) pair.
104  int GetCompositeIndex( const unsigned int level, const unsigned int index );
105 
106  // Description:
107  // Givenes the composite Idx (as set by SetCompositeIdx) this method returns the
108  // corresponding level and dataset index within the level.
109  void GetLevelAndIndex(
110  const unsigned int compositeIdx, unsigned int &level, unsigned int &idx );
111 
112  // Description:
113  // Override ShallowCopy/DeepCopy and CopyStructure
114  virtual void ShallowCopy(vtkDataObject *src);
115  virtual void DeepCopy(vtkDataObject *src);
116  virtual void CopyStructure(vtkCompositeDataSet *src);
117 
118  // Retrieve an instance of this class from an information object.
120  static vtkUniformGridAMR* GetData(vtkInformationVector* v, int i=0);
121  //ETX
122 
123 protected:
125  virtual ~vtkUniformGridAMR();
126 
127  // Description:
128  // Get/Set the meta AMR meta data
129  vtkGetObjectMacro(AMRData, vtkAMRDataInternals);
130 
133  double Bounds[6];
134 
135  // Description:
136  // Get/Set the meta AMR meta data
137  vtkGetObjectMacro(AMRInfo, vtkAMRInformation);
138  virtual void SetAMRInfo(vtkAMRInformation*);
139 
140 
141 private:
142  vtkUniformGridAMR(const vtkUniformGridAMR&); // Not implemented.
143  void operator=(const vtkUniformGridAMR&); // Not implemented.
144 
146 };
147 
148 #endif
virtual void ShallowCopy(vtkDataObject *src)
virtual void DeepCopy(vtkDataObject *src)
static vtkDataObject * New()
subclass of vtkCompositeDataIterator with API to get current level and dataset index.
Store vtkAlgorithm input/output information.
void PrintSelf(ostream &os, vtkIndent indent)
superclass for composite data iterators
virtual void SetDataSet(vtkCompositeDataIterator *iter, vtkDataObject *dataObj)=0
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:38
vtkAMRInformation * AMRInfo
#define VTK_UNIFORM_GRID_AMR
Definition: vtkType.h:93
container of vtkUniformGrid for an AMR data set
static vtkCompositeDataSet * GetData(vtkInformation *info)
virtual void CopyStructure(vtkCompositeDataSet *input)=0
image data with blanking
virtual vtkDataObject * GetDataSet(vtkCompositeDataIterator *iter)=0
virtual void Initialize()
Store zero or more vtkInformation instances.
virtual int GetDataObjectType()
general representation of visualization data
Definition: vtkDataObject.h:64
vtkAMRDataInternals * AMRData
virtual vtkCompositeDataIterator * NewIterator()=0
#define VTKCOMMONDATAMODEL_EXPORT
#define max(a, b)