1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
27 #include "wxVTKRenderWindowInteractorPlus.h"
28 #include "vtkInteractorStyleBaseView.h"
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 )
37 //-------------------------------------------------------------------
38 wxVTKRenderWindowInteractorPlus::wxVTKRenderWindowInteractorPlus()
39 : wxVTKRenderWindowInteractor()
44 //-------------------------------------------------------------------
45 wxVTKRenderWindowInteractorPlus::wxVTKRenderWindowInteractorPlus(wxWindow *parent, wxVtkBaseView *wxvtkbaseview)
46 : wxVTKRenderWindowInteractor(parent, -1)
48 _wxvtkbaseview = wxvtkbaseview;
51 //-------------------------------------------------------------------
52 wxVTKRenderWindowInteractorPlus::~wxVTKRenderWindowInteractorPlus()
56 //---------------------------------------------------------------------------
57 wxVTKRenderWindowInteractorPlus * wxVTKRenderWindowInteractorPlus::New()
59 // we don't make use of the objectfactory, because we're not registered
60 return new wxVTKRenderWindowInteractorPlus;
63 //-------------------------------------------------------------------
64 void wxVTKRenderWindowInteractorPlus::OnLeftDClick( wxMouseEvent& event )
68 wxvtkbaseview->GetInteractorStyleBaseView()->OnLeftDClick();
70 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnLeftDClick();
72 //-------------------------------------------------------------------
73 void wxVTKRenderWindowInteractorPlus::OnRightDClick( wxMouseEvent& event )
77 _wxvtkbaseview->GetInteractorStyleBaseView()->OnRightDClick();
79 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnRightDClick();
81 //-------------------------------------------------------------------
82 void wxVTKRenderWindowInteractorPlus::OnMiddleDClick( wxMouseEvent& event )
87 _wxvtkbaseview->GetInteractorStyleBaseView()->OnMiddleDClick();
89 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMiddleDClick();
91 //-------------------------------------------------------------------
92 void wxVTKRenderWindowInteractorPlus::OnMouseWheel( wxMouseEvent& event )
97 _wxvtkbaseview->GetInteractorStyleBaseView()->OnMouseWheel();
100 if(event.GetWheelRotation() > 0)
103 //EED InvokeEvent(vtkCommand::MouseWheelForwardEvent, NULL);
104 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMouseWheelForward();
109 //EED InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL);
110 ((vtkInteractorStyleBaseView*)_wxvtkbaseview->GetInteractorStyleBaseView())->OnMouseWheelBackward();