openscenegraph
osgGA/Widget
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2013 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#ifndef OSGGA_WIDGET
15#define OSGGA_WIDGET
16
17#include <osg/Group>
18#include <osg/BoundingBox>
19#include <osgGA/Event>
20#include <osgGA/EventVisitor>
21
22namespace osgGA
23{
24
26{
27public:
31
32 virtual void traverse(osg::NodeVisitor& nv);
34
35 virtual bool handle(osgGA::EventVisitor* ev, osgGA::Event* event);
37
39
40 virtual void createGraphics();
42
43 virtual void setExtents(const osg::BoundingBoxf& bb);
44 const osg::BoundingBoxf& getExtents() const { return _extents; }
45
47 {
50 EVENT_DRIVEN_FOCUS_DISABLED
51 };
52
53 void setFocusBehaviour(FocusBehaviour behaviour) { _focusBehaviour = behaviour; }
54 FocusBehaviour getFocusBehaviour() const { return _focusBehaviour; }
55
57 virtual void updateFocus(osg::NodeVisitor& nv);
58
60 virtual void setHasEventFocus(bool focus);
61
63 virtual bool getHasEventFocus() const;
64
66
68 virtual void enter();
69 virtual void enterImplementation();
70
72 virtual void leave();
73 virtual void leaveImplementation();
74
75
76protected:
77 virtual ~Widget() {}
78
82
84};
85
86}
87
88#endif
Definition EventVisitor:42
Definition Event:27
Definition GUIEventAdapter:82
Definition osgGA/Widget:26
virtual void setHasEventFocus(bool focus)
virtual void enter()
virtual ~Widget()
Definition osgGA/Widget:77
bool _hasEventFocus
Definition osgGA/Widget:80
META_Node(osgGA, Widget)
virtual bool handleImplementation(osgGA::EventVisitor *ev, osgGA::Event *event)
FocusBehaviour _focusBehaviour
Definition osgGA/Widget:79
virtual void enterImplementation()
FocusBehaviour
Definition osgGA/Widget:47
@ CLICK_TO_FOCUS
Definition osgGA/Widget:48
@ FOCUS_FOLLOWS_POINTER
Definition osgGA/Widget:49
FocusBehaviour getFocusBehaviour() const
Definition osgGA/Widget:54
osg::BoundingBoxf _extents
Definition osgGA/Widget:83
virtual osg::BoundingSphere computeBound() const
Widget(const Widget &tfw, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual bool computePositionInLocalCoordinates(osgGA::EventVisitor *ev, osgGA::GUIEventAdapter *event, osg::Vec3 &localPosition) const
virtual bool handle(osgGA::EventVisitor *ev, osgGA::Event *event)
virtual void setExtents(const osg::BoundingBoxf &bb)
virtual void createGraphicsImplementation()
virtual void traverse(osg::NodeVisitor &nv)
const osg::BoundingBoxf & getExtents() const
Definition osgGA/Widget:44
virtual void traverseImplementation(osg::NodeVisitor &nv)
virtual void leaveImplementation()
void setFocusBehaviour(FocusBehaviour behaviour)
Definition osgGA/Widget:53
virtual void leave()
virtual void createGraphics()
bool _graphicsInitialized
Definition osgGA/Widget:81
virtual bool getHasEventFocus() const
virtual void updateFocus(osg::NodeVisitor &nv)
Definition BoundingBox:34
Definition BoundingSphere:35
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Definition Group:29
Definition NodeVisitor:82
Definition Vec3f:29
Definition Callback:21
#define OSGGA_EXPORT
Definition osgGA/Export:40