2015-05-11 20:54:16 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
|
|
|
// 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.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Copyright 2015 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
2015-05-11 20:54:16 +00:00
|
|
|
// Copyright 2015 UT-Battelle, LLC.
|
|
|
|
// Copyright 2015 Los Alamos National Security.
|
|
|
|
//
|
2017-09-20 21:33:44 +00:00
|
|
|
// Under the terms of Contract DE-NA0003525 with NTESS,
|
2015-05-11 20:54:16 +00:00
|
|
|
// the U.S. Government retains certain rights in this software.
|
|
|
|
//
|
|
|
|
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
|
|
|
// Laboratory (LANL), the U.S. Government retains certain rights in
|
|
|
|
// this software.
|
|
|
|
//============================================================================
|
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>
|
|
|
|
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
|
2017-05-18 14:51:24 +00:00
|
|
|
#include <vtkm/cont/Field.h>
|
2018-12-11 13:56:08 +00:00
|
|
|
#include <vtkm/cont/VariantArrayHandle.h>
|
2015-04-15 16:43:12 +00:00
|
|
|
|
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:
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
CellSet(const std::string& name)
|
2016-12-16 22:04:58 +00:00
|
|
|
: Name(name)
|
2015-05-11 20:54:16 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
CellSet(const vtkm::cont::CellSet& src)
|
2016-12-16 22:04:58 +00:00
|
|
|
: Name(src.Name)
|
2017-05-18 14:29:41 +00:00
|
|
|
{
|
|
|
|
}
|
2015-10-21 22:27:09 +00:00
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2017-05-18 14:29:41 +00:00
|
|
|
CellSet& operator=(const vtkm::cont::CellSet& src)
|
2015-10-21 22:27:09 +00:00
|
|
|
{
|
|
|
|
this->Name = src.Name;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
virtual ~CellSet();
|
2015-05-11 20:54:16 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
std::string GetName() const { return this->Name; }
|
2016-01-25 14:23:08 +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;
|
|
|
|
|
|
|
|
virtual std::shared_ptr<CellSet> CreateNewInstance() const = 0;
|
|
|
|
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-05-20 19:26:10 +00:00
|
|
|
protected:
|
2017-05-18 14:29:41 +00:00
|
|
|
std::string Name;
|
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
|