2015-05-11 20:54:16 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2015-05-11 20:54:16 +00:00
|
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
// PURPOSE. See the above copyright notice for more information.
|
|
|
|
//============================================================================
|
2015-04-15 16:43:12 +00:00
|
|
|
#ifndef vtk_m_cont_CellSet_h
|
|
|
|
#define vtk_m_cont_CellSet_h
|
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
#include <vtkm/cont/vtkm_cont_export.h>
|
|
|
|
|
2015-09-17 19:45:35 +00:00
|
|
|
#include <vtkm/StaticAssert.h>
|
|
|
|
|
2015-04-15 16:43:12 +00:00
|
|
|
#include <vtkm/cont/ArrayHandle.h>
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
2015-04-15 16:43:12 +00:00
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
class VTKM_CONT_EXPORT CellSet
|
2015-04-15 16:43:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-01-13 20:54:59 +00:00
|
|
|
CellSet() = default;
|
2020-02-26 20:16:35 +00:00
|
|
|
CellSet(const CellSet&) = default;
|
|
|
|
CellSet(CellSet&&) noexcept = default;
|
2020-01-13 20:54:59 +00:00
|
|
|
|
2020-02-26 20:16:35 +00:00
|
|
|
CellSet& operator=(const CellSet&) = default;
|
|
|
|
CellSet& operator=(CellSet&&) noexcept = default;
|
2020-01-13 20:54:59 +00:00
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
virtual ~CellSet();
|
2015-05-11 20:54:16 +00:00
|
|
|
|
2015-08-02 21:59:44 +00:00
|
|
|
virtual vtkm::Id GetNumberOfCells() const = 0;
|
2015-05-11 20:54:16 +00:00
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
virtual vtkm::Id GetNumberOfFaces() const = 0;
|
2015-05-11 20:54:16 +00:00
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
virtual vtkm::Id GetNumberOfEdges() const = 0;
|
2015-05-11 20:54:16 +00:00
|
|
|
|
2015-12-22 00:27:54 +00:00
|
|
|
virtual vtkm::Id GetNumberOfPoints() const = 0;
|
2015-08-02 21:59:44 +00:00
|
|
|
|
2019-03-19 18:08:29 +00:00
|
|
|
virtual vtkm::UInt8 GetCellShape(vtkm::Id id) const = 0;
|
|
|
|
virtual vtkm::IdComponent GetNumberOfPointsInCell(vtkm::Id id) const = 0;
|
|
|
|
virtual void GetCellPointIds(vtkm::Id id, vtkm::Id* ptids) const = 0;
|
|
|
|
|
2019-04-02 20:23:51 +00:00
|
|
|
virtual std::shared_ptr<CellSet> NewInstance() const = 0;
|
2019-03-19 18:08:29 +00:00
|
|
|
virtual void DeepCopy(const CellSet* src) = 0;
|
|
|
|
|
2015-07-12 16:05:47 +00:00
|
|
|
virtual void PrintSummary(std::ostream&) const = 0;
|
2015-05-20 19:26:10 +00:00
|
|
|
|
2018-05-30 18:32:06 +00:00
|
|
|
virtual void ReleaseResourcesExecution() = 0;
|
2015-04-15 16:43:12 +00:00
|
|
|
};
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace internal
|
|
|
|
{
|
2015-07-28 23:33:52 +00:00
|
|
|
|
2016-08-29 15:13:00 +00:00
|
|
|
/// Checks to see if the given object is a cell set. It contains a
|
|
|
|
/// typedef named \c type that is either std::true_type or
|
|
|
|
/// std::false_type. Both of these have a typedef named value with the
|
2015-07-28 23:33:52 +00:00
|
|
|
/// respective boolean value.
|
|
|
|
///
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename T>
|
2015-07-28 23:33:52 +00:00
|
|
|
struct CellSetCheck
|
|
|
|
{
|
2018-06-28 18:29:27 +00:00
|
|
|
using U = typename std::remove_pointer<T>::type;
|
|
|
|
using type = typename std::is_base_of<vtkm::cont::CellSet, U>;
|
2015-07-28 23:33:52 +00:00
|
|
|
};
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
#define VTKM_IS_CELL_SET(T) VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value)
|
2015-07-28 23:33:52 +00:00
|
|
|
|
|
|
|
} // namespace internal
|
2015-04-15 16:43:12 +00:00
|
|
|
}
|
|
|
|
} // namespace vtkm::cont
|
|
|
|
|
|
|
|
#endif //vtk_m_cont_CellSet_h
|