VTK  9.1.0
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 =========================================================================*/
62 #ifndef vtkUniformGrid_h
63 #define vtkUniformGrid_h
64 
65 #include "vtkCommonDataModelModule.h" // For export macro
66 #include "vtkImageData.h"
67 
68 class vtkEmptyCell;
69 class vtkStructuredVisibilityConstraint;
71 class vtkAMRBox;
72 
73 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGrid : public vtkImageData
74 {
75 public:
77 
80  static vtkUniformGrid* New();
81  vtkTypeMacro(vtkUniformGrid, vtkImageData);
82  void PrintSelf(ostream& os, vtkIndent indent) override;
84 
89  void CopyStructure(vtkDataSet* ds) override;
90 
94  int GetDataObjectType() override { return VTK_UNIFORM_GRID; }
95 
97 
100  vtkCell* GetCell(int i, int j, int k) override;
101  vtkCell* GetCell(vtkIdType cellId) override;
102  void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
103  vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
104  double pcoords[3], double* weights) override;
105  vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
106  double tol2, int& subId, double pcoords[3], double* weights) override;
107  vtkCell* FindAndGetCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
108  double pcoords[3], double* weights) override;
109  int GetCellType(vtkIdType cellId) override;
110  void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override
111  {
113  cellId, ptIds, this->GetDataDescription(), this->GetDimensions());
114  }
115  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override
116  {
117  vtkStructuredData::GetPointCells(ptId, cellIds, this->GetDimensions());
118  }
119  void Initialize() override;
120  int GetMaxCellSize() override { return 8; } // voxel is the largest
122 
127 
134  int Initialize(const vtkAMRBox* def, double* origin, double* spacing);
142  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, int nGhosts);
143 
151  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, const int nGhosts[3]);
160  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, int nGhostsI, int nGhostsJ,
161  int nGhostsK);
162 
164 
170  virtual void BlankPoint(vtkIdType ptId);
171  virtual void UnBlankPoint(vtkIdType ptId);
172  virtual void BlankPoint(const int i, const int j, const int k);
173  virtual void UnBlankPoint(const int i, const int j, const int k);
175 
177 
183  virtual void BlankCell(vtkIdType ptId);
184  virtual void UnBlankCell(vtkIdType ptId);
185  virtual void BlankCell(const int i, const int j, const int k);
186  virtual void UnBlankCell(const int i, const int j, const int k);
188 
193  bool HasAnyBlankCells() override;
198  bool HasAnyBlankPoints() override;
199 
205  virtual unsigned char IsPointVisible(vtkIdType pointId);
206 
212  virtual unsigned char IsCellVisible(vtkIdType cellId);
213 
215 
217 
223 
224 protected:
226  ~vtkUniformGrid() override;
227 
231  void GetCellDims(int cellDims[3]);
232 
236  void ComputeScalarRange() override;
237 
239 
240 private:
241  vtkUniformGrid(const vtkUniformGrid&) = delete;
242  void operator=(const vtkUniformGrid&) = delete;
243 
244  vtkEmptyCell* EmptyCell;
245 
246  static unsigned char MASKED_CELL_VALUE;
247 };
248 
249 #endif
vtkAMRBox
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:73
vtkImageData.h
vtkUniformGrid::Initialize
void Initialize() override
Standard vtkDataSet API methods.
vtkUniformGrid::~vtkUniformGrid
~vtkUniformGrid() override
vtkUniformGrid::Initialize
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...
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkUniformGrid::GetDataObjectType
int GetDataObjectType() override
Return what type of dataset this is.
Definition: vtkUniformGrid.h:94
vtkUniformGrid::UnBlankPoint
virtual void UnBlankPoint(vtkIdType ptId)
Methods for supporting blanking of cells.
vtkUniformGrid::CopyStructure
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an input image data object.
vtkUniformGrid::GetEmptyCell
vtkEmptyCell * GetEmptyCell()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkEmptyCell
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:30
vtkUniformGrid::IsCellVisible
virtual unsigned char IsCellVisible(vtkIdType cellId)
Return non-zero value if specified cell is visible.
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:145
vtkUniformGrid::UnBlankPoint
virtual void UnBlankPoint(const int i, const int j, const int k)
Methods for supporting blanking of cells.
vtkUniformGrid::IsPointVisible
virtual unsigned char IsPointVisible(vtkIdType pointId)
Return non-zero value if specified point is visible.
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:74
vtkUniformGrid::GetData
static vtkUniformGrid * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
vtkUniformGrid::FindAndGetCell
vtkCell * FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
VTK_UNIFORM_GRID
#define VTK_UNIFORM_GRID
Definition: vtkType.h:87
vtkUniformGrid::NewImageDataCopy
virtual vtkImageData * NewImageDataCopy()
vtkImageData::GetDimensions
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
vtkUniformGrid::GetData
static vtkUniformGrid * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkUniformGrid::GetCell
vtkCell * GetCell(int i, int j, int k) override
Standard vtkDataSet API methods.
vtkUniformGrid::HasAnyBlankCells
bool HasAnyBlankCells() override
Returns 1 if there is any visibility constraint on the cells, 0 otherwise.
vtkUniformGrid::GetPointCells
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Standard vtkDataSet API methods.
Definition: vtkUniformGrid.h:115
vtkUniformGrid::vtkUniformGrid
vtkUniformGrid()
vtkStructuredData::GetCellPoints
static void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds, int dataDescription, int dim[3])
Get the points defining a cell.
vtkUniformGrid::GetCell
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Standard vtkDataSet API methods.
vtkUniformGrid::GetCellType
int GetCellType(vtkIdType cellId) override
Standard vtkDataSet API methods.
vtkUniformGrid::GetCell
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet API methods.
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:147
vtkUniformGrid::Initialize
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...
vtkStructuredData::GetPointCells
static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, int dim[3])
Get the cells using a point.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkUniformGrid::HasAnyBlankPoints
bool HasAnyBlankPoints() override
Returns 1 if there is any visibility constraint on the points, 0 otherwise.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkUniformGrid::BlankPoint
virtual void BlankPoint(vtkIdType ptId)
Methods for supporting blanking of cells.
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:140
vtkUniformGrid::New
static vtkUniformGrid * New()
Construct an empty uniform grid.
vtkUniformGrid::GetMaxCellSize
int GetMaxCellSize() override
Standard vtkDataSet API methods.
Definition: vtkUniformGrid.h:120
vtkUniformGrid::BlankCell
virtual void BlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
vtkImageData::vtkUniformGrid
friend class vtkUniformGrid
Definition: vtkImageData.h:746
vtkUniformGrid::GetCellPoints
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Standard vtkDataSet API methods.
Definition: vtkUniformGrid.h:110
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:487
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
vtkUniformGrid::Initialize
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...
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkUniformGrid::FindCell
vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
vtkUniformGrid::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Construct an empty uniform grid.
vtkUniformGrid::GetCellDims
void GetCellDims(int cellDims[3])
Returns the cell dimensions for this vtkUniformGrid instance.
vtkUniformGrid::BlankPoint
virtual void BlankPoint(const int i, const int j, const int k)
Methods for supporting blanking of cells.
vtkImageData::GetDataDescription
int GetDataDescription()
Definition: vtkImageData.h:740
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:116
vtkUniformGrid::FindCell
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
vtkUniformGrid::UnBlankCell
virtual void UnBlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
vtkUniformGrid::UnBlankCell
virtual void UnBlankCell(const int i, const int j, const int k)
Methods for supporting blanking of cells.
vtkUniformGrid::GetGridDescription
int GetGridDescription()
Returns the data description of this uniform grid instance.
vtkUniformGrid::ComputeScalarRange
void ComputeScalarRange() override
Override this method because of blanking.
vtkUniformGrid::BlankCell
virtual void BlankCell(const int i, const int j, const int k)
Methods for supporting blanking of cells.
vtkUniformGrid::Initialize
int Initialize(const vtkAMRBox *def, double *origin, double *spacing)
Initialize with no ghost cell arrays, from the definition in the given box.