vtk-m/vtkm/filter/ExternalFaces.hxx

49 lines
1.5 KiB
C++
Raw Normal View History

2016-01-19 14:59:31 +00:00
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
2019-04-15 23:24:21 +00:00
//
2016-01-19 14:59:31 +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.
//============================================================================
#ifndef vtk_m_filter_ExternalFaces_hxx
#define vtk_m_filter_ExternalFaces_hxx
2017-05-18 14:29:41 +00:00
namespace vtkm
{
namespace filter
{
2016-01-19 14:59:31 +00:00
//-----------------------------------------------------------------------------
template <typename DerivedPolicy>
vtkm::cont::DataSet ExternalFaces::DoExecute(const vtkm::cont::DataSet& input,
vtkm::filter::PolicyBase<DerivedPolicy> policy)
2016-01-19 14:59:31 +00:00
{
//1. extract the cell set
const vtkm::cont::DynamicCellSet& cells = input.GetCellSet();
2016-01-19 14:59:31 +00:00
//2. using the policy convert the dynamic cell set, and run the
2016-01-19 14:59:31 +00:00
// external faces worklet
2019-08-13 21:28:37 +00:00
vtkm::cont::CellSetExplicit<> outCellSet;
if (cells.IsSameType(vtkm::cont::CellSetStructured<3>()))
{
this->Worklet.Run(cells.Cast<vtkm::cont::CellSetStructured<3>>(),
input.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex()),
outCellSet);
}
else
{
this->Worklet.Run(vtkm::filter::ApplyPolicyCellSetUnstructured(cells, policy, *this),
outCellSet);
}
2016-01-19 14:59:31 +00:00
return this->GenerateOutput(input, outCellSet);
2016-01-19 14:59:31 +00:00
}
}
}
#endif