]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuTransferFunctionView.h
*** empty log message ***
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuTransferFunctionView.h
1 #ifdef _USE_WXWIDGETS_
2 #ifndef __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__
3 #define __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__
4 #include "bbtkWxBlackBox.h"
5
6 #include "vtkImageData.h"
7 //#include "HistogramWidget.h"
8 #include "HistogramDialogComboBox.h"
9
10 #include "vtkPiecewiseFunction.h"
11 #include "vtkColorTransferFunction.h"
12 #include <wx/wx.h>
13
14 namespace bbcreaMaracasVisu
15 {
16
17   
18
19 class /*BBTK_EXPORT*/ TransferFunctionView
20  : 
21    public bbtk::WxBlackBox
22 {
23   BBTK_BLACK_BOX_INTERFACE(TransferFunctionView,bbtk::WxBlackBox);
24         BBTK_DECLARE_INPUT(In, vtkImageData*);
25         BBTK_DECLARE_OUTPUT(OpacityFunction, vtkPiecewiseFunction*);
26         BBTK_DECLARE_OUTPUT(ColorFunction, vtkColorTransferFunction*);
27
28         BBTK_DECLARE_OUTPUT(WindowLevel, double);
29         BBTK_DECLARE_OUTPUT(ColorLevel, double);
30         /*BBTK_DECLARE_OUTPUT(GreyLevel, std::vector<double> );
31         BBTK_DECLARE_OUTPUT(Value, std::vector<double> );
32         BBTK_DECLARE_OUTPUT(GreyLevelColors, std::vector<double>);
33         BBTK_DECLARE_OUTPUT(Red, std::vector<double>);
34         BBTK_DECLARE_OUTPUT(Green, std::vector<double>);
35         BBTK_DECLARE_OUTPUT(Blue, std::vector<double>);*/
36
37   BBTK_PROCESS(Process);
38   void Process();
39   BBTK_CREATE_WIDGET(CreateWidget);
40   void CreateWidget(wxWindow* parent);  
41
42   void onColorChange();
43
44   void onSliderChange();
45
46   private:
47         //HistogramWidget *mwxwidget;
48           HistogramDialogComboBox *mwxwidget;
49         vtkImageData* _currentimg;
50         
51         vtkPiecewiseFunction* _tfun;
52         vtkColorTransferFunction* _ctfun;
53 };
54
55 class HandlerTransferFunctionView : public wxEvtHandler
56 {
57         public:
58                 HandlerTransferFunctionView(TransferFunctionView* box);
59                 ~HandlerTransferFunctionView();    
60                 
61                  void onColorChange(wxCommandEvent& event);
62
63                  void onSliderChange(wxCommandEvent& event);
64                 
65         private:
66                 TransferFunctionView                    *_box;  
67 };
68
69 BBTK_BEGIN_DESCRIBE_BLACK_BOX(TransferFunctionView,bbtk::WxBlackBox);
70 BBTK_NAME("TransferFunctionView");
71 BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
72 BBTK_DESCRIPTION("Transfer Function Window");
73 //BBTK_CATEGORY("__CategoryBlackBox__");
74   BBTK_INPUT(TransferFunctionView,In,"Input image",vtkImageData*,"");
75         BBTK_OUTPUT(TransferFunctionView,OpacityFunction,"Transfer function for the opacity", vtkPiecewiseFunction*,"");
76         BBTK_OUTPUT(TransferFunctionView,ColorFunction,"Transfer function for the color", vtkColorTransferFunction*,"");  
77         BBTK_OUTPUT(TransferFunctionView,WindowLevel,"WidowLevel for the current window", double,"");  
78         BBTK_OUTPUT(TransferFunctionView,ColorLevel,"ColorLevel for the current window", double,"");  
79   /*BBTK_OUTPUT(TransferFunctionView,GreyLevel,"Greylevel related to the transparency",std::vector<double>,"");
80   BBTK_OUTPUT(TransferFunctionView,Value,"Value of the transparency in the transfer function",std::vector<double>,"");
81   BBTK_OUTPUT(TransferFunctionView,GreyLevelColors,"Grey level of the color in the transfer function",std::vector<double>,"");
82   BBTK_OUTPUT(TransferFunctionView,Red,"Red value according to the GreyLevelColors",std::vector<double>,"");
83   BBTK_OUTPUT(TransferFunctionView,Green,"Green value according to the GreyLevelColors",std::vector<double>,"");
84   BBTK_OUTPUT(TransferFunctionView,Blue,"Blue value according to the GreyLevelColors",std::vector<double>,"");*/
85 BBTK_END_DESCRIBE_BLACK_BOX(TransferFunctionView);
86 }
87
88
89 // EO namespace bbcreaMaracasVisu
90
91 #endif // __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__
92 #endif // _USE_WXWIDGETS_
93