VTK-m  2.2
WarpScalar.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 
11 #ifndef vtk_m_filter_field_transform_WarpScalar_h
12 #define vtk_m_filter_field_transform_WarpScalar_h
13 
15 
16 #include <vtkm/Deprecated.h>
17 
18 struct VTKM_DEPRECATED(2.2, "WarpScalar.h header no longer supported. Use Warp.h.")
20 {
21 };
22 
24 
25 namespace vtkm
26 {
27 namespace filter
28 {
29 namespace field_transform
30 {
31 
32 class VTKM_DEPRECATED(2.2, "Use more general Warp filter.") WarpScalar
34 {
35 public:
36  VTKM_DEPRECATED(2.2, "Use SetScaleFactor().")
37  VTKM_CONT explicit WarpScalar(vtkm::FloatDefault scaleAmount)
38  {
39  this->SetScaleFactor(scaleAmount);
40  this->SetOutputFieldName("warpscalar");
41  }
42 
43  VTKM_DEPRECATED(2.2, "Use SetDirectionField().")
44  VTKM_CONT void SetNormalField(
45  const std::string& name,
46  vtkm::cont::Field::Association association = vtkm::cont::Field::Association::Any)
47  {
48  if ((association != vtkm::cont::Field::Association::Any) &&
50  {
51  throw vtkm::cont::ErrorBadValue("Normal field should always be associated with points.");
52  }
53  this->SetDirectionField(name);
54  }
55 
56  VTKM_DEPRECATED(2.2, "Use GetDirectionFieldName().")
57  VTKM_CONT std::string GetNormalFieldName() const { return this->GetDirectionFieldName(); }
58 
59  VTKM_DEPRECATED(2.2, "Only point association supported.")
60  VTKM_CONT vtkm::cont::Field::Association GetNormalFieldAssociation() const
61  {
62  return this->GetActiveFieldAssociation(1);
63  }
64 
65  VTKM_DEPRECATED(2.2, "Use SetScaleField().")
66  VTKM_CONT void SetScalarFactorField(
67  const std::string& name,
68  vtkm::cont::Field::Association association = vtkm::cont::Field::Association::Any)
69  {
70  if ((association != vtkm::cont::Field::Association::Any) &&
72  {
73  throw vtkm::cont::ErrorBadValue("Normal field should always be associated with points.");
74  }
75  this->SetScaleField(name);
76  }
77 
78  VTKM_DEPRECATED(2.2, "Use GetScaleField().")
79  VTKM_CONT std::string GetScalarFactorFieldName() const { return this->GetScaleFieldName(); }
80 
81  VTKM_DEPRECATED(2.2, "Only point association supported.")
82  VTKM_CONT vtkm::cont::Field::Association GetScalarFactorFieldAssociation() const
83  {
84  return this->GetActiveFieldAssociation(1);
85  }
86 };
87 
88 } // namespace field_transform
89 } // namespace filter
90 } // namespace vtkm
91 
92 #endif //vtk_m_filter_field_transform_WarpScalar_h
vtkm_give_WarpScalar_h_warning
vtkm_deprecated_WarpScalar_h_warning vtkm_give_WarpScalar_h_warning
Definition: WarpScalar.h:23
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Warp.h
vtkm::filter::field_transform::Warp
Modify points by moving points along scaled direction vectors.
Definition: Warp.h:53
vtkm_deprecated_WarpScalar_h_warning
Definition: WarpScalar.h:18
vtkm::filter::field_transform::WarpScalar
Definition: WarpScalar.h:32
vtkm::cont::Field::Association::Any
@ Any
Any field regardless of the association.
vtkm::cont::Field::Association::Points
@ Points
A field that applies to points.
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
vtkm::cont::ErrorBadValue
This class is thrown when a VTKm function or method encounters an invalid value that inhibits progres...
Definition: ErrorBadValue.h:25
Deprecated.h
VTKM_DEPRECATED
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145