2016-12-14 20:10:43 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2016-12-14 20:10:43 +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_PointAverage_h
|
|
|
|
#define vtk_m_filter_PointAverage_h
|
|
|
|
|
2020-08-19 23:20:43 +00:00
|
|
|
#include <vtkm/filter/vtkm_filter_extra_export.h>
|
2019-09-09 13:39:23 +00:00
|
|
|
|
|
|
|
#include <vtkm/cont/ArrayHandleUniformPointCoordinates.h>
|
2020-05-15 23:47:30 +00:00
|
|
|
#include <vtkm/cont/CellSetExtrude.h>
|
2020-08-10 23:25:55 +00:00
|
|
|
#include <vtkm/filter/FilterField.h>
|
2016-12-14 20:10:43 +00:00
|
|
|
#include <vtkm/worklet/PointAverage.h>
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace filter
|
|
|
|
{
|
2017-07-06 17:51:45 +00:00
|
|
|
/// \brief Cell to Point interpolation filter.
|
|
|
|
///
|
|
|
|
/// PointAverage is a filter that transforms cell data (i.e., data
|
|
|
|
/// specified per cell) into point data (i.e., data specified at cell
|
|
|
|
/// points). The method of transformation is based on averaging the data
|
|
|
|
/// values of all cells using a particular point.
|
2020-08-10 23:25:55 +00:00
|
|
|
class VTKM_ALWAYS_EXPORT PointAverage : public vtkm::filter::FilterField<PointAverage>
|
2016-12-14 20:10:43 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-08-30 15:53:18 +00:00
|
|
|
template <typename T, typename StorageType, typename DerivedPolicy>
|
2018-04-02 21:58:21 +00:00
|
|
|
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input,
|
|
|
|
const vtkm::cont::ArrayHandle<T, StorageType>& field,
|
|
|
|
const vtkm::filter::FieldMetadata& fieldMeta,
|
2019-09-09 13:39:23 +00:00
|
|
|
vtkm::filter::PolicyBase<DerivedPolicy> policy);
|
2016-12-14 20:10:43 +00:00
|
|
|
|
2020-05-15 23:47:30 +00:00
|
|
|
// PointAverage is a simple filter that is used to test custom filter types.
|
|
|
|
using AdditionalFieldStorage = vtkm::List<vtkm::cont::internal::StorageTagExtrude>;
|
|
|
|
using SupportedCellSets =
|
|
|
|
vtkm::ListAppend<vtkm::List<vtkm::cont::CellSetExtrude>, VTKM_DEFAULT_CELL_SET_LIST>;
|
|
|
|
|
2016-12-14 20:10:43 +00:00
|
|
|
private:
|
|
|
|
vtkm::worklet::PointAverage Worklet;
|
|
|
|
};
|
2019-09-09 13:39:23 +00:00
|
|
|
|
|
|
|
#ifndef vtkm_filter_PointAverage_cxx
|
|
|
|
VTKM_FILTER_EXPORT_EXECUTE_METHOD(PointAverage);
|
|
|
|
#endif
|
2016-12-14 20:10:43 +00:00
|
|
|
}
|
|
|
|
} // namespace vtkm::filter
|
|
|
|
|
2019-10-07 19:39:02 +00:00
|
|
|
#include <vtkm/filter/PointAverage.hxx>
|
|
|
|
|
2016-12-14 20:10:43 +00:00
|
|
|
#endif // vtk_m_filter_PointAverage_h
|