OpenSceneGraph  3.0.1
Public Types | Public Member Functions | Protected Attributes
osgViewer::GraphicsWindow Class Reference

Base class for providing Windowing API agnostic access to creating and managing graphics 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,
  HandCursor, UpDownCursor, LeftRightCursor, TopSideCursor,
  BottomSideCursor, LeftSideCursor, RightSideCursor, TopLeftCorner,
  TopRightCorner, BottomRightCorner, BottomLeftCorner
}
 Mouse cursor types, the same ones already present with ancient glut ... More...
typedef std::list
< osgViewer::View * > 
Views

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 raiseWindow ()
 Raise the window to the top.
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 void setSyncToVBlank (bool on)
 Create a new mouse cursor from the usual bitmap data.
bool getSyncToVBlank () const
virtual void setSwapGroup (bool on, GLuint group, GLuint barrier)
 Set swap group.
void getSwapGroup (bool &on, GLuint &group, GLuint &barrier) const
virtual bool valid () const
 Return whether a valid and usable GraphicsContext has been created.
virtual bool realizeImplementation ()
 Realize the GraphicsContext implementation, Pure virtual - must be implemented by concrete implementations of GraphicsContext.
virtual bool isRealizedImplementation () const
 Return true if the graphics context has been realized, 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.
void getViews (Views &views)
 Returns the list of views (osgViewer::View) attached to this GraphicsWindow.
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 graphics 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 on top of the GraphicsContext, thereby adding a mechanism 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 Typedef Documentation


Member Enumeration Documentation

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

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

Constructor & Destructor Documentation

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

Member Function Documentation

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

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

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

Implements osg::GraphicsContext.

References osg::notify(), and osg::NOTICE.

virtual void osgViewer::GraphicsWindow::checkEvents ( ) [inline, virtual]
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::GraphicsWindowEmbedded, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowWin32.

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

Close the graphics context implementation.

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

Implements osg::GraphicsContext.

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

References osg::notify(), and osg::NOTICE.

osgGA::EventQueue* osgViewer::GraphicsWindow::getEventQueue ( ) [inline]
const osgGA::EventQueue* osgViewer::GraphicsWindow::getEventQueue ( ) const [inline]
void osgViewer::GraphicsWindow::getSwapGroup ( bool &  on,
GLuint &  group,
GLuint &  barrier 
) const [inline]
bool osgViewer::GraphicsWindow::getSyncToVBlank ( ) const [inline]
void osgViewer::GraphicsWindow::getViews ( Views views)

Returns the list of views (osgViewer::View) attached to this GraphicsWindow.

Internally, the method walks through all the cameras and collects all the views attached to the cameras.

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

Set Window decoration.

Reimplemented in osgQt::GraphicsWindowQt.

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

Return the name of the window.

Reimplemented in osgQt::GraphicsWindowQt.

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

Get the window's position and size.

Reimplemented in osgQt::GraphicsWindowQt.

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

Get focus on if the pointer is in this window.

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

References osg::notify(), and osg::NOTICE.

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

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

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

Implements osg::GraphicsContext.

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

References osg::notify(), and osg::NOTICE.

virtual bool osgViewer::GraphicsWindow::isSameKindAs ( const Object *  object) const [inline, virtual]
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::GraphicsWindowEmbedded, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowWin32.

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

Make this graphics context current with specified read context implementation.

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

References osg::notify(), and osg::NOTICE.

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

Make this graphics context current implementation.

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

Implements osg::GraphicsContext.

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

References osg::notify(), and osg::NOTICE.

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

Realize the GraphicsContext implementation, Pure virtual - must be implemented by concrete implementations of GraphicsContext.

Implements osg::GraphicsContext.

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

References osg::notify(), and osg::NOTICE.

virtual bool osgViewer::GraphicsWindow::releaseContextImplementation ( ) [inline, virtual]
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::requestRedraw ( ) [virtual]

requestRedraw() requests a single redraw.

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 osgQt::GraphicsWindowQt, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowWin32.

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

Set mouse cursor to a specific shape.

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

References osg::notify(), and osg::NOTICE.

void osgViewer::GraphicsWindow::setEventQueue ( osgGA::EventQueue eventQueue) [inline]
virtual void osgViewer::GraphicsWindow::setSwapGroup ( bool  on,
GLuint  group,
GLuint  barrier 
) [inline, virtual]

Set swap group.

Reimplemented in osgViewer::GraphicsWindowWin32.

References osg::notify(), and osg::NOTICE.

virtual void osgViewer::GraphicsWindow::setSyncToVBlank ( bool  on) [inline, virtual]

Create a new mouse cursor from the usual bitmap data.

Set sync-to-vblank.

Reimplemented in osgViewer::GraphicsWindowWin32.

References osg::notify(), and osg::NOTICE.

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 osgQt::GraphicsWindowQt, osgViewer::GraphicsWindowX11, and osgViewer::GraphicsWindowWin32.

References osg::notify(), and osg::NOTICE.

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

Set the name of the window.

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

References osg::notify(), and osg::NOTICE.

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::GraphicsWindowX11, osgQt::GraphicsWindowQt, and osgViewer::GraphicsWindowWin32.

References osg::notify(), and osg::NOTICE.

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

Swap the front and back buffers implementation.

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

Implements osg::GraphicsContext.

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

References osg::notify(), and osg::NOTICE.

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

Switch on/off the cursor.

Reimplemented in osgQt::GraphicsWindowQt, and osgViewer::GraphicsWindowWin32.

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

Return whether a valid and usable GraphicsContext has been created.

Implements osg::GraphicsContext.

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

References osg::notify(), and osg::NOTICE.


Member Data Documentation


The documentation for this class was generated from the following file:

osg logo
Generated at Mon Oct 3 2011 12:39:51 for the OpenSceneGraph by doxygen 1.7.5.