Viskores  1.0
LogValues.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 #ifndef viskores_filter_field_transform_LogValues_h
19 #define viskores_filter_field_transform_LogValues_h
20 
21 #include <viskores/filter/Filter.h>
23 
24 namespace viskores
25 {
26 namespace filter
27 {
28 namespace field_transform
29 {
30 
43 class VISKORES_FILTER_FIELD_TRANSFORM_EXPORT LogValues : public viskores::filter::Filter
44 {
45 public:
47  enum struct LogBase
48  {
50  E,
52  TWO,
54  TEN
55  };
56 
58  VISKORES_CONT const LogBase& GetBaseValue() const { return this->BaseValue; }
60  VISKORES_CONT void SetBaseValue(const LogBase& base) { this->BaseValue = base; }
61 
67  VISKORES_CONT void SetBaseValueToE() { this->SetBaseValue(LogBase::E); }
72  VISKORES_CONT void SetBaseValueTo2() { this->SetBaseValue(LogBase::TWO); }
77  VISKORES_CONT void SetBaseValueTo10() { this->SetBaseValue(LogBase::TEN); }
78 
86  viskores::FloatDefault GetMinValue() const { return this->MinValue; }
88  void SetMinValue(const viskores::FloatDefault& value) { this->MinValue = value; }
89 
90 private:
91  viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
92  LogBase BaseValue = LogBase::E;
93  viskores::FloatDefault MinValue = std::numeric_limits<FloatDefault>::min();
94 };
95 } // namespace field_transform
96 } // namespace viskores::filter
97 } // namespace viskores
98 
99 #endif //viskores_filter_field_transform_LogValues_h
viskores::filter::field_transform::LogValues::SetBaseValue
void SetBaseValue(const LogBase &base)
Specify the base of the logarithm.
Definition: LogValues.h:60
viskores::filter::field_transform::LogValues
Adds field to a viskores::cont::DataSet that gives the log values for the user specified field.
Definition: LogValues.h:43
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::field_transform::LogValues::SetMinValue
void SetMinValue(const viskores::FloatDefault &value)
Specifies the minimum value to take the logarithm of.
Definition: LogValues.h:88
viskores::filter::field_transform::LogValues::SetBaseValueTo10
void SetBaseValueTo10()
Take the base 10 logarithm.
Definition: LogValues.h:77
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores::filter::field_transform::LogValues::SetBaseValueToE
void SetBaseValueToE()
Take the natural logarithm.
Definition: LogValues.h:67
viskores::filter::field_transform::LogValues::SetBaseValueTo2
void SetBaseValueTo2()
Take the base 2 logarithm.
Definition: LogValues.h:72
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::filter::field_transform::LogValues::GetMinValue
viskores::FloatDefault GetMinValue() const
Specifies the minimum value to take the logarithm of.
Definition: LogValues.h:86
viskores::filter::field_transform::LogValues::LogBase
LogBase
Identifies a type of logarithm as specified by its base.
Definition: LogValues.h:47
viskores::filter::field_transform::LogValues::GetBaseValue
const LogBase & GetBaseValue() const
Specify the base of the logarithm.
Definition: LogValues.h:58
viskores::FloatDefault
viskores::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:244
viskores_filter_field_transform_export.h
Filter.h