]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.h
#3093 creaMaracasVisu Feature New Normal - Contour Information in pixels and image...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMPRWidget.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 /*=========================================================================
27
28   Program:   wxMaracas
29   Module:    $RCSfile: wxMPRWidget.h,v $
30   Language:  C++
31   Date:      $Date: 2012/11/15 14:14:35 $
32   Version:   $Revision: 1.13 $
33
34   Copyright: (c) 2002, 2003
35   License:
36   
37      This software is distributed WITHOUT ANY WARRANTY; without even 
38      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
39      PURPOSE.  See the above copyright notice for more information.
40
41 =========================================================================*/
42
43 #ifndef __WX__MPR__WIDGET__HXX__
44 #define __WX__MPR__WIDGET__HXX__
45
46 #include "marTypes.h"
47 #include <vector>
48
49 #include <vtkObjectBase.h>
50 #include <vtkCommand.h>
51 #include <vtkActor.h>
52 #include <vtkPoints.h>
53 #include <vtkPolyData.h>
54 #include <vtkPolyDataMapper.h>
55 #include <vtkProbeFilter.h>
56 #include <vtkPlaneSource.h> 
57 #include <vtkImageChangeInformation.h>
58 #include <vtkStructuredPoints.h> 
59 #include <vtkTransform.h> 
60 #include <vtkImageViewer2.h> 
61 #include <vtkBoxWidget.h>
62 #include <vtkPointWidget.h>
63 #include <vtkPlaneWidget.h>
64
65 #include <vtkCubeSource.h>
66 #include <vtkCylinderSource.h>
67 #include <vtkSphereSource.h>
68 #include <vtkProperty2D.h>
69 #include <vtkTextProperty.h>
70 #include <vtkXYPlotActor.h>
71
72 #include "wxMPRBaseData.h"
73 #include "wxVtkBaseView.h"
74
75 #include <wx/notebook.h>
76 #include <wx/listbox.h>
77 #include <wx/tglbtn.h>
78 #include <wx/splitter.h>
79 #include "marTypes.h"
80 #include "vtkInteractorStyleSphere.h"
81 #include "idAlBeRa.h"
82
83 #include "wxVtkMPR3DView.h"
84 #include "wxVtkMPR2DView.h"
85 #include "vtkPlane2DView.h"
86 #include "wxSphereView.h"
87 #include "wxVtkClipping3DView.h"
88 #include "wxPanelCuttingImageData.h"
89 #include "wxWidgetMesure2D_Plane_in_MPR.h"
90
91 #include "wxVtk3DBaseView.h"
92
93 //class wxMPRWidget;
94 //class vtkInteractorStylePlane2D;
95 //class vtkInfoTextImageInteractorPlane2D;
96 //class vtkInteractorStyleMPRView;
97 //class wxVtkMPR3DView;
98 //class wxVtkClipping3DView;
99
100 class creaMaracasVisu_EXPORT wxMPRWidget : public wxPanel
101 {
102 public:
103     wxMPRWidget(wxWindow* parent,marImageData *marimageData = NULL);
104         ~wxMPRWidget( );
105         void ConfigureVTK();
106
107         virtual void OnRefreshView(wxCommandEvent & event);
108         void OnDClickLeft(wxCommandEvent & event);
109
110         void OnPageAChanged(wxNotebookEvent & event);
111         void OnPageBChanged(wxNotebookEvent & event);
112
113         vtkMPRBaseData  *GetVtkMPRBaseData();
114         vtkPlane2DView  *GetVtkPlane2DView();
115         
116         //returns the 3d view of the widget
117         wxVtkMPR3DView  *GetWxvtkmpr3Dview_BB();
118
119         void    RefreshView(bool firsttime=false);
120
121         wxVtkBaseView *GetWxVtkBaseView(int page, int id);
122
123         //returns the 2d view of the specific direction (0|1|2)
124         wxVtkMPR2DView *GetWxvtkMPR2Dview(int direction);
125
126         void setImageData(vtkImageData * img);
127
128 private:
129         marImageData                    *_marImageData; 
130         vtkMPRBaseData                  *_vtkmprbasedata; 
131         wxVtkMPR2DView                  *_vtkmpr2Dview[3]; 
132         vtkPlane2DView                  *_vtkplane2Dview;
133         wxSphereView                    *_wxsphereview;
134         wxVtkMPR2DView                  *_vtkmpr2Dview_B[3]; 
135         vtkPlane2DView                  *_vtkplane2Dview_B;
136         wxSphereView                    *_wxsphereview_B;
137
138         wxVtk3DBaseView                 *_wxvtk3Dbaseview_MPRClipping3D;
139         wxVtkMPR3DView                  *_wxvtkmpr3Dview;
140         wxVtkClipping3DView             *_wxvtkclipping3Dview;
141
142         wxVtk3DBaseView                 *_wxvtk3Dbaseview_MPR3D_B;
143         wxVtkMPR3DView                  *_wxvtkmpr3Dview_B;
144
145         wxVtk3DBaseView                 *_wxvtk3Dbaseview_Clipping3D_BB;
146         wxVtkMPR3DView                  *_wxvtkmpr3Dview_BB;
147         wxVtkClipping3DView             *_wxvtkclipping3Dview_BB;
148
149         int                                             _refreshAPage;
150         int                                             _refreshBPage;
151
152
153         wxFrame                                 *_framePanelCutting;
154         wxCheckBox                              *_btnCutImageData;
155         wxPanelCuttingImageData *_panelCutting;
156
157         wxWidgetMesure2D_Plane_in_MPR   *_widgetMesure;
158         wxWidgetMesure2D_Plane_in_MPR   *_widgetMesure_B;
159
160         wxPanel *CreateControlPanel(wxWindow *parent);
161         wxPanel *CreateMPRPanel(wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
162         wxPanel *CreateMPRPanel4View(wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
163         wxPanel *CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
164
165         void    OnCutImagaData( wxCommandEvent &event);
166
167         DECLARE_EVENT_TABLE( );
168 };
169
170 #endif // __WX__MPR__WIDGET__HXX__
171
172
173
174 // EOF - wxMPRWidget.h