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