VTK-m  2.0
NDHistogram.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_density_estimate_NDHistogram_h
11 #define vtk_m_filter_density_estimate_NDHistogram_h
12 
14 #include <vtkm/filter/density_estimate/vtkm_filter_density_estimate_export.h>
15 
16 namespace vtkm
17 {
18 namespace filter
19 {
20 namespace density_estimate
21 {
34 class VTKM_FILTER_DENSITY_ESTIMATE_EXPORT NDHistogram : public vtkm::filter::FilterField
35 {
36 public:
37  VTKM_CONT
38  void AddFieldAndBin(const std::string& fieldName, vtkm::Id numOfBins);
39 
40  // This index is the field position in FieldNames
41  // (or the input _fieldName string vector of SetFields() Function)
42  VTKM_CONT
43  vtkm::Float64 GetBinDelta(size_t fieldIdx);
44 
45  // This index is the field position in FieldNames
46  // (or the input _fieldName string vector of SetFields() Function)
47  VTKM_CONT
48  vtkm::Range GetDataRange(size_t fieldIdx);
49 
50 private:
51  VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
52 
53  std::vector<vtkm::Id> NumOfBins;
54  std::vector<std::string> FieldNames;
55  std::vector<vtkm::Float64> BinDeltas;
56  std::vector<vtkm::Range> DataRanges; //Min Max of the field
57 };
58 } // namespace density_estimate
59 } // namespace filter
60 } // namespace vtm
61 
62 #endif //vtk_m_filter_density_estimate_NDHistogram_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::DataSet
Definition: DataSet.h:34
vtkm::filter::density_estimate::NDHistogram::FieldNames
std::vector< std::string > FieldNames
Definition: NDHistogram.h:54
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
FilterField.h
vtkm::filter::FilterField
Definition: FilterField.h:21
vtkm::filter::density_estimate::NDHistogram::DataRanges
std::vector< vtkm::Range > DataRanges
Definition: NDHistogram.h:56
vtkm::filter::density_estimate::NDHistogram::NumOfBins
std::vector< vtkm::Id > NumOfBins
Definition: NDHistogram.h:53
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::filter::density_estimate::NDHistogram
Generate a N-Dims histogram from input fields.
Definition: NDHistogram.h:34
vtkm::Float64
double Float64
Definition: Types.h:155
vtkm::filter::density_estimate::NDHistogram::BinDeltas
std::vector< vtkm::Float64 > BinDeltas
Definition: NDHistogram.h:55
vtkm::Range
Represent a continuous scalar range of values.
Definition: Range.h:31