VTK
vtkStructuredGrid.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkStructuredGrid.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 =========================================================================*/
47 #ifndef vtkStructuredGrid_h
48 #define vtkStructuredGrid_h
49 
50 #include "vtkCommonDataModelModule.h" // For export macro
51 #include "vtkPointSet.h"
52 
53 #include "vtkStructuredData.h" // Needed for inline methods
54 
55 class vtkEmptyCell;
56 class vtkHexahedron;
57 class vtkLine;
58 class vtkQuad;
60 class vtkVertex;
61 
63 {
64 public:
66 
68  void PrintSelf(ostream& os, vtkIndent indent);
69 
72 
76 
78 
80  double *GetPoint(vtkIdType ptId) {return this->vtkPointSet::GetPoint(ptId);}
81  void GetPoint(vtkIdType ptId, double p[3])
82  {this->vtkPointSet::GetPoint(ptId,p);}
84  void GetCell(vtkIdType cellId, vtkGenericCell *cell);
85  void GetCellBounds(vtkIdType cellId, double bounds[6]);
86  int GetCellType(vtkIdType cellId);
88  void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds);
89  void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
90  {
91  vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());
92  }
93  void Initialize();
94  int GetMaxCellSize() {return 8;}; //hexahedron is the largest
95  void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
96  vtkIdList *cellIds);
98 
100 
101  void SetDimensions(int i, int j, int k);
102  void SetDimensions(int dim[3]);
104 
106 
107  virtual int *GetDimensions ();
108  virtual void GetDimensions (int dim[3]);
110 
112  int GetDataDimension();
113 
115 
118  void SetExtent(int extent[6]);
119  void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2);
120  vtkGetVector6Macro(Extent, int);
122 
128  unsigned long GetActualMemorySize();
129 
131 
135 
137  int GetExtentType() { return VTK_3D_EXTENT; }
138 
140 
144  void BlankPoint(vtkIdType ptId);
147 
149 
153  void BlankCell(vtkIdType ptId);
154  void UnBlankCell(vtkIdType ptId);
156 
159  unsigned char IsPointVisible(vtkIdType ptId);
160 
163  unsigned char IsCellVisible(vtkIdType cellId);
164 
167  virtual bool HasAnyBlankPoints();
170  virtual bool HasAnyBlankCells();
171 
176  void GetCellDims( int cellDims[3] );
177 
181  virtual void Crop(const int* updateExtent);
182 
183  //BTX
185 
188  //ETX
190 
197  void GetPoint(int i, int j, int k, double p[3], bool adjustForExtent = true);
198 
199 protected:
202 
203  // for the GetCell method
209 
210  int Dimensions[3];
212 
213  int Extent[6];
214 
217  virtual void ComputeScalarRange();
218 
219 private:
221 
222  void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
223  {this->GetCellNeighbors(cellId, &ptIds, &cellIds);}
225 
226  // Internal method used by DeepCopy and ShallowCopy.
227  void InternalStructuredGridCopy(vtkStructuredGrid *src);
228 
229  static unsigned char MASKED_CELL_VALUE;
230 
231 private:
232  vtkStructuredGrid(const vtkStructuredGrid&); // Not implemented.
233  void operator=(const vtkStructuredGrid&); // Not implemented.
234 };
235 
236 
238 {
239  int nCells=1;
240  int dims[3];
241  int i;
242 
243  this->GetDimensions(dims);
244  for (i=0; i<3; i++)
245  {
246  if (dims[i] <= 0)
247  {
248  return 0;
249  }
250  if (dims[i] > 1)
251  {
252  nCells *= (dims[i]-1);
253  }
254  }
255 
256  return nCells;
257 }
258 
260 {
262 }
263 
264 #endif
265 
266 
267 
268 
269 
270 
vtkGetVector6Macro
#define vtkGetVector6Macro(name, type)
Definition: vtkSetGet.h:380
vtkStructuredData::GetDataDimension
static int GetDataDimension(int dataDescription)
vtkStructuredGrid::GetCellType
int GetCellType(vtkIdType cellId)
vtkStructuredGrid::Initialize
void Initialize()
vtkStructuredGrid::GetPoint
void GetPoint(vtkIdType ptId, double p[3])
Definition: vtkStructuredGrid.h:81
vtkStructuredGrid::GetCellPoints
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)
vtkStructuredGrid::GetPoint
double * GetPoint(vtkIdType ptId)
Definition: vtkStructuredGrid.h:80
vtkHexahedron
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:47
vtkStructuredGrid::BlankCell
void BlankCell(vtkIdType ptId)
vtkPointSet.h
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkStructuredGrid::EmptyCell
vtkEmptyCell * EmptyCell
Definition: vtkStructuredGrid.h:208
vtkCommonDataModelModule.h
vtkStructuredGrid::GetPoint
void GetPoint(int i, int j, int k, double p[3], bool adjustForExtent=true)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkEmptyCell
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:32
vtkStructuredGrid::SetDimensions
void SetDimensions(int dim[3])
vtkStructuredGrid::ComputeScalarRange
virtual void ComputeScalarRange()
vtkPointSet::GetNumberOfPoints
vtkIdType GetNumberOfPoints()
Definition: vtkPointSet.h:134
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkStructuredGrid::GetNumberOfCells
vtkIdType GetNumberOfCells()
Definition: vtkStructuredGrid.h:237
vtkStructuredGrid
topologically regular array of data
Definition: vtkStructuredGrid.h:63
vtkStructuredGrid::GetCellDims
void GetCellDims(int cellDims[3])
vtkgl::v
const GLdouble * v
Definition: vtkgl.h:11595
vtkStructuredGrid::SetDimensions
void SetDimensions(int i, int j, int k)
vtkStructuredGrid::GetCell
vtkCell * GetCell(vtkIdType cellId)
vtkVertex
a cell that represents a 3D point
Definition: vtkVertex.h:36
vtkLine
cell represents a 1D line
Definition: vtkLine.h:35
vtkStructuredGrid::GetActualMemorySize
unsigned long GetActualMemorySize()
VTK_3D_EXTENT
#define VTK_3D_EXTENT
Definition: vtkDataObject.h:61
vtkStructuredGrid::GetCellBounds
void GetCellBounds(vtkIdType cellId, double bounds[6])
vtkStructuredGrid::HasAnyBlankPoints
virtual bool HasAnyBlankPoints()
vtkStructuredGrid::IsCellVisible
unsigned char IsCellVisible(vtkIdType cellId)
vtkStructuredData.h
vtkStructuredGrid::GetDimensions
virtual int * GetDimensions()
vtkStructuredGrid::GetDataDimension
int GetDataDimension()
Definition: vtkStructuredGrid.h:259
vtkStructuredGrid::SetExtent
void SetExtent(int extent[6])
vtkStructuredGrid::IsPointVisible
unsigned char IsPointVisible(vtkIdType ptId)
vtkDataSet::GetCellNeighbors
virtual void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds)
vtkStructuredGrid::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkgl::src
GLenum src
Definition: vtkgl.h:12525
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:62
vtkStructuredData::GetPointCells
static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3])
vtkStructuredGrid::New
static vtkStructuredGrid * New()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkStructuredGrid::HasAnyBlankCells
virtual bool HasAnyBlankCells()
vtkStructuredGrid::GetPointCells
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)
Definition: vtkStructuredGrid.h:89
vtkStructuredGrid::DeepCopy
void DeepCopy(vtkDataObject *src)
vtkStructuredGrid::Crop
virtual void Crop(const int *updateExtent)
vtkStructuredGrid::DataDescription
int DataDescription
Definition: vtkStructuredGrid.h:211
vtkStructuredGrid::GetData
static vtkStructuredGrid * GetData(vtkInformationVector *v, int i=0)
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkStructuredGrid::BlankPoint
void BlankPoint(vtkIdType ptId)
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkStructuredGrid::SetExtent
void SetExtent(int x1, int x2, int y1, int y2, int z1, int z2)
vtkStructuredGrid::GetMaxCellSize
int GetMaxCellSize()
Definition: vtkStructuredGrid.h:94
vtkStructuredGrid::Quad
vtkQuad * Quad
Definition: vtkStructuredGrid.h:206
vtkStructuredGrid::ShallowCopy
void ShallowCopy(vtkDataObject *src)
vtkStructuredGrid::UnBlankPoint
void UnBlankPoint(vtkIdType ptId)
vtkStructuredGrid::GetData
static vtkStructuredGrid * GetData(vtkInformation *info)
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:45
vtkStructuredGrid::GetCell
void GetCell(vtkIdType cellId, vtkGenericCell *cell)
vtkStructuredGrid::Hexahedron
vtkHexahedron * Hexahedron
Definition: vtkStructuredGrid.h:207
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:42
vtkStructuredGrid::Vertex
vtkVertex * Vertex
Definition: vtkStructuredGrid.h:204
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkStructuredGrid::GetDataObjectType
int GetDataObjectType()
Definition: vtkStructuredGrid.h:71
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkStructuredGrid::CopyStructure
void CopyStructure(vtkDataSet *ds)
vtkDataSet::GetNumberOfCells
virtual vtkIdType GetNumberOfCells()=0
vtkStructuredGrid::UnBlankCell
void UnBlankCell(vtkIdType ptId)
vtkStructuredGrid::GetNumberOfPoints
vtkIdType GetNumberOfPoints()
Definition: vtkStructuredGrid.h:79
vtkStructuredGrid::vtkStructuredGrid
vtkStructuredGrid()
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkStructuredGrid::GetDimensions
virtual void GetDimensions(int dim[3])
vtkStructuredGrid::GetCellNeighbors
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds)
vtkPointSet::GetPoint
double * GetPoint(vtkIdType ptId)
Definition: vtkPointSet.h:59
vtkQuad
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:41
vtkStructuredGrid::Line
vtkLine * Line
Definition: vtkStructuredGrid.h:205
vtkStructuredGrid::GetExtentType
int GetExtentType()
Definition: vtkStructuredGrid.h:137
vtkStructuredGrid::~vtkStructuredGrid
~vtkStructuredGrid()
VTK_STRUCTURED_GRID
#define VTK_STRUCTURED_GRID
Definition: vtkType.h:68