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 =========================================================================*/
22 #ifndef __vtkUniformGrid_h
23 #define __vtkUniformGrid_h
24 
25 #include "vtkImageData.h"
26 
27 class vtkEmptyCell;
30 class vtkAMRBox;
31 
33 {
34 public:
36 
37  static vtkUniformGrid *New();
39  void PrintSelf(ostream& os, vtkIndent indent);
41 
44  virtual void CopyStructure(vtkDataSet *ds);
45 
47  virtual int GetDataObjectType() {return VTK_UNIFORM_GRID;};
48 
50 
51  virtual vtkCell *GetCell(vtkIdType cellId);
52  virtual void GetCell(vtkIdType cellId, vtkGenericCell *cell);
53  virtual vtkIdType FindCell(
54  double x[3], vtkCell *cell, vtkIdType cellId, double tol2,
55  int& subId, double pcoords[3], double *weights);
56  virtual vtkIdType FindCell(
57  double x[3], vtkCell *cell, vtkGenericCell *gencell,
58  vtkIdType cellId, double tol2, int& subId,
59  double pcoords[3], double *weights);
60  virtual vtkCell *FindAndGetCell(
61  double x[3], vtkCell *cell, vtkIdType cellId,
62  double tol2, int& subId, double pcoords[3],
63  double *weights);
64  virtual int GetCellType(vtkIdType cellId);
65  virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)
67  this->GetDimensions());}
68  virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
69  {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());}
70  virtual void Initialize();
71  virtual int GetMaxCellSize() {return 8;}; //voxel is the largest
73 
74  //BTX
76 
80  int Initialize(const vtkAMRBox *def);
81  // Description:
82  // Initialize from the definition in the given box, with ghost cell
83  // arrays nGhosts cells thick in all directions. The box is expetced
84  // to be 3D, if you have 2D data the set the third dimensions 0.
85  // eg. (X,X,0)(X,X,0)
86  // Returns 0 if the initialization failed.
87  int Initialize(const vtkAMRBox *def, int nGhosts);
88  // Description:
89  // Initialize from the definition in the given box, with ghost cell
90  // arrays of the thickness given in each direction by "nGhosts" array.
91  // The box and ghost array are expected to be 3D, if you have 2D data
92  // the set the third dimensions 0. eg. (X,X,0)(X,X,0)
93  // Returns 0 if the initialization failed.
94  int Initialize(const vtkAMRBox *def, const int nGhosts[3]);
95  // Description:
96  // Construct a uniform grid, from the definition in the given box
97  // "def", with ghost cell arrays of the thickness given in each
98  // direction by "nGhosts*". The box and ghost array are expected
99  // to be 3D, if you have 2D data the set the third dimensions 0. eg.
100  // (X,X,0)(X,X,0)
101  // Returns 0 if the initialization failed.
102  int Initialize(const vtkAMRBox *def,int nGhostsI,int nGhostsJ,int nGhostsK);
103  //ETX
105 
107 
108  virtual void ShallowCopy(vtkDataObject *src);
109  virtual void DeepCopy(vtkDataObject *src);
111 
113 
117  virtual void BlankPoint(vtkIdType ptId);
118  virtual void UnBlankPoint(vtkIdType ptId);
120 
122 
125  virtual void BlankCell(vtkIdType ptId);
126  virtual void UnBlankCell(vtkIdType ptId);
128 
130  virtual vtkUnsignedCharArray *GetPointVisibilityArray();
131 
135  virtual void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility);
136 
138  virtual vtkUnsignedCharArray *GetCellVisibilityArray();
139 
143  virtual void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility);
144 
147  virtual unsigned char IsPointVisible(vtkIdType ptId);
148 
151  virtual unsigned char IsCellVisible(vtkIdType cellId);
152 
155  virtual unsigned char GetPointBlanking();
156 
159  virtual unsigned char GetCellBlanking();
160 
161  virtual vtkImageData* NewImageDataCopy();
162 
163  //BTX
165 
167  static vtkUniformGrid* GetData(vtkInformationVector* v, int i=0);
168  //ETX
170 
171 protected:
172  vtkUniformGrid();
173  ~vtkUniformGrid();
174 
176  virtual void ComputeScalarRange();
177 
179 
180  void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility);
181  vtkGetObjectMacro(PointVisibility, vtkStructuredVisibilityConstraint);
182 
184 
185  void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility);
186  vtkGetObjectMacro(CellVisibility, vtkStructuredVisibilityConstraint);
187 
188  vtkEmptyCell* GetEmptyCell();
189 
190 private:
191  vtkUniformGrid(const vtkUniformGrid&); // Not implemented.
192  void operator=(const vtkUniformGrid&); // Not implemented.
193 
194  vtkEmptyCell *EmptyCell;
195 };
196 
197 
198 #endif
199 
200 
201