1 // SALOME VTKViewer : build VTK viewer into Salome desktop
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : VVTK_InteractorStyle.h
25 // Author : Christophe ATTANASIO
29 #ifndef __VVTK_InteractorStyle_h
30 #define __VVTK_InteractorStyle_h
35 #include "SVTK_InteractorStyle.h"
37 //-------------------------------------------
38 //! Control the value of increment in new style of interaction.
40 This class controls of value of increment,
41 for pan/rotate/zoom operations in new style
44 class VVTK_ControllerIncrement : public SVTK_ControllerIncrement {
46 vtkTypeMacro(VVTK_ControllerIncrement,SVTK_ControllerIncrement);
47 static VVTK_ControllerIncrement* New();
49 //! Increace the increment value by multiplying on 2
50 virtual int Increase();
52 //! Decreace the increment value by division on 2
53 virtual int Decrease();
56 VVTK_ControllerIncrement();
57 virtual ~VVTK_ControllerIncrement();
60 VVTK_ControllerIncrement(const VVTK_ControllerIncrement&); //Not implemented
61 void operator=(const VVTK_ControllerIncrement&); //Not implemented
64 //-------------------------------------------
65 //! Control the behaviour of KeyDown event in new style of interaction.
67 This class controls of behaviour of of KeyDown event
68 in new style of interaction.
70 class VVTK_ControllerOnKeyDown : public SVTK_ControllerOnKeyDown{
72 vtkTypeMacro(VVTK_ControllerOnKeyDown, SVTK_ControllerOnKeyDown);
73 static VVTK_ControllerOnKeyDown* New();
75 //! Provides the action on event
76 virtual bool OnKeyDown(vtkInteractorStyle* );
79 VVTK_ControllerOnKeyDown();
80 virtual ~VVTK_ControllerOnKeyDown();
83 VVTK_ControllerOnKeyDown(const VVTK_ControllerOnKeyDown&);//Not implemented
84 void operator=(const VVTK_ControllerOnKeyDown&); //Not implemented
88 //! Introduce new style of interaction (keyboard free)
89 class VVTK_EXPORT VVTK_InteractorStyle : public SVTK_InteractorStyle
92 static VVTK_InteractorStyle *New();
93 vtkTypeMacro(VVTK_InteractorStyle,SVTK_InteractorStyle);
95 //! Redefined from SVTK_InteractorStyle::SetInteractor in order to add an observer (callback) for custorm event (space mouse event)
98 SetInteractor( vtkRenderWindowInteractor* );
101 VVTK_InteractorStyle();
102 ~VVTK_InteractorStyle();
104 VVTK_InteractorStyle(const VVTK_InteractorStyle&); // Not implemented
105 void operator=(const VVTK_InteractorStyle&); // Not implemented
107 // Generic event bindings must be overridden in subclasses
109 //! Redefine SVTK_InteractorStyle::OnLeftButtonDown
110 virtual void OnLeftButtonDown(int ctrl, int shift, int x, int y);
112 //! Redefine SVTK_InteractorStyle::OnMiddleButtonDown
113 virtual void OnMiddleButtonDown(int ctrl, int shift, int x, int y);
115 //! Redefine SVTK_InteractorStyle::OnLeftButtonUp
116 virtual void OnLeftButtonUp(int ctrl, int shift, int x, int y);
118 //! Redefine SVTK_InteractorStyle::OnMiddleButtonUp
119 virtual void OnMiddleButtonUp(int ctrl, int shift, int x, int y);
121 //! Redefine SVTK_InteractorStyle::onFinishOperation
122 virtual void onFinishOperation();
124 //! Main process VTK event method
127 ProcessEvents(vtkObject* object,
132 //! Redefine SVTK_InteractorStyle::onSpaceMouseButton
133 virtual void onSpaceMouseButton( int button );
135 //! To decrease magnification of the Gauss Points
136 void DecreaseGaussPointMagnification();
138 //! To increase magnification of the Gauss Points
139 void IncreaseGaussPointMagnification();
141 //! SpaceMouse short cuts
142 int mySMDecreaseMagnificationBtn;
143 int mySMIncreaseMagnificationBtn;
145 bool myIsMidButtonDown;
146 bool myIsLeftButtonDown;