vtkExtractHistogram.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkExtractHistogram.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkExtractHistogram_h
28 #define vtkExtractHistogram_h
29 
30 #include "vtkPVVTKExtensionsMiscModule.h" //needed for exports
31 #include "vtkTableAlgorithm.h"
32 
33 class vtkDoubleArray;
34 class vtkFieldData;
35 class vtkIntArray;
36 struct vtkEHInternals;
37 
39 {
40 public:
41  static vtkExtractHistogram* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
51  vtkSetClampMacro(Component, int, 0, VTK_INT_MAX);
52  vtkGetMacro(Component, int);
54 
56 
59  vtkSetClampMacro(BinCount, int, 1, VTK_INT_MAX);
60  vtkGetMacro(BinCount, int);
62 
64 
69  vtkSetMacro(CenterBinsAroundMinAndMax, bool);
70  vtkGetMacro(CenterBinsAroundMinAndMax, bool);
71  vtkBooleanMacro(CenterBinsAroundMinAndMax, bool);
73 
75 
79  vtkSetVector2Macro(CustomBinRanges, double);
80  vtkGetVector2Macro(CustomBinRanges, double);
82 
84 
88  vtkSetMacro(UseCustomBinRanges, bool);
89  vtkGetMacro(UseCustomBinRanges, bool);
90  vtkBooleanMacro(UseCustomBinRanges, bool);
92 
94 
99  vtkSetMacro(CalculateAverages, int);
100  vtkGetMacro(CalculateAverages, int);
101  vtkBooleanMacro(CalculateAverages, int);
103 
104 protected:
106  ~vtkExtractHistogram() override;
107 
115  virtual bool GetInputArrayRange(vtkInformationVector** inputVector, double range[2]);
116 
117  int FillInputPortInformation(int port, vtkInformation* info) override;
118 
119  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
120  vtkInformationVector* outputVector) override;
121 
122  // Initialize the bin_extents using the data range for the selected
123  // array.
124  virtual bool InitializeBinExtents(
125  vtkInformationVector** inputVector, vtkDoubleArray* bin_extents, double& min, double& max);
126 
127  void BinAnArray(
128  vtkDataArray* src, vtkIntArray* vals, double min, double max, vtkFieldData* field);
129 
130  void FillBinExtents(vtkDoubleArray* bin_extents, double min, double max);
131 
132  double CustomBinRanges[2];
136  int BinCount;
138 
139  vtkEHInternals* Internal;
140 
141 private:
142  void operator=(const vtkExtractHistogram&) = delete;
143  vtkExtractHistogram(const vtkExtractHistogram&) = delete;
144 
145  int GetInputFieldAssociation();
146  vtkFieldData* GetInputFieldData(vtkDataObject* input);
147 };
148 
149 #endif
vtkEHInternals * Internal
static vtkTableAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual int FillInputPortInformation(int port, vtkInformation *info)
#define VTKPVVTKEXTENSIONSMISC_EXPORT
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Extract histogram data (binned values) from any dataset.
void operator=(const vtkObjectBase &)