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;
35 class vtkStructuredVisibilityConstraint;
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 
117  virtual void BlankPoint(vtkIdType ptId);
118  virtual void UnBlankPoint(vtkIdType ptId);
119  virtual void BlankPoint( const int i, const int j, const int k );
120  virtual void UnBlankPoint( const int i, const int j, const int k );
122 
124 
127  virtual void BlankCell(vtkIdType ptId);
128  virtual void UnBlankCell(vtkIdType ptId);
129  virtual void BlankCell( const int i, const int j, const int k );
130  virtual void UnBlankCell( const int i, const int j, const int k );
132 
135  virtual bool HasAnyBlankCells();
138  virtual bool HasAnyBlankPoints();
139 
142  virtual unsigned char IsPointVisible(vtkIdType ptId);
143 
146  virtual unsigned char IsCellVisible(vtkIdType cellId);
147 
148  virtual vtkImageData* NewImageDataCopy();
149 
150  //BTX
152 
154  static vtkUniformGrid* GetData(vtkInformationVector* v, int i=0);
155  //ETX
157 
158 protected:
159  vtkUniformGrid();
160  ~vtkUniformGrid();
161 
163  void GetCellDims( int cellDims[3] );
164 
166  virtual void ComputeScalarRange();
167 
168  vtkEmptyCell* GetEmptyCell();
169 
170 private:
171  vtkUniformGrid(const vtkUniformGrid&); // Not implemented.
172  void operator=(const vtkUniformGrid&); // Not implemented.
173 
174  vtkEmptyCell *EmptyCell;
175 
176  static unsigned char MASKED_CELL_VALUE;
177 };
178 
179 
180 #endif
181 
182 
183 
static vtkImageData * GetData(vtkInformation *info)
static vtkImageData * New()
virtual void ComputeScalarRange()
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:38
virtual vtkCell * GetCell(vtkIdType cellId)
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:275
virtual vtkCell * FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)
virtual bool HasAnyBlankCells()
Definition: vtkDataSet.h:341
provides thread-safe access to cells
virtual void Initialize()
abstract class to specify cell behavior
Definition: vtkCell.h:61
friend class vtkUniformGrid
Definition: vtkImageData.h:419
#define VTK_UNIFORM_GRID
Definition: vtkType.h:76
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()
virtual bool HasAnyBlankPoints()
Definition: vtkDataSet.h:349
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
list of point or cell ids
Definition: vtkIdList.h:35
void PrintSelf(ostream &os, vtkIndent indent)
virtual void CopyStructure(vtkDataSet *ds)
int GetDataDescription()
Definition: vtkImageData.h:412
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.
#define VTKCOMMONDATAMODEL_EXPORT
virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)
virtual int GetCellType(vtkIdType cellId)