]> Creatis software - creaRigidRegistration.git/blob - PackRecalage/src/bbPackRecalageImageSwitcherBox.h
0d3c18ffc47e6542fcc3dedec8bbd99da2934735
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageImageSwitcherBox.h
1 #ifdef _USE_WXWIDGETS_
2 #ifndef __bbPackRecalageImageSwitcherBox_h_INCLUDED__
3 #define __bbPackRecalageImageSwitcherBox_h_INCLUDED__
4 #include "bbPackRecalage_EXPORT.h"
5 #include "bbtkWxBlackBox.h"
6
7 #include "vtkImageData.h"
8
9 #include <wx/timer.h>
10 #include <wx/wx.h>
11
12 namespace bbPackRecalage
13 {
14         class ImageSwitcherBox;
15
16         class MyTimer: public wxTimer
17         {
18         public:
19                 MyTimer(ImageSwitcherBox *box);
20                 ~MyTimer();
21         virtual void Notify();
22
23         ImageSwitcherBox *_box;
24         };
25
26 class bbPackRecalage_EXPORT ImageSwitcherBox
27  : 
28    public bbtk::WxBlackBox
29 {
30   BBTK_BLACK_BOX_INTERFACE(ImageSwitcherBox,bbtk::WxBlackBox);
31   BBTK_DECLARE_INPUT(Title,std::string);
32   BBTK_DECLARE_INPUT(In1,vtkImageData*);
33   BBTK_DECLARE_INPUT(In2,vtkImageData*);
34   BBTK_DECLARE_INPUT(Time,int);
35   BBTK_DECLARE_INPUT(On,bool);
36   BBTK_PROCESS(Process);
37   BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
38   void Process();
39   BBTK_CREATE_WIDGET(CreateWidget);
40   void CreateWidget(wxWindow*);
41
42   public:
43           void Change();
44
45   private:
46         bool change;
47         MyTimer *myTimer;
48         int time;
49         int oldTime;
50         bool _on;
51         bool firstTime;
52 };
53
54 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageSwitcherBox,bbtk::WxBlackBox);
55 BBTK_NAME("ImageSwitcherBox");
56 BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
57 BBTK_DESCRIPTION("Switches between 2 images for comparison");
58 BBTK_CATEGORY("__CategoryBlackBox__");
59 BBTK_INPUT(ImageSwitcherBox,Title,"Title prepended to the Widget",std::string,"");
60 BBTK_INPUT(ImageSwitcherBox,In1,"First Image",vtkImageData*,"");
61 BBTK_INPUT(ImageSwitcherBox,In2,"Second Image",vtkImageData*,"");
62 BBTK_INPUT(ImageSwitcherBox,Time,"Time between image change",int,"");
63 BBTK_INPUT(ImageSwitcherBox,On,"Defines if the switcher is turned on. ON = True.",bool,"");
64 BBTK_OUTPUT(ImageSwitcherBox,Out,"Image to be placed",vtkImageData*,"");
65 BBTK_END_DESCRIBE_BLACK_BOX(ImageSwitcherBox);
66 }
67 // EO namespace bbPackRecalage
68
69 #endif // __bbPackRecalageImageSwitcherBox_h_INCLUDED__
70 #endif // _USE_WXWIDGETS_
71