VTK-m  2.0
Histogram.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_filter_density_estimate_Histogram_h
12 #define vtk_m_filter_density_estimate_Histogram_h
13 
15 #include <vtkm/filter/density_estimate/vtkm_filter_density_estimate_export.h>
16 
17 namespace vtkm
18 {
19 namespace filter
20 {
21 namespace density_estimate
22 {
27 class VTKM_FILTER_DENSITY_ESTIMATE_EXPORT Histogram : public vtkm::filter::FilterField
28 {
29 public:
30  //Construct a histogram with a default of 10 bins
31  VTKM_CONT
32  Histogram();
33 
34  VTKM_CONT
35  void SetNumberOfBins(vtkm::Id count) { this->NumberOfBins = count; }
36 
37  VTKM_CONT
38  vtkm::Id GetNumberOfBins() const { return this->NumberOfBins; }
39 
44  VTKM_CONT
45  void SetRange(const vtkm::Range& range) { this->Range = range; }
46 
47  VTKM_CONT
48  const vtkm::Range& GetRange() const { return this->Range; }
50 
52  VTKM_CONT
53  vtkm::Float64 GetBinDelta() const { return this->BinDelta; }
54 
58  VTKM_CONT
59  vtkm::Range GetComputedRange() const { return this->ComputedRange; }
60 
61 private:
62  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
63  VTKM_CONT vtkm::cont::PartitionedDataSet DoExecutePartitions(
64  const vtkm::cont::PartitionedDataSet& inData) override;
65 
70  VTKM_CONT void PreExecute(const vtkm::cont::PartitionedDataSet& input);
71  VTKM_CONT void PostExecute(const vtkm::cont::PartitionedDataSet& input,
74 
75  vtkm::Id NumberOfBins = 10;
76  vtkm::Float64 BinDelta = 0;
79  bool InExecutePartitions = false;
80 };
81 } // namespace density_estimate
82 } // namespace filter
83 } // namespace vtkm
84 
85 #endif // vtk_m_filter_density_estimate_Histogram_h
vtkm::filter::density_estimate::Histogram::ComputedRange
vtkm::Range ComputedRange
Definition: Histogram.h:77
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::filter::density_estimate::Histogram::GetNumberOfBins
VTKM_CONT vtkm::Id GetNumberOfBins() const
Definition: Histogram.h:38
vtkm::filter::density_estimate::Histogram::SetRange
VTKM_CONT void SetRange(const vtkm::Range &range)
Definition: Histogram.h:45
vtkm::filter::density_estimate::Histogram::Range
vtkm::Range Range
Definition: Histogram.h:78
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::density_estimate::Histogram::GetBinDelta
VTKM_CONT vtkm::Float64 GetBinDelta() const
Returns the bin delta of the last computed field.
Definition: Histogram.h:53
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::filter::density_estimate::Histogram::GetComputedRange
VTKM_CONT vtkm::Range GetComputedRange() const
Returns the range used for most recent execute.
Definition: Histogram.h:59
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::density_estimate::Histogram
Construct the histogram of a given Field.
Definition: Histogram.h:27
vtkm::filter::density_estimate::Histogram::SetNumberOfBins
VTKM_CONT void SetNumberOfBins(vtkm::Id count)
Definition: Histogram.h:35
vtkm::Float64
double Float64
Definition: Types.h:155
vtkm::filter::density_estimate::Histogram::GetRange
const VTKM_CONT vtkm::Range & GetRange() const
Definition: Histogram.h:48
vtkm::cont::PartitionedDataSet
Definition: PartitionedDataSet.h:25
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31