VTK  9.3.0
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 <string> // for std::string
27 #include <utility> // for std::pair
28 #include <vector> // for std::vector
29 
30 #include "vtkAcceleratorsVTKmFiltersModule.h" // required for correct export
31 #include "vtkArrayDataAlgorithm.h"
32 #include "vtkmlib/vtkmInitializer.h" // Need for initializing vtk-m
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class VTKACCELERATORSVTKMFILTERS_EXPORT vtkmNDHistogram : public vtkArrayDataAlgorithm
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
41  void AddFieldAndBin(const std::string& fieldName, const vtkIdType& numberOfBins);
42 
43  double GetBinDelta(size_t fieldIndex);
44  std::pair<double, double> GetDataRange(size_t fieldIndex);
45 
52  int GetFieldIndexFromFieldName(const std::string& fieldName);
53 
54  static vtkmNDHistogram* New();
55 
56 protected:
58  ~vtkmNDHistogram() override;
59 
62 
63 private:
64  vtkmNDHistogram(const vtkmNDHistogram&) = delete;
65  void operator=(const vtkmNDHistogram&) = delete;
66  std::vector<std::string> FieldNames;
67  std::vector<vtkIdType> NumberOfBins;
68  std::vector<double> BinDeltas;
69  std::vector<std::pair<double, double>> DataRanges;
70  vtkmInitializer Initializer;
71 };
72 
73 VTK_ABI_NAMESPACE_END
74 #endif // vtkmNDHistogram_h
Superclass for algorithms that produce vtkArrayDatas as output.
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
generate a n dimensional histogram field from input fields
int GetFieldIndexFromFieldName(const std::string &fieldName)
GetFieldIndexFromFieldName.
void AddFieldAndBin(const std::string &fieldName, const vtkIdType &numberOfBins)
double GetBinDelta(size_t fieldIndex)
static vtkmNDHistogram * New()
std::pair< double, double > GetDataRange(size_t fieldIndex)
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkmNDHistogram() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ string
Definition: vtkX3D.h:490
int vtkIdType
Definition: vtkType.h:315