OpenWalnut  1.5.0dev
WKeyboardHandler.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WKEYBOARDHANDLER_H
26 #define WKEYBOARDHANDLER_H
27 
28 #include <iostream>
29 #include <string>
30 
31 #include <osg/Geode>
32 #include <osg/Viewport>
33 #include <osgGA/GUIEventHandler>
34 #include <osgViewer/Viewer>
35 
36 #include "WMPointConnector.h"
37 
38 
39 /**
40  * Forward declartion for the WMPointConnector
41  */
42 class WMPointConnector;
43 
44 /**
45  * The keyboard handler for the keyboard events of WMPointConnector
46  */
47 class WKeyboardHandler : public osgGA::GUIEventHandler
48 {
49 public:
50  /**
51  * Constructs one WKeyboardHandler.
52  * \param connector The WMPointConnector this handler belongs to.
53  */
54  explicit WKeyboardHandler( WMPointConnector* connector );
55 
56  /**
57  * The callback for the event listener.
58  * \param ea The Adapter of the event.
59  * \param aa The Adapter of the action.
60  * \return Whether the event should be passed on.
61  */
62  bool handle( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa );
63 
64 private:
65  /**
66  * The WMPointConnector this handler belongs to.
67  */
69 
70  /**
71  * Whether ctrl is pressed or not.
72  */
73  bool m_isCtrl = false;
74 
75  /**
76  * Whether shift is pressed or not.
77  */
78  bool m_isShift = false;
79 };
80 
81 #endif // WKEYBOARDHANDLER_H
The keyboard handler for the keyboard events of WMPointConnector.
bool m_isCtrl
Whether ctrl is pressed or not.
WMPointConnector * m_connector
The WMPointConnector this handler belongs to.
WKeyboardHandler(WMPointConnector *connector)
Constructs one WKeyboardHandler.
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
The callback for the event listener.
bool m_isShift
Whether shift is pressed or not.
This module connects the points in a point dataset.