Viskores  1.0
Histogram.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_density_estimate_Histogram_h
20 #define viskores_filter_density_estimate_Histogram_h
21 
22 #include <viskores/filter/Filter.h>
24 
25 namespace viskores
26 {
27 namespace filter
28 {
29 namespace density_estimate
30 {
48 class VISKORES_FILTER_DENSITY_ESTIMATE_EXPORT Histogram : public viskores::filter::Filter
49 {
50 public:
52 
56  VISKORES_CONT void SetNumberOfBins(viskores::Id count) { this->NumberOfBins = count; }
57 
59  VISKORES_CONT viskores::Id GetNumberOfBins() const { return this->NumberOfBins; }
60 
65  VISKORES_CONT void SetRange(const viskores::Range& range) { this->Range = range; }
66 
70  VISKORES_CONT const viskores::Range& GetRange() const { return this->Range; }
71 
75  VISKORES_CONT viskores::Float64 GetBinDelta() const { return this->BinDelta; }
76 
82  VISKORES_CONT viskores::Range GetComputedRange() const { return this->ComputedRange; }
83 
84 private:
85  VISKORES_CONT viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
87  const viskores::cont::PartitionedDataSet& inData) override;
88 
93  VISKORES_CONT void PreExecute(const viskores::cont::PartitionedDataSet& input);
94  VISKORES_CONT void PostExecute(const viskores::cont::PartitionedDataSet& input,
97 
98  viskores::Id NumberOfBins = 10;
99  viskores::Float64 BinDelta = 0;
102  bool InExecutePartitions = false;
103 };
104 } // namespace density_estimate
105 } // namespace filter
106 } // namespace viskores
107 
108 #endif // viskores_filter_density_estimate_Histogram_h
viskores::filter::density_estimate::Histogram::ComputedRange
viskores::Range ComputedRange
Definition: Histogram.h:100
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::density_estimate::Histogram::SetRange
void SetRange(const viskores::Range &range)
Set the range to use to generate the histogram.
Definition: Histogram.h:65
viskores::filter::density_estimate::Histogram::GetComputedRange
viskores::Range GetComputedRange() const
Returns the range used for most recent execute.
Definition: Histogram.h:82
viskores::filter::density_estimate::Histogram
Construct the histogram of a given field.
Definition: Histogram.h:48
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores_filter_density_estimate_export.h
viskores::filter::density_estimate::Histogram::Range
viskores::Range Range
Definition: Histogram.h:101
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::PartitionedDataSet
Comprises a set of viskores::cont::DataSet objects.
Definition: PartitionedDataSet.h:34
viskores::Range
Represent a continuous scalar range of values.
Definition: Range.h:39
viskores::filter::density_estimate::Histogram::SetNumberOfBins
void SetNumberOfBins(viskores::Id count)
Set the number of bins for the resulting histogram.
Definition: Histogram.h:56
viskores::filter::density_estimate::Histogram::GetNumberOfBins
viskores::Id GetNumberOfBins() const
Get the number of bins for the resulting histogram.
Definition: Histogram.h:59
viskores::filter::density_estimate::Histogram::GetBinDelta
viskores::Float64 GetBinDelta() const
Returns the size of bin in the computed histogram.
Definition: Histogram.h:75
viskores::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
viskores::filter::density_estimate::Histogram::GetRange
const viskores::Range & GetRange() const
Get the range used to generate the histogram.
Definition: Histogram.h:70
Filter.h