VTK  9.7.1
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 
16 namespace viskores
17 {
18 namespace cont
19 {
20 
21 class DataSet;
22 
23 }
24 } // viskores::cont
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 
28 class vtkPoints;
29 class vtkCell;
30 class 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 {
36 public:
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 
55  vtkIdType GetNumberOfPoints() override;
56 
60  vtkIdType GetNumberOfCells() override;
61 
65  double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override;
66 
71  void GetPoint(vtkIdType id, double x[3]) override;
72 
73  using vtkDataSet::GetCell;
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 
111  using Superclass::FindCell;
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 
170 protected:
171  vtkmDataSet();
172  ~vtkmDataSet() override;
173 
174 private:
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 
183 VTK_ABI_NAMESPACE_END
184 #endif // vtkmDataSet_h
virtual vtkIdType GetNumberOfCells()=0
Determine the number of cells composing the dataset.
virtual void GetPointCells(vtkIdType ptId, vtkIdList *cellIds)=0
Topological inquiry to get cells using point.
static vtkDataObject * New()
virtual vtkIdType GetNumberOfPoints()=0
Determine the number of points composing the dataset.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
virtual void ComputeBounds()
Compute the data bounding box from data points.
int vtkIdType
Definition: vtkType.h:363
virtual void Squeeze()
Reclaim any extra memory used to store data.
provides thread-safe access to cells
abstract class to specify cell behavior
Definition: vtkCell.h:50
#define VTK_DEPRECATED_IN_9_6_0(reason)
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int GetMaxCellSize()=0
Convenience method returns largest cell size in dataset.
list of point or cell ids
Definition: vtkIdList.h:25
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)=0
Topological inquiry to get points defining cell.
int GetDataObjectType() VTK_FUTURE_CONST override
Return the type of data object.
Definition: vtkmDataSet.h:160
std::map< std::string, DataArray > DataSet
key: variable name, value: DataArray
Definition: VTXTypes.h:28
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
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.
#define VTK_SIZEHINT(...)
void Initialize() override
Restore data object to initial state.
virtual void CopyStructure(vtkDataSet *ds)=0
Copy the geometric and topological structure of an object.
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
virtual double * GetPoint(vtkIdType ptId)=0
Get point coordinates with ptId such that: 0 <= ptId < NumberOfPoints.
general representation of visualization data
Definition: vtkDataObject.h:55
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition: vtkDataSet.h:248
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
represent and manipulate 3D points
Definition: vtkPoints.h:30
virtual void GetCellBounds(vtkIdType cellId, double bounds[6])
Get the bounds of the cell with cellId such that: 0 <= cellId < NumberOfCells.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int GetCellType(vtkIdType cellId)=0
Get type of cell with cellId such that: 0 <= cellId < NumberOfCells.