]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuViewerMPR.h
b8d143c8b88515ba7562f698f23fc73f5afde212
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuViewerMPR.h
1 #ifdef _USE_WXWIDGETS_
2 #ifndef __bbcreaMaracasVisuViewerMPR_h_INCLUDED__
3 #define __bbcreaMaracasVisuViewerMPR_h_INCLUDED__
4 #include "bbtkWxBlackBox.h"
5
6 #include "wxMaracasMPR.h"
7 #include "vtkImageData.h"
8 #include "vtkRenderer.h"
9 #include "wxMPRWidget2.h"
10
11 namespace bbcreaMaracasVisu
12 {
13
14
15
16   //--------------------------------------------------------------------------
17   class ViewerMPR;
18   class wxWidgetMPR : public wxPanel
19   {
20         public:
21                 wxWidgetMPR(ViewerMPR* box,wxWindow* parent, marImageData       *marimagedata=NULL);
22                 ~wxWidgetMPR();
23             
24                 //if the MPR had generated the refresh event
25                 void OnRefreshView(wxCommandEvent & event);
26                 void OnDClickLeft(wxCommandEvent & event); 
27
28                 //Get the actual Point
29                 std::vector <int> GetPoint();
30                 //Get renderer
31                 vtkRenderer* GetRenderer();
32
33                 //refreshView
34                 void Refresh();
35
36                 void setImageData(vtkImageData* img);
37                 void ConfigureVTK();
38                 
39         private:
40                 
41                 ViewerMPR                       *mbbViewerMPR;
42                 wxMPRWidget2            *wxwidget;
43                 std::vector<int>        point;
44                         
45         DECLARE_EVENT_TABLE( );
46             
47   };
48   
49   //------------------------------------------------------------------------
50   //------------------------------------------------------------------------
51   //------------------------------------------------------------------------
52
53
54
55 class /*BBTK_EXPORT*/ ViewerMPR
56  : 
57    public bbtk::WxBlackBox
58 {
59   BBTK_BLACK_BOX_INTERFACE(ViewerMPR,bbtk::WxBlackBox);
60 //==================================================================
61 /// User callback called in the box contructor
62 virtual void bbUserConstructor();
63 /// User callback called in the box copy constructor
64 virtual void bbUserCopyConstructor(bbtk::BlackBox::Pointer);
65 /// User callback called in the box destructor
66 virtual void bbUserDestructor();
67 //==================================================================
68   BBTK_DECLARE_INPUT(Title,std::string);
69     BBTK_DECLARE_INPUT(In, vtkImageData *);
70     BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer *);
71         BBTK_DECLARE_OUTPUT(Point,std::vector<int>);
72   BBTK_PROCESS(Process);
73   void Process();
74   BBTK_CREATE_WIDGET(CreateWidget);
75   void CreateWidget(wxWindow* parent);
76
77 private:
78   wxWidgetMPR *wxwidget;
79   vtkImageData  *_img;
80 };
81
82 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ViewerMPR,bbtk::WxBlackBox);
83         BBTK_NAME("ViewerMPR");
84         BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
85         BBTK_DESCRIPTION("Maracas viewer MPR + 3D");
86     BBTK_CATEGORY("viewer");
87     BBTK_INPUT(ViewerMPR,Title,"Viewer MPR + 3D",std::string,"");
88         BBTK_INPUT(ViewerMPR,In,"Input image",vtkImageData*,"");
89         BBTK_OUTPUT(ViewerMPR,Renderer," This object accept actors of vtk type (ex. AddActor). ",vtkRenderer*,"");
90         BBTK_OUTPUT(ViewerMPR,Point," This is the point choose by the user ",std::vector<int>,"");
91
92 BBTK_END_DESCRIBE_BLACK_BOX(ViewerMPR);
93 }
94 // EO namespace bbcreaMaracasVisu
95
96 #endif // __bbcreaMaracasVisuViewerMPR_h_INCLUDED__
97 #endif // _USE_WXWIDGETS_
98