VTK-m  2.2
HistSampling.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_resampling_HistSampling_h
11 #define vtk_m_filter_resampling_HistSampling_h
12 
13 #include <vtkm/filter/Filter.h>
15 
16 #include <vtkm/Deprecated.h>
17 
18 namespace vtkm
19 {
20 namespace filter
21 {
22 namespace resampling
23 {
24 
41 {
42 public:
47  VTKM_CONT void SetNumberOfBins(vtkm::Id numberOfBins) { this->NumberOfBins = numberOfBins; }
49  VTKM_CONT vtkm::Id GetNumberOfBins() { return this->NumberOfBins; }
50 
56  VTKM_CONT void SetSampleFraction(vtkm::FloatDefault fraction) { this->SampleFraction = fraction; }
58  VTKM_CONT vtkm::FloatDefault GetSampleFraction() const { return this->SampleFraction; }
59 
60  VTKM_DEPRECATED(2.2, "Use SetSampleFraction().")
61  VTKM_CONT void SetSamplePercent(vtkm::FloatDefault samplePercent)
62  {
63  this->SetSampleFraction(samplePercent);
64  }
65  VTKM_DEPRECATED(2.2, "Use GetSampleFraction().")
66  VTKM_CONT vtkm::FloatDefault GetSamplePercent() const { return this->GetSampleFraction(); }
67 
72  VTKM_CONT void SetSeed(vtkm::UInt32 seed) { this->Seed = seed; }
74  VTKM_CONT vtkm::UInt32 GetSeed() { return this->Seed; }
75 
76 private:
77  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
78  vtkm::Id NumberOfBins = 10;
79  vtkm::FloatDefault SampleFraction = 0.1f;
80  vtkm::UInt32 Seed = 0;
81 };
82 
83 } // namespace resampling
84 } // namespace filter
85 } // namespace vtkm
86 
87 #endif // vtk_m_filter_resampling_HistSampling_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::resampling::HistSampling::SetSeed
void SetSeed(vtkm::UInt32 seed)
Specify the seed used for random number generation.
Definition: HistSampling.h:72
vtkm::cont::DataSet
Contains and manages the geometric data structures that VTK-m operates on.
Definition: DataSet.h:57
vtkm::filter::resampling::HistSampling::SetSampleFraction
void SetSampleFraction(vtkm::FloatDefault fraction)
Specify the fraction of points to create in the sampled data.
Definition: HistSampling.h:56
vtkm::filter::resampling::HistSampling::GetSeed
vtkm::UInt32 GetSeed()
Specify the seed used for random number generation.
Definition: HistSampling.h:74
vtkm::filter::resampling::HistSampling::GetSampleFraction
vtkm::FloatDefault GetSampleFraction() const
Specify the fraction of points to create in the sampled data.
Definition: HistSampling.h:58
vtkm::filter::resampling::HistSampling
Adaptively sample points to preserve tail features.
Definition: HistSampling.h:40
vtkm::filter::Filter
Base class for all filters.
Definition: Filter.h:163
vtkm_filter_resampling_export.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::FloatDefault
vtkm::Float32 FloatDefault
The floating point type to use when no other precision is specified.
Definition: Types.h:236
vtkm::UInt32
uint32_t UInt32
Base type to use for 32-bit unsigned integer numbers.
Definition: Types.h:185
Deprecated.h
vtkm::filter::resampling::HistSampling::GetNumberOfBins
vtkm::Id GetNumberOfBins()
Specify the number of bins used when computing the histogram.
Definition: HistSampling.h:49
VTKM_DEPRECATED
#define VTKM_DEPRECATED(...)
Definition: Deprecated.h:145
vtkm::filter::resampling::HistSampling::SetNumberOfBins
void SetNumberOfBins(vtkm::Id numberOfBins)
Specify the number of bins used when computing the histogram.
Definition: HistSampling.h:47
VTKM_FILTER_RESAMPLING_EXPORT
#define VTKM_FILTER_RESAMPLING_EXPORT
Definition: vtkm_filter_resampling_export.h:44
Filter.h