Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osgGLUT::Viewer Class Reference

A basic viewer base class which provides a window, simple keyboard and mouse interaction. More...

Inheritance diagram for osgGLUT::Viewer:

Inheritance graph
[legend]
List of all members.

Public Types

typedef std::vector< osg::ref_ptr<
osgGA::CameraManipulator > > 
CameraManipList

Public Methods

 Viewer ()
virtual ~Viewer ()
virtual void init (osg::Node *rootnode)
 init is deprecated, you should use addViewport instead.

virtual unsigned int addViewport (osgUtil::SceneView *sv, float x=0.0, float y=0.0, float width=1.0, float height=1.0)
virtual unsigned int addViewport (osg::Node *, float x=0.0, float y=0.0, float width=1.0, float height=1.0)
const unsigned int getNumViewports () const
osgUtil::SceneViewgetViewportSceneView (unsigned int pos)
virtual bool open ()
virtual bool run ()
virtual float app (unsigned int viewport)
virtual float cull (unsigned int viewport)
virtual float draw (unsigned int viewport)
long initClock ()
double clockSeconds ()
osg::Timer_t updateFrameTick ()
double frameSeconds ()
double frameRate ()
void help (std::ostream &fout)
unsigned int registerCameraManipulator (osgGA::CameraManipulator *cm, unsigned int viewport=0)
void selectCameraManipulator (unsigned int pos, unsigned int viewport=0)
void setEventHandler (osgGA::GUIEventHandler *handler, unsigned int viewport=0)
virtual void requestRedraw ()
 requestRedraw() requests a single redraw.

virtual void requestContinuousUpdate (bool)
 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).

virtual void requestWarpPointer (int x, int y)
 requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer to a specified x,y location on the window.

void readCommandLine (std::vector< std::string > &commandLine)
 read the command line string list, removing any matched control sequences.

void setDisplaySettings (osg::DisplaySettings *ds)
osg::DisplaySettingsgetDisplaySettings ()
const osg::DisplaySettingsgetDisplaySettings () const

Protected Types

typedef std::vector< ViewportDefViewportList

Protected Methods

virtual void clear ()
virtual void display ()
virtual void reshape (GLint w, GLint h)
virtual void mouseMotion (int x, int y)
virtual void mousePassiveMotion (int x, int y)
virtual void mouse (int button, int state, int x, int y)
virtual void keyboard (unsigned char key, int x, int y)
void setFocusedViewport (unsigned int pos)
int mapWindowXYToSceneView (int x, int y)
void showStats (const unsigned int i)
osg::Timer_t clockTick ()
osg::Timer_t frameTick ()

Protected Attributes

ViewportList _viewportList
unsigned int _focusedViewport
std::string _saveFileName
bool _viewFrustumCullingActive
bool _smallFeatureCullingActive
int polymode
int texture
int backface
int lighting
int flat_shade
float frRate
int _printStats
StatsRecord times [3]
bool _useDisplayLists
osg::Timer _timer
osg::Timer_t _initialTick
osg::Timer_t _lastFrameTick
osg::Timer_t _frameTick
osg::ref_ptr< osg::FrameStamp_frameStamp
osg::ref_ptr< osg::DisplaySettings_displaySettings

Static Protected Attributes

Viewer * s_theViewer

Detailed Description

A basic viewer base class which provides a window, simple keyboard and mouse interaction.

Please note, this viewer class has been developed via a rather haphazard path and needs a total rewrite. It currently suffices for osg demos but shouldn't be viewed as the be all and end of osg viewer classes. Someone please rewrite it :-)


Member Typedef Documentation

typedef std::vector<osg::ref_ptr<osgGA::CameraManipulator> > osgGLUT::Viewer::CameraManipList
 

typedef std::vector<ViewportDef> osgGLUT::Viewer::ViewportList [protected]
 


Constructor & Destructor Documentation

osgGLUT::Viewer::Viewer  
 

virtual osgGLUT::Viewer::~Viewer   [virtual]
 


Member Function Documentation

virtual unsigned int osgGLUT::Viewer::addViewport osg::Node  ,
float    x = 0.0,
float    y = 0.0,
float    width = 1.0,
float    height = 1.0
[virtual]
 

virtual unsigned int osgGLUT::Viewer::addViewport osgUtil::SceneView   sv,
float    x = 0.0,
float    y = 0.0,
float    width = 1.0,
float    height = 1.0
[virtual]
 

virtual float osgGLUT::Viewer::app unsigned int    viewport [virtual]
 

virtual void osgGLUT::Viewer::clear   [protected, virtual]
 

Reimplemented from osgGLUT::Window.

double osgGLUT::Viewer::clockSeconds   [inline]
 

osg::Timer_t osgGLUT::Viewer::clockTick   [protected]
 

virtual float osgGLUT::Viewer::cull unsigned int    viewport [virtual]
 

virtual void osgGLUT::Viewer::display   [protected, virtual]
 

Reimplemented from osgGLUT::Window.

virtual float osgGLUT::Viewer::draw unsigned int    viewport [virtual]
 

double osgGLUT::Viewer::frameRate   [inline]
 

double osgGLUT::Viewer::frameSeconds   [inline]
 

osg::Timer_t osgGLUT::Viewer::frameTick   [protected]
 

const osg::DisplaySettings* osgGLUT::Viewer::getDisplaySettings   const [inline]
 

osg::DisplaySettings* osgGLUT::Viewer::getDisplaySettings   [inline]
 

const unsigned int osgGLUT::Viewer::getNumViewports   const [inline]
 

osgUtil::SceneView* osgGLUT::Viewer::getViewportSceneView unsigned int    pos [inline]
 

void osgGLUT::Viewer::help std::ostream &    fout
 

virtual void osgGLUT::Viewer::init osg::Node   rootnode [virtual]
 

init is deprecated, you should use addViewport instead.

init is only available for backwards compatibility.

long osgGLUT::Viewer::initClock  
 

virtual void osgGLUT::Viewer::keyboard unsigned char    key,
int    x,
int    y
[protected, virtual]
 

Reimplemented from osgGLUT::Window.

int osgGLUT::Viewer::mapWindowXYToSceneView int    x,
int    y
[protected]
 

virtual void osgGLUT::Viewer::mouse int    button,
int    state,
int    x,
int    y
[protected, virtual]
 

Reimplemented from osgGLUT::Window.

virtual void osgGLUT::Viewer::mouseMotion int    x,
int    y
[protected, virtual]
 

Reimplemented from osgGLUT::Window.

virtual void osgGLUT::Viewer::mousePassiveMotion int    x,
int    y
[protected, virtual]
 

Reimplemented from osgGLUT::Window.

virtual bool osgGLUT::Viewer::open   [virtual]
 

Reimplemented from osgGLUT::Window.

void osgGLUT::Viewer::readCommandLine std::vector< std::string > &    commandLine
 

read the command line string list, removing any matched control sequences.

unsigned int osgGLUT::Viewer::registerCameraManipulator osgGA::CameraManipulator   cm,
unsigned int    viewport = 0
 

virtual void osgGLUT::Viewer::requestContinuousUpdate bool    [inline, virtual]
 

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.

Implements osgGA::GUIActionAdapter.

virtual void osgGLUT::Viewer::requestRedraw   [inline, virtual]
 

requestRedraw() requests a single redraw.

Implements osgGA::GUIActionAdapter.

virtual void osgGLUT::Viewer::requestWarpPointer int    x,
int    y
[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.

virtual void osgGLUT::Viewer::reshape GLint    w,
GLint    h
[protected, virtual]
 

Reimplemented from osgGLUT::Window.

virtual bool osgGLUT::Viewer::run   [virtual]
 

Reimplemented from osgGLUT::Window.

void osgGLUT::Viewer::selectCameraManipulator unsigned int    pos,
unsigned int    viewport = 0
 

void osgGLUT::Viewer::setDisplaySettings osg::DisplaySettings   ds [inline]
 

void osgGLUT::Viewer::setEventHandler osgGA::GUIEventHandler   handler,
unsigned int    viewport = 0
 

void osgGLUT::Viewer::setFocusedViewport unsigned int    pos [protected]
 

void osgGLUT::Viewer::showStats const unsigned int    i [protected]
 

osg::Timer_t osgGLUT::Viewer::updateFrameTick  
 


Member Data Documentation

osg::ref_ptr<osg::DisplaySettings> osgGLUT::Viewer::_displaySettings [protected]
 

unsigned int osgGLUT::Viewer::_focusedViewport [protected]
 

osg::ref_ptr<osg::FrameStamp> osgGLUT::Viewer::_frameStamp [protected]
 

osg::Timer_t osgGLUT::Viewer::_frameTick [protected]
 

osg::Timer_t osgGLUT::Viewer::_initialTick [protected]
 

osg::Timer_t osgGLUT::Viewer::_lastFrameTick [protected]
 

int osgGLUT::Viewer::_printStats [protected]
 

std::string osgGLUT::Viewer::_saveFileName [protected]
 

bool osgGLUT::Viewer::_smallFeatureCullingActive [protected]
 

osg::Timer osgGLUT::Viewer::_timer [protected]
 

bool osgGLUT::Viewer::_useDisplayLists [protected]
 

bool osgGLUT::Viewer::_viewFrustumCullingActive [protected]
 

ViewportList osgGLUT::Viewer::_viewportList [protected]
 

int osgGLUT::Viewer::backface [protected]
 

int osgGLUT::Viewer::flat_shade [protected]
 

float osgGLUT::Viewer::frRate [protected]
 

int osgGLUT::Viewer::lighting [protected]
 

int osgGLUT::Viewer::polymode [protected]
 

Viewer* osgGLUT::Viewer::s_theViewer [static, protected]
 

int osgGLUT::Viewer::texture [protected]
 

StatsRecord osgGLUT::Viewer::times[3] [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:50 2002 for the Open Scene Graph by doxygen 1.2.16.