OpenSceneGraph 3.6.5
ViewerEventHandlers
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14// Code by: Jeremy Moles (cubicool) 2007-2008
15
16#ifndef OSGWIDGET_VIEWER_EVENT_HANDLERS
17#define OSGWIDGET_VIEWER_EVENT_HANDLERS
18
19#include <osgGA/GUIEventAdapter>
20#include <osgGA/GUIEventHandler>
22
23// NOTE! These are all just examples of some default event handlers--they are not
24// required. You are more than welcome to provide your own even handlers that
25// communicate with a WindowManager using it's public API.
26
27namespace osgWidget {
28
29// This handles the pressing/moving of mouse buttons, etc.
31{
32 public:
33
35
36 virtual bool handle(
41 );
42
43
44 typedef bool (MouseHandler::*MouseAction)(float, float, int);
45 typedef bool (WindowManager::*MouseEvent)(float, float);
46
47 protected:
48
50
51 bool _handleMousePush (float, float, int);
52 bool _handleMouseRelease (float, float, int);
53 bool _handleMouseDoubleClick (float, float, int);
54 bool _handleMouseDrag (float, float, int);
55 bool _handleMouseMove (float, float, int);
56 bool _handleMouseScroll (float, float, int);
57
59 bool _doMouseEvent (float, float, MouseEvent);
60};
61
62// This handles the forwarding of keypress events.
80
81// This class offers a default kind of handling for resizing.
100
101// This class provides a hotkey that lets you toggle back and forth between
102// a camera and setting the CameraManipulator's home point.
122
123}
124
125#endif
The osgWidget library is a NodeKit that extends the core scene graph to support a 2D (and eventually ...
Definition Box:21
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for observed objects, that automatically set pointers to them to null when they are del...
Definition observer_ptr:39
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Definition GUIActionAdapter:62
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
EventType
Definition GUIEventAdapter:91
GUIEventHandler provides a basic interface for any class which wants to handle a GUI Events.
Definition GUIEventHandler:50
bool(WindowManager::* MouseEvent)(float, float)
Definition ViewerEventHandlers:45
MouseAction _isMouseEvent(osgGA::GUIEventAdapter::EventType) const
bool _handleMouseMove(float, float, int)
bool _handleMouseScroll(float, float, int)
virtual bool handle(const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &, osg::Object *, osg::NodeVisitor *)
Handle events, return true if handled, false otherwise.
bool _handleMouseDoubleClick(float, float, int)
bool _doMouseEvent(float, float, MouseEvent)
bool _handleMousePush(float, float, int)
bool(MouseHandler::* MouseAction)(float, float, int)
Definition ViewerEventHandlers:44
MouseHandler(WindowManager *)
bool _handleMouseDrag(float, float, int)
osg::observer_ptr< WindowManager > _wm
Definition ViewerEventHandlers:49
bool _handleMouseRelease(float, float, int)
osg::observer_ptr< WindowManager > _wm
Definition ViewerEventHandlers:77
KeyboardHandler(WindowManager *)
virtual bool handle(const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &, osg::Object *, osg::NodeVisitor *)
Handle events, return true if handled, false otherwise.
virtual bool handle(const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &, osg::Object *, osg::NodeVisitor *)
Handle events, return true if handled, false otherwise.
ResizeHandler(WindowManager *, osg::Camera *=0)
osg::observer_ptr< osg::Camera > _camera
Definition ViewerEventHandlers:98
osg::observer_ptr< WindowManager > _wm
Definition ViewerEventHandlers:97
virtual bool handle(const osgGA::GUIEventAdapter &, osgGA::GUIActionAdapter &, osg::Object *, osg::NodeVisitor *)
Handle events, return true if handled, false otherwise.
osg::ref_ptr< osg::Node > _oldNode
Definition ViewerEventHandlers:120
CameraSwitchHandler(WindowManager *, osg::Camera *)
osg::observer_ptr< WindowManager > _wm
Definition ViewerEventHandlers:118
osg::observer_ptr< osg::Camera > _camera
Definition ViewerEventHandlers:119
Definition WindowManager:39
#define OSGWIDGET_EXPORT
Definition Export:42

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.