#ifndef SG_SCENE_PICKCALLBACK_HXX
#define SG_SCENE_PICKCALLBACK_HXX
+#include <osg/Vec2d>
+
#include <simgear/structure/SGReferenced.hxx>
+#include <simgear/structure/SGSharedPtr.hxx>
#include <simgear/math/SGMath.hxx>
+namespace osgGA { class GUIEventAdapter; }
+
// Used to implement scenery interaction.
// The interface is still under development
class SGPickCallback : public SGReferenced {
public:
+ enum Priority {
+ PriorityGUI = 0,
+ PriorityPanel = 1,
+ PriorityOther = 2
+ };
+
struct Info {
SGVec3d wgs84;
SGVec3d local;
};
+ SGPickCallback(Priority priority = PriorityOther) :
+ _priority(priority)
+ { }
+
virtual ~SGPickCallback() {}
- virtual bool buttonPressed(int button, const Info& info)
+ virtual bool buttonPressed(int button, const osgGA::GUIEventAdapter* event, const Info& info)
{ return false; }
+
virtual void update(double dt)
{ }
virtual void buttonReleased(void)
{ }
+
+ virtual void mouseMoved(const osgGA::GUIEventAdapter* event)
+ { }
+
+ virtual bool hover(const osg::Vec2d& windowPos, const Info& info)
+ { return false; }
+
+ Priority getPriority() const
+ { return _priority; }
+
+private:
+ Priority _priority;
};
struct SGSceneryPick {