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
26#ifndef vtkUniformGrid_h
27#define vtkUniformGrid_h
28
29#include "vtkCommonDataModelModule.h" // For export macro
30#include "vtkImageData.h"
31
32VTK_ABI_NAMESPACE_BEGIN
33class vtkEmptyCell;
34class vtkStructuredVisibilityConstraint;
36class vtkAMRBox;
37
38class VTKCOMMONDATAMODEL_EXPORT vtkUniformGrid : public vtkImageData
39{
40public:
42
47 void PrintSelf(ostream& os, vtkIndent indent) override;
49
54 void CopyStructure(vtkDataSet* ds) override;
55
59 int GetDataObjectType() override { return VTK_UNIFORM_GRID; }
60
62
65 vtkCell* GetCell(int i, int j, int k) override;
66 vtkCell* GetCell(vtkIdType cellId) override;
67 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
68 vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
69 double pcoords[3], double* weights) override;
70 vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
71 double tol2, int& subId, double pcoords[3], double* weights) override;
72 vtkCell* FindAndGetCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
73 double pcoords[3], double* weights) override;
74 int GetCellType(vtkIdType cellId) override;
76 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override
77 {
79 cellId, ptIds, this->GetDataDescription(), this->GetDimensions());
80 }
81 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override
82 {
83 vtkStructuredData::GetPointCells(ptId, cellIds, this->GetDimensions());
84 }
85 void Initialize() override;
86 int GetMaxCellSize() override { return 8; } // voxel is the largest
88
93
100 int Initialize(const vtkAMRBox* def, double* origin, double* spacing);
108 int Initialize(const vtkAMRBox* def, double* origin, double* spacing, int nGhosts);
109
117 int Initialize(const vtkAMRBox* def, double* origin, double* spacing, const int nGhosts[3]);
126 int Initialize(const vtkAMRBox* def, double* origin, double* spacing, int nGhostsI, int nGhostsJ,
127 int nGhostsK);
128
130
136 virtual void BlankPoint(vtkIdType ptId);
137 virtual void UnBlankPoint(vtkIdType ptId);
138 virtual void BlankPoint(int i, int j, int k);
139 virtual void UnBlankPoint(int i, int j, int k);
141
143
149 virtual void BlankCell(vtkIdType ptId);
150 virtual void UnBlankCell(vtkIdType ptId);
151 virtual void BlankCell(int i, int j, int k);
152 virtual void UnBlankCell(int i, int j, int k);
154
159 bool HasAnyBlankCells() override;
164 bool HasAnyBlankPoints() override;
165
171 virtual unsigned char IsPointVisible(vtkIdType pointId);
172
178 virtual unsigned char IsCellVisible(vtkIdType cellId);
179
181
183
189
190protected:
192 ~vtkUniformGrid() override;
193
197 void GetCellDims(int cellDims[3]);
198
202 void ComputeScalarRange() override;
203
205
206private:
207 vtkUniformGrid(const vtkUniformGrid&) = delete;
208 void operator=(const vtkUniformGrid&) = delete;
209
210 vtkEmptyCell* EmptyCell;
211
212 static unsigned char MASKED_CELL_VALUE;
213};
214
215VTK_ABI_NAMESPACE_END
216#endif
Encloses a rectangular region of voxel like cells.
Definition vtkAMRBox.h:38
abstract class to specify cell behavior
Definition vtkCell.h:59
abstract class to specify dataset behavior
Definition vtkDataSet.h:62
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
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:32
topologically and geometrically regular array of data
friend class vtkUniformGrid
virtual int * GetDimensions()
Get dimensions of this structured points dataset.
int GetDataDescription()
a simple class to control print indentation
Definition vtkIndent.h:38
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 vtkImageData * NewImageDataCopy()
vtkCell * GetCell(int i, int j, int k) 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.
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.
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet API methods.
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 * GetData(vtkInformationVector *v, int i=0)
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...
static vtkUniformGrid * New()
Construct an empty uniform grid.
vtkEmptyCell * GetEmptyCell()
void PrintSelf(ostream &os, vtkIndent indent) override
Construct an empty uniform grid.
vtkCell * FindAndGetCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
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.
static vtkUniformGrid * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
int GetMaxCellSize() override
Standard vtkDataSet API methods.
virtual void UnBlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
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
#define VTK_UNIFORM_GRID
Definition vtkType.h:75
int vtkIdType
Definition vtkType.h:315
#define VTK_NEWINSTANCE