vtk-m/vtkm/filter/CellSetConnectivity.hxx

43 lines
1.3 KiB
C++
Raw Normal View History

2019-04-15 23:24:21 +00:00
//============================================================================
2019-02-28 16:11:08 +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.
2019-04-15 23:24:21 +00:00
//============================================================================
2019-02-28 16:11:08 +00:00
#ifndef vtkm_m_filter_CellSetConnectivity_hxx
#define vtkm_m_filter_CellSetConnectivity_hxx
#include <vtkm/filter/CreateResult.h>
#include <vtkm/worklet/connectivities/CellSetConnectivity.h>
2019-02-28 16:11:08 +00:00
namespace vtkm
{
namespace filter
{
VTKM_CONT CellSetConnectivity::CellSetConnectivity()
: OutputFieldName("component")
{
}
template <typename Policy>
2019-02-28 16:11:08 +00:00
inline VTKM_CONT vtkm::cont::DataSet CellSetConnectivity::DoExecute(
const vtkm::cont::DataSet& input,
vtkm::filter::PolicyBase<Policy> policy)
2019-02-28 16:11:08 +00:00
{
vtkm::cont::ArrayHandle<vtkm::Id> component;
vtkm::worklet::connectivity::CellSetConnectivity().Run(
vtkm::filter::ApplyPolicyCellSet(input.GetCellSet(), policy, *this), component);
2019-02-28 16:11:08 +00:00
return CreateResultFieldCell(input, component, this->GetOutputFieldName());
2019-02-28 16:11:08 +00:00
}
}
}
#endif //vtkm_m_filter_CellSetConnectivity_hxx