VTK  9.4.20250114
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
32#include "vtkmlib/vtkmInitializer.h" // Need for initializing vtk-m
33
34VTK_ABI_NAMESPACE_BEGIN
35class VTKACCELERATORSVTKMFILTERS_EXPORT vtkmNDHistogram : public vtkArrayDataAlgorithm
36{
37public:
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
55
56protected:
58 ~vtkmNDHistogram() override;
59
61 int FillInputPortInformation(int port, vtkInformation* info) override;
62
63private:
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
73VTK_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: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:315