VTK-m  2.0
FieldPropagation.h
Go to the documentation of this file.
1 
2 //============================================================================
3 // Copyright (c) Kitware, Inc.
4 // All rights reserved.
5 // See LICENSE.txt for details.
6 //
7 // This software is distributed WITHOUT ANY WARRANTY; without even
8 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9 // PURPOSE. See the above copyright notice for more information.
10 //============================================================================
11 
12 #ifndef vtk_m_worklet_contour_FieldPropagation_h
13 #define vtk_m_worklet_contour_FieldPropagation_h
14 
15 #include <vtkm/VectorAnalysis.h>
17 namespace vtkm
18 {
19 namespace worklet
20 {
21 namespace contour
22 {
23 
24 // ---------------------------------------------------------------------------
26 {
27 public:
28  using ControlSignature = void(FieldIn interpolation_ids,
29  FieldIn interpolation_weights,
30  WholeArrayIn inputField,
31  FieldOut output);
32  using ExecutionSignature = void(_1, _2, _3, _4);
33  using InputDomain = _1;
34 
35  VTKM_CONT
37 
38  template <typename WeightType, typename InFieldPortalType, typename OutFieldType>
39  VTKM_EXEC void operator()(const vtkm::Id2& low_high,
40  const WeightType& weight,
41  const InFieldPortalType& inPortal,
42  OutFieldType& result) const
43  {
44  //fetch the low / high values from inPortal
45  result = static_cast<OutFieldType>(
46  vtkm::Lerp(inPortal.Get(low_high[0]), inPortal.Get(low_high[1]), weight));
47  }
48 };
49 }
50 }
51 }
52 
53 
54 #endif
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::contour::MapPointField
Definition: FieldPropagation.h:25
vtkm::worklet::WorkletMapField::FieldOut
A control signature tag for output fields.
Definition: WorkletMapField.h:60
vtkm::worklet::contour::MapPointField::operator()
VTKM_EXEC void operator()(const vtkm::Id2 &low_high, const WeightType &weight, const InFieldPortalType &inPortal, OutFieldType &result) const
Definition: FieldPropagation.h:39
VectorAnalysis.h
vtkm::worklet::WorkletMapField::FieldIn
A control signature tag for input fields.
Definition: WorkletMapField.h:49
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::worklet::contour::MapPointField::InputDomain
_1 InputDomain
Definition: FieldPropagation.h:33
vtkm::Lerp
VTKM_EXEC_CONT ValueType Lerp(const ValueType &value0, const ValueType &value1, const WeightType &weight)
Returns the linear interpolation of two values based on weight.
Definition: VectorAnalysis.h:32
vtkm::Vec< vtkm::Id, 2 >
vtkm::worklet::contour::MapPointField::MapPointField
VTKM_CONT MapPointField()
Definition: FieldPropagation.h:36
vtkm::worklet::contour::MapPointField::ExecutionSignature
void(_1, _2, _3, _4) ExecutionSignature
Definition: FieldPropagation.h:32
vtkm::worklet::contour::MapPointField::ControlSignature
void(FieldIn interpolation_ids, FieldIn interpolation_weights, WholeArrayIn inputField, FieldOut output) ControlSignature
Definition: FieldPropagation.h:31
vtkm::worklet::WorkletMapField
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38