Inheritance diagram for osgViewer::Viewer:
Public Types | |
enum | ThreadingModel { SingleThreaded, CullDrawThreadPerContext, DrawThreadPerContext, CullThreadPerCameraDrawThreadPerContext, AutomaticSelection } |
enum | BarrierPosition { BeforeSwapBuffers, AfterSwapBuffers } |
typedef std::vector< osg::GraphicsContext * > | Contexts |
typedef std::vector< osgViewer::GraphicsWindow * > | Windows |
typedef std::vector< osg::Camera * > | Cameras |
typedef std::vector< OpenThreads::Thread * > | Threads |
typedef std::vector< osg::OperationsThread * > | OperationsThreads |
Public Member Functions | |
Viewer () | |
Viewer (osg::ArgumentParser &arguments) | |
virtual | ~Viewer () |
bool | isRealized () const |
Get whether at least of one of this viewers windows are realized. | |
void | realize () |
set up windows and associated threads. | |
void | setDone (bool done) |
bool | done () const |
void | setStartTick (osg::Timer_t tick) |
osg::Timer_t | getStartTick () const |
void | setReferenceTime (double time=0.0) |
osg::FrameStamp * | getFrameStamp () |
const osg::FrameStamp * | getFrameStamp () const |
virtual void | setSceneData (osg::Node *node) |
Set the sene graph data that viewer with view. | |
virtual GraphicsWindowEmbedded * | setUpViewerAsEmbeddedInWindow (int x, int y, int width, int height) |
Convenience method for setting up the viewer so it can be used embedded in an external managed window. | |
void | setThreadingModel (ThreadingModel threadingModel) |
Set the threading model the rendering traversals will use. | |
ThreadingModel | getThreadingModel () const |
Get the threading model the rendering traversals will use. | |
void | setUseMainThreadForRenderingTraversals (bool flag) |
Set whether the main thread, calling frame(), should be used for the rendering traversals. | |
bool | getUseMainThreadForRenderingTraversals () const |
Get whether the main thread, calling frame(), should be used for the rendering traversals. | |
ThreadingModel | suggestBestThreadingModel () |
Let the viewer suggest the best threading model for the viewers camera/window setup and the hardware available. | |
void | setEndBarrierPosition (BarrierPosition bp) |
Set the position of the end barrier. | |
BarrierPosition | getEndBarrierPosition () const |
Get the end barrier position. | |
void | setKeyEventSetsDone (int key) |
Set the key event that the viewer checks on each frame to see if the viewer's done flag should be set to signal end of viewers main loop. | |
int | getKeyEventSetsDone () const |
get the key event that the viewer checks on each frame to see if the viewer's done flag. | |
void | setQuitEventSetsDone (bool flag) |
if the flag is true, the viewer set its done flag when a QUIT_APPLICATION is received, false disables this feature | |
bool | getQuitEventSetsDone () const |
| |
virtual int | run () |
Execute a main frame loop. | |
virtual void | frame (double simulationTime=USE_REFERENCE_TIME) |
Render a complete new frame. | |
virtual void | advance (double simulationTime=USE_REFERENCE_TIME) |
virtual void | eventTraversal () |
virtual void | updateTraversal () |
virtual void | renderingTraversals () |
void | setCameraWithFocus (osg::Camera *camera) |
osg::Camera * | getCameraWithFocus () |
const osg::Camera * | getCameraWithFocus () const |
void | getContexts (Contexts &contexts, bool onlyValid=true) |
void | getWindows (Windows &windows, bool onlyValid=true) |
void | getCameras (Cameras &cameras, bool onlyActive=true) |
void | getAllThreads (Threads &threads, bool onlyActive=true) |
void | getOperationsThreads (OperationsThreads &threads, bool onlyActive=true) |
void | setRealizeOperation (osg::Operation *op) |
Set the graphics operation to call on realization of the viewers graphics windows. | |
osg::Operation * | getRealizeOperation () |
Get the graphics operation to call on realization of the viewers graphics windows. | |
void | setUpThreading () |
Set up the threading and processor affinity as per the viewers threading model. | |
bool | areThreadsRunning () const |
Return true if viewer threads are running. | |
void | stopThreading () |
Stop any threads begin run by viewer. | |
void | startThreading () |
Start any threads required by the viewer. | |
void | setUpRenderingSupport () |
Set up the Operations to render the various viewer cameras on the viewers graphics windows. | |
virtual void | getUsage (osg::ApplicationUsage &usage) const |
Get the keyboard and mouse usage of this viewer. | |
Protected Types | |
typedef std::list< osg::ref_ptr< osgUtil::SceneView > > | SceneViews |
Protected Member Functions | |
void | constructorInit () |
void | checkWindowStatus () |
void | makeCurrent (osg::GraphicsContext *gc) |
void | releaseContext () |
Protected Attributes | |
bool | _firstFrame |
bool | _done |
int | _keyEventSetsDone |
bool | _quitEventSetsDone |
ThreadingModel | _threadingModel |
bool | _threadsRunning |
bool | _useMainThreadForRenderingTraversal |
BarrierPosition | _endBarrierPosition |
osg::ref_ptr< osg::BarrierOperation > | _startRenderingBarrier |
osg::ref_ptr< osg::BarrierOperation > | _endRenderingDispatchBarrier |
osg::ref_ptr< EndOfDynamicDrawBlock > | _endDynamicDrawBlock |
unsigned int | _numWindowsOpenAtLastSetUpThreading |
SceneViews | _sceneViews |
osg::Timer_t | _startTick |
osg::ref_ptr< osg::FrameStamp > | _frameStamp |
osg::observer_ptr< osg::Camera > | _cameraWithFocus |
osg::ref_ptr< osgGA::EventVisitor > | _eventVisitor |
osg::ref_ptr< osg::Operation > | _realizeOperation |
osg::observer_ptr< osg::GraphicsContext > | _currentContext |
typedef std::vector<osg::GraphicsContext*> osgViewer::Viewer::Contexts |
typedef std::vector<osgViewer::GraphicsWindow*> osgViewer::Viewer::Windows |
typedef std::vector<osg::Camera*> osgViewer::Viewer::Cameras |
typedef std::vector<OpenThreads::Thread*> osgViewer::Viewer::Threads |
typedef std::vector<osg::OperationsThread*> osgViewer::Viewer::OperationsThreads |
typedef std::list< osg::ref_ptr<osgUtil::SceneView> > osgViewer::Viewer::SceneViews [protected] |
osgViewer::Viewer::Viewer | ( | ) |
osgViewer::Viewer::Viewer | ( | osg::ArgumentParser & | arguments | ) |
virtual osgViewer::Viewer::~Viewer | ( | ) | [virtual] |
bool osgViewer::Viewer::isRealized | ( | ) | const |
Get whether at least of one of this viewers windows are realized.
void osgViewer::Viewer::realize | ( | ) |
set up windows and associated threads.
void osgViewer::Viewer::setDone | ( | bool | done | ) | [inline] |
bool osgViewer::Viewer::done | ( | ) | const [inline] |
void osgViewer::Viewer::setStartTick | ( | osg::Timer_t | tick | ) |
osg::Timer_t osgViewer::Viewer::getStartTick | ( | ) | const [inline] |
void osgViewer::Viewer::setReferenceTime | ( | double | time = 0.0 |
) |
osg::FrameStamp* osgViewer::Viewer::getFrameStamp | ( | ) | [inline] |
const osg::FrameStamp* osgViewer::Viewer::getFrameStamp | ( | ) | const [inline] |
virtual void osgViewer::Viewer::setSceneData | ( | osg::Node * | node | ) | [virtual] |
virtual GraphicsWindowEmbedded* osgViewer::Viewer::setUpViewerAsEmbeddedInWindow | ( | int | x, | |
int | y, | |||
int | width, | |||
int | height | |||
) | [virtual] |
Convenience method for setting up the viewer so it can be used embedded in an external managed window.
Returns the GraphicsWindowEmbedded that can be used by applications to pass in events to the viewer.
void osgViewer::Viewer::setThreadingModel | ( | ThreadingModel | threadingModel | ) |
Set the threading model the rendering traversals will use.
ThreadingModel osgViewer::Viewer::getThreadingModel | ( | ) | const [inline] |
Get the threading model the rendering traversals will use.
void osgViewer::Viewer::setUseMainThreadForRenderingTraversals | ( | bool | flag | ) |
Set whether the main thread, calling frame(), should be used for the rendering traversals.
bool osgViewer::Viewer::getUseMainThreadForRenderingTraversals | ( | ) | const [inline] |
Get whether the main thread, calling frame(), should be used for the rendering traversals.
ThreadingModel osgViewer::Viewer::suggestBestThreadingModel | ( | ) |
Let the viewer suggest the best threading model for the viewers camera/window setup and the hardware available.
void osgViewer::Viewer::setEndBarrierPosition | ( | BarrierPosition | bp | ) |
Set the position of the end barrier.
AfterSwapBuffers will may result is slightly higher framerates, by may lead to inconcistent swapping between different windows. BeforeSwapBuffers may lead to slightly lower framerate, but improve consistency in timing of swap buffers, especially important if you are likely to consistently break frame.
BarrierPosition osgViewer::Viewer::getEndBarrierPosition | ( | ) | const [inline] |
Get the end barrier position.
void osgViewer::Viewer::setKeyEventSetsDone | ( | int | key | ) | [inline] |
Set the key event that the viewer checks on each frame to see if the viewer's done flag should be set to signal end of viewers main loop.
Default value is Escape (osgGA::GUIEVentAdapter::KEY_Escape). Setting to 0 switches off the feature.
int osgViewer::Viewer::getKeyEventSetsDone | ( | ) | const [inline] |
get the key event that the viewer checks on each frame to see if the viewer's done flag.
void osgViewer::Viewer::setQuitEventSetsDone | ( | bool | flag | ) | [inline] |
if the flag is true, the viewer set its done flag when a QUIT_APPLICATION is received, false disables this feature
bool osgViewer::Viewer::getQuitEventSetsDone | ( | ) | const [inline] |
virtual int osgViewer::Viewer::run | ( | ) | [virtual] |
virtual void osgViewer::Viewer::frame | ( | double | simulationTime = USE_REFERENCE_TIME |
) | [virtual] |
Render a complete new frame.
Calls advance(), eventTraversal(), updateTraversal(), renderingTraversals().
virtual void osgViewer::Viewer::advance | ( | double | simulationTime = USE_REFERENCE_TIME |
) | [virtual] |
virtual void osgViewer::Viewer::eventTraversal | ( | ) | [virtual] |
virtual void osgViewer::Viewer::updateTraversal | ( | ) | [virtual] |
virtual void osgViewer::Viewer::renderingTraversals | ( | ) | [virtual] |
void osgViewer::Viewer::setCameraWithFocus | ( | osg::Camera * | camera | ) | [inline] |
osg::Camera* osgViewer::Viewer::getCameraWithFocus | ( | ) | [inline] |
const osg::Camera* osgViewer::Viewer::getCameraWithFocus | ( | ) | const [inline] |
void osgViewer::Viewer::getContexts | ( | Contexts & | contexts, | |
bool | onlyValid = true | |||
) |
void osgViewer::Viewer::getWindows | ( | Windows & | windows, | |
bool | onlyValid = true | |||
) |
void osgViewer::Viewer::getCameras | ( | Cameras & | cameras, | |
bool | onlyActive = true | |||
) |
void osgViewer::Viewer::getAllThreads | ( | Threads & | threads, | |
bool | onlyActive = true | |||
) |
void osgViewer::Viewer::getOperationsThreads | ( | OperationsThreads & | threads, | |
bool | onlyActive = true | |||
) |
void osgViewer::Viewer::setRealizeOperation | ( | osg::Operation * | op | ) | [inline] |
Set the graphics operation to call on realization of the viewers graphics windows.
osg::Operation* osgViewer::Viewer::getRealizeOperation | ( | ) | [inline] |
Get the graphics operation to call on realization of the viewers graphics windows.
void osgViewer::Viewer::setUpThreading | ( | ) |
Set up the threading and processor affinity as per the viewers threading model.
bool osgViewer::Viewer::areThreadsRunning | ( | ) | const [inline] |
Return true if viewer threads are running.
void osgViewer::Viewer::stopThreading | ( | ) |
Stop any threads begin run by viewer.
void osgViewer::Viewer::startThreading | ( | ) |
Start any threads required by the viewer.
void osgViewer::Viewer::setUpRenderingSupport | ( | ) |
Set up the Operations to render the various viewer cameras on the viewers graphics windows.
virtual void osgViewer::Viewer::getUsage | ( | osg::ApplicationUsage & | usage | ) | const [virtual] |
Get the keyboard and mouse usage of this viewer.
void osgViewer::Viewer::constructorInit | ( | ) | [protected] |
void osgViewer::Viewer::checkWindowStatus | ( | ) | [protected] |
void osgViewer::Viewer::makeCurrent | ( | osg::GraphicsContext * | gc | ) | [inline, protected] |
void osgViewer::Viewer::releaseContext | ( | ) | [inline, protected] |
bool osgViewer::Viewer::_firstFrame [protected] |
bool osgViewer::Viewer::_done [protected] |
int osgViewer::Viewer::_keyEventSetsDone [protected] |
bool osgViewer::Viewer::_quitEventSetsDone [protected] |
ThreadingModel osgViewer::Viewer::_threadingModel [protected] |
bool osgViewer::Viewer::_threadsRunning [protected] |
bool osgViewer::Viewer::_useMainThreadForRenderingTraversal [protected] |
unsigned int osgViewer::Viewer::_numWindowsOpenAtLastSetUpThreading [protected] |
SceneViews osgViewer::Viewer::_sceneViews [protected] |
osg::Timer_t osgViewer::Viewer::_startTick [protected] |
osg::ref_ptr<osg::FrameStamp> osgViewer::Viewer::_frameStamp [protected] |