VTK-m  2.0
Magnitude.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_worklet_Magnitude_h
11 #define vtk_m_worklet_Magnitude_h
12 
14 
15 #include <vtkm/VectorAnalysis.h>
16 
17 namespace vtkm
18 {
19 namespace worklet
20 {
21 
23 {
24 public:
26 
27  template <typename T, typename T2>
28  VTKM_EXEC void operator()(const T& inValue, T2& outValue) const
29  {
30  outValue = static_cast<T2>(vtkm::Magnitude(inValue));
31  }
32 };
33 }
34 } // namespace vtkm::worklet
35 
36 #endif // vtk_m_worklet_Magnitude_h
VTKM_EXEC
#define VTKM_EXEC
Definition: ExportMacros.h:51
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
WorkletMapField.h
vtkm::worklet::WorkletMapField::FieldOut
A control signature tag for output fields.
Definition: WorkletMapField.h:60
vtkm::Magnitude
VTKM_EXEC_CONT detail::FloatingPointReturnType< T >::Type Magnitude(const T &x)
Returns the magnitude of a vector.
Definition: VectorAnalysis.h:100
vtkm::worklet::Magnitude
Definition: Magnitude.h:22
VectorAnalysis.h
vtkm::worklet::WorkletMapField::FieldIn
A control signature tag for input fields.
Definition: WorkletMapField.h:49
vtkm::worklet::Magnitude::ControlSignature
void(FieldIn, FieldOut) ControlSignature
Definition: Magnitude.h:25
vtkm::worklet::Magnitude::operator()
VTKM_EXEC void operator()(const T &inValue, T2 &outValue) const
Definition: Magnitude.h:28
vtkm::worklet::WorkletMapField
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38