2015-08-11 22:01:35 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2015-08-11 22:01:35 +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_worklet_Magnitude_h
|
|
|
|
#define vtk_m_worklet_Magnitude_h
|
|
|
|
|
|
|
|
#include <vtkm/worklet/WorkletMapField.h>
|
|
|
|
|
|
|
|
#include <vtkm/VectorAnalysis.h>
|
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace worklet
|
|
|
|
{
|
2015-08-11 22:01:35 +00:00
|
|
|
|
|
|
|
class Magnitude : public vtkm::worklet::WorkletMapField
|
|
|
|
{
|
|
|
|
public:
|
2019-01-10 18:59:25 +00:00
|
|
|
using ControlSignature = void(FieldIn, FieldOut);
|
2018-05-25 21:18:41 +00:00
|
|
|
using ExecutionSignature = void(_1, _2);
|
2015-08-11 22:01:35 +00:00
|
|
|
|
2017-05-18 14:29:41 +00:00
|
|
|
template <typename T, typename T2>
|
|
|
|
VTKM_EXEC void operator()(const T& inValue, T2& outValue) const
|
2015-08-11 22:01:35 +00:00
|
|
|
{
|
2018-01-04 18:19:39 +00:00
|
|
|
outValue = static_cast<T2>(vtkm::Magnitude(inValue));
|
2015-08-11 22:01:35 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
} // namespace vtkm::worklet
|
|
|
|
|
|
|
|
#endif // vtk_m_worklet_Magnitude_h
|