]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuViewerMPR.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuViewerMPR.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 #ifdef _USE_WXWIDGETS_
27 #ifndef __bbcreaMaracasVisuViewerMPR_h_INCLUDED__
28 #define __bbcreaMaracasVisuViewerMPR_h_INCLUDED__
29 #include "bbtkWxBlackBox.h"
30
31 #include "wxMaracasMPR.h"
32 #include "vtkImageData.h"
33 #include "vtkRenderer.h"
34 #include "wxMPRWidget2.h"
35
36 namespace bbcreaMaracasVisu
37 {
38
39
40
41   //--------------------------------------------------------------------------
42   class ViewerMPR;
43   class wxWidgetMPR : public wxPanel
44   {
45         public:
46                 wxWidgetMPR(ViewerMPR* box,wxWindow* parent, marImageData       *marimagedata=NULL);
47                 ~wxWidgetMPR();
48             
49                 //if the MPR had generated the refresh event
50                 void OnRefreshView(wxCommandEvent & event);
51                 void OnDClickLeft(wxCommandEvent & event); 
52
53                 //Get the actual Point
54                 std::vector <int> GetPoint();
55                 //Get renderer
56                 vtkRenderer* GetRenderer();
57
58                 //refreshView
59                 void Refresh();
60
61                 void setImageData(vtkImageData* img);
62                 void ConfigureVTK();
63                 
64         private:
65                 
66                 ViewerMPR                       *mbbViewerMPR;
67                 wxMPRWidget2            *wxwidget;
68                 std::vector<int>        point;
69                         
70         DECLARE_EVENT_TABLE( );
71             
72   };
73   
74   //------------------------------------------------------------------------
75   //------------------------------------------------------------------------
76   //------------------------------------------------------------------------
77
78
79
80 class /*BBTK_EXPORT*/ ViewerMPR
81  : 
82    public bbtk::WxBlackBox
83 {
84   BBTK_BLACK_BOX_INTERFACE(ViewerMPR,bbtk::WxBlackBox);
85   BBTK_DECLARE_INPUT(Title,std::string);
86     BBTK_DECLARE_INPUT(In, vtkImageData *);
87     BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer *);
88         BBTK_DECLARE_OUTPUT(Point,std::vector<int>);
89   BBTK_PROCESS(Process);
90   void Process();
91   BBTK_CREATE_WIDGET(CreateWidget);
92   void CreateWidget(wxWindow* parent);
93
94 private:
95   wxWidgetMPR *wxwidget;
96   vtkImageData  *_img;
97 };
98
99 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ViewerMPR,bbtk::WxBlackBox);
100         BBTK_NAME("ViewerMPR");
101         BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
102         BBTK_DESCRIPTION("Maracas viewer MPR + 3D");
103     BBTK_CATEGORY("viewer");
104     BBTK_INPUT(ViewerMPR,Title,"Viewer MPR + 3D",std::string,"");
105         BBTK_INPUT(ViewerMPR,In,"Input image",vtkImageData*,"");
106         BBTK_OUTPUT(ViewerMPR,Renderer," This object accept actors of vtk type (ex. AddActor). ",vtkRenderer*,"");
107         BBTK_OUTPUT(ViewerMPR,Point," This is the point choose by the user ",std::vector<int>,"");
108
109 BBTK_END_DESCRIBE_BLACK_BOX(ViewerMPR);
110 }
111 // EO namespace bbcreaMaracasVisu
112
113 #endif // __bbcreaMaracasVisuViewerMPR_h_INCLUDED__
114 #endif // _USE_WXWIDGETS_
115