Viskores  1.0
WarpScalar.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 
19 #ifndef viskores_filter_field_transform_WarpScalar_h
20 #define viskores_filter_field_transform_WarpScalar_h
21 
23 
24 #include <viskores/Deprecated.h>
25 
26 struct VISKORES_DEPRECATED(2.2, "WarpScalar.h header no longer supported. Use Warp.h.")
28 {
29 };
30 
32 
33 namespace viskores
34 {
35 namespace filter
36 {
37 namespace field_transform
38 {
39 
40 class VISKORES_DEPRECATED(2.2, "Use more general Warp filter.") WarpScalar
42 {
43 public:
44  VISKORES_DEPRECATED(2.2, "Use SetScaleFactor().")
46  {
47  this->SetScaleFactor(scaleAmount);
48  this->SetOutputFieldName("warpscalar");
49  }
50 
51  VISKORES_DEPRECATED(2.2, "Use SetDirectionField().")
52  VISKORES_CONT void SetNormalField(
53  const std::string& name,
54  viskores::cont::Field::Association association = viskores::cont::Field::Association::Any)
55  {
56  if ((association != viskores::cont::Field::Association::Any) &&
58  {
59  throw viskores::cont::ErrorBadValue("Normal field should always be associated with points.");
60  }
61  this->SetDirectionField(name);
62  }
63 
64  VISKORES_DEPRECATED(2.2, "Use GetDirectionFieldName().")
65  VISKORES_CONT std::string GetNormalFieldName() const { return this->GetDirectionFieldName(); }
66 
67  VISKORES_DEPRECATED(2.2, "Only point association supported.")
68  VISKORES_CONT viskores::cont::Field::Association GetNormalFieldAssociation() const
69  {
70  return this->GetActiveFieldAssociation(1);
71  }
72 
73  VISKORES_DEPRECATED(2.2, "Use SetScaleField().")
74  VISKORES_CONT void SetScalarFactorField(
75  const std::string& name,
76  viskores::cont::Field::Association association = viskores::cont::Field::Association::Any)
77  {
78  if ((association != viskores::cont::Field::Association::Any) &&
80  {
81  throw viskores::cont::ErrorBadValue("Normal field should always be associated with points.");
82  }
83  this->SetScaleField(name);
84  }
85 
86  VISKORES_DEPRECATED(2.2, "Use GetScaleField().")
87  VISKORES_CONT std::string GetScalarFactorFieldName() const { return this->GetScaleFieldName(); }
88 
89  VISKORES_DEPRECATED(2.2, "Only point association supported.")
90  VISKORES_CONT viskores::cont::Field::Association GetScalarFactorFieldAssociation() const
91  {
92  return this->GetActiveFieldAssociation(1);
93  }
94 };
95 
96 } // namespace field_transform
97 } // namespace filter
98 } // namespace viskores
99 
100 #endif //viskores_filter_field_transform_WarpScalar_h
Warp.h
viskores::cont::Field::Association::Any
@ Any
Any field regardless of the association.
viskores_give_WarpScalar_h_warning
viskores_deprecated_WarpScalar_h_warning viskores_give_WarpScalar_h_warning
Definition: WarpScalar.h:31
viskores::filter::field_transform::WarpScalar
Definition: WarpScalar.h:40
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
VISKORES_DEPRECATED
#define VISKORES_DEPRECATED(...)
Definition: Deprecated.h:156
viskores::filter::field_transform::Warp
Modify points by moving points along scaled direction vectors.
Definition: Warp.h:61
viskores::cont::ErrorBadValue
This class is thrown when a Viskores function or method encounters an invalid value that inhibits pro...
Definition: ErrorBadValue.h:33
viskores::FloatDefault
viskores::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:244
Deprecated.h
viskores_deprecated_WarpScalar_h_warning
Definition: WarpScalar.h:26
viskores::cont::Field::Association::Points
@ Points
A field that applies to points.