VTK  9.1.0
vtkmNDHistogram.h
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // Copyright (c) Kitware, Inc.
4 // All rights reserved.
5 // See LICENSE.txt for details.
6 //
7 // This software is distributed WITHOUT ANY WARRANTY; without even
8 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9 // PURPOSE. See the above copyright notice for more information.
10 //
11 // Copyright 2012 Sandia Corporation.
12 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
13 // the U.S. Government retains certain rights in this software.
14 //
15 //=============================================================================
34 #ifndef vtkmNDHistogram_h
35 #define vtkmNDHistogram_h
36 
37 #include "vtkAcceleratorsVTKmFiltersModule.h" // required for correct export
38 #include "vtkArrayDataAlgorithm.h"
39 #include <string> // for std::string
40 #include <utility> // for std::pair
41 #include <vector> // for std::vector
42 
43 class VTKACCELERATORSVTKMFILTERS_EXPORT vtkmNDHistogram : public vtkArrayDataAlgorithm
44 {
45 public:
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 };
79 
80 #endif // vtkmNDHistogram_h
Superclass for algorithms that produce vtkArrayDatas as output.
a simple class to control print indentation
Definition: vtkIndent.h:34
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:382
@ port
Definition: vtkX3D.h:453
@ string
Definition: vtkX3D.h:496
int vtkIdType
Definition: vtkType.h:332