VTK-m  2.1
CellSet.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 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_CellSet_h
11 #define vtk_m_cont_CellSet_h
12 
14 
15 #include <vtkm/StaticAssert.h>
16 
17 #include <vtkm/cont/ArrayHandle.h>
18 
19 namespace vtkm
20 {
21 namespace cont
22 {
23 
29 {
30 public:
31  CellSet() = default;
32  CellSet(const CellSet&) = default;
33  CellSet(CellSet&&) noexcept = default;
34 
35  CellSet& operator=(const CellSet&) = default;
36  CellSet& operator=(CellSet&&) noexcept = default;
37 
38  virtual ~CellSet();
39 
41  virtual vtkm::Id GetNumberOfCells() const = 0;
42 
43  virtual vtkm::Id GetNumberOfFaces() const = 0;
44 
45  virtual vtkm::Id GetNumberOfEdges() const = 0;
46 
48  virtual vtkm::Id GetNumberOfPoints() const = 0;
49 
51  virtual vtkm::UInt8 GetCellShape(vtkm::Id id) const = 0;
53  virtual vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id id) const = 0;
55  virtual void GetCellPointIds(vtkm::Id id, vtkm::Id* ptids) const = 0;
56 
58  virtual std::shared_ptr<CellSet> NewInstance() const = 0;
62  virtual void DeepCopy(const CellSet* src) = 0;
63 
65  virtual void PrintSummary(std::ostream&) const = 0;
66 
71  virtual void ReleaseResourcesExecution() = 0;
72 };
73 
74 namespace internal
75 {
76 
82 template <typename T>
83 struct CellSetCheck
84 {
85  using U = typename std::remove_pointer<T>::type;
86  using type = typename std::is_base_of<vtkm::cont::CellSet, U>::type;
87 };
88 
89 #define VTKM_IS_CELL_SET(T) VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value)
90 
91 } // namespace internal
92 }
93 } // namespace vtkm::cont
94 
95 #endif //vtk_m_cont_CellSet_h
ArrayHandle.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::IdComponent
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
VTKM_CONT_EXPORT
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
vtkm_cont_export.h
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::cont::CellSet
Defines the topological structure of the data in a DataSet.
Definition: CellSet.h:28
vtkm::UInt8
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:169
StaticAssert.h