Viskores  1.0
NDHistogram.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 #ifndef viskores_filter_density_estimate_NDHistogram_h
19 #define viskores_filter_density_estimate_NDHistogram_h
20 
21 #include <viskores/filter/Filter.h>
23 
24 namespace viskores
25 {
26 namespace filter
27 {
28 namespace density_estimate
29 {
42 class VISKORES_FILTER_DENSITY_ESTIMATE_EXPORT NDHistogram : public viskores::filter::Filter
43 {
44 public:
46  void AddFieldAndBin(const std::string& fieldName, viskores::Id numOfBins);
47 
48  // This index is the field position in FieldNames
49  // (or the input _fieldName string vector of SetFields() Function)
51  viskores::Float64 GetBinDelta(size_t fieldIdx);
52 
53  // This index is the field position in FieldNames
54  // (or the input _fieldName string vector of SetFields() Function)
56  viskores::Range GetDataRange(size_t fieldIdx);
57 
58 private:
59  VISKORES_CONT viskores::cont::DataSet DoExecute(const viskores::cont::DataSet& input) override;
60 
61  std::vector<viskores::Id> NumOfBins;
62  std::vector<std::string> FieldNames;
63  std::vector<viskores::Float64> BinDeltas;
64  std::vector<viskores::Range> DataRanges; //Min Max of the field
65 };
66 } // namespace density_estimate
67 } // namespace filter
68 } // namespace vtm
69 
70 #endif //viskores_filter_density_estimate_NDHistogram_h
viskores::cont::DataSet
Contains and manages the geometric data structures that Viskores operates on.
Definition: DataSet.h:66
viskores::filter::Filter
Base class for all filters.
Definition: Filter.h:171
viskores_filter_density_estimate_export.h
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::filter::density_estimate::NDHistogram::NumOfBins
std::vector< viskores::Id > NumOfBins
Definition: NDHistogram.h:61
viskores::filter::density_estimate::NDHistogram
Generate a N-Dims histogram from input fields.
Definition: NDHistogram.h:42
viskores::Range
Represent a continuous scalar range of values.
Definition: Range.h:39
viskores::Float64
double Float64
Base type to use for 64-bit floating-point numbers.
Definition: Types.h:169
viskores::filter::density_estimate::NDHistogram::FieldNames
std::vector< std::string > FieldNames
Definition: NDHistogram.h:62
viskores::filter::density_estimate::NDHistogram::BinDeltas
std::vector< viskores::Float64 > BinDeltas
Definition: NDHistogram.h:63
viskores::filter::density_estimate::NDHistogram::DataRanges
std::vector< viskores::Range > DataRanges
Definition: NDHistogram.h:64
Filter.h