VTK  9.2.5
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 =========================================================================*/
68 #ifndef vtkUniformGrid_h
69 #define vtkUniformGrid_h
70 
71 #include "vtkCommonDataModelModule.h" // For export macro
72 #include "vtkImageData.h"
73 
74 class vtkEmptyCell;
75 class vtkStructuredVisibilityConstraint;
77 class vtkAMRBox;
78 
79 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGrid : public vtkImageData
80 {
81 public:
83 
86  static vtkUniformGrid* New();
87  vtkTypeMacro(vtkUniformGrid, vtkImageData);
88  void PrintSelf(ostream& os, vtkIndent indent) override;
90 
95  void CopyStructure(vtkDataSet* ds) override;
96 
100  int GetDataObjectType() override { return VTK_UNIFORM_GRID; }
101 
103 
106  vtkCell* GetCell(int i, int j, int k) override;
107  vtkCell* GetCell(vtkIdType cellId) override;
108  void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
109  vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
110  double pcoords[3], double* weights) override;
111  vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
112  double tol2, int& subId, double pcoords[3], double* weights) override;
113  vtkCell* FindAndGetCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
114  double pcoords[3], double* weights) override;
115  int GetCellType(vtkIdType cellId) override;
117  void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override
118  {
120  cellId, ptIds, this->GetDataDescription(), this->GetDimensions());
121  }
122  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override
123  {
124  vtkStructuredData::GetPointCells(ptId, cellIds, this->GetDimensions());
125  }
126  void Initialize() override;
127  int GetMaxCellSize() override { return 8; } // voxel is the largest
129 
134 
141  int Initialize(const vtkAMRBox* def, double* origin, double* spacing);
149  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, int nGhosts);
150 
158  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, const int nGhosts[3]);
167  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, int nGhostsI, int nGhostsJ,
168  int nGhostsK);
169 
171 
177  virtual void BlankPoint(vtkIdType ptId);
178  virtual void UnBlankPoint(vtkIdType ptId);
179  virtual void BlankPoint(const int i, const int j, const int k);
180  virtual void UnBlankPoint(const int i, const int j, const int k);
182 
184 
190  virtual void BlankCell(vtkIdType ptId);
191  virtual void UnBlankCell(vtkIdType ptId);
192  virtual void BlankCell(const int i, const int j, const int k);
193  virtual void UnBlankCell(const int i, const int j, const int k);
195 
200  bool HasAnyBlankCells() override;
205  bool HasAnyBlankPoints() override;
206 
212  virtual unsigned char IsPointVisible(vtkIdType pointId);
213 
219  virtual unsigned char IsCellVisible(vtkIdType cellId);
220 
222 
224 
230 
231 protected:
233  ~vtkUniformGrid() override;
234 
238  void GetCellDims(int cellDims[3]);
239 
243  void ComputeScalarRange() override;
244 
246 
247 private:
248  vtkUniformGrid(const vtkUniformGrid&) = delete;
249  void operator=(const vtkUniformGrid&) = delete;
250 
251  vtkEmptyCell* EmptyCell;
252 
253  static unsigned char MASKED_CELL_VALUE;
254 };
255 
256 #endif
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:79
abstract class to specify cell behavior
Definition: vtkCell.h:150
abstract class to specify dataset behavior
Definition: vtkDataSet.h:172
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)=0
Topological inquiry to get points defining cell.
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:143
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
friend class vtkUniformGrid
Definition: vtkImageData.h:759
int GetDataDescription()
Definition: vtkImageData.h:753
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
a simple class to control print indentation
Definition: vtkIndent.h:119
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
Standard vtkDataSet API methods.
bool HasAnyBlankPoints() override
Returns 1 if there is any visibility constraint on the points, 0 otherwise.
int GetGridDescription()
Returns the data description of this uniform grid instance.
vtkCell * GetCell(int i, int j, int k) override
Standard vtkDataSet API methods.
virtual void UnBlankPoint(vtkIdType ptId)
Methods for supporting blanking of cells.
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 unsigned char IsCellVisible(vtkIdType cellId)
Return non-zero value if specified cell is visible.
virtual void UnBlankPoint(const int i, const int j, const int k)
Methods for supporting blanking of cells.
virtual unsigned char IsPointVisible(vtkIdType pointId)
Return non-zero value if specified point is visible.
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.
static vtkUniformGrid * New()
Construct an empty uniform grid.
virtual void BlankPoint(const int i, const int j, const int k)
Methods for supporting blanking of cells.
virtual vtkImageData * NewImageDataCopy()
static vtkUniformGrid * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
virtual void UnBlankCell(const int i, const int j, const int k)
Methods for supporting blanking of cells.
~vtkUniformGrid() override
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Standard vtkDataSet API methods.
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...
void ComputeScalarRange() override
Override this method because of blanking.
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...
void PrintSelf(ostream &os, vtkIndent indent) override
Construct an empty uniform grid.
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet API methods.
vtkEmptyCell * GetEmptyCell()
int GetMaxCellSize() override
Standard vtkDataSet API methods.
virtual void UnBlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
static vtkUniformGrid * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
vtkCell * FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
void Initialize() override
Standard vtkDataSet API methods.
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
Standard vtkDataSet API methods.
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Standard vtkDataSet API methods.
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Standard vtkDataSet API methods.
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
virtual void BlankCell(const int i, const int j, const int k)
Methods for supporting blanking of cells.
void GetCellDims(int cellDims[3])
Returns the cell dimensions for this vtkUniformGrid instance.
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:382
@ spacing
Definition: vtkX3D.h:487
#define VTK_UNIFORM_GRID
Definition: vtkType.h:87
int vtkIdType
Definition: vtkType.h:332