osg::View Class Reference

`#include <View>`

Inheritance diagram for osg::View:

## Classes

struct | Slave

## Public Types

enum | LightingMode { NO_LIGHT , HEADLIGHT , SKY_LIGHT }
Public Types inherited from osg::Object
enum | DataVariance { DYNAMIC , STATIC , UNSPECIFIED }

## Public Member Functions

| View ()
| View (const osg::View &view, const osg::CopyOp &copyop=CopyOp::SHALLOW_COPY)
| META_Object (osg, View)
virtual void | take (View &rhs)
void | setStats (osg::Stats *stats)
osg::Stats * | getStats ()
const osg::Stats * | getStats () const
void | setLightingMode (LightingMode lightingMode)
LightingMode | getLightingMode () const
void | setLight (osg::Light *light)
osg::Light * | getLight ()
const osg::Light * | getLight () const
void | setCamera (osg::Camera *camera)
osg::Camera * | getCamera ()
const osg::Camera * | getCamera () const
void | setFrameStamp (osg::FrameStamp *fs)
osg::FrameStamp * | getFrameStamp ()
const osg::FrameStamp * | getFrameStamp () const
bool | addSlave (osg::Camera *camera, bool useMastersSceneData=true)
bool | addSlave (osg::Camera *camera, const osg::Matrix &projectionOffset, const osg::Matrix &viewOffset, bool useMastersSceneData=true)
bool | removeSlave (unsigned int pos)
unsigned int | getNumSlaves () const
Slave & | getSlave (unsigned int pos)
const Slave & | getSlave (unsigned int pos) const
unsigned int | findSlaveIndexForCamera (osg::Camera *camera) const
Slave * | findSlaveForCamera (osg::Camera *camera)
void | updateSlaves ()
virtual void | resizeGLObjectBuffers (unsigned int maxSize)
virtual void | releaseGLObjects (osg::State *=0) 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)
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< Slave > | Slaves

## Protected Member Functions

virtual | ~View ()
virtual osg::GraphicsOperation * | createRenderer (osg::Camera *)
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

osg::ref_ptr< osg::Stats > | _stats
LightingMode | _lightingMode
osg::ref_ptr< osg::Light > | _light
osg::ref_ptr< osg::Camera > | _camera
Slaves | _slaves
osg::ref_ptr< osg::FrameStamp > | _frameStamp
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

Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Detailed Description

View - maintains a master camera view and a list of slave cameras that are relative to this master camera. Note, if no slave cameras are attached to the view then the master camera does both the control and implementation of the rendering of the scene, but if slave cameras are present then the master controls the view onto the scene, while the slaves implement the rendering of the scene.

## Member Typedef Documentation

## Slaves

typedef std::vector<Slave> osg::View::Slaves

protected

## Member Enumeration Documentation

## LightingMode

enum osg::View::LightingMode

Options for controlling the global lighting used for the view.

Enumerator
NO_LIGHT |
HEADLIGHT |
SKY_LIGHT |

## Constructor & Destructor Documentation

## View() [1/2]

osg::View::View | ( |  | ) |

Referenced by META_Object(), take(), osg::View::Slave::updateSlave(), and osg::View::Slave::updateSlaveImplementation().

## View() [2/2]

osg::View::View | ( | const osg::View & | view,
|  | const osg::CopyOp & | copyop = CopyOp::SHALLOW_COPY )

References osg::CopyOp::SHALLOW_COPY.

## ~View()

virtual osg::View::~View | ( |  | ) |

protected virtual

Reimplemented in osgViewer::View.

## Member Function Documentation

## addSlave() [1/2]

bool osg::View::addSlave | ( | osg::Camera * | camera,
|  | bool | useMastersSceneData = true )

inline

References addSlave(), and osg::Matrixd::identity().

Referenced by addSlave().

## addSlave() [2/2]

bool osg::View::addSlave | ( | osg::Camera * | camera,
|  | const osg::Matrix & | projectionOffset,
|  | const osg::Matrix & | viewOffset,
|  | bool | useMastersSceneData = true )

## createRenderer()

virtual osg::GraphicsOperation * osg::View::createRenderer | ( | osg::Camera * |  | ) |

inline protected virtual

Reimplemented in osgViewer::View.

## findSlaveForCamera()

Slave * osg::View::findSlaveForCamera | ( | osg::Camera * | camera | ) |

## findSlaveIndexForCamera()

unsigned int osg::View::findSlaveIndexForCamera | ( | osg::Camera * | camera | ) | const

## getCamera() [1/2]

osg::Camera * osg::View::getCamera | ( |  | ) |

inline

Get the master camera of the view.

References _camera.

## getCamera() [2/2]

const osg::Camera * osg::View::getCamera | ( |  | ) | const

inline

Get the const master camera of the view.

References _camera.

## getFrameStamp() [1/2]

osg::FrameStamp * osg::View::getFrameStamp | ( |  | ) |

inline

Get the frame stamp of the view.

References _frameStamp.

Referenced by osgViewer::Viewer::getViewerFrameStamp().

## getFrameStamp() [2/2]

const osg::FrameStamp * osg::View::getFrameStamp | ( |  | ) | const

inline

Get the frame stamp of the view.

References _frameStamp.

## getLight() [1/2]

osg::Light * osg::View::getLight | ( |  | ) |

inline

Get the global lighting if assigned.

References _light.

## getLight() [2/2]

const osg::Light * osg::View::getLight | ( |  | ) | const

inline

Get the const global lighting if assigned.

References _light.

## getLightingMode()

LightingMode osg::View::getLightingMode | ( |  | ) | const

inline

Get the global lighting used for this view.

References _lightingMode.

## getNumSlaves()

unsigned int osg::View::getNumSlaves | ( |  | ) | const

inline

References _slaves.

## getSlave() [1/2]

Slave & osg::View::getSlave | ( | unsigned int | pos | ) |

inline

References _slaves.

## getSlave() [2/2]

const Slave & osg::View::getSlave | ( | unsigned int | pos | ) | const

inline

References _slaves.

## getStats() [1/2]

osg::Stats * osg::View::getStats | ( |  | ) |

inline

Get the Viewers Stats object.

References _stats.

Referenced by osgViewer::Viewer::getViewerStats(), and osgViewer::Viewer::getViewerStats().

## getStats() [2/2]

const osg::Stats * osg::View::getStats | ( |  | ) | const

inline

Get the Viewers Stats object.

References _stats.

## META_Object()

osg::View::META_Object | ( | osg | ,
|  | View | )

References View().

## releaseGLObjects()

virtual void osg::View::releaseGLObjects | ( | osg::State * | = 0 | ) | const

virtual

If State is non-zero, this function releases any associated OpenGL objects for the specified graphics context. Otherwise, releases OpenGL objects for all graphics contexts.

Reimplemented from osg::Object.

Reimplemented in osgViewer::Viewer.

Referenced by osgViewer::Viewer::releaseGLObjects().

## removeSlave()

bool osg::View::removeSlave | ( | unsigned int | pos | ) |

## resizeGLObjectBuffers()

virtual void osg::View::resizeGLObjectBuffers | ( | unsigned int |  | ) |

virtual

Resize any per context GLObject buffers to specified size.

Reimplemented from osg::Object.

Reimplemented in osgViewer::Viewer.

Referenced by osgViewer::Viewer::resizeGLObjectBuffers().

## setCamera()

void osg::View::setCamera | ( | osg::Camera * | camera | ) |

Set the master camera of the view.

## setFrameStamp()

void osg::View::setFrameStamp | ( | osg::FrameStamp * | fs | ) |

inline

Set the frame stamp of the view.

References _frameStamp.

## setLight()

void osg::View::setLight | ( | osg::Light * | light | ) |

inline

Get the global light.

References _light.

## setLightingMode()

void osg::View::setLightingMode | ( | LightingMode | lightingMode | ) |

Set the global lighting to use for this view. Defaults to headlight.

## setStats()

void osg::View::setStats | ( | osg::Stats * | stats | ) |

inline

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

References _stats.

Referenced by osgViewer::Viewer::setViewerStats().

## take()

virtual void osg::View::take | ( | View & | rhs | ) |

virtual

Take all the settings, Camera and Slaves from the passed in view, leaving it empty.

Reimplemented in osgViewer::View, and osgViewer::Viewer.

References View().

## updateSlaves()

void osg::View::updateSlaves | ( |  | ) |

## Member Data Documentation

## _camera

osg::ref_ptr<osg::Camera> osg::View::_camera

protected

Referenced by getCamera(), and getCamera().

## _frameStamp

osg::ref_ptr<osg::FrameStamp> osg::View::_frameStamp

protected

Referenced by getFrameStamp(), getFrameStamp(), and setFrameStamp().

## _light

osg::ref_ptr<osg::Light> osg::View::_light

protected

Referenced by getLight(), getLight(), and setLight().

## _lightingMode

LightingMode osg::View::_lightingMode

protected

Referenced by getLightingMode().

## _slaves

Slaves osg::View::_slaves

protected

Referenced by getNumSlaves(), getSlave(), and getSlave().

## _stats

osg::ref_ptr<osg::Stats> osg::View::_stats

protected

Referenced by getStats(), getStats(), and setStats().

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

- osg/View