Viskores  1.0
CellSet.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_cont_CellSet_h
19 #define viskores_cont_CellSet_h
20 
22 
23 #include <viskores/StaticAssert.h>
24 
26 
27 namespace viskores
28 {
29 namespace cont
30 {
31 
36 class VISKORES_CONT_EXPORT CellSet
37 {
38 public:
39  CellSet() = default;
40  CellSet(const CellSet&) = default;
41  CellSet(CellSet&&) noexcept = default;
42 
43  CellSet& operator=(const CellSet&) = default;
44  CellSet& operator=(CellSet&&) noexcept = default;
45 
46  virtual ~CellSet();
47 
49  virtual viskores::Id GetNumberOfCells() const = 0;
50 
51  virtual viskores::Id GetNumberOfFaces() const = 0;
52 
53  virtual viskores::Id GetNumberOfEdges() const = 0;
54 
56  virtual viskores::Id GetNumberOfPoints() const = 0;
57 
59  virtual viskores::UInt8 GetCellShape(viskores::Id id) const = 0;
61  virtual viskores::IdComponent GetNumberOfPointsInCell(viskores::Id id) const = 0;
63  virtual void GetCellPointIds(viskores::Id id, viskores::Id* ptids) const = 0;
64 
66  virtual std::shared_ptr<CellSet> NewInstance() const = 0;
70  virtual void DeepCopy(const CellSet* src) = 0;
71 
73  virtual void PrintSummary(std::ostream&) const = 0;
74 
79  virtual void ReleaseResourcesExecution() = 0;
80 };
81 
82 namespace internal
83 {
84 
90 template <typename T>
91 struct CellSetCheck
92 {
93  using U = typename std::remove_pointer<T>::type;
94  using type = typename std::is_base_of<viskores::cont::CellSet, U>::type;
95 };
96 
97 #define VISKORES_IS_CELL_SET(T) \
98  VISKORES_STATIC_ASSERT(::viskores::cont::internal::CellSetCheck<T>::type::value)
99 
100 } // namespace internal
101 }
102 } // namespace viskores::cont
103 
104 #endif //viskores_cont_CellSet_h
ArrayHandle.h
viskores::IdComponent
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::UInt8
uint8_t UInt8
Base type to use for 8-bit unsigned integer numbers.
Definition: Types.h:177
StaticAssert.h
viskores::cont::CellSet
Defines the topological structure of the data in a DataSet.
Definition: CellSet.h:36
viskores_cont_export.h