Restructured classes to better fit with style of the rest of the OSG.

This commit is contained in:
Robert Osfield
2008-07-25 19:57:17 +00:00
parent 727925a1c2
commit ff5da51dcb
18 changed files with 2230 additions and 2193 deletions

View File

@@ -15,62 +15,73 @@
namespace osgWidget {
// This handles the pressing/moving of mouse buttons, etc.
class OSGWIDGET_EXPORT MouseHandler: public osgGA::GUIEventHandler {
osg::ref_ptr<WindowManager> _wm;
class OSGWIDGET_EXPORT MouseHandler: public osgGA::GUIEventHandler
{
public:
MouseHandler(WindowManager*);
bool _handleMousePush (float, float, int);
bool _handleMouseRelease (float, float, int);
bool _handleMouseDoubleClick (float, float, int);
bool _handleMouseDrag (float, float, int);
bool _handleMouseMove (float, float, int);
bool _handleMouseScroll (float, float, int);
virtual bool handle(
const osgGA::GUIEventAdapter&,
osgGA::GUIActionAdapter&,
osg::Object*,
osg::NodeVisitor*
);
typedef bool (MouseHandler::*MouseAction)(float, float, int);
typedef bool (WindowManager::*MouseEvent)(float, float);
protected:
MouseAction _isMouseEvent (osgGA::GUIEventAdapter::EventType) const;
bool _doMouseEvent (float, float, MouseEvent);
osg::ref_ptr<WindowManager> _wm;
bool _handleMousePush (float, float, int);
bool _handleMouseRelease (float, float, int);
bool _handleMouseDoubleClick (float, float, int);
bool _handleMouseDrag (float, float, int);
bool _handleMouseMove (float, float, int);
bool _handleMouseScroll (float, float, int);
typedef bool (MouseHandler::*MouseAction)(float, float, int);
typedef bool (WindowManager::*MouseEvent)(float, float);
MouseAction _isMouseEvent (osgGA::GUIEventAdapter::EventType) const;
bool _doMouseEvent (float, float, MouseEvent);
public:
MouseHandler(WindowManager*);
virtual bool handle(
const osgGA::GUIEventAdapter&,
osgGA::GUIActionAdapter&,
osg::Object*,
osg::NodeVisitor*
);
};
// This handles the forwarding of keypress events.
class OSGWIDGET_EXPORT KeyboardHandler: public osgGA::GUIEventHandler {
osg::ref_ptr<WindowManager> _wm;
class OSGWIDGET_EXPORT KeyboardHandler: public osgGA::GUIEventHandler
{
public:
KeyboardHandler(WindowManager*);
public:
KeyboardHandler(WindowManager*);
virtual bool handle(
const osgGA::GUIEventAdapter&,
osgGA::GUIActionAdapter&,
osg::Object*,
osg::NodeVisitor*
);
protected:
osg::ref_ptr<WindowManager> _wm;
virtual bool handle(
const osgGA::GUIEventAdapter&,
osgGA::GUIActionAdapter&,
osg::Object*,
osg::NodeVisitor*
);
};
// This class offers a default kind of handling for resizing.
class OSGWIDGET_EXPORT ResizeHandler: public osgGA::GUIEventHandler {
osg::ref_ptr<WindowManager> _wm;
osg::ref_ptr<osg::Camera> _camera;
class OSGWIDGET_EXPORT ResizeHandler: public osgGA::GUIEventHandler
{
public:
ResizeHandler(WindowManager*, osg::Camera*);
public:
ResizeHandler(WindowManager*, osg::Camera*);
virtual bool handle(
const osgGA::GUIEventAdapter&,
osgGA::GUIActionAdapter&,
osg::Object*,
osg::NodeVisitor*
);
protected:
osg::ref_ptr<WindowManager> _wm;
osg::ref_ptr<osg::Camera> _camera;
virtual bool handle(
const osgGA::GUIEventAdapter&,
osgGA::GUIActionAdapter&,
osg::Object*,
osg::NodeVisitor*
);
};
}