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 
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, double* origin, double* spacing);
94  int Initialize(const vtkAMRBox *def, double* origin, double* spacing, int nGhosts);
95 
101  int Initialize(const vtkAMRBox *def, double* origin, double* spacing, const int nGhosts[3]);
103 
108  int Initialize(const vtkAMRBox *def, double* origin, double* spacing, int nGhostsI,int nGhostsJ,int nGhostsK);
109  //ETX
111 
113 
114  virtual void ShallowCopy(vtkDataObject *src);
115  virtual void DeepCopy(vtkDataObject *src);
117 
119 
123  virtual void BlankPoint(vtkIdType ptId);
124  virtual void UnBlankPoint(vtkIdType ptId);
125  virtual void BlankPoint( const int i, const int j, const int k );
126  virtual void UnBlankPoint( const int i, const int j, const int k );
128 
130 
133  virtual void BlankCell(vtkIdType ptId);
134  virtual void UnBlankCell(vtkIdType ptId);
135  virtual void BlankCell( const int i, const int j, const int k );
136  virtual void UnBlankCell( const int i, const int j, const int k );
138 
140  virtual vtkUnsignedCharArray *GetPointVisibilityArray();
141 
145  virtual void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility);
146 
148  virtual vtkUnsignedCharArray *GetCellVisibilityArray();
149 
153  virtual void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility);
154 
157  virtual void AttachCellVisibilityToCellData( );
158 
161  virtual void AttachPointVisibilityToPointData( );
162 
165  virtual unsigned char IsPointVisible(vtkIdType ptId);
166 
169  virtual unsigned char IsCellVisible(vtkIdType cellId);
170 
173  virtual unsigned char GetPointBlanking();
174 
177  virtual unsigned char GetCellBlanking();
178 
179  virtual vtkImageData* NewImageDataCopy();
180 
181  //BTX
183 
185  static vtkUniformGrid* GetData(vtkInformationVector* v, int i=0);
186  //ETX
188 
189 protected:
190  vtkUniformGrid();
191  ~vtkUniformGrid();
192 
194  void GetCellDims( int cellDims[3] );
195 
197  virtual void ComputeScalarRange();
198 
200 
201  void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility);
203 
205 
206  void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility);
208 
209  vtkEmptyCell* GetEmptyCell();
210 
211 private:
212  vtkUniformGrid(const vtkUniformGrid&); // Not implemented.
213  void operator=(const vtkUniformGrid&); // Not implemented.
214 
215  vtkEmptyCell *EmptyCell;
216 };
217 
218 
219 #endif
220 
221 
222 
static vtkImageData * GetData(vtkInformation *info)
const GLdouble * v
Definition: vtkgl.h:11595
static vtkImageData * New()
virtual void ComputeScalarRange()
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:60
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:38
virtual vtkCell * GetCell(vtkIdType cellId)
virtual void ShallowCopy(vtkDataObject *src)
virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:31
int vtkIdType
Definition: vtkType.h:268
virtual vtkCell * FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
provides thread-safe access to cells
vtkStructuredVisibilityConstraint * PointVisibility
virtual void Initialize()
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
abstract class to specify cell behavior
Definition: vtkCell.h:58
friend class vtkUniformGrid
Definition: vtkImageData.h:414
#define VTK_UNIFORM_GRID
Definition: vtkType.h:76
GLenum src
Definition: vtkgl.h:12525
const GLbyte * weights
Definition: vtkgl.h:12766
virtual int * GetDimensions()
a simple class to control print indentation
Definition: vtkIndent.h:38
static void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds, int dataDescription, int dim[3])
virtual int GetDataObjectType()
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
list of point or cell ids
Definition: vtkIdList.h:35
vtkStructuredVisibilityConstraint * CellVisibility
void PrintSelf(ostream &os, vtkIndent indent)
virtual void CopyStructure(vtkDataSet *ds)
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
int GetDataDescription()
Definition: vtkImageData.h:407
dynamic, self-adjusting array of unsigned char
static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3])
image data with blanking
virtual int GetMaxCellSize()
Store zero or more vtkInformation instances.
helper object to manage the visibility of points and cells
general representation of visualization data
Definition: vtkDataObject.h:64
#define VTKCOMMONDATAMODEL_EXPORT
virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)
virtual void DeepCopy(vtkDataObject *src)
virtual int GetCellType(vtkIdType cellId)