VTK  9.7.1
vtkmNDHistogram.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
23 #ifndef vtkmNDHistogram_h
24 #define vtkmNDHistogram_h
25 
26 #include "vtkAcceleratorsVTKmFiltersModule.h" // required for correct export
27 #include "vtkArrayDataAlgorithm.h"
28 #include "vtkmAlgorithm.h" // For vtkmAlgorithm
29 #include "vtkmlib/vtkmInitializer.h" // Need for initializing viskores
30 
31 #include <string> // for std::string
32 #include <utility> // for std::pair
33 #include <vector> // for std::vector
34 
35 #ifndef __VTK_WRAP__
36 #define vtkArrayDataAlgorithm vtkmAlgorithm<vtkArrayDataAlgorithm>
37 #endif
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class VTKACCELERATORSVTKMFILTERS_EXPORT vtkmNDHistogram : public vtkArrayDataAlgorithm
41 {
42 public:
44 #ifndef __VTK_WRAP__
45 #undef vtkArrayDataAlgorithm
46 #endif
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
49  void AddFieldAndBin(const std::string& fieldName, const vtkIdType& numberOfBins);
50 
51  double GetBinDelta(size_t fieldIndex);
52  std::pair<double, double> GetDataRange(size_t fieldIndex);
53 
60  int GetFieldIndexFromFieldName(const std::string& fieldName);
61 
62  static vtkmNDHistogram* New();
63 
64 protected:
66  ~vtkmNDHistogram() override;
67 
70 
71 private:
72  vtkmNDHistogram(const vtkmNDHistogram&) = delete;
73  void operator=(const vtkmNDHistogram&) = delete;
74  std::vector<std::string> FieldNames;
75  std::vector<vtkIdType> NumberOfBins;
76  std::vector<double> BinDeltas;
77  std::vector<std::pair<double, double>> DataRanges;
78  vtkmInitializer Initializer;
79 };
80 
81 VTK_ABI_NAMESPACE_END
82 #endif // vtkmNDHistogram_h
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Store vtkAlgorithm input/output information.
generate a n dimensional histogram field from input fields
int vtkIdType
Definition: vtkType.h:363
a simple class to control print indentation
Definition: vtkIndent.h:28
Superclass for algorithms that produce vtkArrayDatas as output.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
static vtkArrayDataAlgorithm * New()
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.