VTK  9.7.1
vtkmHistogram.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Kitware, Inc.
3 // SPDX-FileCopyrightText: Copyright 2012 Sandia Corporation.
4 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
15 #ifndef vtkmHistogram_h
16 #define vtkmHistogram_h
17 
18 #include "vtkAcceleratorsVTKmFiltersModule.h" //required for correct export
19 #include "vtkTableAlgorithm.h"
20 #include "vtkmAlgorithm.h" // For vtkmAlgorithm
21 #include "vtkmlib/vtkmInitializer.h" // Need for initializing viskores
22 
23 #ifndef __VTK_WRAP__
24 #define vtkTableAlgorithm vtkmAlgorithm<vtkTableAlgorithm>
25 #endif
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkDoubleArray;
29 
30 class VTKACCELERATORSVTKMFILTERS_EXPORT vtkmHistogram : public vtkTableAlgorithm
31 {
32 public:
34 #ifndef __VTK_WRAP__
35 #undef vtkTableAlgorithm
36 #endif
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38  static vtkmHistogram* New();
39 
41 
44  vtkSetMacro(NumberOfBins, vtkIdType);
45  vtkGetMacro(NumberOfBins, vtkIdType);
47 
49 
53  vtkSetVector2Macro(CustomBinRange, double);
54  vtkGetVector2Macro(CustomBinRange, double);
56 
58 
62  vtkSetMacro(UseCustomBinRanges, bool);
63  vtkGetMacro(UseCustomBinRanges, bool);
64  vtkBooleanMacro(UseCustomBinRanges, bool);
66 
68 
73  vtkSetMacro(CenterBinsAroundMinAndMax, bool);
74  vtkGetMacro(CenterBinsAroundMinAndMax, bool);
75  vtkBooleanMacro(CenterBinsAroundMinAndMax, bool);
77 
79 
82  vtkGetVectorMacro(ComputedRange, double, 2);
84 
86 
89  vtkGetMacro(BinDelta, double);
91 
92 protected:
93  vtkmHistogram();
94  ~vtkmHistogram() override;
95 
98 
99 private:
100  vtkmHistogram(const vtkmHistogram&) = delete;
101  void operator=(const vtkmHistogram&) = delete;
102 
103  void FillBinExtents(vtkDoubleArray* binExtents);
104 
105  vtkIdType NumberOfBins;
106  double BinDelta;
107  double CustomBinRange[2];
108  bool UseCustomBinRanges;
109  bool CenterBinsAroundMinAndMax;
110  double ComputedRange[2];
111  vtkmInitializer Initializer;
112 };
113 
114 VTK_ABI_NAMESPACE_END
115 #endif // vtkmHistogram_h
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkTableAlgorithm * New()
Store vtkAlgorithm input/output information.
int vtkIdType
Definition: vtkType.h:363
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:28
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Superclass for algorithms that produce only vtkTables as output.
Store zero or more vtkInformation instances.
generate a histogram out of a scalar data
Definition: vtkmHistogram.h:30