VTK-m  2.0
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 
13 #include <vtkm/cont/vtkm_cont_export.h>
14 
15 #include <vtkm/StaticAssert.h>
16 
17 #include <vtkm/cont/ArrayHandle.h>
18 
19 namespace vtkm
20 {
21 namespace cont
22 {
23 
24 class VTKM_CONT_EXPORT CellSet
25 {
26 public:
27  CellSet() = default;
28  CellSet(const CellSet&) = default;
29  CellSet(CellSet&&) noexcept = default;
30 
31  CellSet& operator=(const CellSet&) = default;
32  CellSet& operator=(CellSet&&) noexcept = default;
33 
34  virtual ~CellSet();
35 
36  virtual vtkm::Id GetNumberOfCells() const = 0;
37 
38  virtual vtkm::Id GetNumberOfFaces() const = 0;
39 
40  virtual vtkm::Id GetNumberOfEdges() const = 0;
41 
42  virtual vtkm::Id GetNumberOfPoints() const = 0;
43 
44  virtual vtkm::UInt8 GetCellShape(vtkm::Id id) const = 0;
45  virtual vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id id) const = 0;
46  virtual void GetCellPointIds(vtkm::Id id, vtkm::Id* ptids) const = 0;
47 
48  virtual std::shared_ptr<CellSet> NewInstance() const = 0;
49  virtual void DeepCopy(const CellSet* src) = 0;
50 
51  virtual void PrintSummary(std::ostream&) const = 0;
52 
53  virtual void ReleaseResourcesExecution() = 0;
54 };
55 
56 namespace internal
57 {
58 
64 template <typename T>
65 struct CellSetCheck
66 {
67  using U = typename std::remove_pointer<T>::type;
68  using type = typename std::is_base_of<vtkm::cont::CellSet, U>::type;
69 };
70 
71 #define VTKM_IS_CELL_SET(T) VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value)
72 
73 } // namespace internal
74 }
75 } // namespace vtkm::cont
76 
77 #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
Represents a component ID (index of component in a vector).
Definition: Types.h:168
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::cont::CellSet
Definition: CellSet.h:24
vtkm::UInt8
uint8_t UInt8
Definition: Types.h:157
StaticAssert.h