]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractorPlus.cxx
no message
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVTKRenderWindowInteractorPlus.cxx
1
2 #include "wxVTKRenderWindowInteractorPlus.h"
3 #include "vtkInteractorStyleBaseView.h"
4
5 BEGIN_EVENT_TABLE( wxVTKRenderWindowInteractorPlus, wxVTKRenderWindowInteractor )
6     EVT_LEFT_DCLICK( wxVTKRenderWindowInteractorPlus::OnLeftDClick )
7     EVT_RIGHT_DCLICK( wxVTKRenderWindowInteractorPlus::OnRightDClick )
8     EVT_MIDDLE_DCLICK( wxVTKRenderWindowInteractorPlus::OnMiddleDClick )
9         EVT_MOUSEWHEEL( wxVTKRenderWindowInteractorPlus::OnMouseWheel )
10 END_EVENT_TABLE( );
11
12 //-------------------------------------------------------------------
13 wxVTKRenderWindowInteractorPlus::wxVTKRenderWindowInteractorPlus() 
14 : wxVTKRenderWindowInteractor()
15 {
16 }
17
18
19 //-------------------------------------------------------------------
20 wxVTKRenderWindowInteractorPlus::wxVTKRenderWindowInteractorPlus(wxWindow *parent, wxVtkBaseView *wxvtkbaseview)
21 : wxVTKRenderWindowInteractor(parent, -1)
22 {
23         _wxvtkbaseview = wxvtkbaseview;
24 }
25
26 //-------------------------------------------------------------------
27 wxVTKRenderWindowInteractorPlus::~wxVTKRenderWindowInteractorPlus()
28 {
29 }
30
31 //---------------------------------------------------------------------------
32 wxVTKRenderWindowInteractorPlus * wxVTKRenderWindowInteractorPlus::New()
33 {
34   // we don't make use of the objectfactory, because we're not registered
35   return new wxVTKRenderWindowInteractorPlus;
36 }
37
38 //-------------------------------------------------------------------
39 void wxVTKRenderWindowInteractorPlus::OnLeftDClick( wxMouseEvent& event )
40 {
41         /**
42          * JCP 14/05/09  
43         wxvtkbaseview->GetInteractorStyleBaseView()->OnLeftDClick();
44         */
45         ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnLeftDClick();
46 }
47 //-------------------------------------------------------------------
48 void wxVTKRenderWindowInteractorPlus::OnRightDClick( wxMouseEvent& event )
49 {
50         /**
51                  * JCP 14/05/09          
52         _wxvtkbaseview->GetInteractorStyleBaseView()->OnRightDClick();
53         */
54         ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnRightDClick();
55 }
56 //-------------------------------------------------------------------
57 void wxVTKRenderWindowInteractorPlus::OnMiddleDClick( wxMouseEvent& event )
58 {
59         /**
60                  * JCP 14/05/09
61                  
62         _wxvtkbaseview->GetInteractorStyleBaseView()->OnMiddleDClick();
63         */
64         ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMiddleDClick();
65 }
66 //-------------------------------------------------------------------
67 void wxVTKRenderWindowInteractorPlus::OnMouseWheel( wxMouseEvent& event )
68 {
69         /**
70                  * JCP 14/05/09
71                  
72         _wxvtkbaseview->GetInteractorStyleBaseView()->OnMouseWheel();
73         */
74         
75         
76 //EED ????  this is just a maracasvisu EED old mechanism to be erased ..
77         ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMouseWheel();
78         
79         
80         if(event.GetWheelRotation() > 0)
81     {
82                 //Send event to VTK
83                 //EED InvokeEvent(vtkCommand::MouseWheelForwardEvent, NULL);
84                 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMouseWheelForward();
85     }
86         else
87     {
88                 //Send event to VTK
89                 //EED InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL);
90                 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMouseWheelBackward();
91     }
92         
93         
94 }
95
96