VTK
vtkUniformGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkUniformGrid.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 =========================================================================*/
28 #ifndef __vtkUniformGrid_h
29 #define __vtkUniformGrid_h
30 
31 #include "vtkCommonDataModelModule.h" // For export macro
32 #include "vtkImageData.h"
33 
34 class vtkEmptyCell;
37 class vtkAMRBox;
38 
39 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGrid : public vtkImageData
40 {
41 public:
43 
44  static vtkUniformGrid *New();
46  void PrintSelf(ostream& os, vtkIndent indent);
48 
51  virtual void CopyStructure(vtkDataSet *ds);
52 
54  virtual int GetDataObjectType() {return VTK_UNIFORM_GRID;};
55 
57 
58  virtual vtkCell *GetCell(vtkIdType cellId);
59  virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell);
60  virtual vtkIdType FindCell(
61  double x[3], vtkCell *cell, vtkIdType cellId, double tol2,
62  int& subId, double pcoords[3], double *weights);
63  virtual vtkIdType FindCell(
64  double x[3], vtkCell *cell, vtkGenericCell *gencell,
65  vtkIdType cellId, double tol2, int& subId,
66  double pcoords[3], double *weights);
67  virtual vtkCell *FindAndGetCell(
68  double x[3], vtkCell *cell, vtkIdType cellId,
69  double tol2, int& subId, double pcoords[3],
70  double *weights);
71  virtual int GetCellType(vtkIdType cellId);
72  virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)
74  this->GetDimensions());}
75  virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
76  {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());}
77  virtual void Initialize();
78  virtual int GetMaxCellSize() {return 8;}; //voxel is the largest
80 
82  int GetGridDescription();
83 
84  //BTX
89  int Initialize(const vtkAMRBox *def);
94  int Initialize(const vtkAMRBox *def, int nGhosts);
100  int Initialize(const vtkAMRBox *def, const int nGhosts[3]);
102 
107  int Initialize(const vtkAMRBox *def,int nGhostsI,int nGhostsJ,int nGhostsK);
108  //ETX
110 
112 
113  virtual void ShallowCopy(vtkDataObject *src);
114  virtual void DeepCopy(vtkDataObject *src);
116 
118 
122  virtual void BlankPoint(vtkIdType ptId);
123  virtual void UnBlankPoint(vtkIdType ptId);
124  virtual void BlankPoint( const int i, const int j, const int k );
125  virtual void UnBlankPoint( const int i, const int j, const int k );
127 
129 
132  virtual void BlankCell(vtkIdType ptId);
133  virtual void UnBlankCell(vtkIdType ptId);
134  virtual void BlankCell( const int i, const int j, const int k );
135  virtual void UnBlankCell( const int i, const int j, const int k );
137 
139  virtual vtkUnsignedCharArray *GetPointVisibilityArray();
140 
144  virtual void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility);
145 
147  virtual vtkUnsignedCharArray *GetCellVisibilityArray();
148 
152  virtual void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility);
153 
156  virtual void AttachCellVisibilityToCellData( );
157 
160  virtual void AttachPointVisibilityToPointData( );
161 
164  virtual unsigned char IsPointVisible(vtkIdType ptId);
165 
168  virtual unsigned char IsCellVisible(vtkIdType cellId);
169 
172  virtual unsigned char GetPointBlanking();
173 
176  virtual unsigned char GetCellBlanking();
177 
178  virtual vtkImageData* NewImageDataCopy();
179 
180  //BTX
182 
184  static vtkUniformGrid* GetData(vtkInformationVector* v, int i=0);
185  //ETX
187 
188 protected:
189  vtkUniformGrid();
190  ~vtkUniformGrid();
191 
193  void GetCellDims( int cellDims[3] );
194 
196  virtual void ComputeScalarRange();
197 
199 
200  void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility);
201  vtkGetObjectMacro(PointVisibility, vtkStructuredVisibilityConstraint);
202 
204 
205  void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility);
206  vtkGetObjectMacro(CellVisibility, vtkStructuredVisibilityConstraint);
207 
208  vtkEmptyCell* GetEmptyCell();
209 
210 private:
211  vtkUniformGrid(const vtkUniformGrid&); // Not implemented.
212  void operator=(const vtkUniformGrid&); // Not implemented.
213 
214  vtkEmptyCell *EmptyCell;
215 };
216 
217 
218 #endif
219 
220 
221