VTK  9.3.0
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 vtk-m
13 
14 #include <memory> // for std::shared_ptr
15 
16 namespace vtkm
17 {
18 namespace cont
19 {
20 
21 class DataSet;
22 
23 }
24 } // vtkm::cont
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 
28 class vtkPoints;
29 class vtkCell;
30 class vtkGenericCell;
31 
32 class VTKACCELERATORSVTKMDATAMODEL_EXPORT vtkmDataSet : public vtkDataSet
33 {
34 public:
35  vtkTypeMacro(vtkmDataSet, vtkDataSet);
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
38  static vtkmDataSet* New();
39 
42 
48  void CopyStructure(vtkDataSet* ds) override;
49 
54 
59 
63  double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override;
64 
69  void GetPoint(vtkIdType id, double x[3]) override;
70 
71  using vtkDataSet::GetCell;
75  vtkCell* GetCell(vtkIdType cellId) override;
76  void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
77 
82  void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
83 
87  int GetCellType(vtkIdType cellId) override;
88 
93  void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
94 
98  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
99 
101 
106  vtkIdType FindPoint(double x[3]) override;
108 
119  vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
120  double pcoords[3], double* weights) override;
121 
127  vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
128  double tol2, int& subId, double pcoords[3], double* weights) override;
129 
133  void Squeeze() override;
134 
138  void ComputeBounds() override;
139 
144  void Initialize() override;
145 
150  int GetMaxCellSize() override;
151 
159  unsigned long GetActualMemorySize() override;
160 
164  int GetDataObjectType() override { return VTK_DATA_SET; }
165 
167 
170  void ShallowCopy(vtkDataObject* src) override;
171  void DeepCopy(vtkDataObject* src) override;
173 
174 protected:
176  ~vtkmDataSet() override;
177 
178 private:
179  vtkmDataSet(const vtkmDataSet&) = delete;
180  void operator=(const vtkmDataSet&) = delete;
181 
182  struct DataMembers;
183  std::shared_ptr<DataMembers> Internals;
184  vtkmInitializer Initializer;
185 };
186 
187 VTK_ABI_NAMESPACE_END
188 #endif // vtkmDataSet_h
abstract class to specify cell behavior
Definition: vtkCell.h:59
general representation of visualization data
Definition: vtkDataObject.h:64
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
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:32
a simple class to control print indentation
Definition: vtkIndent.h:38
represent and manipulate 3D points
Definition: vtkPoints.h:38
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.
void SetVtkmDataSet(const vtkm::cont::DataSet &ds)
void GetPoint(vtkIdType id, double x[3]) override
Copy point coordinates into user provided array x[3] for specified point id.
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Locate cell based on global coordinate x and tolerance squared.
vtkCell * GetCell(vtkIdType cellId) override
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
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
static vtkmDataSet * New()
vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
This is a version of the above method that can be used with multithreaded applications.
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.
vtkm::cont::DataSet GetVtkmDataSet() const
int GetDataObjectType() override
Return the type of data object.
Definition: vtkmDataSet.h:164
void CopyStructure(vtkDataSet *ds) override
Copy the geometric and topological structure of an object.
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
int vtkIdType
Definition: vtkType.h:315
#define VTK_DATA_SET
Definition: vtkType.h:73
#define VTK_SIZEHINT(...)