VTK-m  2.2
Normalize.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_Normalize_h
11 #define vtk_m_worklet_Normalize_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 = vtkm::Normal(inValue);
31  }
32 };
33 
35 {
36 public:
38 
39  template <typename T>
40  VTKM_EXEC void operator()(T& value) const
41  {
42  vtkm::Normalize(value);
43  }
44 };
45 }
46 } // namespace vtkm::worklet
47 
48 #endif // vtk_m_worklet_Normalize_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:80
vtkm::Normal
T Normal(const T &x)
Returns a normalized version of the given vector.
Definition: VectorAnalysis.h:158
VectorAnalysis.h
vtkm::worklet::Normalize::ControlSignature
void(FieldInOut) ControlSignature
Definition: Normalize.h:37
vtkm::worklet::Normal
Definition: Normalize.h:22
vtkm::worklet::WorkletMapField::FieldIn
A control signature tag for input fields.
Definition: WorkletMapField.h:60
vtkm::Normalize
void Normalize(T &x)
Changes a vector to be normal.
Definition: VectorAnalysis.h:169
vtkm::worklet::WorkletMapField::FieldInOut
A control signature tag for input-output (in-place) fields.
Definition: WorkletMapField.h:99
vtkm::worklet::Normalize
Definition: Normalize.h:34
vtkm::worklet::Normalize::operator()
void operator()(T &value) const
Definition: Normalize.h:40
vtkm::worklet::Normal::operator()
void operator()(const T &inValue, T2 &outValue) const
Definition: Normalize.h:28
vtkm::worklet::Normal::ControlSignature
void(FieldIn, FieldOut) ControlSignature
Definition: Normalize.h:25
vtkm::worklet::WorkletMapField
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:39