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