OpenSceneGraph
3.4.0
|
InteractiveImage is an event handler that computes the mouse coordinates in an images coordinate frame and then passes keyboard and mouse events to it. More...
Public Member Functions | |
InteractiveImageHandler (osg::Image *image) | |
Constructor to use when the InteractiveImage is in the 3D scene (i.e. not in a fullscreen HUD overlay). | |
InteractiveImageHandler (osg::Image *image, osg::Texture2D *texture, osg::Camera *camera) | |
Constructor to use when the InteractiveImage is in a fullscreen HUD overlay. | |
META_Object (osgViewer, InteractiveImageHandler) | |
virtual bool | run (osg::Object *object, osg::Object *data) |
Invoke the callback, first parameter is the Object that the callback is attached to, the second parameter, the data, is typically the NodeVisitor that is invoking the callback. | |
virtual bool | handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *nv) |
Handle events, return true if handled, false otherwise. | |
virtual bool | cull (osg::NodeVisitor *nv, osg::Drawable *drawable, osg::RenderInfo *renderInfo) const |
do customized cull code, return true if drawable should be culled. | |
Protected Member Functions | |
virtual | ~InteractiveImageHandler () |
InteractiveImageHandler () | |
InteractiveImageHandler (const InteractiveImageHandler &, const osg::CopyOp &=osg::CopyOp::SHALLOW_COPY) | |
bool | mousePosition (osgViewer::View *view, osg::NodeVisitor *nv, const osgGA::GUIEventAdapter &ea, int &x, int &y) const |
void | resize (int width, int height) |
Protected Attributes | |
osg::observer_ptr< osg::Image > | _image |
osg::observer_ptr< osg::Texture2D > | _texture |
bool | _fullscreen |
osg::observer_ptr< osg::Camera > | _camera |
InteractiveImage is an event handler that computes the mouse coordinates in an images coordinate frame and then passes keyboard and mouse events to it.
This event handler is useful for vnc or browser surfaces in the 3D scene.
Constructor to use when the InteractiveImage is in the 3D scene (i.e. not in a fullscreen HUD overlay).
osgViewer::InteractiveImageHandler::InteractiveImageHandler | ( | osg::Image * | image, |
osg::Texture2D * | texture, | ||
osg::Camera * | camera | ||
) |
Constructor to use when the InteractiveImage is in a fullscreen HUD overlay.
virtual osgViewer::InteractiveImageHandler::~InteractiveImageHandler | ( | ) | [inline, protected, virtual] |
osgViewer::InteractiveImageHandler::InteractiveImageHandler | ( | ) | [inline, protected] |
osgViewer::InteractiveImageHandler::InteractiveImageHandler | ( | const InteractiveImageHandler & | , |
const osg::CopyOp & | = osg::CopyOp::SHALLOW_COPY |
||
) | [inline, protected] |
virtual bool osgViewer::InteractiveImageHandler::cull | ( | osg::NodeVisitor * | nv, |
osg::Drawable * | drawable, | ||
osg::RenderInfo * | renderInfo | ||
) | const [virtual] |
do customized cull code, return true if drawable should be culled.
Reimplemented from osg::Drawable::CullCallback.
virtual bool osgViewer::InteractiveImageHandler::handle | ( | const osgGA::GUIEventAdapter & | ea, |
osgGA::GUIActionAdapter & | aa, | ||
osg::Object * | , | ||
osg::NodeVisitor * | |||
) | [virtual] |
Handle events, return true if handled, false otherwise.
Reimplemented from osgGA::GUIEventHandler.
bool osgViewer::InteractiveImageHandler::mousePosition | ( | osgViewer::View * | view, |
osg::NodeVisitor * | nv, | ||
const osgGA::GUIEventAdapter & | ea, | ||
int & | x, | ||
int & | y | ||
) | const [protected] |
void osgViewer::InteractiveImageHandler::resize | ( | int | width, |
int | height | ||
) | [protected] |
virtual bool osgViewer::InteractiveImageHandler::run | ( | osg::Object * | object, |
osg::Object * | data | ||
) | [inline, virtual] |
Invoke the callback, first parameter is the Object that the callback is attached to, the second parameter, the data, is typically the NodeVisitor that is invoking the callback.
The run(..) method may be overriden by users directly, or if the user is using one of the old style callbacks such as NodeCallback or Drawable::UpdateCallback then you can just override the appropriate callback method on those callback subclasses. If you are implementing your own callback then one should call traverse() to make sure nested callbacks and visitor traversal() is completed.
Reimplemented from osg::Callback.
References osgGA::EventHandler::run().
bool osgViewer::InteractiveImageHandler::_fullscreen [protected] |
![]() | Generated at Tue Dec 8 2015 00:16:52 for the OpenSceneGraph by doxygen 1.7.6.1. |