VTK  9.2.5
vtkmDataSet.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 // This software is distributed WITHOUT ANY WARRANTY; without even
6 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
7 // PURPOSE. See the above copyright notice for more information.
8 //
9 // Copyright 2015 Sandia Corporation.
10 // Copyright 2015 UT-Battelle, LLC.
11 // Copyright 2015 Los Alamos National Security.
12 //
13 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
14 // the U.S. Government retains certain rights in this software.
15 //
16 // Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
17 // Laboratory (LANL), the U.S. Government retains certain rights in
18 // this software.
19 //============================================================================
20 #ifndef vtkmDataSet_h
21 #define vtkmDataSet_h
22 
23 #include "vtkAcceleratorsVTKmDataModelModule.h" // For export macro
24 #include "vtkDataSet.h"
25 
26 #include <memory> // for std::shared_ptr
27 
28 namespace vtkm
29 {
30 namespace cont
31 {
32 
33 class DataSet;
34 
35 }
36 } // vtkm::cont
37 
38 class vtkPoints;
39 class vtkCell;
40 class vtkGenericCell;
41 
42 class VTKACCELERATORSVTKMDATAMODEL_EXPORT vtkmDataSet : public vtkDataSet
43 {
44 public:
45  vtkTypeMacro(vtkmDataSet, vtkDataSet);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
48  static vtkmDataSet* New();
49 
52 
58  void CopyStructure(vtkDataSet* ds) override;
59 
64 
69 
73  double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override;
74 
79  void GetPoint(vtkIdType id, double x[3]) override;
80 
81  using vtkDataSet::GetCell;
85  vtkCell* GetCell(vtkIdType cellId) override;
86  void GetCell(vtkIdType cellId, vtkGenericCell* cell) override;
87 
92  void GetCellBounds(vtkIdType cellId, double bounds[6]) override;
93 
97  int GetCellType(vtkIdType cellId) override;
98 
103  void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
104 
108  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
109 
111 
116  vtkIdType FindPoint(double x[3]) override;
118 
129  vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
130  double pcoords[3], double* weights) override;
131 
137  vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
138  double tol2, int& subId, double pcoords[3], double* weights) override;
139 
143  void Squeeze() override;
144 
148  void ComputeBounds() override;
149 
154  void Initialize() override;
155 
160  int GetMaxCellSize() override;
161 
169  unsigned long GetActualMemorySize() override;
170 
174  int GetDataObjectType() override { return VTK_DATA_SET; }
175 
177 
180  void ShallowCopy(vtkDataObject* src) override;
181  void DeepCopy(vtkDataObject* src) override;
183 
184 protected:
186  ~vtkmDataSet() override;
187 
188 private:
189  vtkmDataSet(const vtkmDataSet&) = delete;
190  void operator=(const vtkmDataSet&) = delete;
191 
192  struct DataMembers;
193  std::shared_ptr<DataMembers> Internals;
194 };
195 
196 #endif // vtkmDataSet_h
abstract class to specify cell behavior
Definition: vtkCell.h:150
general representation of visualization data
abstract class to specify dataset behavior
Definition: vtkDataSet.h:172
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:143
a simple class to control print indentation
Definition: vtkIndent.h:119
represent and manipulate 3D points
Definition: vtkPoints.h:149
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:174
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:39
int vtkIdType
Definition: vtkType.h:332
#define VTK_DATA_SET
Definition: vtkType.h:85
#define VTK_SIZEHINT(...)