osgViewer::GraphicsWindow Class Reference

Base class for providing Windowing API agnostic access to creating and managing graphisc window and events. More...

Inheritance diagram for osgViewer::GraphicsWindow:

Inheritance graph
[legend]

List of all members.

Public Types

enum  MouseCursor {
  InheritCursor, NoCursor, RightArrowCursor, LeftArrowCursor,
  InfoCursor, DestroyCursor, HelpCursor, CycleCursor,
  SprayCursor, WaitCursor, TextCursor, CrosshairCursor,
  UpDownCursor, LeftRightCursor, TopSideCursor, BottomSideCursor,
  LeftSideCursor, RightSideCursor, TopLeftCorner, TopRightCorner,
  BottomRightCorner, BottomLeftCorner
}
 Mouse cursor types, the same ones already present with ancient glut . More...

Public Member Functions

 GraphicsWindow ()
virtual bool isSameKindAs (const Object *object) const
virtual const char * libraryName () const
 return the name of the object's library.
virtual const char * className () const
 return the name of the object's class type.
void setEventQueue (osgGA::EventQueue *eventQueue)
osgGA::EventQueuegetEventQueue ()
const osgGA::EventQueuegetEventQueue () const
virtual void checkEvents ()
void setWindowRectangle (int x, int y, int width, int height)
 Set the window's position and size.
virtual bool setWindowRectangleImplementation (int, int, int, int)
 implementation of setWindowRectangle, should be implemented by derived classes
virtual void getWindowRectangle (int &x, int &y, int &width, int &height)
 Get the window's position and size.
void setWindowDecoration (bool flag)
 Set Window decoration.
virtual bool setWindowDecorationImplementation (bool)
 implementation of setWindowDecoration, should be implemented by derived classes
virtual bool getWindowDecoration () const
 Set Window decoration.
virtual void grabFocus ()
 Get focus.
virtual void grabFocusIfPointerInWindow ()
 Get focus on if the pointer is in this window.
virtual void setWindowName (const std::string &)
 Set the name of the window.
virtual std::string getWindowName ()
 Return the name of the window.
virtual void useCursor (bool cursorOn)
 Switch on/off the cursor.
virtual void setCursor (MouseCursor)
 Set mouse cursor to a specific shape.
virtual bool valid () const
 Create a new mouse cursor from the usual bitmap data.
virtual bool realizeImplementation ()
 Realise the GraphicsContext implementation, Pure virtual - must be implemented by concrate implementations of GraphicsContext.
virtual bool isRealizedImplementation () const
 Return true if the graphics context has been realised, and is ready to use, implementation.
virtual void closeImplementation ()
 Close the graphics context implementation.
virtual bool makeCurrentImplementation ()
 Make this graphics context current implementation.
virtual bool makeContextCurrentImplementation (GraphicsContext *)
 Make this graphics context current with specified read context implementation.
virtual bool releaseContextImplementation ()
 Release the graphics context.
virtual void bindPBufferToTextureImplementation (GLenum)
 Pure virtual, Bind the graphics context to associated texture implementation.
virtual void swapBuffersImplementation ()
 Swap the front and back buffers implementation.
virtual void requestRedraw ()
 requestRedraw() requests a single redraw.
virtual void requestContinuousUpdate (bool=true)
 requestContinousUpdate(bool) is for en/disabling a throw or idle callback to be requested by a GUIEventHandler (typically a MatrixManipulator, though other GUIEventHandler's may also provide functionality).
virtual void requestWarpPointer (float, float)
 requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer to a specified x,y location on the window.

Protected Attributes

osg::ref_ptr
< osgGA::EventQueue
_eventQueue


Detailed Description

Base class for providing Windowing API agnostic access to creating and managing graphisc window and events.

Note, the GraphicsWindow is subclassed from osg::GraphicsContext, and to provide an implemention you'll need to implement its range of pure virtual functions, you'll find these all have naming convention methodNameImplemention(..). GraphicsWindow adds the event queue ontop of the GraphicsContext, thereby adding a mechnism for adapting Windowing events as well as basics graphics context work, you should wire up custom GraphicsWindowImplementation to push their events through into the EventQueue.


Member Enumeration Documentation

enum osgViewer::GraphicsWindow::MouseCursor

Mouse cursor types, the same ones already present with ancient glut .

..

Enumerator:
InheritCursor 
NoCursor 
RightArrowCursor 
LeftArrowCursor 
InfoCursor 
DestroyCursor 
HelpCursor 
CycleCursor 
SprayCursor 
WaitCursor 
TextCursor 
CrosshairCursor 
UpDownCursor 
LeftRightCursor 
TopSideCursor 
BottomSideCursor 
LeftSideCursor 
RightSideCursor 
TopLeftCorner 
TopRightCorner 
BottomRightCorner 
BottomLeftCorner 


Constructor & Destructor Documentation

osgViewer::GraphicsWindow::GraphicsWindow (  )  [inline]


Member Function Documentation

virtual bool osgViewer::GraphicsWindow::isSameKindAs ( const Object *  object  )  const [inline, virtual]

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual const char* osgViewer::GraphicsWindow::libraryName (  )  const [inline, virtual]

return the name of the object's library.

Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.

Reimplemented from osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual const char* osgViewer::GraphicsWindow::className (  )  const [inline, virtual]

return the name of the object's class type.

Must be defined by derived classes.

Reimplemented from osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

void osgViewer::GraphicsWindow::setEventQueue ( osgGA::EventQueue eventQueue  )  [inline]

osgGA::EventQueue* osgViewer::GraphicsWindow::getEventQueue (  )  [inline]

const osgGA::EventQueue* osgViewer::GraphicsWindow::getEventQueue (  )  const [inline]

virtual void osgViewer::GraphicsWindow::checkEvents (  )  [inline, virtual]

Reimplemented in osgViewer::GraphicsWindowWin32, and osgViewer::GraphicsWindowX11.

void osgViewer::GraphicsWindow::setWindowRectangle ( int  x,
int  y,
int  width,
int  height 
) [inline]

Set the window's position and size.

virtual bool osgViewer::GraphicsWindow::setWindowRectangleImplementation ( int  ,
int  ,
int  ,
int   
) [inline, virtual]

implementation of setWindowRectangle, should be implemented by derived classes

Reimplemented in osgViewer::GraphicsWindowWin32, and osgViewer::GraphicsWindowX11.

virtual void osgViewer::GraphicsWindow::getWindowRectangle ( int &  x,
int &  y,
int &  width,
int &  height 
) [inline, virtual]

Get the window's position and size.

void osgViewer::GraphicsWindow::setWindowDecoration ( bool  flag  )  [inline]

Set Window decoration.

virtual bool osgViewer::GraphicsWindow::setWindowDecorationImplementation ( bool   )  [inline, virtual]

implementation of setWindowDecoration, should be implemented by derived classes

Reimplemented in osgViewer::GraphicsWindowWin32, and osgViewer::GraphicsWindowX11.

virtual bool osgViewer::GraphicsWindow::getWindowDecoration (  )  const [inline, virtual]

Set Window decoration.

virtual void osgViewer::GraphicsWindow::grabFocus (  )  [inline, virtual]

Get focus.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual void osgViewer::GraphicsWindow::grabFocusIfPointerInWindow (  )  [inline, virtual]

Get focus on if the pointer is in this window.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual void osgViewer::GraphicsWindow::setWindowName ( const std::string &   )  [inline, virtual]

Set the name of the window.

Reimplemented in osgViewer::GraphicsWindowWin32, and osgViewer::GraphicsWindowX11.

virtual std::string osgViewer::GraphicsWindow::getWindowName (  )  [inline, virtual]

Return the name of the window.

virtual void osgViewer::GraphicsWindow::useCursor ( bool  cursorOn  )  [inline, virtual]

Switch on/off the cursor.

Reimplemented in osgViewer::GraphicsWindowWin32.

virtual void osgViewer::GraphicsWindow::setCursor ( MouseCursor   )  [inline, virtual]

Set mouse cursor to a specific shape.

virtual bool osgViewer::GraphicsWindow::valid (  )  const [inline, virtual]

Create a new mouse cursor from the usual bitmap data.

Return whether a valid and usable GraphicsContext has been created.

Implements osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual bool osgViewer::GraphicsWindow::realizeImplementation (  )  [inline, virtual]

Realise the GraphicsContext implementation, Pure virtual - must be implemented by concrate implementations of GraphicsContext.

Implements osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual bool osgViewer::GraphicsWindow::isRealizedImplementation (  )  const [inline, virtual]

Return true if the graphics context has been realised, and is ready to use, implementation.

Pure virtual - must be implemented by concrate implementations of GraphicsContext.

Implements osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual void osgViewer::GraphicsWindow::closeImplementation (  )  [inline, virtual]

Close the graphics context implementation.

Pure virtual - must be implemented by concrate implementations of GraphicsContext.

Implements osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual bool osgViewer::GraphicsWindow::makeCurrentImplementation (  )  [inline, virtual]

Make this graphics context current implementation.

Pure virtual - must be implemented by concrate implementations of GraphicsContext.

Implements osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual bool osgViewer::GraphicsWindow::makeContextCurrentImplementation ( GraphicsContext *   )  [inline, virtual]

Make this graphics context current with specified read context implementation.

Pure virtual - must be implemented by concrate implementations of GraphicsContext.

virtual bool osgViewer::GraphicsWindow::releaseContextImplementation (  )  [inline, virtual]

Release the graphics context.

Implements osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual void osgViewer::GraphicsWindow::bindPBufferToTextureImplementation ( GLenum   )  [inline, virtual]

Pure virtual, Bind the graphics context to associated texture implementation.

Pure virtual - must be implemented by concrate implementations of GraphicsContext.

Implements osg::GraphicsContext.

virtual void osgViewer::GraphicsWindow::swapBuffersImplementation (  )  [inline, virtual]

Swap the front and back buffers implementation.

Pure virtual - must be implemented by Concrate implementations of GraphicsContext.

Implements osg::GraphicsContext.

Reimplemented in osgViewer::GraphicsWindowWin32, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowEmbedded.

virtual void osgViewer::GraphicsWindow::requestRedraw (  )  [inline, virtual]

requestRedraw() requests a single redraw.

Implements osgGA::GUIActionAdapter.

virtual void osgViewer::GraphicsWindow::requestContinuousUpdate ( bool  needed = true  )  [inline, virtual]

requestContinousUpdate(bool) is for en/disabling a throw or idle callback to be requested by a GUIEventHandler (typically a MatrixManipulator, 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.

Implements osgGA::GUIActionAdapter.

virtual void osgViewer::GraphicsWindow::requestWarpPointer ( float  x,
float  y 
) [inline, virtual]

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.

Implements osgGA::GUIActionAdapter.

Reimplemented in osgViewer::GraphicsWindowWin32, and osgViewer::GraphicsWindowX11.


Member Data Documentation

osg::ref_ptr<osgGA::EventQueue> osgViewer::GraphicsWindow::_eventQueue [protected]


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:53 2007 for the OpenSceneGraph by doxygen 1.5.3.