]> Creatis software - creaImageIO.git/blob - src2/creaImageIOWxGimmickPanel.h
21da84f0ab3f193909854f16034e9faec7ae99d2
[creaImageIO.git] / src2 / creaImageIOWxGimmickPanel.h
1 #ifndef __creaImageIOWxGimmickPanel_h_INCLUDED__
2 #define __creaImageIOWxGimmickPanel_h_INCLUDED__
3
4 #ifdef USE_WXWIDGETS
5
6 // Signal/slot mechanism for progress events
7 #include <boost/signal.hpp>
8 #include <boost/bind.hpp>
9
10 #include <creaImageIOWxGimmickView.h>
11 #include <creaWx.h>
12
13 namespace creaImageIO
14 {
15   /**
16    * \ingroup GUI
17    */
18   //=====================================================================
19  //=====================================================================
20   class CREAIMAGEIO_EXPORT WxGimmickPanel : public wxPanel
21   {
22   public:
23     WxGimmickPanel();    
24     WxGimmickPanel(wxWindow *parent, 
25                    const wxWindowID id,
26                    const wxPoint& pos, 
27                    const wxSize& size,
28                    int threads = 0);
29     
30     ~WxGimmickPanel();
31
32       //=============================================
33       typedef boost::signal<void (bool)> SendImageSignalType;
34       typedef SendImageSignalType::slot_function_type SendImageCallbackType;
35       //=============================================
36
37      //==================================================================
38       /// Adds the function f to the list of functions to call 
39       /// when the addition progresses.
40       /// f is of type ProgressCallbackType which is:
41       /// void (*ProgressCallbackType)(Progress&)
42       /// To pass a member function 'f' of an instance 'c' of a class 'C' 
43       /// as callback you have to 'bind' it, i.e. call:
44       /// ConnectSendImageObserver ( boost::bind( &C::f , c, _1 ) );
45       void ConnectSendImageObserver(SendImageCallbackType callback);
46      //==================================================================
47
48         //===============================================================================================
49         //Image Selection
50         //===============================================================================================
51
52     void GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
53     { 
54         mView->GetSelectedImages(s, dim); 
55     }
56
57     void GetSelectedImagesInVector(std::vector<vtkImageData*>& s, int dim)
58     { 
59         mView->GetSelectedImagesInVector(s, dim); 
60     }
61
62     void OnSelectedImage(bool t);
63
64     void AddImagesToDB(std::string dir);
65
66     //    DECLARE_EVENT_TABLE();
67   private :
68     
69           boost::shared_ptr<Gimmick>       mGimmick;
70     WxGimmickView* mView;
71
72         ///The sendImage signal
73     SendImageSignalType mSendImageSignal;
74
75   }; // class WxGimmickPanel
76   //=====================================================================
77
78   
79 } // EO namespace creaImageIO
80
81
82 #endif // USE_WIDGETS
83 // EOF
84 #endif