VTK  9.7.20260709
vtkRectilinearGrid.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
138
139#ifndef vtkRectilinearGrid_h
140#define vtkRectilinearGrid_h
141
142#include "vtkCartesianGrid.h"
143#include "vtkCommonDataModelModule.h" // For export macro
144#include "vtkSmartPointer.h" // For vtkSmartPointer
145#include "vtkStructuredData.h" // For inline methods
146#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
147
148VTK_ABI_NAMESPACE_BEGIN
149class vtkDataArray;
151class vtkPoints;
152
153class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkRectilinearGrid : public vtkCartesianGrid
154{
155public:
158
160 void PrintSelf(ostream& os, vtkIndent indent) override;
161
165 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_RECTILINEAR_GRID; }
166
168
171 void ShallowCopy(vtkDataObject* src) override;
172 void DeepCopy(vtkDataObject* src) override;
174
179 void CopyStructure(vtkDataSet* ds) override;
180
184 void Initialize() override;
185
189
192 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
193 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
194 vtkIdType FindPoint(double x[3]) override;
195 vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* genCell, vtkIdType cellId,
196 double tol2, int& subId, double pcoords[3], double* weights) override;
197 void ComputeBounds() override;
199
208 int ComputeStructuredCoordinates(const double x[3], int ijk[3], double pcoords[3]) override;
209
215 vtkIdType ComputePointId(int ijk[3]) override;
216
222 vtkIdType ComputeCellId(int ijk[3]) override;
223
230 void GetPoint(int i, int j, int k, double p[3]);
231
233
237 vtkGetObjectMacro(XCoordinates, vtkDataArray);
239
241
245 vtkGetObjectMacro(YCoordinates, vtkDataArray);
247
249
253 vtkGetObjectMacro(ZCoordinates, vtkDataArray);
255
264 unsigned long GetActualMemorySize() override;
265
271 void Crop(const int updateExtent[6]) override;
272
274
280
281protected:
284
288
289 void BuildPoints() override;
290
291private:
292 void Cleanup();
293
294 vtkRectilinearGrid(const vtkRectilinearGrid&) = delete;
295 void operator=(const vtkRectilinearGrid&) = delete;
296};
297
298//----------------------------------------------------------------------------
303
304//----------------------------------------------------------------------------
309
310VTK_ABI_NAMESPACE_END
311#endif
void GetPoint(vtkIdType id, double x[3]) override
Standard vtkDataSet API methods.
int * GetDimensions()
Get dimensions of this structured points dataset.
virtual vtkIdType ComputeCellId(int ijk[3])=0
Given a location in structured coordinates (i-j-k), return the cell id.
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Standard vtkDataSet API methods.
virtual vtkIdType ComputePointId(int ijk[3])=0
Given a location in structured coordinates (i-j-k), return the point id.
vtkCell * GetCell(vtkIdType cellId) override
Standard vtkDataSet API methods.
abstract class to specify cell behavior
Definition vtkCell.h:130
provides thread-safe access to cells
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition vtkPoints.h:140
static vtkRectilinearGrid * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard vtkObject API methods.
void Initialize() override
Restore object to initial state.
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
virtual void SetZCoordinates(vtkDataArray *)
Specify the grid coordinates in the z-direction.
vtkIdType ComputeCellId(int ijk[3]) override
Given a location in structured coordinates (i-j-k), return the cell id.
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.
int ComputeStructuredCoordinates(const double x[3], int ijk[3], double pcoords[3]) override
Computes the cell structured coordinates for a point x[3].
virtual void SetYCoordinates(vtkDataArray *)
Specify the grid coordinates in the y-direction.
virtual void SetXCoordinates(vtkDataArray *)
Specify the grid coordinates in the x-direction.
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
static vtkRectilinearGrid * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
vtkDataArray * YCoordinates
void Crop(const int updateExtent[6]) override
Reallocates and copies to set the Extent to the UpdateExtent.
vtkDataArray * XCoordinates
void BuildPoints() override
Pure abstract method responsible to build and set internal points.
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an input rectilinear grid object.
~vtkRectilinearGrid() override
void GetPoint(int i, int j, int k, double p[3])
Given the IJK-coordinates of the point, it returns the corresponding xyz-coordinates.
vtkIdType FindPoint(double x[3]) override
Standard vtkDataSet API methods.
vtkDataArray * ZCoordinates
void GetCellBounds(vtkIdType cellId, double bounds[6]) override
Standard vtkDataSet API methods.
static vtkRectilinearGrid * New()
void ComputeBounds() override
Standard vtkDataSet API methods.
int GetDataObjectType() VTK_FUTURE_CONST override
Return what type of dataset this is.
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkIdType ComputePointId(int ijk[3]) override
Given a location in structured coordinates (i-j-k), return the point id.
static vtkRectilinearGrid * ExtendedNew()
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Standard vtkDataSet API methods.
implicit object to represent cell connectivity
static vtkIdType ComputePointId(const int dim[3], const int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given a location in structured coordinates (i-j-k), and the dimensions of the structured dataset,...
static vtkIdType ComputeCellId(const int dim[3], const int ijk[3], int dataDescription=vtkStructuredData::VTK_STRUCTURED_EMPTY)
Given a location in structured coordinates (i-j-k), and the dimensions of the structured dataset,...
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363
@ VTK_RECTILINEAR_GRID
Definition vtkType.h:112
#define VTK_MARSHALAUTO