vtk-m/vtkm/filter/CellSetConnectivity.hxx
Kenneth Moreland 5fa02057ae Rely less on overload resolution for ApplyPolicy
Previously, all the ApplyPolicy functions had the same name and used
template resolution to figure out which one to use. This was pretty
clear at first when there was just one for fields and one for cell sets.
But then it grew to several different types, particularly for fields. It
was hard to look at the code and figure out which form of ApplyPolicy
was being used, and compilers were starting to get confused.

Resolve the problem by giving all the methods unique names to make it
clear which one you expect to be called.
2019-09-09 16:08:11 -06:00

45 lines
1.4 KiB
C++

//============================================================================
// 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.
//============================================================================
#ifndef vtkm_m_filter_CellSetConnectivity_hxx
#define vtkm_m_filter_CellSetConnectivity_hxx
#include <vtkm/filter/CreateResult.h>
#include <vtkm/worklet/connectivities/CellSetConnectivity.h>
namespace vtkm
{
namespace filter
{
VTKM_CONT CellSetConnectivity::CellSetConnectivity()
{
this->SetOutputFieldName("component");
}
template <typename T, typename StorageType, typename DerivedPolicy>
inline VTKM_CONT vtkm::cont::DataSet CellSetConnectivity::DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<T, StorageType>&,
const vtkm::filter::FieldMetadata& fieldMetadata,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy)
{
vtkm::cont::ArrayHandle<vtkm::Id> component;
vtkm::worklet::connectivity::CellSetConnectivity().Run(
vtkm::filter::ApplyPolicyCellSet(input.GetCellSet(), policy), component);
return CreateResult(input, component, this->GetOutputFieldName(), fieldMetadata);
}
}
}
#endif //vtkm_m_filter_CellSetConnectivity_hxx