VTK  9.0.1
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 "vtkAcceleratorsVTKmModule.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 VTKACCELERATORSVTKM_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 
50  void SetVtkmDataSet(const vtkm::cont::DataSet& ds);
51  vtkm::cont::DataSet GetVtkmDataSet() const;
52 
58  void CopyStructure(vtkDataSet* ds) override;
59 
63  vtkIdType GetNumberOfPoints() override;
64 
68  vtkIdType GetNumberOfCells() override;
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 
102  void GetCellPoints(vtkIdType cellId, vtkIdList* ptIds) override;
103 
107  void GetPointCells(vtkIdType ptId, vtkIdList* cellIds) override;
108 
110 
115  vtkIdType FindPoint(double x[3]) override;
117 
128  vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
129  double pcoords[3], double* weights) override;
130 
136  vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
137  double tol2, int& subId, double pcoords[3], double* weights) override;
138 
142  void Squeeze() override;
143 
147  void ComputeBounds() override;
148 
153  void Initialize() override;
154 
159  int GetMaxCellSize() override;
160 
168  unsigned long GetActualMemorySize() override;
169 
173  int GetDataObjectType() override { return VTK_DATA_SET; }
174 
176 
179  void ShallowCopy(vtkDataObject* src) override;
180  void DeepCopy(vtkDataObject* src) override;
182 
183 protected:
184  vtkmDataSet();
185  ~vtkmDataSet() override;
186 
187 private:
188  vtkmDataSet(const vtkmDataSet&) = delete;
189  void operator=(const vtkmDataSet&) = delete;
190 
191  struct DataMembers;
192  std::shared_ptr<DataMembers> Internals;
193 };
194 
195 #endif // vtkmDataSet_h
196 // VTK-HeaderTest-Exclude: 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 FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)=0
Locate cell based on global coordinate x and tolerance squared.
virtual vtkIdType GetNumberOfPoints()=0
Determine the number of points composing the dataset.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
int GetDataObjectType() override
Return the type of data object.
Definition: vtkmDataSet.h:173
virtual void ComputeBounds()
Compute the data bounding box from data points.
int vtkIdType
Definition: vtkType.h:338
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:56
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:33
virtual int GetMaxCellSize()=0
Convenience method returns largest cell size in dataset.
list of point or cell ids
Definition: vtkIdList.h:30
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)=0
Topological inquiry to get points defining cell.
#define VTK_DATA_SET
Definition: vtkType.h:93
std::map< std::string, DataArray > DataSet
key: variable name, value: DataArray
Definition: VTXTypes.h:39
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
#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:59
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition: vtkDataSet.h:193
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
represent and manipulate 3D points
Definition: vtkPoints.h:33
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.