]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVTKRenderWindowInteractorPlus.cxx
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVTKRenderWindowInteractorPlus.cxx
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 #include "wxVTKRenderWindowInteractorPlus.h"
28 #include "vtkInteractorStyleBaseView.h"
29
30 BEGIN_EVENT_TABLE( wxVTKRenderWindowInteractorPlus, wxVTKRenderWindowInteractor )
31     EVT_LEFT_DCLICK( wxVTKRenderWindowInteractorPlus::OnLeftDClick )
32     EVT_RIGHT_DCLICK( wxVTKRenderWindowInteractorPlus::OnRightDClick )
33     EVT_MIDDLE_DCLICK( wxVTKRenderWindowInteractorPlus::OnMiddleDClick )
34         EVT_MOUSEWHEEL( wxVTKRenderWindowInteractorPlus::OnMouseWheel )
35 END_EVENT_TABLE( );
36
37 //-------------------------------------------------------------------
38 wxVTKRenderWindowInteractorPlus::wxVTKRenderWindowInteractorPlus() 
39 : wxVTKRenderWindowInteractor()
40 {
41 }
42
43
44 //-------------------------------------------------------------------
45 wxVTKRenderWindowInteractorPlus::wxVTKRenderWindowInteractorPlus(wxWindow *parent, wxVtkBaseView *wxvtkbaseview)
46 : wxVTKRenderWindowInteractor(parent, -1)
47 {
48         _wxvtkbaseview = wxvtkbaseview;
49 }
50
51 //-------------------------------------------------------------------
52 wxVTKRenderWindowInteractorPlus::~wxVTKRenderWindowInteractorPlus()
53 {
54 }
55
56 //---------------------------------------------------------------------------
57 wxVTKRenderWindowInteractorPlus * wxVTKRenderWindowInteractorPlus::New()
58 {
59   // we don't make use of the objectfactory, because we're not registered
60   return new wxVTKRenderWindowInteractorPlus;
61 }
62
63 //-------------------------------------------------------------------
64 void wxVTKRenderWindowInteractorPlus::OnLeftDClick( wxMouseEvent& event )
65 {
66         /**
67          * JCP 14/05/09  
68         wxvtkbaseview->GetInteractorStyleBaseView()->OnLeftDClick();
69         */
70         ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnLeftDClick();
71 }
72 //-------------------------------------------------------------------
73 void wxVTKRenderWindowInteractorPlus::OnRightDClick( wxMouseEvent& event )
74 {
75         /**
76                  * JCP 14/05/09          
77         _wxvtkbaseview->GetInteractorStyleBaseView()->OnRightDClick();
78         */
79         ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnRightDClick();
80 }
81 //-------------------------------------------------------------------
82 void wxVTKRenderWindowInteractorPlus::OnMiddleDClick( wxMouseEvent& event )
83 {
84         /**
85                  * JCP 14/05/09
86                  
87         _wxvtkbaseview->GetInteractorStyleBaseView()->OnMiddleDClick();
88         */
89         ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMiddleDClick();
90 }
91 //-------------------------------------------------------------------
92 void wxVTKRenderWindowInteractorPlus::OnMouseWheel( wxMouseEvent& event )
93 {
94         /**
95                  * JCP 14/05/09
96                  
97         _wxvtkbaseview->GetInteractorStyleBaseView()->OnMouseWheel();
98         */
99         
100         if(event.GetWheelRotation() > 0)
101     {
102                 //Send event to VTK
103                 //EED InvokeEvent(vtkCommand::MouseWheelForwardEvent, NULL);
104                 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMouseWheelForward();
105     }
106         else
107     {
108                 //Send event to VTK
109                 //EED InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL);
110                 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMouseWheelBackward();
111     }
112         
113         
114 }
115
116