ParaView
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 "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
31 #include "vtkTableAlgorithm.h"
32 
33 class vtkDoubleArray;
34 class vtkFieldData;
35 class vtkIntArray;
36 struct vtkEHInternals;
37 
38 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkExtractHistogram : public vtkTableAlgorithm
39 {
40 public:
41  static vtkExtractHistogram* New();
42  vtkTypeMacro(vtkExtractHistogram, vtkTableAlgorithm);
43  void PrintSelf(ostream& os, vtkIndent indent);
44 
46 
50  vtkSetClampMacro(Component, int, 0, VTK_INT_MAX);
51  vtkGetMacro(Component, int);
53 
55 
58  vtkSetClampMacro(BinCount, int, 1, VTK_INT_MAX);
59  vtkGetMacro(BinCount, int);
61 
63 
67  vtkSetVector2Macro(CustomBinRanges, double);
68  vtkGetVector2Macro(CustomBinRanges, double);
70 
72 
76  vtkSetMacro(UseCustomBinRanges, bool);
77  vtkGetMacro(UseCustomBinRanges, bool);
78  vtkBooleanMacro(UseCustomBinRanges, bool);
80 
82 
87  vtkSetMacro(CalculateAverages, int);
88  vtkGetMacro(CalculateAverages, int);
89  vtkBooleanMacro(CalculateAverages, int);
91 
92 protected:
95 
103  virtual bool GetInputArrayRange(vtkInformationVector** inputVector, double range[2]);
104 
105  virtual int FillInputPortInformation(int port, vtkInformation* info);
106 
107  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
108  vtkInformationVector* outputVector);
109 
110  // Initialize the bin_extents using the data range for the selected
111  // array.
112  virtual bool InitializeBinExtents(
113  vtkInformationVector** inputVector, vtkDoubleArray* bin_extents, double& min, double& max);
114 
115  void BinAnArray(
116  vtkDataArray* src, vtkIntArray* vals, double min, double max, vtkFieldData* field);
117 
118  void FillBinExtents(vtkDoubleArray* bin_extents, double min, double max);
119 
120  double CustomBinRanges[2];
123  int BinCount;
125 
126  vtkEHInternals* Internal;
127 
128 private:
129  void operator=(const vtkExtractHistogram&) VTK_DELETE_FUNCTION;
130  vtkExtractHistogram(const vtkExtractHistogram&) VTK_DELETE_FUNCTION;
131 
132  int GetInputFieldAssociation();
133  vtkFieldData* GetInputFieldData(vtkDataObject* input);
134 };
135 
136 #endif
vtkEHInternals * Internal
Extract histogram data (binned values) from any dataset.