VTK-m  2.2
LogValues.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_filter_field_transform_LogValues_h
11 #define vtk_m_filter_field_transform_LogValues_h
12 
13 #include <vtkm/filter/Filter.h>
15 
16 namespace vtkm
17 {
18 namespace filter
19 {
20 namespace field_transform
21 {
22 
36 {
37 public:
39  enum struct LogBase
40  {
42  E,
44  TWO,
46  TEN
47  };
48 
50  VTKM_CONT const LogBase& GetBaseValue() const { return this->BaseValue; }
52  VTKM_CONT void SetBaseValue(const LogBase& base) { this->BaseValue = base; }
53 
59  VTKM_CONT void SetBaseValueToE() { this->SetBaseValue(LogBase::E); }
64  VTKM_CONT void SetBaseValueTo2() { this->SetBaseValue(LogBase::TWO); }
69  VTKM_CONT void SetBaseValueTo10() { this->SetBaseValue(LogBase::TEN); }
70 
78  vtkm::FloatDefault GetMinValue() const { return this->MinValue; }
80  void SetMinValue(const vtkm::FloatDefault& value) { this->MinValue = value; }
81 
82 private:
83  vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
84  LogBase BaseValue = LogBase::E;
85  vtkm::FloatDefault MinValue = std::numeric_limits<FloatDefault>::min();
86 };
87 } // namespace field_transform
88 } // namespace vtkm::filter
89 } // namespace vtkm
90 
91 #endif //vtk_m_filter_field_transform_LogValues_h
vtkm::filter::field_transform::LogValues::SetBaseValueTo2
void SetBaseValueTo2()
Take the base 2 logarithm.
Definition: LogValues.h:64
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::field_transform::LogValues::SetBaseValue
void SetBaseValue(const LogBase &base)
Specify the base of the logarithm.
Definition: LogValues.h:52
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm_filter_field_transform_export.h
vtkm::filter::field_transform::LogValues::GetBaseValue
const LogBase & GetBaseValue() const
Specify the base of the logarithm.
Definition: LogValues.h:50
vtkm::filter::field_transform::LogValues::SetBaseValueToE
void SetBaseValueToE()
Take the natural logarithm.
Definition: LogValues.h:59
vtkm::filter::field_transform::LogValues::SetBaseValueTo10
void SetBaseValueTo10()
Take the base 10 logarithm.
Definition: LogValues.h:69
vtkm::filter::Filter
Base class for all filters.
Definition: Filter.h:163
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::field_transform::LogValues
Adds field to a vtkm::cont::DataSet that gives the log values for the user specified field.
Definition: LogValues.h:35
vtkm::filter::field_transform::LogValues::GetMinValue
vtkm::FloatDefault GetMinValue() const
Specifies the minimum value to take the logarithm of.
Definition: LogValues.h:78
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
vtkm::filter::field_transform::LogValues::LogBase
LogBase
Identifies a type of logarithm as specified by its base.
Definition: LogValues.h:39
vtkm::filter::field_transform::LogValues::SetMinValue
void SetMinValue(const vtkm::FloatDefault &value)
Specifies the minimum value to take the logarithm of.
Definition: LogValues.h:80
VTKM_FILTER_FIELD_TRANSFORM_EXPORT
#define VTKM_FILTER_FIELD_TRANSFORM_EXPORT
Definition: vtkm_filter_field_transform_export.h:44
Filter.h