Added setHandled/getHandled to osgGA::GUIEventAdapter
This commit is contained in:
parent
3c96113970
commit
a01cade782
@ -258,6 +258,12 @@ public:
|
|||||||
|
|
||||||
GUIEventAdapter(const GUIEventAdapter& rhs);
|
GUIEventAdapter(const GUIEventAdapter& rhs);
|
||||||
|
|
||||||
|
/** Set whether this event has been handled by an event handler or not.*/
|
||||||
|
void setHandled(bool handled) { _handled = handled; }
|
||||||
|
|
||||||
|
/** Get whether this event has been handled by an event handler or not.*/
|
||||||
|
bool getHandled() const { return _handled; }
|
||||||
|
|
||||||
/** Get the Type of the GUI GUIEventAdapter.*/
|
/** Get the Type of the GUI GUIEventAdapter.*/
|
||||||
void setEventType(EventType Type) { _eventType = Type; }
|
void setEventType(EventType Type) { _eventType = Type; }
|
||||||
|
|
||||||
@ -394,6 +400,7 @@ public:
|
|||||||
/** Force users to create on heap, so that multiple referencing is safe.*/
|
/** Force users to create on heap, so that multiple referencing is safe.*/
|
||||||
virtual ~GUIEventAdapter();
|
virtual ~GUIEventAdapter();
|
||||||
|
|
||||||
|
bool _handled;
|
||||||
EventType _eventType;
|
EventType _eventType;
|
||||||
double _time;
|
double _time;
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
using namespace osgGA;
|
using namespace osgGA;
|
||||||
|
|
||||||
GUIEventAdapter::GUIEventAdapter():
|
GUIEventAdapter::GUIEventAdapter():
|
||||||
|
_handled(false),
|
||||||
_eventType(NONE),
|
_eventType(NONE),
|
||||||
_time(0.0),
|
_time(0.0),
|
||||||
_windowX(0),
|
_windowX(0),
|
||||||
@ -42,6 +43,7 @@ GUIEventAdapter::GUIEventAdapter():
|
|||||||
|
|
||||||
GUIEventAdapter::GUIEventAdapter(const GUIEventAdapter& rhs):
|
GUIEventAdapter::GUIEventAdapter(const GUIEventAdapter& rhs):
|
||||||
osg::Referenced(),
|
osg::Referenced(),
|
||||||
|
_handled(rhs._handled),
|
||||||
_eventType(rhs._eventType),
|
_eventType(rhs._eventType),
|
||||||
_time(rhs._time),
|
_time(rhs._time),
|
||||||
_windowX(rhs._windowX),
|
_windowX(rhs._windowX),
|
||||||
|
@ -28,11 +28,11 @@ void GUIEventHandler::operator()(osg::Node* node, osg::NodeVisitor* nv)
|
|||||||
{
|
{
|
||||||
if (handle(*(*itr), *(ev->getActionAdapter()), node, nv))
|
if (handle(*(*itr), *(ev->getActionAdapter()), node, nv))
|
||||||
{
|
{
|
||||||
return;
|
(*itr)->setHandled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
traverse(node,nv);
|
if (node->getNumChildrenRequiringEventTraversal()>0) traverse(node,nv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUIEventHandler::event(osg::NodeVisitor* nv, osg::Drawable* drawable)
|
void GUIEventHandler::event(osg::NodeVisitor* nv, osg::Drawable* drawable)
|
||||||
|
Loading…
Reference in New Issue
Block a user