VTK  9.5.20251009
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
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
39VTK_ABI_NAMESPACE_BEGIN
40class VTKACCELERATORSVTKMFILTERS_EXPORT vtkmNDHistogram : public vtkArrayDataAlgorithm
41{
42public:
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
63
64protected:
66 ~vtkmNDHistogram() override;
67
69 int FillInputPortInformation(int port, vtkInformation* info) override;
70
71private:
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
81VTK_ABI_NAMESPACE_END
82#endif // vtkmNDHistogram_h
Superclass for algorithms that produce vtkArrayDatas as output.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
generate a n dimensional histogram field from input fields
std::pair< double, double > GetDataRange(size_t fieldIndex)
int GetFieldIndexFromFieldName(const std::string &fieldName)
GetFieldIndexFromFieldName.
static vtkmNDHistogram * New()
void AddFieldAndBin(const std::string &fieldName, const vtkIdType &numberOfBins)
double GetBinDelta(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.
int vtkIdType
Definition vtkType.h:367