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.
|
|
|
|
//============================================================================
|
|
|
|
|
2019-10-07 19:39:02 +00:00
|
|
|
#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
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2018-08-30 15:53:18 +00:00
|
|
|
template <typename DerivedPolicy>
|
2020-11-17 19:37:05 +00:00
|
|
|
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
|
2019-08-13 17:08:54 +00:00
|
|
|
const vtkm::cont::DynamicCellSet& cells = input.GetCellSet();
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2017-03-02 21:09:03 +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;
|
2017-07-19 19:35:31 +00:00
|
|
|
|
|
|
|
if (cells.IsSameType(vtkm::cont::CellSetStructured<3>()))
|
2017-08-03 20:08:06 +00:00
|
|
|
{
|
2017-07-31 14:06:33 +00:00
|
|
|
this->Worklet.Run(cells.Cast<vtkm::cont::CellSetStructured<3>>(),
|
|
|
|
input.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex()),
|
2018-08-30 15:53:18 +00:00
|
|
|
outCellSet);
|
2017-08-03 20:08:06 +00:00
|
|
|
}
|
2017-07-19 19:35:31 +00:00
|
|
|
else
|
2017-08-03 20:08:06 +00:00
|
|
|
{
|
2020-05-15 23:47:30 +00:00
|
|
|
this->Worklet.Run(vtkm::filter::ApplyPolicyCellSetUnstructured(cells, policy, *this),
|
|
|
|
outCellSet);
|
2017-08-03 20:08:06 +00:00
|
|
|
}
|
2016-01-19 14:59:31 +00:00
|
|
|
|
2019-09-09 13:39:23 +00:00
|
|
|
return this->GenerateOutput(input, outCellSet);
|
2016-01-19 14:59:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-07 19:39:02 +00:00
|
|
|
|
|
|
|
#endif
|