VTK  9.1.0
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
28namespace vtkm
29{
30namespace cont
31{
32
33class DataSet;
34
35}
36} // vtkm::cont
37
38class vtkPoints;
39class vtkCell;
40class vtkGenericCell;
41
42class VTKACCELERATORSVTKMDATAMODEL_EXPORT vtkmDataSet : public vtkDataSet
43{
44public:
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
64
69
73 double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override;
74
79 void GetPoint(vtkIdType id, double x[3]) override;
80
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
183protected:
185 ~vtkmDataSet() override;
186
187private:
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
abstract class to specify cell behavior
Definition: vtkCell.h:147
general representation of visualization data
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
virtual vtkCell * GetCell(vtkIdType cellId)=0
Get cell with cellId such that: 0 <= cellId < NumberOfCells.
provides thread-safe access to cells
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
represent and manipulate 3D points
Definition: vtkPoints.h:143
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.
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
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.
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.
vtkm::cont::DataSet GetVtkmDataSet() const
int GetDataObjectType() override
Return the type of data object.
Definition: vtkmDataSet.h:173
static vtkmDataSet * New()
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(...)