HistogramWidget.h
Go to the documentation of this file.00001
00002
00003 #ifndef __HISTOGRAMW__
00004 #define __HISTOGRAMW__
00005
00006
00007
00008
00009
00010
00011 #include <wx/wxprec.h>
00012 #ifdef __BORLANDC__
00013 #pragma hdrstop
00014 #endif
00015 #ifndef WX_PRECOMP
00016 #include <wx/wx.h>
00017 #endif
00018
00019 #include "marTypes.h"
00020 #include "pPlotter.h"
00021 #include "pFunctionPoint.h"
00022 #include "vtkImageData.h"
00023 #include "pHistogram.h"
00024 #include "pPlotterScaleY.h"
00025 #include "pPlotterScaleX.h"
00026
00027
00028 #define NUM_POINTS 100
00029 #define WINDOW_SIZE 10
00030
00031 class creaMaracasVisu_EXPORT HistogramWidget:public wxPanel
00032 {
00033 public:
00034
00035
00036
00037
00038
00039
00040
00041 HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, int flag,vtkImageData* imageData,int type);
00042
00043 ~HistogramWidget();
00044
00045
00046
00047
00048 void drawHistogram();
00049
00050
00051
00052 void drawTransferenceFunction();
00053
00054
00055
00056 void OnSize( wxSizeEvent &WXUNUSED(event) );
00057
00058
00059
00060
00061
00062
00063 int getSizeTransferenceFunction();
00064
00065
00066
00067 int getSizeBarColor();
00068
00069
00070
00071 void getTransferenceFunctionPoint(int index,int& x,int& y);
00072
00073
00074
00075 void getDataBarColorPoint(int index,int&x, int& red,int& green,int& blue);
00076
00077
00078
00079
00080 int getHistogramPoint(int gValue);
00081
00082
00083
00084
00085
00086
00087
00088
00089 float getMaxShowedPorcentage();
00090 float getMinShowedPorcentage();
00091 float getActualShowedPorcentage();
00092
00093
00094
00095
00096
00097
00098
00099
00100 bool addPointToTransferenceFunction(double x, double y);
00101
00102
00103
00104
00105
00106
00107
00108 bool addColorPoint(double x,int red,int green, int blue);
00109
00110
00111
00112 void updatePlotter();
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 void erasePointsTransferenceFunction();
00123
00124
00125
00126 void eraseColorPoints();
00127
00128
00129
00130
00131
00132 void setTransferenceFunctionHasPoints(bool hasPoints);
00133 void setTransferenceFunctionHasColor(bool hasColorPoints);
00134 int getHistogramSize();
00135 void setType(int type);
00136
00137
00138
00139 private:
00140
00141 pHistogram* histogram;
00142 pPlotter* plotter;
00143 int idTransferenceFunction;
00144 int histogramSize;
00145 int idHistogram;
00146
00147
00148
00149
00150
00151 bool transferenceFunctionHasPoints;
00152 bool transferenceFunctionHasColor;
00153
00154
00155
00156
00157 int type;
00158
00159 DECLARE_CLASS(HistogramWidget);
00160
00161
00162
00163 DECLARE_EVENT_TABLE()
00164
00165 };
00166 #endif
00167
00168