VTK  9.4.20251007
vtkStructuredGrid.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
35
36#ifndef vtkStructuredGrid_h
37#define vtkStructuredGrid_h
38
39#include "vtkCommonDataModelModule.h" // For export macro
40#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_3_0
41#include "vtkPointSet.h"
42
43#include "vtkStructuredData.h" // Needed for inline methods
44
45VTK_ABI_NAMESPACE_BEGIN
46class vtkEmptyCell;
47class vtkHexahedron;
48class vtkLine;
49class vtkQuad;
51class vtkVertex;
52
53class VTKCOMMONDATAMODEL_EXPORT vtkStructuredGrid : public vtkPointSet
54{
55public:
58
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
65 int GetDataObjectType() override { return VTK_STRUCTURED_GRID; }
66
70 void CopyStructure(vtkDataSet* ds) override;
71
75 void Initialize() override;
76
78
81 vtkIdType GetNumberOfCells() override;
83 double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override
84 {
85 return this->vtkPointSet::GetPoint(ptId);
86 }
87 void GetPoint(vtkIdType ptId, double p[3]) override { this->vtkPointSet::GetPoint(ptId, p); }
88 vtkCell* GetCell(vtkIdType cellId) override;
89 vtkCell* GetCell(int i, int j, int k) override;
90 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
91 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
92 int GetCellType(vtkIdType cellId) override;
94 void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
95 VTK_SIZEHINT(pts, npts) override;
96 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
97 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override
98 {
99 int dims[3];
100 this->GetDimensions(dims);
101 vtkStructuredData::GetPointCells(ptId, cellIds, dims);
102 }
103 int GetMaxCellSize() override { return 8; } // hexahedron is the largest
104 int GetMaxSpatialDimension() override;
105 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds) override;
106 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds, int* seedLoc);
108
115
123
125
134
136
145
151 unsigned char IsPointVisible(vtkIdType ptId);
152
158 unsigned char IsCellVisible(vtkIdType cellId);
159
164 bool HasAnyBlankPoints() override;
169 bool HasAnyBlankCells() override;
170
174 vtkGetMacro(DataDescription, int);
175
182 void GetCellDims(int cellDims[3]);
183
185
188 void SetDimensions(int i, int j, int k);
189
193 void SetDimensions(const int dims[3]);
195
197
200 VTK_DEPRECATED_IN_9_3_0("Please use GetDimensions(int dims[3]) instead.")
201 virtual int* GetDimensions() VTK_SIZEHINT(3);
202
206 virtual void GetDimensions(int dims[3]);
208
212 int GetDataDimension();
213
215
220 void SetExtent(VTK_FUTURE_CONST int extent[6]);
221 void SetExtent(int xMin, int xMax, int yMin, int yMax, int zMin, int zMax);
222 vtkGetVector6Macro(Extent, int);
224
233 unsigned long GetActualMemorySize() override;
234
236
239 void ShallowCopy(vtkDataObject* src) override;
240 void DeepCopy(vtkDataObject* src) override;
242
246 int GetExtentType() override { return VTK_3D_EXTENT; }
247
253 void Crop(const int* updateExtent) override;
254
256
262
272 void GetPoint(int i, int j, int k, double p[3], bool adjustForExtent = true);
273
274protected:
277
279
281
282 int Extent[6];
283
286
291 void ComputeScalarRange() override;
292
296
297private:
298 // Internal method used by DeepCopy and ShallowCopy.
299 void InternalStructuredGridCopy(vtkStructuredGrid* src);
300
301 vtkStructuredGrid(const vtkStructuredGrid&) = delete;
302 void operator=(const vtkStructuredGrid&) = delete;
303};
304
305//------------------------------------------------------------------------------
310
311//------------------------------------------------------------------------------
316
321
322VTK_ABI_NAMESPACE_END
323#endif
abstract class to specify cell behavior
Definition vtkCell.h:51
virtual int GetMaxSpatialDimension()
Get the maximum spatial dimensionality of the data which is the maximum dimension of all cells.
an empty cell used as a place-holder during processing
provides thread-safe access to cells
a cell that represents a linear 3D hexahedron
list of point or cell ids
Definition vtkIdList.h:24
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition vtkLine.h:23
vtkIdType GetNumberOfCells() override
This method always returns 0, as there are no cells in a vtkPointSet.
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
void GetPoint(vtkIdType ptId, double x[3]) override
See vtkDataSet for additional information.
a cell that represents a 2D quadrilateral
Definition vtkQuad.h:28
Hold a reference to a vtkObjectBase instance.
implicit object to represent cell connectivity
static vtkIdType GetNumberOfCells(const int ext[6], int dataDescription=VTK_EMPTY)
Given the grid extent, this method returns the total number of cells within the extent.
static int GetDataDimension(int dataDescription)
Return the topological dimension of the data (e.g., 0, 1, 2, or 3D).
static void GetPointCells(vtkIdType ptId, vtkIdList *cellIds, VTK_FUTURE_CONST int dim[3])
Get the cells using a point.
vtkSmartPointer< vtkStructuredCellArray > StructuredCells
static vtkStructuredGrid * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
void SetDimensions(int i, int j, int k)
Sets the extent to be 0 to i-1, 0 to j-1, and 0 to k-1.
vtkIdType GetCellSize(vtkIdType cellId) override
Standard vtkDataSet API methods.
void GetCellDims(int cellDims[3])
Given the node dimensions of this grid instance, this method computes the node dimensions.
void BlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
void GetPoint(vtkIdType ptId, double p[3]) override
Standard vtkDataSet API methods.
void BlankPoint(vtkIdType ptId)
Methods for supporting blanking of cells.
vtkStructuredCellArray * GetCells()
Return the structured grid connectivity array.
vtkCell * GetCell(int i, int j, int k) override
Standard vtkDataSet API methods.
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds) override
Standard vtkDataSet API methods.
void GetCellBounds(vtkIdType cellId, double bounds[6]) override
Standard vtkDataSet API methods.
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Standard vtkDataSet API methods.
int GetDataObjectType() override
Return what type of dataset this is.
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Standard vtkDataSet API methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Standard vtkDataSet API methods.
int GetExtentType() override
The extent type is a 3D extent.
int GetMaxCellSize() override
Standard vtkDataSet API methods.
int GetDataDimension()
Return the dimensionality of the data.
void BuildImplicitStructures()
~vtkStructuredGrid() override
void ComputeScalarRange() override
Compute the range of the scalars and cache it into ScalarRange only if the cache became invalid (Scal...
int GetMaxSpatialDimension() override
Standard vtkDataSet API methods.
vtkIdType GetNumberOfPoints() override
Standard vtkDataSet API methods.
double * GetPoint(vtkIdType ptId) override
Standard vtkDataSet API methods.
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkIdType GetNumberOfCells() override
Standard vtkDataSet API methods.
bool HasAnyBlankCells() override
Returns 1 if there is any visibility constraint on the cells, 0 otherwise.
void UnBlankPoint(vtkIdType ptId)
Methods for supporting blanking of cells.
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet API methods.
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
void Crop(const int *updateExtent) override
Reallocates and copies to set the Extent to the UpdateExtent.
void GetCellPoints(vtkIdType cellId, vtkIdType &npts, vtkIdType const *&pts, vtkIdList *ptIds) override
Standard vtkDataSet API methods.
unsigned char IsCellVisible(vtkIdType cellId)
Return non-zero value if specified point is visible.
int GetCellType(vtkIdType cellId) override
Standard vtkDataSet API methods.
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an input poly data object.
static vtkStructuredGrid * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
virtual int * GetDimensions()
Get dimensions of this structured grid.
unsigned char IsPointVisible(vtkIdType ptId)
Return non-zero value if specified point is visible.
void GetPoint(int i, int j, int k, double p[3], bool adjustForExtent=true)
Get a point in the grid.
static vtkStructuredGrid * ExtendedNew()
bool HasAnyBlankPoints() override
Returns 1 if there is any visibility constraint on the points, 0 otherwise.
static vtkStructuredGrid * New()
vtkSmartPointer< vtkConstantArray< int > > StructuredCellTypes
void SetExtent(VTK_FUTURE_CONST int extent[6])
Different ways to set the extent of the data array.
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds, int *seedLoc)
Standard vtkDataSet API methods.
void UnBlankCell(vtkIdType ptId)
Methods for supporting blanking of cells.
void Initialize() override
Restore object to initial state.
vtkConstantArray< int > * GetCellTypesArray()
Get the array of all cell types in the structured grid.
void SetDimensions(const int dims[3])
Sets the extent to be 0 to dim[i]-1 in all 3 dimensions.
dynamic, self-adjusting array of unsigned char
a cell that represents a 3D point
Definition vtkVertex.h:23
vtkImplicitArray< vtkConstantImplicitBackend< T > > vtkConstantArray
A utility alias for wrapping constant functions in implicit arrays.
#define VTK_3D_EXTENT
#define VTK_DEPRECATED_IN_9_3_0(reason)
int vtkIdType
Definition vtkType.h:315
#define VTK_STRUCTURED_GRID
Definition vtkType.h:67
#define VTK_SIZEHINT(...)