VTK  9.3.0
vtkUniformGrid.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkUniformGrid_h
18 #define vtkUniformGrid_h
19 
20 #include "vtkCommonDataModelModule.h" // For export macro
21 #include "vtkImageData.h"
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkEmptyCell;
25 class vtkStructuredVisibilityConstraint;
27 class vtkAMRBox;
28 
29 class VTKCOMMONDATAMODEL_EXPORT vtkUniformGrid : public vtkImageData
30 {
31 public:
33 
36  static vtkUniformGrid* New();
37  vtkTypeMacro(vtkUniformGrid, vtkImageData);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
45  void CopyStructure(vtkDataSet* ds) override;
46 
50  int GetDataObjectType() override { return VTK_UNIFORM_GRID; }
51 
53 
56  vtkCell* GetCell(int i, int j, int k) override;
57  vtkCell* GetCell(vtkIdType cellId) override;
58  void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
59  vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
60  double pcoords[3], double* weights) override;
61  vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
62  double tol2, int& subId, double pcoords[3], double* weights) override;
63  vtkCell* FindAndGetCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
64  double pcoords[3], double* weights) override;
65  int GetCellType(vtkIdType cellId) override;
67  void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override
68  {
70  cellId, ptIds, this->GetDataDescription(), this->GetDimensions());
71  }
72  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override
73  {
74  vtkStructuredData::GetPointCells(ptId, cellIds, this->GetDimensions());
75  }
76  void Initialize() override;
77  int GetMaxCellSize() override { return 8; } // voxel is the largest
79 
84 
91  int Initialize(const vtkAMRBox* def, double* origin, double* spacing);
99  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, int nGhosts);
100 
108  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, const int nGhosts[3]);
117  int Initialize(const vtkAMRBox* def, double* origin, double* spacing, int nGhostsI, int nGhostsJ,
118  int nGhostsK);
119 
121 
127  virtual void BlankPoint(vtkIdType ptId);
128  virtual void UnBlankPoint(vtkIdType ptId);
129  virtual void BlankPoint(int i, int j, int k);
130  virtual void UnBlankPoint(int i, int j, int k);
132 
134 
140  virtual void BlankCell(vtkIdType ptId);
141  virtual void UnBlankCell(vtkIdType ptId);
142  virtual void BlankCell(int i, int j, int k);
143  virtual void UnBlankCell(int i, int j, int k);
145 
150  bool HasAnyBlankCells() override;
155  bool HasAnyBlankPoints() override;
156 
162  virtual unsigned char IsPointVisible(vtkIdType pointId);
163 
169  virtual unsigned char IsCellVisible(vtkIdType cellId);
170 
172 
174 
180 
181 protected:
183  ~vtkUniformGrid() override;
184 
188  void GetCellDims(int cellDims[3]);
189 
193  void ComputeScalarRange() override;
194 
196 
197 private:
198  vtkUniformGrid(const vtkUniformGrid&) = delete;
199  void operator=(const vtkUniformGrid&) = delete;
200 
201  vtkEmptyCell* EmptyCell;
202 
203  static unsigned char MASKED_CELL_VALUE;
204 };
205 
206 VTK_ABI_NAMESPACE_END
207 #endif
Encloses a rectangular region of voxel like cells.
Definition: vtkAMRBox.h:29
abstract class to specify cell behavior
Definition: vtkCell.h:50
abstract class to specify dataset behavior
Definition: vtkDataSet.h:53
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:22
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:23
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
friend class vtkUniformGrid
Definition: vtkImageData.h:638
int GetDataDescription()
Definition: vtkImageData.h:633
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
a simple class to control print indentation
Definition: vtkIndent.h:29
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, VTK_FUTURE_CONST 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.
virtual void UnBlankPoint(int i, int j, int k)
Methods for supporting blanking of cells.
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 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 vtkImageData * NewImageDataCopy()
static vtkUniformGrid * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
virtual void BlankPoint(int i, int j, 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()
virtual void BlankCell(int i, int j, int k)
Methods for supporting blanking of cells.
virtual void UnBlankCell(int i, int j, int k)
Methods for supporting blanking of cells.
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.
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:376
@ spacing
Definition: vtkX3D.h:481
#define VTK_UNIFORM_GRID
Definition: vtkType.h:75
int vtkIdType
Definition: vtkType.h:315
#define VTK_NEWINSTANCE