osgViewer::CompositeViewer Class Reference

`#include <CompositeViewer>`

Inheritance diagram for osgViewer::CompositeViewer:

## Public Member Functions

| CompositeViewer ()
| CompositeViewer (const CompositeViewer &, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
| CompositeViewer (osg::ArgumentParser &arguments)
| META_Object (osgViewer, CompositeViewer)
virtual | ~CompositeViewer ()
bool | readConfiguration (const std::string &filename)
virtual void | setViewerStats (osg::Stats *stats)
virtual osg::Stats * | getViewerStats ()
virtual const osg::Stats * | getViewerStats () const
void | addView (osgViewer::View *view)
template<class T>
void | addView (const osg::ref_ptr< T > &view)
void | removeView (osgViewer::View *view)
template<class T>
void | removeView (const osg::ref_ptr< T > &view)
osgViewer::View * | getView (unsigned i)
const osgViewer::View * | getView (unsigned i) const
unsigned int | getNumViews () const
virtual bool | isRealized () const
virtual void | realize ()
virtual void | setStartTick (osg::Timer_t tick)
void | setReferenceTime (double time=0.0)
osg::FrameStamp * | getFrameStamp ()
const osg::FrameStamp * | getFrameStamp () const
virtual double | elapsedTime ()
virtual osg::FrameStamp * | getViewerFrameStamp ()
virtual int | run ()
virtual bool | checkNeedToDoFrame ()
virtual bool | checkEvents ()
virtual void | advance (double simulationTime=USE_REFERENCE_TIME)
virtual void | eventTraversal ()
virtual void | updateTraversal ()
void | setCameraWithFocus (osg::Camera *camera)
osg::Camera * | getCameraWithFocus ()
const osg::Camera * | getCameraWithFocus () const
osgViewer::View * | getViewWithFocus ()
const osgViewer::View * | getViewWithFocus () const
virtual void | getCameras (Cameras &cameras, bool onlyActive=true)
virtual void | getContexts (Contexts &contexts, bool onlyValid=true)
virtual void | getAllThreads (Threads &threads, bool onlyActive=true)
virtual void | getOperationThreads (OperationThreads &threads, bool onlyActive=true)
virtual void | getScenes (Scenes &scenes, bool onlyValid=true)
virtual void | getViews (Views &views, bool onlyValid=true)
virtual void | getUsage (osg::ApplicationUsage &usage) const
Public Member Functions inherited from osgViewer::ViewerBase
| ViewerBase ()
| ViewerBase (const ViewerBase &vb)
void | setUseConfigureAffinity (bool flag)
bool | getUseConfigureAffinity () const
virtual void | configureAffinity ()
virtual void | setProcessorAffinity (const OpenThreads::Affinity &affinity)
OpenThreads::Affinity & | getProcessorAffinity ()
const OpenThreads::Affinity & | getProcessorAffinity () const
virtual void | setThreadingModel (ThreadingModel threadingModel)
ThreadingModel | getThreadingModel () const
virtual ThreadingModel | suggestBestThreadingModel ()
virtual void | setUpThreading ()
bool | areThreadsRunning () const
virtual void | stopThreading ()
virtual void | startThreading ()
void | setEndBarrierPosition (BarrierPosition bp)
BarrierPosition | getEndBarrierPosition () const
void | setEndBarrierOperation (osg::BarrierOperation::PreBlockOp op)
osg::BarrierOperation::PreBlockOp | getEndBarrierOperation () const
void | setDone (bool done)
bool | done () const
void | setEventVisitor (osgGA::EventVisitor *eventVisitor)
osgGA::EventVisitor * | getEventVisitor ()
const osgGA::EventVisitor * | getEventVisitor () const
void | setKeyEventSetsDone (int key)
int | getKeyEventSetsDone () const
void | setQuitEventSetsDone (bool flag)
bool | getQuitEventSetsDone () const
void | setReleaseContextAtEndOfFrameHint (bool hint)
bool | getReleaseContextAtEndOfFrameHint () const
void | setUpdateVisitor (osgUtil::UpdateVisitor *updateVisitor)
osgUtil::UpdateVisitor * | getUpdateVisitor ()
const osgUtil::UpdateVisitor * | getUpdateVisitor () const
void | setUpdateOperations (osg::OperationQueue *operations)
osg::OperationQueue * | getUpdateOperations ()
const osg::OperationQueue * | getUpdateOperations () const
void | addUpdateOperation (osg::Operation *operation)
void | removeUpdateOperation (osg::Operation *operation)
void | setRealizeOperation (osg::Operation *op)
osg::Operation * | getRealizeOperation ()
void | setCleanUpOperation (osg::Operation *op)
osg::Operation * | getCleanUpOperation ()
void | setIncrementalCompileOperation (osgUtil::IncrementalCompileOperation *ico)
osgUtil::IncrementalCompileOperation * | getIncrementalCompileOperation ()
void | setRunFrameScheme (FrameScheme fs)
FrameScheme | getRunFrameScheme () const
void | setRunMaxFrameRate (double frameRate)
double | getRunMaxFrameRate () const
virtual void | frame (double simulationTime=USE_REFERENCE_TIME)
virtual void | renderingTraversals ()
virtual void | getWindows (Windows &windows, bool onlyValid=true)
void | checkWindowStatus ()
void | checkWindowStatus (const Contexts &contexts)
bool | getRequestRedraw () const
bool | getRequestContinousUpdate () const
Public Member Functions inherited from osg::Object
| Object ()
| Object (bool threadSafeRefUnref)
| Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
virtual Object * | cloneType () const =0
virtual Object * | clone (const CopyOp &) const =0
virtual bool | isSameKindAs (const Object *) const
virtual const char * | libraryName () const =0
virtual const char * | className () const =0
std::string | getCompoundClassName () const
virtual Node * | asNode ()
virtual const Node * | asNode () const
virtual NodeVisitor * | asNodeVisitor ()
virtual const NodeVisitor * | asNodeVisitor () const
virtual StateSet * | asStateSet ()
virtual const StateSet * | asStateSet () const
virtual StateAttribute * | asStateAttribute ()
virtual const StateAttribute * | asStateAttribute () const
virtual Uniform * | asUniform ()
virtual const Uniform * | asUniform () const
virtual Camera * | asCamera ()
virtual const Camera * | asCamera () const
virtual Drawable * | asDrawable ()
virtual const Drawable * | asDrawable () const
virtual Callback * | asCallback ()
virtual const Callback * | asCallback () const
virtual CallbackObject * | asCallbackObject ()
virtual const CallbackObject * | asCallbackObject () const
virtual UserDataContainer * | asUserDataContainer ()
virtual const UserDataContainer * | asUserDataContainer () const
virtual ValueObject * | asValueObject ()
virtual const ValueObject * | asValueObject () const
virtual Image * | asImage ()
virtual const Image * | asImage () const
virtual void | setThreadSafeRefUnref (bool threadSafe)
virtual void | setName (const std::string &name)
void | setName (const char *name)
const std::string & | getName () const
void | setDataVariance (DataVariance dv)
DataVariance | getDataVariance () const
virtual void | computeDataVariance ()
void | setUserDataContainer (osg::UserDataContainer *udc)
template<class T>
void | setUserDataContainer (const ref_ptr< T > &udc)
osg::UserDataContainer * | getUserDataContainer ()
const osg::UserDataContainer * | getUserDataContainer () const
osg::UserDataContainer * | getOrCreateUserDataContainer ()
virtual void | setUserData (Referenced *obj)
template<class T>
void | setUserData (const ref_ptr< T > &ud)
virtual Referenced * | getUserData ()
virtual const Referenced * | getUserData () const
template<typename T>
bool | getUserValue (const std::string &name, T &value) const
template<typename T>
void | setUserValue (const std::string &name, const T &value)
virtual void | resizeGLObjectBuffers (unsigned int)
virtual void | releaseGLObjects (osg::State *=0) const
template<typename T>
BoolValueObject UCharValueObject UShortValueObject UIntValueObject DoubleValueObject Vec3fValueObject Vec2dValueObject Vec4dValueObject PlaneValueObject MatrixdValueObject BoundingBoxdValueObject BoundingSpheredValueObject bool | getUserValue (const std::string &name, T &value) const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Protected Types

typedef std::vector< osg::ref_ptr< osgViewer::View > > | RefViews

## Protected Member Functions

void | constructorInit ()
virtual void | viewerInit ()
void | generateSlavePointerData (osg::Camera *camera, osgGA::GUIEventAdapter &event)
void | generatePointerData (osgGA::GUIEventAdapter &event)
void | reprojectPointerData (osgGA::GUIEventAdapter &source_event, osgGA::GUIEventAdapter &dest_event)
Protected Member Functions inherited from osgViewer::ViewerBase
void | viewerBaseInit ()
void | makeCurrent (osg::GraphicsContext *gc)
void | releaseContext ()
Protected Member Functions inherited from osg::Object
virtual | ~Object ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

RefViews | _views
bool | _firstFrame
osg::ref_ptr< osg::Stats > | _stats
osg::Timer_t | _startTick
osg::ref_ptr< osg::FrameStamp > | _frameStamp
osg::observer_ptr< osg::Camera > | _cameraWithFocus
osg::observer_ptr< osgViewer::View > | _viewWithFocus
osg::ref_ptr< osgGA::GUIEventAdapter > | _previousEvent
Protected Attributes inherited from osgViewer::ViewerBase
bool | _firstFrame
bool | _done
int | _keyEventSetsDone
bool | _quitEventSetsDone
bool | _releaseContextAtEndOfFrameHint
bool | _useConfigureAffinity
OpenThreads::Affinity | _affinity
ThreadingModel | _threadingModel
bool | _threadsRunning
bool | _requestRedraw
bool | _requestContinousUpdate
FrameScheme | _runFrameScheme
double | _runMaxFrameRate
BarrierPosition | _endBarrierPosition
osg::BarrierOperation::PreBlockOp | _endBarrierOperation
osg::ref_ptr< osg::BarrierOperation > | _startRenderingBarrier
osg::ref_ptr< osg::BarrierOperation > | _endRenderingDispatchBarrier
osg::ref_ptr< osg::EndOfDynamicDrawBlock > | _endDynamicDrawBlock
osg::ref_ptr< osgGA::EventVisitor > | _eventVisitor
osg::ref_ptr< osg::OperationQueue > | _updateOperations
osg::ref_ptr< osgUtil::UpdateVisitor > | _updateVisitor
osg::ref_ptr< osg::Operation > | _realizeOperation
osg::ref_ptr< osg::Operation > | _cleanUpOperation
osg::ref_ptr< osgUtil::IncrementalCompileOperation > | _incrementalCompileOperation
osg::observer_ptr< osg::GraphicsContext > | _currentContext
Protected Attributes inherited from osg::Object
std::string | _name
DataVariance | _dataVariance
osg::UserDataContainer * | _userDataContainer
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Additional Inherited Members

Public Types inherited from osgViewer::ViewerBase
enum | ThreadingModel { SingleThreaded , CullDrawThreadPerContext , ThreadPerContext = CullDrawThreadPerContext , DrawThreadPerContext , CullThreadPerCameraDrawThreadPerContext , ThreadPerCamera = CullThreadPerCameraDrawThreadPerContext , AutomaticSelection }
enum | BarrierPosition { BeforeSwapBuffers , AfterSwapBuffers }
enum | FrameScheme { ON_DEMAND , CONTINUOUS }
typedef std::vector< osg::Camera * > | Cameras
typedef std::vector< osg::GraphicsContext * > | Contexts
typedef std::vector< osgViewer::GraphicsWindow * > | Windows
typedef std::vector< OpenThreads::Thread * > | Threads
typedef std::vector< osg::OperationThread * > | OperationThreads
typedef std::vector< osgViewer::Scene * > | Scenes
typedef std::vector< osgViewer::View * > | Views
Public Types inherited from osg::Object
enum | DataVariance { DYNAMIC , STATIC , UNSPECIFIED }
Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Detailed Description

CompositeViewer holds one or more views to one or more scenes.

## Member Typedef Documentation

## RefViews

typedef std::vector< osg::ref_ptr<osgViewer::View> > osgViewer::CompositeViewer::RefViews

protected

## Constructor & Destructor Documentation

## CompositeViewer() [1/3]

osgViewer::CompositeViewer::CompositeViewer | ( |  | ) |

Referenced by CompositeViewer(), and META_Object().

## CompositeViewer() [2/3]

osgViewer::CompositeViewer::CompositeViewer | ( | const CompositeViewer & | ,
|  | const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY )

References CompositeViewer(), and osg::CopyOp::SHALLOW_COPY.

## CompositeViewer() [3/3]

osgViewer::CompositeViewer::CompositeViewer | ( | osg::ArgumentParser & | arguments | ) |

## ~CompositeViewer()

virtual osgViewer::CompositeViewer::~CompositeViewer | ( |  | ) |

virtual

## Member Function Documentation

## addView() [1/2]

template<class T>

void osgViewer::CompositeViewer::addView | ( | const osg::ref_ptr< T > & | view | ) |

inline

References addView(), and osg::ref_ptr< T >::get().

Referenced by addView().

## addView() [2/2]

void osgViewer::CompositeViewer::addView | ( | osgViewer::View * | view | ) |

## advance()

virtual void osgViewer::CompositeViewer::advance | ( | double | simulationTime = USE_REFERENCE_TIME | ) |

virtual

Implements osgViewer::ViewerBase.

References USE_REFERENCE_TIME.

## checkEvents()

virtual bool osgViewer::CompositeViewer::checkEvents | ( |  | ) |

virtual

check to see if events have been received, return true if events are now available.

Implements osgViewer::ViewerBase.

## checkNeedToDoFrame()

virtual bool osgViewer::CompositeViewer::checkNeedToDoFrame | ( |  | ) |

virtual

Check to see if the new frame is required, called by run() when FrameScheme is set to ON_DEMAND.

Implements osgViewer::ViewerBase.

## constructorInit()

void osgViewer::CompositeViewer::constructorInit | ( |  | ) |

protected

## elapsedTime()

virtual double osgViewer::CompositeViewer::elapsedTime | ( |  | ) |

virtual

Implements osgViewer::ViewerBase.

## eventTraversal()

virtual void osgViewer::CompositeViewer::eventTraversal | ( |  | ) |

virtual

Implements osgViewer::ViewerBase.

## generatePointerData()

void osgViewer::CompositeViewer::generatePointerData | ( | osgGA::GUIEventAdapter & | event | ) |

protected

## generateSlavePointerData()

void osgViewer::CompositeViewer::generateSlavePointerData | ( | osg::Camera * | camera,
|  | osgGA::GUIEventAdapter & | event )

protected

## getAllThreads()

virtual void osgViewer::CompositeViewer::getAllThreads | ( | Threads & | threads,
|  | bool | onlyActive = true )

virtual

Implements osgViewer::ViewerBase.

## getCameras()

virtual void osgViewer::CompositeViewer::getCameras | ( | Cameras & | cameras,
|  | bool | onlyActive = true )

virtual

Implements osgViewer::ViewerBase.

## getCameraWithFocus() [1/2]

osg::Camera * osgViewer::CompositeViewer::getCameraWithFocus | ( |  | ) |

inline

References _cameraWithFocus.

## getCameraWithFocus() [2/2]

const osg::Camera * osgViewer::CompositeViewer::getCameraWithFocus | ( |  | ) | const

inline

References _cameraWithFocus.

## getContexts()

virtual void osgViewer::CompositeViewer::getContexts | ( | Contexts & | contexts,
|  | bool | onlyValid = true )

virtual

Implements osgViewer::ViewerBase.

## getFrameStamp() [1/2]

osg::FrameStamp * osgViewer::CompositeViewer::getFrameStamp | ( |  | ) |

inline

References _frameStamp.

Referenced by getViewerFrameStamp().

## getFrameStamp() [2/2]

const osg::FrameStamp * osgViewer::CompositeViewer::getFrameStamp | ( |  | ) | const

inline

References _frameStamp.

## getNumViews()

unsigned int osgViewer::CompositeViewer::getNumViews | ( |  | ) | const

inline

References _views.

## getOperationThreads()

virtual void osgViewer::CompositeViewer::getOperationThreads | ( | OperationThreads & | threads,
|  | bool | onlyActive = true )

virtual

Implements osgViewer::ViewerBase.

## getScenes()

virtual void osgViewer::CompositeViewer::getScenes | ( | Scenes & | scenes,
|  | bool | onlyValid = true )

virtual

Implements osgViewer::ViewerBase.

## getUsage()

virtual void osgViewer::CompositeViewer::getUsage | ( | osg::ApplicationUsage & | usage | ) | const

virtual

Get the keyboard and mouse usage of this viewer.

Implements osgViewer::ViewerBase.

## getView() [1/2]

osgViewer::View * osgViewer::CompositeViewer::getView | ( | unsigned | i | ) |

inline

References _views.

## getView() [2/2]

const osgViewer::View * osgViewer::CompositeViewer::getView | ( | unsigned | i | ) | const

inline

References _views.

## getViewerFrameStamp()

virtual osg::FrameStamp * osgViewer::CompositeViewer::getViewerFrameStamp | ( |  | ) |

inline virtual

Implements osgViewer::ViewerBase.

References getFrameStamp().

## getViewerStats() [1/2]

virtual osg::Stats * osgViewer::CompositeViewer::getViewerStats | ( |  | ) |

inline virtual

Get the Viewers Stats object.

Implements osgViewer::ViewerBase.

References _stats.

## getViewerStats() [2/2]

virtual const osg::Stats * osgViewer::CompositeViewer::getViewerStats | ( |  | ) | const

inline virtual

Get the Viewers Stats object.

Implements osgViewer::ViewerBase.

References _stats.

## getViews()

virtual void osgViewer::CompositeViewer::getViews | ( | Views & | views,
|  | bool | onlyValid = true )

virtual

Implements osgViewer::ViewerBase.

## getViewWithFocus() [1/2]

osgViewer::View * osgViewer::CompositeViewer::getViewWithFocus | ( |  | ) |

inline

References _viewWithFocus.

## getViewWithFocus() [2/2]

const osgViewer::View * osgViewer::CompositeViewer::getViewWithFocus | ( |  | ) | const

inline

References _viewWithFocus.

## isRealized()

virtual bool osgViewer::CompositeViewer::isRealized | ( |  | ) | const

virtual

Get whether at least of one of this viewer's windows are realized.

Implements osgViewer::ViewerBase.

## META_Object()

osgViewer::CompositeViewer::META_Object | ( | osgViewer | ,
|  | CompositeViewer | )

References CompositeViewer().

## readConfiguration()

bool osgViewer::CompositeViewer::readConfiguration | ( | const std::string & | filename | ) |

virtual

Read the viewer configuration from a configuration file.

Implements osgViewer::ViewerBase.

## realize()

virtual void osgViewer::CompositeViewer::realize | ( |  | ) |

virtual

Set up windows and associated threads.

Implements osgViewer::ViewerBase.

## removeView() [1/2]

template<class T>

void osgViewer::CompositeViewer::removeView | ( | const osg::ref_ptr< T > & | view | ) |

inline

References osg::ref_ptr< T >::get(), and removeView().

Referenced by removeView().

## removeView() [2/2]

void osgViewer::CompositeViewer::removeView | ( | osgViewer::View * | view | ) |

## reprojectPointerData()

void osgViewer::CompositeViewer::reprojectPointerData | ( | osgGA::GUIEventAdapter & | source_event,
|  | osgGA::GUIEventAdapter & | dest_event )

protected

## run()

virtual int osgViewer::CompositeViewer::run | ( |  | ) |

virtual

Execute a main frame loop. Equivalent to while (!viewer.done()) viewer.frame(); Also calls realize() if the viewer is not already realized, and installs trackball manipulator if one is not already assigned.

Reimplemented from osgViewer::ViewerBase.

## setCameraWithFocus()

void osgViewer::CompositeViewer::setCameraWithFocus | ( | osg::Camera * | camera | ) |

## setReferenceTime()

void osgViewer::CompositeViewer::setReferenceTime | ( | double | time = 0.0 | ) |

## setStartTick()

virtual void osgViewer::CompositeViewer::setStartTick | ( | osg::Timer_t | tick | ) |

virtual

## setViewerStats()

virtual void osgViewer::CompositeViewer::setViewerStats | ( | osg::Stats * | stats | ) |

inline virtual

Set the Stats object used to collect various frame related timing and scene graph stats.

Implements osgViewer::ViewerBase.

References _stats.

## updateTraversal()

virtual void osgViewer::CompositeViewer::updateTraversal | ( |  | ) |

virtual

Implements osgViewer::ViewerBase.

## viewerInit()

virtual void osgViewer::CompositeViewer::viewerInit | ( |  | ) |

protected virtual

Implements osgViewer::ViewerBase.

## Member Data Documentation

## _cameraWithFocus

osg::observer_ptr<osg::Camera> osgViewer::CompositeViewer::_cameraWithFocus

protected

Referenced by getCameraWithFocus(), and getCameraWithFocus().

## _firstFrame

bool osgViewer::CompositeViewer::_firstFrame

protected

## _frameStamp

osg::ref_ptr<osg::FrameStamp> osgViewer::CompositeViewer::_frameStamp

protected

Referenced by getFrameStamp(), and getFrameStamp().

## _previousEvent

osg::ref_ptr<osgGA::GUIEventAdapter> osgViewer::CompositeViewer::_previousEvent

protected

## _startTick

osg::Timer_t osgViewer::CompositeViewer::_startTick

protected

## _stats

osg::ref_ptr<osg::Stats> osgViewer::CompositeViewer::_stats

protected

Referenced by getViewerStats(), getViewerStats(), and setViewerStats().

## _views

RefViews osgViewer::CompositeViewer::_views

protected

Referenced by getNumViews(), getView(), and getView().

## _viewWithFocus

osg::observer_ptr<osgViewer::View> osgViewer::CompositeViewer::_viewWithFocus

protected

Referenced by getViewWithFocus(), and getViewWithFocus().

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

- CompositeViewer