]> 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/19 11:17:28 $
7   Version:   $Revision: 1.12 $
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 #include "wxMPRBaseData.h"
48 #include "wxVtkBaseView.h"
49
50 #include <wx/notebook.h>
51 #include <wx/listbox.h>
52 #include <wx/tglbtn.h>
53 #include <wx/splitter.h>
54 #include "marTypes.h"
55 #include "vtkInteractorStyleSphere.h"
56 #include "idAlBeRa.h"
57
58 #include "wxVtkMPR3DView.h"
59 #include "wxVtkMPR2DView.h"
60 #include "vtkPlane2DView.h"
61 #include "wxSphereView.h"
62 #include "wxVtkClipping3DView.h"
63 #include "wxPanelCuttingImageData.h"
64 #include "wxWidgetMesure2D_Plane_in_MPR.h"
65
66 #include "wxVtk3DBaseView.h"
67
68 //class wxMPRWidget;
69 //class vtkInteractorStylePlane2D;
70 //class vtkInfoTextImageInteractorPlane2D;
71 //class vtkInteractorStyleMPRView;
72 //class wxVtkMPR3DView;
73 //class wxVtkClipping3DView;
74
75 class creaMaracasVisu_EXPORT wxMPRWidget : public wxPanel
76 {
77 public:
78     wxMPRWidget(wxWindow* parent,marImageData *marimageData = NULL,double voxelSize = -1);
79         ~wxMPRWidget( );
80         void ConfigureVTK();
81
82         virtual void OnRefreshView(wxCommandEvent & event);
83         void OnDClickLeft(wxCommandEvent & event);
84
85         void OnPageAChanged(wxNotebookEvent & event);
86         void OnPageBChanged(wxNotebookEvent & event);
87
88         vtkMPRBaseData  *GetVtkMPRBaseData();
89         vtkPlane2DView  *GetVtkPlane2DView();
90         
91         //returns the 3d view of the widget
92         wxVtkMPR3DView  *GetWxvtkmpr3Dview_BB();
93
94         void    RefreshView(bool firsttime=false);
95
96         wxVtkBaseView *GetWxVtkBaseView(int page, int id);
97
98         //returns the 2d view of the specific direction (0|1|2)
99         wxVtkMPR2DView *GetWxvtkMPR2Dview(int direction);
100
101         void setImageData(vtkImageData * img, double voxelsize);
102
103 private:
104         double                                  _voxelSize;
105         marImageData                    *_marImageData; 
106         vtkMPRBaseData                  *_vtkmprbasedata; 
107         wxVtkMPR2DView                  *_vtkmpr2Dview[3]; 
108         vtkPlane2DView                  *_vtkplane2Dview;
109         wxSphereView                    *_wxsphereview;
110         wxVtkMPR2DView                  *_vtkmpr2Dview_B[3]; 
111         vtkPlane2DView                  *_vtkplane2Dview_B;
112         wxSphereView                    *_wxsphereview_B;
113
114         wxVtk3DBaseView                 *_wxvtk3Dbaseview_MPRClipping3D;
115         wxVtkMPR3DView                  *_wxvtkmpr3Dview;
116         wxVtkClipping3DView             *_wxvtkclipping3Dview;
117
118         wxVtk3DBaseView                 *_wxvtk3Dbaseview_MPR3D_B;
119         wxVtkMPR3DView                  *_wxvtkmpr3Dview_B;
120
121         wxVtk3DBaseView                 *_wxvtk3Dbaseview_Clipping3D_BB;
122         wxVtkMPR3DView                  *_wxvtkmpr3Dview_BB;
123         wxVtkClipping3DView             *_wxvtkclipping3Dview_BB;
124
125         int                                             _refreshAPage;
126         int                                             _refreshBPage;
127
128
129         wxFrame                                 *_framePanelCutting;
130         wxCheckBox                              *_btnCutImageData;
131         wxPanelCuttingImageData *_panelCutting;
132
133         wxWidgetMesure2D_Plane_in_MPR   *_widgetMesure;
134         wxWidgetMesure2D_Plane_in_MPR   *_widgetMesure_B;
135
136         wxPanel *CreateControlPanel(wxWindow *parent);
137         wxPanel *CreateMPRPanel(wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
138         wxPanel *CreateMPRPanel4View(wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
139         wxPanel *CreateView(int type,wxWindow *parent, vtkMPRBaseData *vtkmprbasedata);
140
141         void    OnCutImagaData( wxCommandEvent &event);
142
143         DECLARE_EVENT_TABLE( );
144 };
145
146 #endif // __WX__MPR__WIDGET__HXX__
147
148
149
150 // EOF - wxMPRWidget.h