VTK  9.5.20251105
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
145#ifndef vtkStructuredGrid_h
146#define vtkStructuredGrid_h
147
148#include "vtkCommonDataModelModule.h" // For export macro
149#include "vtkPointSet.h"
150#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
151
152#include "vtkStructuredData.h" // Needed for inline methods
153
154VTK_ABI_NAMESPACE_BEGIN
155class vtkEmptyCell;
156class vtkHexahedron;
157class vtkLine;
158class vtkQuad;
160class vtkVertex;
161
162class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkStructuredGrid : public vtkPointSet
163{
164public:
167
169 void PrintSelf(ostream& os, vtkIndent indent) override;
170
174 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_STRUCTURED_GRID; }
175
179 void CopyStructure(vtkDataSet* ds) override;
180
184 void Initialize() override;
185
187
190 vtkIdType GetNumberOfCells() override;
192 double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override
193 {
194 return this->vtkPointSet::GetPoint(ptId);
195 }
196 void GetPoint(vtkIdType ptId, double p[3]) override { this->vtkPointSet::GetPoint(ptId, p); }
197 vtkCell* GetCell(vtkIdType cellId) override;
198 vtkCell* GetCell(int i, int j, int k) override;
199 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
200 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
201 int GetCellType(vtkIdType cellId) override;
203 void GetCellPoints(vtkIdType cellId, vtkIdType& npts, vtkIdType const*& pts, vtkIdList* ptIds)
204 VTK_SIZEHINT(pts, npts) override;
205 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
206 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override
207 {
208 int dims[3];
209 this->GetDimensions(dims);
210 vtkStructuredData::GetPointCells(ptId, cellIds, dims);
211 }
212 int GetMaxCellSize() override { return 8; } // hexahedron is the largest
213 int GetMaxSpatialDimension() override;
214 int GetMinSpatialDimension() override;
215 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds) override;
216 void GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds, int* seedLoc);
218
225
227
233 using vtkDataSet::GetCellTypes; // VTK_DEPRECATED_IN_9_6_0
235 VTK_DEPRECATED_IN_9_6_0("Use vtkConstantArray<unsigned char>* GetCellTypes() instead")
236 vtkConstantArray<int>* GetCellTypesArray();
238
240
246 void BlankPoint(vtkIdType ptId);
247 void UnBlankPoint(vtkIdType ptId);
249
251
257 void BlankCell(vtkIdType ptId);
258 void UnBlankCell(vtkIdType ptId);
260
266 unsigned char IsPointVisible(vtkIdType ptId);
267
273 unsigned char IsCellVisible(vtkIdType cellId);
274
279 bool HasAnyBlankPoints() override;
284 bool HasAnyBlankCells() override;
285
289 vtkGetMacro(DataDescription, int);
290
297 void GetCellDims(int cellDims[3]);
298
300
303 void SetDimensions(int i, int j, int k);
304
308 void SetDimensions(const int dims[3]);
310
314 virtual void GetDimensions(int dims[3]);
315
319 int GetDataDimension();
320
322
327 void SetExtent(VTK_FUTURE_CONST int extent[6]);
328 void SetExtent(int xMin, int xMax, int yMin, int yMax, int zMin, int zMax);
329 vtkGetVector6Macro(Extent, int);
331
340 unsigned long GetActualMemorySize() override;
341
343
346 void ShallowCopy(vtkDataObject* src) override;
347 void DeepCopy(vtkDataObject* src) override;
349
353 int GetExtentType() VTK_FUTURE_CONST override { return VTK_3D_EXTENT; }
354
360 void Crop(const int* updateExtent) override;
361
363
369
379 void GetPoint(int i, int j, int k, double p[3], bool adjustForExtent = true);
380
381protected:
384
385 int Dimensions[3];
386
388
389 int Extent[6];
390
394
399 void ComputeScalarRange() override;
400
404
405private:
406 // Internal method used by DeepCopy and ShallowCopy.
407 void InternalStructuredGridCopy(vtkStructuredGrid* src);
408
409 vtkStructuredGrid(const vtkStructuredGrid&) = delete;
410 void operator=(const vtkStructuredGrid&) = delete;
411};
412
413//------------------------------------------------------------------------------
415{
417}
418
419//------------------------------------------------------------------------------
421{
423}
424
425//------------------------------------------------------------------------------
427{
429}
430
431//------------------------------------------------------------------------------
433{
435}
436
437VTK_ABI_NAMESPACE_END
438#endif
abstract class to specify cell behavior
Definition vtkCell.h:129
general representation of visualization data
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
virtual int GetMaxSpatialDimension()
Get the maximum/minimum spatial dimensionality of the data which is the maximum/minimum dimension of ...
virtual void GetCellTypes(vtkCellTypes *types)
Get a list of types of cells in a dataset.
Definition vtkDataSet.h:298
virtual int GetMinSpatialDimension()
Get the maximum/minimum spatial dimensionality of the data which is the maximum/minimum dimension of ...
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:133
A read only array class that wraps an implicit function from integers to any value type supported by ...
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
cell represents a 1D line
Definition vtkLine.h:132
concrete class for storing a set of points
Definition vtkPointSet.h:98
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:87
Hold a reference to a vtkObjectBase instance.
implicit object to represent cell connectivity
static vtkIdType GetNumberOfCells(const int ext[6], int dataDescription=vtkStructuredData::VTK_STRUCTURED_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.
topologically regular array of data
vtkSmartPointer< vtkStructuredCellArray > StructuredCells
static vtkStructuredGrid * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkIdType GetCellSize(vtkIdType cellId) override
Standard vtkDataSet API methods.
void GetPoint(vtkIdType ptId, double p[3]) override
Standard vtkDataSet API methods.
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.
vtkConstantArray< unsigned char > * GetCellTypes()
Get the array of all cell types in the structured grid.
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Standard vtkDataSet API methods.
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.
vtkSmartPointer< vtkConstantArray< int > > LegacyStructuredCellTypes
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Standard vtkDataSet API methods.
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.
vtkIdType GetNumberOfCells() override
Standard vtkDataSet API methods.
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet API methods.
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.
int GetDataObjectType() VTK_FUTURE_CONST override
Return what type of dataset this is.
vtkSmartPointer< vtkConstantArray< unsigned char > > StructuredCellTypes
int GetCellType(vtkIdType cellId) override
Standard vtkDataSet API methods.
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.
void GetPoint(int i, int j, int k, double p[3], bool adjustForExtent=true)
Get a point in the grid.
static vtkStructuredGrid * ExtendedNew()
static vtkStructuredGrid * New()
void GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds, vtkIdList *cellIds, int *seedLoc)
Standard vtkDataSet API methods.
int GetMinSpatialDimension() override
Standard vtkDataSet API methods.
void Initialize() override
Restore object to initial state.
dynamic, self-adjusting array of unsigned char
a cell that represents a 3D point
Definition vtkVertex.h:92
#define VTK_3D_EXTENT
#define VTK_DEPRECATED_IN_9_6_0(reason)
int vtkIdType
Definition vtkType.h:367
@ VTK_STRUCTURED_GRID
Definition vtkType.h:111
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO