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=========================================================================*/
29#ifndef vtkUniformGrid_h
30#define vtkUniformGrid_h
31
32#include "vtkCommonDataModelModule.h" // For export macro
33#include "vtkImageData.h"
34
35class vtkEmptyCell;
36class vtkStructuredVisibilityConstraint;
38class vtkAMRBox;
39
40class VTKCOMMONDATAMODEL_EXPORT vtkUniformGrid : public vtkImageData
41{
42public:
44
49 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
51
56 void CopyStructure(vtkDataSet *ds) VTK_OVERRIDE;
57
61 int GetDataObjectType() VTK_OVERRIDE {return VTK_UNIFORM_GRID;};
62
64
67 vtkCell *GetCell(vtkIdType cellId) VTK_OVERRIDE;
68 void GetCell(vtkIdType cellId, vtkGenericCell *cell) VTK_OVERRIDE;
70 double x[3], vtkCell *cell, vtkIdType cellId, double tol2,
71 int& subId, double pcoords[3], double *weights) VTK_OVERRIDE;
73 double x[3], vtkCell *cell, vtkGenericCell *gencell,
74 vtkIdType cellId, double tol2, int& subId,
75 double pcoords[3], double *weights) VTK_OVERRIDE;
77 double x[3], vtkCell *cell, vtkIdType cellId,
78 double tol2, int& subId, double pcoords[3],
79 double *weights) VTK_OVERRIDE;
80 int GetCellType(vtkIdType cellId) VTK_OVERRIDE;
81 void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) VTK_OVERRIDE
83 this->GetDimensions());}
84 void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) VTK_OVERRIDE
85 {vtkStructuredData::GetPointCells(ptId,cellIds,this->GetDimensions());}
86 void Initialize() VTK_OVERRIDE;
87 int GetMaxCellSize() VTK_OVERRIDE {return 8;}; //voxel is the largest
89
94
101 int Initialize(const vtkAMRBox *def, double* origin, double* spacing);
109 int Initialize(const vtkAMRBox *def, double* origin, double* spacing, int nGhosts);
110
118 int Initialize(const vtkAMRBox *def, double* origin, double* spacing, const int nGhosts[3]);
127 int Initialize(const vtkAMRBox *def, double* origin, double* spacing, int nGhostsI,int nGhostsJ,int nGhostsK);
128
130
136 virtual void BlankPoint(vtkIdType ptId);
137 virtual void UnBlankPoint(vtkIdType ptId);
138 virtual void BlankPoint( const int i, const int j, const int k );
139 virtual void UnBlankPoint( const int i, const int j, const int k );
141
143
149 virtual void BlankCell(vtkIdType ptId);
150 virtual void UnBlankCell(vtkIdType ptId);
151 virtual void BlankCell( const int i, const int j, const int k );
152 virtual void UnBlankCell( const int i, const int j, const int k );
154
159 bool HasAnyBlankCells() VTK_OVERRIDE;
164 bool HasAnyBlankPoints() VTK_OVERRIDE;
165
171 virtual unsigned char IsPointVisible(vtkIdType ptId);
172
178 virtual unsigned char IsCellVisible(vtkIdType cellId);
179
180 virtual vtkImageData* NewImageDataCopy();
181
183
187 static vtkUniformGrid* GetData(vtkInformationVector* v, int i=0);
189
190protected:
192 ~vtkUniformGrid() VTK_OVERRIDE;
193
197 void GetCellDims( int cellDims[3] );
198
202 void ComputeScalarRange() VTK_OVERRIDE;
203
204 vtkEmptyCell* GetEmptyCell();
205
206private:
207 vtkUniformGrid(const vtkUniformGrid&) VTK_DELETE_FUNCTION;
208 void operator=(const vtkUniformGrid&) VTK_DELETE_FUNCTION;
209
210 vtkEmptyCell *EmptyCell;
211
212 static unsigned char MASKED_CELL_VALUE;
213};
214
215
216#endif
217
218
219
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:40
abstract class to specify cell behavior
Definition: vtkCell.h:60
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:33
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
int GetDataDescription()
Definition: vtkImageData.h:476
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
static void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds, int dataDescription, int dim[3])
Get the points defining a cell.
static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3])
Get the cells using a point.
image data with blanking
bool HasAnyBlankCells() override
Returns 1 if there is any visibility constraint on the cells, 0 otherwise.
vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
This is a version of the above method that can be used with multithreaded applications.
int GetGridDescription()
Returns the data description of this uniform grid instance.
virtual void UnBlankPoint(vtkIdType ptId)
int Initialize(const vtkAMRBox *def, double *origin, double *spacing, int nGhostsI, int nGhostsJ, int nGhostsK)
Construct a uniform grid, from the definition in the given box "def", with ghost cell arrays of the t...
virtual void UnBlankPoint(const int i, const int j, const int k)
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet API methods.
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an input image data object.
int GetDataObjectType() override
Return what type of dataset this is.
virtual void BlankPoint(const int i, const int j, const int k)
virtual void UnBlankCell(const int i, const int j, const int k)
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Topological inquiry to get points defining cell.
int Initialize(const vtkAMRBox *def, double *origin, double *spacing, int nGhosts)
Initialize from the definition in the given box, with ghost cell arrays nGhosts cells thick in all di...
int Initialize(const vtkAMRBox *def, double *origin, double *spacing, const int nGhosts[3])
Initialize from the definition in the given box, with ghost cell arrays of the thickness given in eac...
static vtkUniformGrid * New()
Construct an empty uniform grid.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkCell * FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Locate the cell that contains a point and return the cell.
virtual void UnBlankCell(vtkIdType ptId)
void Initialize() override
Restore data object to initial state.
int Initialize(const vtkAMRBox *def, double *origin, double *spacing)
Initialize with no ghost cell arrays, from the definition in the given box.
int GetCellType(vtkIdType cellId) override
Get type of cell with cellId such that: 0 <= cellId < NumberOfCells.
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Topological inquiry to get cells using point.
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Locate cell based on global coordinate x and tolerance squared.
virtual void BlankCell(const int i, const int j, const int k)
virtual void BlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
virtual void BlankPoint(vtkIdType ptId)
Methods for supporting blanking of cells.
dynamic, self-adjusting array of unsigned char
@ info
Definition: vtkX3D.h:376
@ spacing
Definition: vtkX3D.h:481
#define VTK_UNIFORM_GRID
Definition: vtkType.h:97
int vtkIdType
Definition: vtkType.h:287