osgViewer::View Class Reference

View holds a single view on a scene, this view may be composed of one or more slave cameras. More...

Inheritance diagram for osgViewer::View:

Inheritance graph
[legend]

List of all members.

Public Types

typedef std::list
< osg::ref_ptr
< osgGA::GUIEventHandler > > 
EventHandlers

Public Member Functions

 View ()
 View (const osgViewer::View &view, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 META_Object (osgViewer, View)
virtual osg::ViewasView ()
 Provide a mechanism for getting the osg::View assocaited from the GUIActionAdapter.
ViewerBasegetViewerBase ()
 Provide a mechanism for getting the viewer object from this osgViewer::View.
virtual void take (osg::View &rhs)
 Take all the settings, Camera and Slaves from the passed in view, leaving it empty.
virtual void setStartTick (osg::Timer_t tick)
osg::Timer_t getStartTick () const
void setFrameStamp (osg::FrameStamp *fs)
osg::FrameStampgetFrameStamp ()
const osg::FrameStampgetFrameStamp () const
ScenegetScene ()
const ScenegetScene () const
virtual void setSceneData (osg::Node *node)
 Set the scene graph that the View will use.
osg::NodegetSceneData ()
 Get the View's scene graph.
const osg::NodegetSceneData () const
 Get the const View's scene graph.
void setDatabasePager (osgDB::DatabasePager *dp)
 Set the View's database pager.
osgDB::DatabasePagergetDatabasePager ()
 Get the View's database pager.
const
osgDB::DatabasePager
getDatabasePager () const
 Get the const View's database pager.
void setEventQueue (osgGA::EventQueue *eventQueue)
osgGA::EventQueuegetEventQueue ()
const osgGA::EventQueuegetEventQueue () const
void setCameraManipulator (osgGA::MatrixManipulator *manipulator)
 Set the CameraManipulator that moves the View's master Camera position in response to events.
osgGA::MatrixManipulatorgetCameraManipulator ()
 Get the View's CameraManipulator.
const
osgGA::MatrixManipulator
getCameraManipulator () const
 Get the const View's CameraManipulator.
void home ()
 Set the view to the CameraManipulator's home position, if non is attached home() is does nothing.
void addEventHandler (osgGA::GUIEventHandler *eventHandler)
 Add an EventHandler that adds handling of events to the View.
EventHandlersgetEventHandlers ()
 Get the View's list of EventHandlers.
const EventHandlersgetEventHandlers () const
 Get the const View's list of EventHandlers.
void setCoordinateSystemNodePath (const osg::NodePath &nodePath)
 Set the NodePath to any active CoordinateSystemNode present in the Scene.
osg::NodePath getCoordinateSystemNodePath () const
 Get the NodePath to any active CoordinateSystemNode present in the Scene.
void computeActiveCoordinateSystemNodePath ()
 Compute the NodePath to any active CoordinateSystemNode present in the Scene.
void setDisplaySettings (osg::DisplaySettings *ds)
 Set the DisplaySettings object associated with this view.
osg::DisplaySettingsgetDisplaySettings ()
 Set the DisplaySettings object associated with this view.
const
osg::DisplaySettings
getDisplaySettings () const
 Set the DisplaySettings object associated with this view.
void setFusionDistance (osgUtil::SceneView::FusionDistanceMode mode, float value=1.0f)
 Set the FusionDistanceMode and Value.
osgUtil::SceneView::FusionDistanceMode getFusionDistanceMode () const
 Get the FusionDistanceMode.
float getFusionDistanceValue () const
 Get the FusionDistanceValue.
void setUpViewAcrossAllScreens ()
 Convinience method for creating slave Cameras and associated GraphicsWindows across all screens.
void setUpViewInWindow (int x, int y, int width, int height, unsigned int screenNum=0)
 Convinience method for a single Camara on a single window.
void setUpViewOnSingleScreen (unsigned int screenNum=0)
 Convinience method for a single Camara associated with a single full screen GraphicsWindow.
void setUpViewFor3DSphericalDisplay (double radius=1.0, double collar=0.45, unsigned int screenNum=0, osg::Image *intensityMap=0)
 Convinience method for spherical display using 6 slave cameras rendering the 6 sides of a cube map, and 7th camera doing distortion correction to present on a spherical display.
void setUpViewForPanoramicSphericalDisplay (double radius=1.0, double collar=0.45, unsigned int screenNum=0, osg::Image *intensityMap=0)
 Convinience method for spherical display by rendering main scene to as panoramic 2:1 texture and then doing distortion correction to present onto a spherical display.
bool containsCamera (const osg::Camera *camera) const
 Return true if this view contains a specified camera.
const osg::CameragetCameraContainingPosition (float x, float y, float &local_x, float &local_y) const
 Get the camera which contains the pointer position x,y specified master cameras window/eye coords.
bool computeIntersections (float x, float y, osgUtil::LineSegmentIntersector::Intersections &intersections, osg::Node::NodeMask traversalMask=0xffffffff)
 Compute intersections between a ray through the specified master cameras window/eye coords and a specified node.
bool computeIntersections (float x, float y, osg::NodePath &nodePath, osgUtil::LineSegmentIntersector::Intersections &intersections, osg::Node::NodeMask traversalMask=0xffffffff)
 Compute intersections between a ray through the specified master cameras window/eye coords and a specified nodePath's subgraph.
virtual void requestRedraw ()
 requestRedraw() requests a single redraw.
virtual void requestContinuousUpdate (bool needed=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 x, float y)
 requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer to a specified x,y location on the window.
void assignSceneDataToCameras ()
void init ()

Protected Types

typedef std::vector
< osg::observer_ptr
< osg::Node > > 
ObserverNodePath

Protected Member Functions

virtual ~View ()
virtual
osg::GraphicsOperation
createRenderer (osg::Camera *camera)

Protected Attributes

osg::observer_ptr
< ViewerBase
_viewerBase
osg::Timer_t _startTick
osg::ref_ptr
< osg::FrameStamp
_frameStamp
osg::ref_ptr
< osgViewer::Scene
_scene
osg::ref_ptr
< osgGA::EventQueue
_eventQueue
osg::ref_ptr
< osgGA::MatrixManipulator
_cameraManipulator
EventHandlers _eventHandlers
ObserverNodePath _coordinateSystemNodePath
osg::ref_ptr
< osg::DisplaySettings
_displaySettings
osgUtil::SceneView::FusionDistanceMode _fusionDistanceMode
float _fusionDistanceValue

Friends

class CompositeViewer


Detailed Description

View holds a single view on a scene, this view may be composed of one or more slave cameras.


Member Typedef Documentation

typedef std::list< osg::ref_ptr<osgGA::GUIEventHandler> > osgViewer::View::EventHandlers

typedef std::vector< osg::observer_ptr<osg::Node> > osgViewer::View::ObserverNodePath [protected]


Constructor & Destructor Documentation

osgViewer::View::View (  ) 

Reimplemented from osg::View.

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

virtual osgViewer::View::~View (  )  [protected, virtual]

Reimplemented from osg::View.


Member Function Documentation

osgViewer::View::META_Object ( osgViewer  ,
View   
)

virtual osg::View* osgViewer::View::asView (  )  [inline, virtual]

Provide a mechanism for getting the osg::View assocaited from the GUIActionAdapter.

One would use this to case view to osgViewer::View(er) if supported by the subclass.

Reimplemented from osgGA::GUIActionAdapter.

ViewerBase* osgViewer::View::getViewerBase (  )  [inline]

Provide a mechanism for getting the viewer object from this osgViewer::View.

In the case of a osgViewer::Viewer the ViewerBase will effectively point to this object as Viewer subclasses from View. In the case of a osgViewer::CompsoiteViewer the ViewerBase will point to the CompositeViewer that owns this View.

virtual void osgViewer::View::take ( osg::View rhs  )  [virtual]

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

Reimplemented from osg::View.

virtual void osgViewer::View::setStartTick ( osg::Timer_t  tick  )  [virtual]

Reimplemented in osgViewer::Viewer.

osg::Timer_t osgViewer::View::getStartTick (  )  const [inline]

void osgViewer::View::setFrameStamp ( osg::FrameStamp fs  )  [inline]

osg::FrameStamp* osgViewer::View::getFrameStamp (  )  [inline]

const osg::FrameStamp* osgViewer::View::getFrameStamp (  )  const [inline]

Scene* osgViewer::View::getScene (  )  [inline]

const Scene* osgViewer::View::getScene (  )  const [inline]

virtual void osgViewer::View::setSceneData ( osg::Node node  )  [virtual]

Set the scene graph that the View will use.

Reimplemented in osgViewer::Viewer.

osg::Node* osgViewer::View::getSceneData (  )  [inline]

Get the View's scene graph.

const osg::Node* osgViewer::View::getSceneData (  )  const [inline]

Get the const View's scene graph.

void osgViewer::View::setDatabasePager ( osgDB::DatabasePager dp  ) 

Set the View's database pager.

osgDB::DatabasePager* osgViewer::View::getDatabasePager (  ) 

Get the View's database pager.

const osgDB::DatabasePager* osgViewer::View::getDatabasePager (  )  const

Get the const View's database pager.

void osgViewer::View::setEventQueue ( osgGA::EventQueue eventQueue  )  [inline]

osgGA::EventQueue* osgViewer::View::getEventQueue (  )  [inline]

const osgGA::EventQueue* osgViewer::View::getEventQueue (  )  const [inline]

void osgViewer::View::setCameraManipulator ( osgGA::MatrixManipulator manipulator  ) 

Set the CameraManipulator that moves the View's master Camera position in response to events.

osgGA::MatrixManipulator* osgViewer::View::getCameraManipulator (  )  [inline]

Get the View's CameraManipulator.

const osgGA::MatrixManipulator* osgViewer::View::getCameraManipulator (  )  const [inline]

Get the const View's CameraManipulator.

void osgViewer::View::home (  ) 

Set the view to the CameraManipulator's home position, if non is attached home() is does nothing.

Note, to set the home position use getCamaraManipulator()->setHomePosition(...).

void osgViewer::View::addEventHandler ( osgGA::GUIEventHandler eventHandler  ) 

Add an EventHandler that adds handling of events to the View.

EventHandlers& osgViewer::View::getEventHandlers (  )  [inline]

Get the View's list of EventHandlers.

const EventHandlers& osgViewer::View::getEventHandlers (  )  const [inline]

Get the const View's list of EventHandlers.

void osgViewer::View::setCoordinateSystemNodePath ( const osg::NodePath nodePath  ) 

Set the NodePath to any active CoordinateSystemNode present in the Scene.

The CoordinateSystemNode path is used to help applications and CamaraManipualtors handle geocentric coordinates systems, such as known which way is the local up at any position on the a whole earth.

osg::NodePath osgViewer::View::getCoordinateSystemNodePath (  )  const

Get the NodePath to any active CoordinateSystemNode present in the Scene.

void osgViewer::View::computeActiveCoordinateSystemNodePath (  ) 

Compute the NodePath to any active CoordinateSystemNode present in the Scene.

void osgViewer::View::setDisplaySettings ( osg::DisplaySettings ds  )  [inline]

Set the DisplaySettings object associated with this view.

osg::DisplaySettings* osgViewer::View::getDisplaySettings (  )  [inline]

Set the DisplaySettings object associated with this view.

const osg::DisplaySettings* osgViewer::View::getDisplaySettings (  )  const [inline]

Set the DisplaySettings object associated with this view.

void osgViewer::View::setFusionDistance ( osgUtil::SceneView::FusionDistanceMode  mode,
float  value = 1.0f 
) [inline]

Set the FusionDistanceMode and Value.

Note, is used only when working in stereo.

osgUtil::SceneView::FusionDistanceMode osgViewer::View::getFusionDistanceMode (  )  const [inline]

Get the FusionDistanceMode.

float osgViewer::View::getFusionDistanceValue (  )  const [inline]

Get the FusionDistanceValue.

Note, only used for USE_FUSION_DISTANCE_VALUE & PROPORTIONAL_TO_SCREEN_DISTANCE modes.

void osgViewer::View::setUpViewAcrossAllScreens (  ) 

Convinience method for creating slave Cameras and associated GraphicsWindows across all screens.

void osgViewer::View::setUpViewInWindow ( int  x,
int  y,
int  width,
int  height,
unsigned int  screenNum = 0 
)

Convinience method for a single Camara on a single window.

void osgViewer::View::setUpViewOnSingleScreen ( unsigned int  screenNum = 0  ) 

Convinience method for a single Camara associated with a single full screen GraphicsWindow.

void osgViewer::View::setUpViewFor3DSphericalDisplay ( double  radius = 1.0,
double  collar = 0.45,
unsigned int  screenNum = 0,
osg::Image intensityMap = 0 
)

Convinience method for spherical display using 6 slave cameras rendering the 6 sides of a cube map, and 7th camera doing distortion correction to present on a spherical display.

void osgViewer::View::setUpViewForPanoramicSphericalDisplay ( double  radius = 1.0,
double  collar = 0.45,
unsigned int  screenNum = 0,
osg::Image intensityMap = 0 
)

Convinience method for spherical display by rendering main scene to as panoramic 2:1 texture and then doing distortion correction to present onto a spherical display.

bool osgViewer::View::containsCamera ( const osg::Camera camera  )  const

Return true if this view contains a specified camera.

const osg::Camera* osgViewer::View::getCameraContainingPosition ( float  x,
float  y,
float &  local_x,
float &  local_y 
) const

Get the camera which contains the pointer position x,y specified master cameras window/eye coords.

Also passes back the local window coords for the graphics context associated with the camera passed back.

bool osgViewer::View::computeIntersections ( float  x,
float  y,
osgUtil::LineSegmentIntersector::Intersections intersections,
osg::Node::NodeMask  traversalMask = 0xffffffff 
)

Compute intersections between a ray through the specified master cameras window/eye coords and a specified node.

Note, when a master cameras has slaves and no viewport itself its coordinate frame will be in clip space i.e. -1,-1 to 1,1, while if its has a viewport the coordintates will be relative to its viewport dimensions. Mouse events handled by the view will automatically be attached into the master camera window/clip coords so can be passed directly on to the computeIntersections method.

bool osgViewer::View::computeIntersections ( float  x,
float  y,
osg::NodePath nodePath,
osgUtil::LineSegmentIntersector::Intersections intersections,
osg::Node::NodeMask  traversalMask = 0xffffffff 
)

Compute intersections between a ray through the specified master cameras window/eye coords and a specified nodePath's subgraph.

virtual void osgViewer::View::requestRedraw (  )  [virtual]

requestRedraw() requests a single redraw.

Implements osgGA::GUIActionAdapter.

virtual void osgViewer::View::requestContinuousUpdate ( bool  needed = true  )  [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::View::requestWarpPointer ( float  x,
float  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.

void osgViewer::View::assignSceneDataToCameras (  ) 

void osgViewer::View::init (  ) 

virtual osg::GraphicsOperation* osgViewer::View::createRenderer ( osg::Camera camera  )  [protected, virtual]

Reimplemented from osg::View.


Friends And Related Function Documentation

friend class CompositeViewer [friend]


Member Data Documentation

osg::observer_ptr<ViewerBase> osgViewer::View::_viewerBase [protected]

osg::Timer_t osgViewer::View::_startTick [protected]

osg::ref_ptr<osg::FrameStamp> osgViewer::View::_frameStamp [protected]

osg::ref_ptr<osgViewer::Scene> osgViewer::View::_scene [protected]

osg::ref_ptr<osgGA::EventQueue> osgViewer::View::_eventQueue [protected]

osg::ref_ptr<osgGA::MatrixManipulator> osgViewer::View::_cameraManipulator [protected]

EventHandlers osgViewer::View::_eventHandlers [protected]

ObserverNodePath osgViewer::View::_coordinateSystemNodePath [protected]

osg::ref_ptr<osg::DisplaySettings> osgViewer::View::_displaySettings [protected]

osgUtil::SceneView::FusionDistanceMode osgViewer::View::_fusionDistanceMode [protected]

float osgViewer::View::_fusionDistanceValue [protected]


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:53 2007 for the OpenSceneGraph by doxygen 1.5.3.