VTK-m  2.2
Wavelet.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_source_Wavelet_h
12 #define vtk_m_source_Wavelet_h
13 
14 #include <vtkm/source/Source.h>
15 
16 #include <vtkm/Math.h>
17 
18 namespace vtkm
19 {
20 namespace source
21 {
62 {
63 public:
64  VTKM_CONT Wavelet() = default;
65  VTKM_CONT ~Wavelet() = default;
66 
67  VTKM_DEPRECATED(2.0, "Use SetExtent.")
68  VTKM_CONT Wavelet(vtkm::Id3 minExtent, vtkm::Id3 maxExtent = { 10 });
69 
76  VTKM_CONT void SetCenter(const vtkm::Vec3f& center) { this->Center = center; }
77  VTKM_CONT vtkm::Vec3f GetCenter() const { return this->Center; }
79 
85  VTKM_CONT void SetOrigin(const vtkm::Vec3f& origin) { this->Origin = origin; }
87  {
88  if (!vtkm::IsNan(this->Origin[0]))
89  {
90  return this->Origin;
91  }
92  else
93  {
94  return this->MinimumExtent * this->Spacing;
95  }
96  }
97 
98  VTKM_CONT void SetSpacing(const vtkm::Vec3f& spacing) { this->Spacing = spacing; }
99  VTKM_CONT vtkm::Vec3f GetSpacing() const { return this->Spacing; }
100 
101  VTKM_CONT void SetFrequency(const vtkm::Vec3f& frequency) { this->Frequency = frequency; }
102  VTKM_CONT vtkm::Vec3f GetFrequency() const { return this->Frequency; }
103 
104  VTKM_CONT void SetMagnitude(const vtkm::Vec3f& magnitude) { this->Magnitude = magnitude; }
105  VTKM_CONT vtkm::Vec3f GetMagnitude() const { return this->Magnitude; }
106 
107  VTKM_CONT void SetMinimumExtent(const vtkm::Id3& minExtent) { this->MinimumExtent = minExtent; }
108  VTKM_CONT vtkm::Id3 GetMinimumExtent() const { return this->MinimumExtent; }
109 
110  VTKM_CONT void SetMaximumExtent(const vtkm::Id3& maxExtent) { this->MaximumExtent = maxExtent; }
111  VTKM_CONT vtkm::Id3 GetMaximumExtent() const { return this->MaximumExtent; }
112 
113  VTKM_CONT void SetExtent(const vtkm::Id3& minExtent, const vtkm::Id3& maxExtent)
114  {
115  this->MinimumExtent = minExtent;
116  this->MaximumExtent = maxExtent;
117  }
118 
119  VTKM_CONT void SetMaximumValue(const vtkm::FloatDefault& maxVal) { this->MaximumValue = maxVal; }
120  VTKM_CONT vtkm::FloatDefault GetMaximumValue() const { return this->MaximumValue; }
121 
123  {
124  this->StandardDeviation = stdev;
125  }
126  VTKM_CONT vtkm::FloatDefault GetStandardDeviation() const { return this->StandardDeviation; }
127 
128 private:
129  vtkm::cont::DataSet DoExecute() const override;
130 
131  template <vtkm::IdComponent Dim>
132  vtkm::cont::Field GeneratePointField(const vtkm::cont::CellSetStructured<Dim>& cellset,
133  const std::string& name) const;
134 
135  template <vtkm::IdComponent Dim>
136  vtkm::cont::DataSet GenerateDataSet(vtkm::cont::CoordinateSystem coords) const;
137 
138  vtkm::Vec3f Center = { 0, 0, 0 };
139  vtkm::Vec3f Origin = { vtkm::Nan<vtkm::FloatDefault>() };
140  vtkm::Vec3f Spacing = { 1, 1, 1 };
141  vtkm::Vec3f Frequency = { 60.0f, 30.0f, 40.0f };
142  vtkm::Vec3f Magnitude = { 10.0f, 18.0f, 5.0f };
143  vtkm::Id3 MinimumExtent = { -10, -10, -10 };
144  vtkm::Id3 MaximumExtent = { 10, 10, 10 };
145  vtkm::FloatDefault MaximumValue = 255.0f;
146  vtkm::FloatDefault StandardDeviation = 0.5f;
147 };
148 } //namespace source
149 } //namespace vtkm
150 
151 #endif //vtk_m_source_Wavelet_h
vtkm::source::Wavelet::GetSpacing
vtkm::Vec3f GetSpacing() const
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:99
vtkm::source::Wavelet::GetMinimumExtent
vtkm::Id3 GetMinimumExtent() const
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:108
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::source::Wavelet::GetFrequency
vtkm::Vec3f GetFrequency() const
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:102
vtkm::source::Wavelet::SetMaximumExtent
void SetMaximumExtent(const vtkm::Id3 &maxExtent)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:110
vtkm::cont::CellSetStructured
Defines a 1-, 2-, or 3-dimensional structured grid of points.
Definition: CastAndCall.h:32
vtkm::source::Wavelet::SetMaximumValue
void SetMaximumValue(const vtkm::FloatDefault &maxVal)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:119
vtkm::source::Wavelet::SetMinimumExtent
void SetMinimumExtent(const vtkm::Id3 &minExtent)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:107
vtkm::source::Source
Definition: Source.h:23
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::source::Wavelet::SetSpacing
void SetSpacing(const vtkm::Vec3f &spacing)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:98
vtkm::source::Wavelet::GetOrigin
vtkm::Vec3f GetOrigin() const
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:86
vtkm::source::Wavelet::GetMaximumExtent
vtkm::Id3 GetMaximumExtent() const
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:111
Source.h
vtkm::cont::CoordinateSystem
Manages a coordinate system for a DataSet.
Definition: CoordinateSystem.h:30
vtkm::source::Wavelet::SetExtent
void SetExtent(const vtkm::Id3 &minExtent, const vtkm::Id3 &maxExtent)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:113
vtkm::source::Wavelet::SetOrigin
void SetOrigin(const vtkm::Vec3f &origin)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:85
Math.h
vtkm::cont::Field
A Field encapsulates an array on some piece of the mesh, such as the points, a cell set,...
Definition: Field.h:31
vtkm::source::Wavelet::GetCenter
vtkm::Vec3f GetCenter() const
Specifies the center of the wavelet function.
Definition: Wavelet.h:77
VTKM_SOURCE_EXPORT
#define VTKM_SOURCE_EXPORT
Definition: vtkm_source_export.h:44
vtkm::source::Wavelet::SetCenter
void SetCenter(const vtkm::Vec3f &center)
Specifies the center of the wavelet function.
Definition: Wavelet.h:76
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::source::Wavelet::GetMaximumValue
vtkm::FloatDefault GetMaximumValue() const
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:120
vtkm::source::Wavelet::GetMagnitude
vtkm::Vec3f GetMagnitude() const
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:105
vtkm::source::Wavelet::SetMagnitude
void SetMagnitude(const vtkm::Vec3f &magnitude)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:104
vtkm::Vec< vtkm::Id, 3 >
vtkm::Magnitude
detail::FloatingPointReturnType< T >::Type Magnitude(const T &x)
Returns the magnitude of a vector.
Definition: VectorAnalysis.h:100
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
vtkm::source::Wavelet::SetFrequency
void SetFrequency(const vtkm::Vec3f &frequency)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:101
vtkm::source::Wavelet
The Wavelet source creates a dataset similar to VTK's vtkRTAnalyticSource.
Definition: Wavelet.h:61
vtkm::source::Wavelet::SetStandardDeviation
void SetStandardDeviation(const vtkm::FloatDefault &stdev)
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:122
VTKM_DEPRECATED
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
vtkm::source::Wavelet::GetStandardDeviation
vtkm::FloatDefault GetStandardDeviation() const
Specifies the origin (lower left corner) of the dataset created.
Definition: Wavelet.h:126