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 
68  vtkInformationVector* )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
vtkArrayDataAlgorithm.h
vtkmNDHistogram
generate a n dimensional histogram field from input fields
Definition: vtkmNDHistogram.h:42
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkX3D::port
Definition: vtkX3D.h:447
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkArrayDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkArrayDataAlgorithm
Superclass for algorithms that produce vtkArrayDatas as output.
Definition: vtkArrayDataAlgorithm.h:53
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkX3D::info
Definition: vtkX3D.h:376
vtkX3D::string
Definition: vtkX3D.h:490
vtkArrayDataAlgorithm::New
static vtkArrayDataAlgorithm * New()
vtkArrayDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkArrayDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.