]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramDialogComboBox.h
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / HistogramDialogComboBox.h
1
2 #ifndef __HistogramDialogComboBox__
3 #define __HistogramDialogComboBox__
4
5
6 // ----------------------------------------------------------------------------
7 // wx headers inclusion.
8 // For compilers that support precompilation, includes <wx/wx.h>.
9 // ----------------------------------------------------------------------------
10
11 #ifdef __BORLANDC__
12 #pragma hdrstop
13 #endif
14
15 #include <wx/wx.h>
16 #include <vector>
17
18 #include "HistogramDialogComboBoxItem.h"
19 #include <fstream>
20 #include <wx/bmpcbox.h>
21 #include "vtkImageData.h"
22
23
24 #define FILENAME "/Data/colorsfunction.txt"
25
26
27 class HistogramDialogComboBox : public wxPanel
28 {
29 public:
30         /*
31          Constructor
32         */
33         HistogramDialogComboBox(wxWindow* parent);
34         //HistogramDialogComboBox(int bar_width,int bar_height);
35         ~HistogramDialogComboBox();
36
37         void SetColors(std::vector<double> greyvect, std::vector<double> redvect, std::vector<double> greenvect, std::vector<double> bluevect);
38         wxBitmap GetBitmap();
39
40         std::vector<double> getGreyVector(){return _greyvect;}
41         std::vector<double> getRedVector(){return _redvect;}
42         std::vector<double> getGreenVector(){return _greenvect;}
43         std::vector<double> getBlueVector(){return _bluevect;}
44
45         void OnEditBitmapCombo(wxCommandEvent& event);
46         void OnBitmapComboItemSelected(wxCommandEvent& event);
47
48         void setImageData(vtkImageData* img);
49
50         /**
51         **      Returns two vectors, the grey level of the point and its value, the value is between [0,1]
52         **/
53         void GetValuesPointsFunction(std::vector<double>& greylevel,std::vector<double>& value);
54
55         /**
56         **      Returns two vectors, the grey level of the point and its value, the red, green
57         **      and blue value is between [0,1]
58         **/
59         void GetValuesColorPointsFunction(std::vector<double>& greylevel,
60                                                                         std::vector<double>& red,
61                                                                         std::vector<double>& green,
62                                                                         std::vector<double>& blue);
63
64 private:
65
66         std::vector<double> _greyvect;
67         std::vector<double> _redvect;
68         std::vector<double> _greenvect;
69         std::vector<double> _bluevect;
70         std::vector<double> _greyvecttransfer;
71         std::vector<double> _value;
72         vtkImageData* _img;
73         double _maxgreyvalue;
74         int _currentitem;       
75
76         /*
77         * Represents the color of the backGround. Default color is the parent color. 
78         */              
79
80         wxBitmapComboBox*       _bitmapcombo;   
81         std::vector<HistogramDialogComboBoxItem*> _bitmapsitems;
82         wxBitmap* colorBar_Bitmap;
83         wxSizer* _bitmapsizer;
84
85         wxSizer* getBitmapCombo();
86         wxBitmapComboBox* getBitmapComboElements();
87         void OnLoadComboBoxData(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename);
88         void saveCurrentConfiguration(std::vector<HistogramDialogComboBoxItem*>& itembitmaps,std::string filename);
89         
90 };
91
92 #endif
93
94
95