OpenSceneGraph  3.4.0
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
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.

Classes

struct  StereoSlaveCallback

Public Types

typedef std::list
< osg::ref_ptr
< osgGA::EventHandler > > 
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 associated 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
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::DatabasePagergetDatabasePager () const
 Get the const View's database pager.
void setImagePager (osgDB::ImagePager *ip)
 Set the View's image pager.
osgDB::ImagePagergetImagePager ()
 Get the View's image pager.
const osgDB::ImagePagergetImagePager () const
 Get the const View's image pager.
void addDevice (osgGA::Device *eventSource)
 Add a Device.
void setEventQueue (osgGA::EventQueue *eventQueue)
 Remove a Device.
osgGA::EventQueuegetEventQueue ()
const osgGA::EventQueuegetEventQueue () const
void setCameraManipulator (osgGA::CameraManipulator *manipulator, bool resetPosition=true)
 Set the CameraManipulator that moves the View's master Camera position in response to events.
osgGA::CameraManipulatorgetCameraManipulator ()
 Get the View's CameraManipulator.
const osgGA::CameraManipulatorgetCameraManipulator () const
 Get the const View's CameraManipulator.
void home ()
 Set the view to the CameraManipulator's home position, if none is attached home() it does nothing.
void addEventHandler (osgGA::EventHandler *eventHandler)
 Add an EventHandler that adds handling of events to the View.
void removeEventHandler (osgGA::EventHandler *eventHandler)
 Remove an EventHandler from 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::DisplaySettingsgetDisplaySettings () 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 apply (ViewConfig *config)
 Apply a viewer configuration to set up Cameras and Windowing.
ViewConfiggetLastAppliedViewConfig ()
const ViewConfiggetLastAppliedViewConfig () const
void setUpViewAcrossAllScreens ()
 deprecated, use view.apply(new osgViewer::AcrossAllWindows()).
void setUpViewInWindow (int x, int y, int width, int height, unsigned int screenNum=0)
 deprecated, use view.apply(new osgViewer::SingleWindow(x,y,width,screenNum)).
void setUpViewOnSingleScreen (unsigned int screenNum=0)
 deprecated, use view.apply(new osgViewer::SingleScreen(screenNum)).
void setUpViewFor3DSphericalDisplay (double radius=1.0, double collar=0.45, unsigned int screenNum=0, osg::Image *intensityMap=0, const osg::Matrixd &projectorMatrix=osg::Matrixd())
 deprecated, use view.apply(new osgViewer::SphericalDisplay(radius, collar, screenNum, intensityMap, projectorMatrix)).
void setUpViewForPanoramicSphericalDisplay (double radius=1.0, double collar=0.45, unsigned int screenNum=0, osg::Image *intensityMap=0, const osg::Matrixd &projectorMatrix=osg::Matrixd())
 deprecated, use view.apply(new osgViewer::PanoramicSphericalDisplay(radius, collar, screenNum, intensityMap, projectorMatrix)).
void setUpViewForWoWVxDisplay (unsigned int screenNum, unsigned char wow_content, unsigned char wow_factor, unsigned char wow_offset, float wow_disparity_Zd, float wow_disparity_vz, float wow_disparity_M, float wow_disparity_C)
 deprecated.
bool setUpDepthPartitionForCamera (osg::Camera *cameraToPartition, DepthPartitionSettings *dps=0)
 Convenience method for setting up depth partitioning on the specified camera.
bool setUpDepthPartition (DepthPartitionSettings *dsp=0)
 Convenience method for setting up multiple slave cameras with depth partitioning on each of the view's active cameras.
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
 deprecated.
bool computeIntersections (float x, float y, osgUtil::LineSegmentIntersector::Intersections &intersections, osg::Node::NodeMask traversalMask=0xffffffff)
 deprecated.
bool computeIntersections (float x, float y, const osg::NodePath &nodePath, osgUtil::LineSegmentIntersector::Intersections &intersections, osg::Node::NodeMask traversalMask=0xffffffff)
 deprecated.
bool computeIntersections (const osgGA::GUIEventAdapter &ea, osgUtil::LineSegmentIntersector::Intersections &intersections, osg::Node::NodeMask traversalMask=0xffffffff)
 Compute intersections of a ray, starting the current mouse position, through the specified camera.
bool computeIntersections (const osgGA::GUIEventAdapter &ea, const osg::NodePath &nodePath, osgUtil::LineSegmentIntersector::Intersections &intersections, osg::Node::NodeMask traversalMask=0xffffffff)
 Compute intersections of a ray, starting the current mouse position, through the specified master camera's window/eye coordinates and a specified nodePath's subgraph.
bool computeIntersections (const osg::Camera *camera, osgUtil::Intersector::CoordinateFrame cf, float x, float y, osgUtil::LineSegmentIntersector::Intersections &intersections, osg::Node::NodeMask traversalMask=0xffffffff)
 Compute intersections of a ray through the specified camera.
bool computeIntersections (const osg::Camera *camera, osgUtil::Intersector::CoordinateFrame cf, float x, float y, const osg::NodePath &nodePath, osgUtil::LineSegmentIntersector::Intersections &intersections, osg::Node::NodeMask traversalMask=0xffffffff)
 Compute intersections of a ray through the specified camera and a specified nodePath's subgraph.
virtual void requestRedraw ()
 requestRedraw() requests a single redraw.
virtual void requestContinuousUpdate (bool needed=true)
 requestContinuousUpdate(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 (float x, float y)
 requestWarpPointer(int,int) is requesting a repositioning of the mouse pointer to a specified x,y location on the window.
osg::TexturecreateDistortionTexture (int width, int height)
osg::CameraassignRenderToTextureCamera (osg::GraphicsContext *gc, int width, int height, osg::Texture *texture)
osg::CameraassignKeystoneDistortionCamera (osg::DisplaySettings *ds, osg::GraphicsContext *gc, int x, int y, int width, int height, GLenum buffer, osg::Texture *texture, Keystone *keystone)
osg::CameraassignStereoCamera (osg::DisplaySettings *ds, osg::GraphicsContext *gc, int x, int y, int width, int height, GLenum buffer, double eyeScale)
void assignStereoOrKeystoneToCamera (osg::Camera *camera, osg::DisplaySettings *ds)
void assignSceneDataToCameras ()
void init ()

Protected Member Functions

virtual ~View ()
virtual osg::GraphicsOperationcreateRenderer (osg::Camera *camera)

Protected Attributes

osg::observer_ptr< ViewerBase_viewerBase
osg::Timer_t _startTick
Devices _eventSources
osg::ref_ptr< osgViewer::Scene_scene
osg::ref_ptr< osgGA::EventQueue_eventQueue
osg::ref_ptr
< osgGA::CameraManipulator
_cameraManipulator
EventHandlers _eventHandlers
osg::ObserverNodePath _coordinateSystemNodePath
osg::ref_ptr
< osg::DisplaySettings
_displaySettings
osgUtil::SceneView::FusionDistanceMode _fusionDistanceMode
float _fusionDistanceValue
osg::ref_ptr< ViewConfig_lastAppliedViewConfig

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


Constructor & Destructor Documentation

Reimplemented from osg::View.

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

Reimplemented from osg::View.


Member Function Documentation

void osgViewer::View::addDevice ( osgGA::Device eventSource)

Add a Device.

The Device is polled on each new frame via it's Device::checkEvents() method and any events generated then collected via Device::getEventQueue()

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

void osgViewer::View::apply ( ViewConfig config)

Apply a viewer configuration to set up Cameras and Windowing.

osg::Camera* osgViewer::View::assignKeystoneDistortionCamera ( osg::DisplaySettings ds,
osg::GraphicsContext gc,
int  x,
int  y,
int  width,
int  height,
GLenum  buffer,
osg::Texture texture,
Keystone keystone 
)
osg::Camera* osgViewer::View::assignRenderToTextureCamera ( osg::GraphicsContext gc,
int  width,
int  height,
osg::Texture texture 
)
osg::Camera* osgViewer::View::assignStereoCamera ( osg::DisplaySettings ds,
osg::GraphicsContext gc,
int  x,
int  y,
int  width,
int  height,
GLenum  buffer,
double  eyeScale 
)
virtual osg::View* osgViewer::View::asView ( ) [inline, virtual]

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

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

Reimplemented from osgGA::GUIActionAdapter.

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

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

deprecated.

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

deprecated.

bool osgViewer::View::computeIntersections ( const osgGA::GUIEventAdapter ea,
osgUtil::LineSegmentIntersector::Intersections intersections,
osg::Node::NodeMask  traversalMask = 0xffffffff 
) [virtual]

Compute intersections of a ray, starting the current mouse position, through the specified camera.

Reimplemented from osgGA::GUIActionAdapter.

bool osgViewer::View::computeIntersections ( const osgGA::GUIEventAdapter ea,
const osg::NodePath nodePath,
osgUtil::LineSegmentIntersector::Intersections intersections,
osg::Node::NodeMask  traversalMask = 0xffffffff 
) [virtual]

Compute intersections of a ray, starting the current mouse position, through the specified master camera's window/eye coordinates and a specified nodePath's subgraph.

Reimplemented from osgGA::GUIActionAdapter.

bool osgViewer::View::computeIntersections ( const osg::Camera camera,
osgUtil::Intersector::CoordinateFrame  cf,
float  x,
float  y,
osgUtil::LineSegmentIntersector::Intersections intersections,
osg::Node::NodeMask  traversalMask = 0xffffffff 
)

Compute intersections of a ray through the specified camera.

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

Compute intersections of a ray through the specified camera and a specified nodePath's subgraph.

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

Return true if this view contains a specified camera.

osg::Texture* osgViewer::View::createDistortionTexture ( int  width,
int  height 
)
virtual osg::GraphicsOperation* osgViewer::View::createRenderer ( osg::Camera camera) [protected, virtual]

Reimplemented from osg::View.

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

deprecated.

Get the View's CameraManipulator.

Get the const View's CameraManipulator.

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

Get the View's database pager.

Get the const View's database pager.

Set the DisplaySettings object associated with this view.

Set the DisplaySettings object associated with this view.

Get the View's list of EventHandlers.

Get the const View's list of EventHandlers.

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.

Get the View's image pager.

Get the const View's image pager.

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

Get the View's scene graph.

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

Get the const View's scene graph.

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.

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

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

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

Remove an EventHandler from View.

virtual void osgViewer::View::requestContinuousUpdate ( bool  needed = true) [virtual]

requestContinuousUpdate(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 osgViewer::View::requestRedraw ( ) [virtual]

requestRedraw() requests a single redraw.

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 an aircraft joystick.

Implements osgGA::GUIActionAdapter.

void osgViewer::View::setCameraManipulator ( osgGA::CameraManipulator manipulator,
bool  resetPosition = true 
)

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

The parameter resetPosition determines whether manipulator is set to its home position.

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

The CoordinateSystemNode path is used to help applications and CamaraManipulators handle geocentric coordinates systems, so that the local up direction is known at any position on the whole earth.

Set the View's database pager.

Set the DisplaySettings object associated with this view.

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

Remove a Device.

/*/ void removeDevice(osgGA::Device* eventSource);

typedef std::vector< osg::ref_ptr<osgGA::Device> > Devices;

Devices& getDevices() { return _eventSources; } const Devices& getDevices() const { return _eventSources; }

/* Set the EventQueue that the View uses to integrate external non window related events.

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

Set the FusionDistanceMode and Value.

Note, only used when working in stereo.

Set the View's image pager.

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

Set the scene graph that the View will use.

Reimplemented in osgViewer::Viewer.

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

Reimplemented in osgViewer::Viewer.

Convenience method for setting up multiple slave cameras with depth partitioning on each of the view's active cameras.

Convenience method for setting up depth partitioning on the specified camera.

deprecated, use view.apply(new osgViewer::AcrossAllWindows()).

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

deprecated, use view.apply(new osgViewer::SphericalDisplay(radius, collar, screenNum, intensityMap, projectorMatrix)).

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

deprecated, use view.apply(new osgViewer::PanoramicSphericalDisplay(radius, collar, screenNum, intensityMap, projectorMatrix)).

void osgViewer::View::setUpViewForWoWVxDisplay ( unsigned int  screenNum,
unsigned char  wow_content,
unsigned char  wow_factor,
unsigned char  wow_offset,
float  wow_disparity_Zd,
float  wow_disparity_vz,
float  wow_disparity_M,
float  wow_disparity_C 
)

deprecated.

use view.apply(new osgViewer::WoWVxDisplay(type (20 to 42), screenNum).

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

deprecated, use view.apply(new osgViewer::SingleWindow(x,y,width,screenNum)).

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

deprecated, use view.apply(new osgViewer::SingleScreen(screenNum)).

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.

Reimplemented in osgViewer::Viewer.


Friends And Related Function Documentation

friend class CompositeViewer [friend]

Member Data Documentation

Devices osgViewer::View::_eventSources [protected]

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

osg logo
Generated at Tue Dec 8 2015 00:14:32 for the OpenSceneGraph by doxygen 1.7.6.1.