VTK  9.6.20260516
vtkmDataSet.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) Kitware, Inc.
3// SPDX-FileCopyrightText: Copyright 2015 Sandia Corporation.
4// SPDX-FileCopyrightText: Copyright 2015 UT-Battelle, LLC.
5// SPDX-FileCopyrightText: Copyright 2015 Los Alamos National Security.
6// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-LANL-USGov
7#ifndef vtkmDataSet_h
8#define vtkmDataSet_h
9
10#include "vtkAcceleratorsVTKmDataModelModule.h" // For export macro
11#include "vtkDataSet.h"
12#include "vtkmlib/vtkmInitializer.h" // Need for initializing viskores
13
14#include <memory> // for std::shared_ptr
15
16namespace viskores
17{
18namespace cont
19{
20
21class DataSet;
22
23}
24} // viskores::cont
25
26VTK_ABI_NAMESPACE_BEGIN
27
28class vtkPoints;
29class vtkCell;
30class vtkGenericCell;
31
33 "This class has been made obsolete since all vtkmDataArrays can now be hold by vtkDataSet "
34 "subclasses.") VTKACCELERATORSVTKMDATAMODEL_EXPORT vtkmDataSet : public vtkDataSet
35{
36public:
37 vtkTypeMacro(vtkmDataSet, vtkDataSet);
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
40 static vtkmDataSet* New();
41
42 void SetVtkmDataSet(const viskores::cont::DataSet& ds);
43 viskores::cont::DataSet GetVtkmDataSet() const;
44
50 void CopyStructure(vtkDataSet* ds) override;
51
56
61
65 double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override;
66
71 void GetPoint(vtkIdType id, double x[3]) override;
72
77 vtkCell* GetCell(vtkIdType cellId) override;
78 void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
79
84 void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
85
89 int GetCellType(vtkIdType cellId) override;
90
95 void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
96
100 void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
101
103
108 vtkIdType FindPoint(double x[3]) override;
110
123 vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* genCell, vtkIdType cellId,
124 double tol2, int& subId, double pcoords[3], double* weights) override;
125
129 void Squeeze() override;
130
134 void ComputeBounds() override;
135
140 void Initialize() override;
141
146 int GetMaxCellSize() override;
147
155 unsigned long GetActualMemorySize() override;
156
160 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_DATA_SET; }
161
163
166 void ShallowCopy(vtkDataObject* src) override;
167 void DeepCopy(vtkDataObject* src) override;
169
170protected:
172 ~vtkmDataSet() override;
173
174private:
175 vtkmDataSet(const vtkmDataSet&) = delete;
176 void operator=(const vtkmDataSet&) = delete;
177
178 struct DataMembers;
179 std::shared_ptr<DataMembers> Internals;
180 vtkmInitializer Initializer;
181};
182
183VTK_ABI_NAMESPACE_END
184#endif // vtkmDataSet_h
abstract class to specify cell behavior
Definition vtkCell.h:130
virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)
Locate cell based on global coordinate x and tolerance squared.
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)=0
Topological inquiry to get points defining cell.
provides thread-safe access to cells
list of point or cell ids
Definition vtkIdList.h:135
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 3D points
Definition vtkPoints.h:140
vtkIdType GetNumberOfCells() override
Determine the number of cells composing the dataset.
void GetCellBounds(vtkIdType cellId, double bounds[6]) override
Get the bounds of the cell with cellId such that: 0 <= cellId < NumberOfCells.
int GetMaxCellSize() override
Convenience method returns largest cell size in dataset.
void GetPointCells(vtkIdType ptId, vtkIdList *cellIds) override
Topological inquiry to get cells using point.
vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *genCell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Locate cell based on global coordinate x and tolerance squared.
void GetPoint(vtkIdType id, double x[3]) override
Copy point coordinates into user provided array x[3] for specified point id.
void SetVtkmDataSet(const viskores::cont::DataSet &ds)
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
void ComputeBounds() override
Compute the data bounding box from data points.
void GetCell(vtkIdType cellId, vtkGenericCell *cell) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
~vtkmDataSet() override
int GetDataObjectType() VTK_FUTURE_CONST override
Return the type of data object.
vtkCell * GetCell(vtkIdType cellId) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
void Squeeze() override
Reclaim any extra memory used to store data.
double * GetPoint(vtkIdType ptId) override
Get point coordinates with ptId such that: 0 <= ptId < NumberOfPoints.
vtkIdType GetNumberOfPoints() override
Determine the number of points composing the dataset.
void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds) override
Topological inquiry to get points defining cell.
int GetCellType(vtkIdType cellId) override
Get type of cell with cellId such that: 0 <= cellId < NumberOfCells.
void Initialize() override
Restore data object to initial state.
static vtkmDataSet * New()
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an object.
viskores::cont::DataSet GetVtkmDataSet() const
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType FindPoint(double x[3]) override
Locate the closest point to the global coordinate x.
std::map< std::string, DataArray > DataSet
key: variable name, value: DataArray
Definition VTXTypes.h:28
#define VTK_DEPRECATED_IN_9_6_0(reason)
int vtkIdType
Definition vtkType.h:363
@ VTK_DATA_SET
Definition vtkType.h:117
#define VTK_SIZEHINT(...)