OpenSceneGraph 3.6.5
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
52
53 void setFocusBehaviour(FocusBehaviour behaviour) { _focusBehaviour = behaviour; }
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
Vec3f Vec3
Definition Vec3:21
BoundingBoxImpl< Vec3f > BoundingBoxf
Definition BoundingBox:251
BoundingSphered BoundingSphere
Definition BoundingSphere:308
The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help devel...
Definition Callback:21
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
General group node which maintains a list of children.
Definition Group:29
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base Event class.
Definition Event:27
Basic EventVisitor implementation for animating a scene.
Definition EventVisitor:42
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
virtual void setHasEventFocus(bool focus)
set whether the widget has focus or not.
virtual void enter()
update any focus related graphics+state to the focused state.
virtual ~Widget()
Definition Widget:77
bool _hasEventFocus
Definition Widget:80
META_Node(osgGA, Widget)
virtual bool handleImplementation(osgGA::EventVisitor *ev, osgGA::Event *event)
FocusBehaviour _focusBehaviour
Definition Widget:79
virtual void enterImplementation()
FocusBehaviour
Definition Widget:47
@ CLICK_TO_FOCUS
Definition Widget:48
@ EVENT_DRIVEN_FOCUS_DISABLED
Definition Widget:50
@ FOCUS_FOLLOWS_POINTER
Definition Widget:49
FocusBehaviour getFocusBehaviour() const
Definition Widget:54
osg::BoundingBoxf _extents
Definition Widget:83
virtual osg::BoundingSphere computeBound() const
Compute the bounding sphere around Node's geometry or children.
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)
Traverse downwards : calls children's accept method with NodeVisitor.
const osg::BoundingBoxf & getExtents() const
Definition Widget:44
virtual void traverseImplementation(osg::NodeVisitor &nv)
virtual void leaveImplementation()
void setFocusBehaviour(FocusBehaviour behaviour)
Definition Widget:53
virtual void leave()
update any focus related graphics+state to the unfocused state.
virtual void createGraphics()
bool _graphicsInitialized
Definition Widget:81
virtual bool getHasEventFocus() const
get whether the widget has focus or not.
virtual void updateFocus(osg::NodeVisitor &nv)
update the focus according to events.
#define OSGGA_EXPORT
Definition Export:40

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