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.
|
|
|
|
//
|
|
|
|
// Copyright 2015 Sandia Corporation.
|
|
|
|
// Copyright 2015 UT-Battelle, LLC.
|
|
|
|
// Copyright 2015 Los Alamos National Security.
|
|
|
|
//
|
|
|
|
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
|
|
|
// 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/DynamicArrayHandle.h>
|
|
|
|
#include <vtkm/cont/Field.h>
|
2015-04-15 16:43:12 +00:00
|
|
|
|
|
|
|
namespace vtkm {
|
|
|
|
namespace cont {
|
|
|
|
|
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
|
2016-05-13 18:26:59 +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
|
2015-10-21 22:27:09 +00:00
|
|
|
CellSet(const vtkm::cont::CellSet &src)
|
2016-12-16 22:04:58 +00:00
|
|
|
: Name(src.Name)
|
2015-10-21 22:27:09 +00:00
|
|
|
{ }
|
|
|
|
|
2016-10-19 22:42:58 +00:00
|
|
|
VTKM_CONT
|
2015-10-21 22:27:09 +00:00
|
|
|
CellSet &operator=(const vtkm::cont::CellSet &src)
|
|
|
|
{
|
|
|
|
this->Name = src.Name;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
virtual ~CellSet();
|
2015-05-11 20:54:16 +00:00
|
|
|
|
2016-12-16 22:04:58 +00:00
|
|
|
std::string GetName() const
|
2015-05-11 20:54:16 +00:00
|
|
|
{
|
2015-07-12 16:05:47 +00:00
|
|
|
return this->Name;
|
2015-05-11 20:54:16 +00:00
|
|
|
}
|
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
|
|
|
|
2015-07-12 16:05:47 +00:00
|
|
|
virtual void PrintSummary(std::ostream&) const = 0;
|
2015-05-20 19:26:10 +00:00
|
|
|
|
|
|
|
protected:
|
2015-07-12 16:05:47 +00:00
|
|
|
std::string Name;
|
2015-04-15 16:43:12 +00:00
|
|
|
};
|
|
|
|
|
2015-07-28 23:33:52 +00:00
|
|
|
namespace internal {
|
|
|
|
|
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.
|
|
|
|
///
|
|
|
|
template<typename T>
|
|
|
|
struct CellSetCheck
|
|
|
|
{
|
2016-08-29 15:13:00 +00:00
|
|
|
using type = typename std::is_base_of<vtkm::cont::CellSet, T>;
|
2015-07-28 23:33:52 +00:00
|
|
|
};
|
|
|
|
|
2015-08-14 21:16:12 +00:00
|
|
|
#define VTKM_IS_CELL_SET(T) \
|
2015-09-17 19:45:35 +00:00
|
|
|
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
|