2019-09-09 13:39:23 +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.
|
|
|
|
//============================================================================
|
|
|
|
#define vtkm_filter_Threshold_cxx
|
|
|
|
#include <vtkm/filter/Threshold.h>
|
|
|
|
|
2020-02-06 21:58:59 +00:00
|
|
|
#include <vtkm/filter/MapFieldPermutation.h>
|
|
|
|
|
2019-09-09 13:39:23 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace filter
|
|
|
|
{
|
2020-02-06 21:58:59 +00:00
|
|
|
|
2020-11-17 19:37:05 +00:00
|
|
|
bool Threshold::MapFieldOntoOutput(vtkm::cont::DataSet& result, const vtkm::cont::Field& field)
|
2020-02-06 21:58:59 +00:00
|
|
|
{
|
2020-02-19 17:34:24 +00:00
|
|
|
if (field.IsFieldPoint() || field.IsFieldGlobal())
|
2020-02-06 21:58:59 +00:00
|
|
|
{
|
|
|
|
//we copy the input handle to the result dataset, reusing the metadata
|
|
|
|
result.AddField(field);
|
|
|
|
return true;
|
|
|
|
}
|
2020-02-19 17:34:24 +00:00
|
|
|
else if (field.IsFieldCell())
|
2020-02-06 21:58:59 +00:00
|
|
|
{
|
|
|
|
return vtkm::filter::MapFieldPermutation(field, this->Worklet.GetValidCellIds(), result);
|
|
|
|
}
|
2020-02-19 17:34:24 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2020-02-06 21:58:59 +00:00
|
|
|
}
|
|
|
|
|
2019-09-09 13:39:23 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2020-11-17 19:37:05 +00:00
|
|
|
VTKM_FILTER_COMMON_INSTANTIATE_EXECUTE_METHOD(Threshold);
|
2019-09-09 13:39:23 +00:00
|
|
|
}
|
|
|
|
}
|