debian/tmp/usr/include/KWWidgets/vtkKWHistogram.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __vtkKWHistogram_h
00018 #define __vtkKWHistogram_h
00019
00020 #include "vtkObject.h"
00021 #include "vtkKWWidgets.h"
00022
00023 class vtkColorTransferFunction;
00024 class vtkDataArray;
00025 class vtkImageData;
00026 class vtkDoubleArray;
00027 class vtkIntArray;
00028
00029 class KWWidgets_EXPORT vtkKWHistogram : public vtkObject
00030 {
00031 public:
00032 static vtkKWHistogram* New();
00033 vtkTypeRevisionMacro(vtkKWHistogram,vtkObject);
00034 void PrintSelf(ostream& os, vtkIndent indent);
00035
00036
00037
00038
00039
00040
00041 vtkGetVector2Macro(Range, double);
00042
00043
00044
00045 vtkGetObjectMacro(Bins, vtkDoubleArray);
00046
00047
00048
00049 virtual vtkIdType GetNumberOfBins();
00050
00051
00052
00053
00054 vtkSetMacro(MaximumNumberOfBins, vtkIdType);
00055 vtkGetMacro(MaximumNumberOfBins, vtkIdType);
00056
00057
00058
00059 virtual double GetMinimumOccurence();
00060 virtual double GetMaximumOccurence();
00061 virtual double GetTotalOccurence();
00062
00063
00064
00065 virtual double GetOccurenceAtValue(double value);
00066
00067
00068
00069
00070
00071 virtual double GetValueAtAccumulatedOccurence(
00072 double acc, double *exclude_value = 0);
00073
00074
00075
00076
00077 virtual void BuildHistogram(vtkDataArray *scalars, int component);
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 vtkSetVector2Macro(Range, double);
00091
00092
00093
00094
00095 virtual void EstimateHistogramRange(
00096 vtkDataArray *scalars, int component, double range[2]);
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 virtual void AccumulateHistogram(vtkDataArray *scalars, int component);
00114
00115
00116
00117
00118 virtual void EmptyHistogram();
00119
00120
00121
00122 virtual void SetLogMode(int);
00123 vtkBooleanMacro(LogMode, int);
00124 vtkGetMacro(LogMode, int);
00125
00126 protected:
00127 vtkKWHistogram();
00128 ~vtkKWHistogram();
00129
00130 double Range[2];
00131
00132 vtkDoubleArray *Bins;
00133
00134 vtkImageData *Image;
00135 vtkIntArray *ImageCoordinates;
00136
00137 unsigned long LastImageBuildTime;
00138 unsigned long LastTransferFunctionTime;
00139 int LogMode;
00140 vtkIdType MaximumNumberOfBins;
00141
00142 virtual void ComputeStatistics();
00143 unsigned long LastStatisticsBuildTime;
00144
00145 double MinimumOccurence;
00146 double MaximumOccurence;
00147 double TotalOccurence;
00148
00149
00150
00151
00152 virtual void UpdateHistogram(
00153 vtkDataArray *scalars, int component, int reset_range);
00154
00155
00156
00157
00158 virtual void EstimateHistogramRangeAndNumberOfBins(
00159 vtkDataArray *scalars, int component,
00160 double range[2], vtkIdType *nb_of_bins);
00161
00162 public:
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172 class KWWidgets_EXPORT ImageDescriptor
00173 {
00174 public:
00175 ImageDescriptor();
00176
00177 int IsValid() const;
00178 int IsEqualTo(const ImageDescriptor *desc);
00179 void Copy(const ImageDescriptor *desc);
00180
00181 int DrawForeground;
00182 int DrawBackground;
00183 int DrawGrid;
00184 int GridSize;
00185
00186 enum
00187 {
00188 StyleBars = 0,
00189 StyleDots
00190 };
00191 int Style;
00192
00193 double Range[2];
00194 void SetRange(double range0, double range1);
00195 void SetRange(double range[2]);
00196
00197 unsigned int Width;
00198 unsigned int Height;
00199 void SetDimensions(unsigned int width, unsigned int height);
00200
00201 double Color[3];
00202 void SetColor(double color[3]);
00203
00204 double BackgroundColor[3];
00205 void SetBackgroundColor(double color[3]);
00206
00207 double OutOfRangeColor[3];
00208 void SetOutOfRangeColor(double color[3]);
00209
00210 double GridColor[3];
00211 void SetGridColor(double color[3]);
00212
00213 vtkColorTransferFunction *ColorTransferFunction;
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228 double DefaultMaximumOccurence;
00229 double LastMaximumOccurence;
00230 };
00231
00232 virtual int IsImageUpToDate(const ImageDescriptor *desc = 0);
00233 virtual vtkImageData* GetImage(ImageDescriptor *desc);
00234 virtual vtkIntArray* GetImageCoordinates(ImageDescriptor *desc);
00235
00236
00237 protected:
00238
00239 vtkKWHistogram::ImageDescriptor *LastImageDescriptor;
00240
00241
00242 virtual int RefreshImage(ImageDescriptor *desc);
00243
00244 private:
00245 vtkKWHistogram(const vtkKWHistogram&);
00246 void operator=(const vtkKWHistogram&);
00247 };
00248
00249 #endif
00250