VTK
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 <utility>
38 #include <vector>
39 #include "vtkArrayDataAlgorithm.h"
40 #include "vtkAcceleratorsVTKmModule.h" // required for correct export
41 
42 class VTKACCELERATORSVTKM_EXPORT vtkmNDHistogram : public vtkArrayDataAlgorithm
43 {
44 public:
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
48  void AddFieldAndBin(const std::string& fieldName, const vtkIdType& numberOfBins);
49 
50  double GetBinDelta(size_t fieldIndex);
51  std::pair<double, double> GetDataRange(size_t fieldIndex);
52 
59  int GetFieldIndexFromFieldName(const std::string& fieldName);
60 
61  static vtkmNDHistogram* New();
62 
63 protected:
65  ~vtkmNDHistogram();
66 
67  int RequestData(vtkInformation* , vtkInformationVector** ,
68  vtkInformationVector* )override;
69  int FillInputPortInformation(int port, vtkInformation* info) override;
70 private:
71  vtkmNDHistogram(const vtkmNDHistogram&) = delete;
72  void operator=(const vtkmNDHistogram&) = delete;
73  std::vector<std::string> FieldNames;
74  std::vector<vtkIdType> NumberOfBins;
75  std::vector<double> BinDeltas;
76  std::vector<std::pair<double, double>> DataRanges;
77 };
78 
79 #endif // vtkmNDHistogram_h
80 
81 // VTK-HeaderTest-Exclude: vtkmNDHistogram.h
Store vtkAlgorithm input/output information.
generate a n dimensional histogram field from input fields
int vtkIdType
Definition: vtkType.h:347
a simple class to control print indentation
Definition: vtkIndent.h:39
Superclass for algorithms that produce vtkArrayDatas as output.
Store zero or more vtkInformation instances.