OpenSceneGraph/doc/doc++/osgGA/GUIActionAdapter.html

98 lines
4.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>class osgGA::GUIActionAdapter</TITLE>
<META NAME="GENERATOR" CONTENT="DOC++ 3.4.8">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H2>class <A HREF="#DOC.DOCU">osgGA::GUIActionAdapter</A></H2></H2><BLOCKQUOTE> Abstract base class defining the interface by which GUIEventHandlers may request actions of the GUI system in use.</BLOCKQUOTE>
<HR>
<DL>
<P><DL>
<DT><H3>Public Methods</H3><DD><DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.2.5.1">requestRedraw</A></B>() = 0
<DD><I> requestRedraw() requests a single redraw</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.2.5.2">requestContinuousUpdate</A></B>(bool needed=true) = 0
<DD><I> requestContinousUpdate(bool) is for en/disabling a throw or idle callback to be requested by a GUIEventHandler (typically a CameraManipulator, though other GUIEventHandler's may also provide functionality).</I>
<DT>
<IMG ALT="[more]" BORDER=0 SRC=icon1.gif>virtual void <B><A HREF="#DOC.2.5.3">requestWarpPointer</A></B>(int x, int y) = 0
<DD><I> requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer to a specified x,y location on the window.</I>
</DL></P>
</DL>
<A NAME="DOC.DOCU"></A>
<HR>
<H2>Documentation</H2>
<BLOCKQUOTE>
Abstract base class defining the interface by which GUIEventHandlers may request
actions of the GUI system in use. These requests for actions should then be honoured
by the GUI toolkit of the user's application.
<P>To provide more detail, when a GUIEventHandler (e.g. a TrackballManipulator)
handles an incoming event, such as a mouse event, it may wish to make
a request of the GUI. E.g. if a model is 'thrown', the trackball manipulator
may wish to start a timer, and be repeatedly called, to continuously refresh the
camera's position and orientation. However, it has no way of doing this, as it
knows nothing of the window system in which it's operating. Instead, the
GUIEventHandler issues it's request via a GUIActionAdapter, and the viewer
in use should honour the request, using the GUI system in play.
<P>There is more than one way of using the GUIActionAdapter. E.g. it may be inherited
into a Viewer class, as is done with osgGLUT::Viewer. Alternatively, a simple
subclass of GUIActionAdapter (e.g. osgQt::QtActionAdapter) may be passed to
the GUIEventHandler::handle() function; once the function has returned, the viewer
will then unpack the results and work out what to do to respond to the
requests.
<P>Also there are several ways to run your app and handle the updating of
the window. osgGLUT::Viewer always has a idle callback registered which does a
redraw all the time. osgGLUT::Viewer can safely ignore both requestRedraw() and
requestContinousUpdate() as these are happening all the time anyway.
<P>Other apps will probably want to respond to the requestRedraw() and
requestContinousUpdate(bool) and again there is more than one way to handle it.
You can override requestRedraw() and implement to call your own window
redraw straight away. Or you can implement so that a flag is set and
then you then respond the flag being set in your own leisure.
</BLOCKQUOTE>
<DL>
<A NAME="requestRedraw"></A>
<A NAME="DOC.2.5.1"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void requestRedraw() = 0</B></TT>
<DD>
requestRedraw() requests a single redraw
<DL><DT><DD></DL><P>
<A NAME="requestContinuousUpdate"></A>
<A NAME="DOC.2.5.2"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void requestContinuousUpdate(bool needed=true) = 0</B></TT>
<DD>
requestContinousUpdate(bool) is for en/disabling a throw or idle
callback to be requested by a GUIEventHandler (typically a CameraManipulator,
though other GUIEventHandler's may also provide functionality).
GUI toolkits can respond to this immediately by registering an idle/timed
callback, or can delay setting the callback and update at their own leisure.
<DL><DT><DD></DL><P>
<A NAME="requestWarpPointer"></A>
<A NAME="DOC.2.5.3"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>virtual void requestWarpPointer(int x, int y) = 0</B></TT>
<DD>
requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer
to a specified x,y location on the window. This is used by some camera manipulators
to initialise the mouse pointer when mouse position relative to a controls
neutral mouse position is required, i.e when mimicking a aircrafts joystick.
<DL><DT><DD></DL><P></DL>
<HR><DL><DT><B>This class has no child classes.</B></DL>
<DL><DT><DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I></P><HR>
<BR>
This page was generated with the help of <A HREF="http://docpp.sourceforge.net">DOC++</A>.
</BODY>
</HTML>