class OSGUTIL_EXPORT osgUtil::SceneView

SceneView is literally a view of a scene, encapsulating the camera, global state, lights and the scene itself.

Inheritance:


Public Methods

[more] SceneView(osg::DisplaySettings* ds=NULL)
Construct a default scene view
[more]void setDefaults()
Set scene view to use default global state, light, camera and render visitor
[more]void setSceneData(osg::Node* node)
Set the data which to view.
[more]osg::Node* getSceneData()
Get the scene data which to view.
[more]const osg::Node* getSceneData() const
Get the const scene data which to view.
[more]void setViewport(osg::Viewport* viewport)
Set the viewport of the scene view to use specfied osg::Viewport.
[more]void setViewport(int x, int y, int width, int height)
Set the viewport of the scene view to specified dimensions.
[more]const osg::Viewport* getViewport() const
Get the const viewport.
[more]osg::Viewport* getViewport()
Get the viewport.
[more]void getViewport(int& x, int& y, int& width, int& height)
Get the viewport of the scene view.
[more]inline void setDisplaySettings(osg::DisplaySettings* vs)
Set the DisplaySettings.
[more]inline const osg::DisplaySettings* getDisplaySettings() const
Get the const DisplaySettings
[more]inline osg::DisplaySettings* getDisplaySettings()
Get the DisplaySettings
[more]void setBackgroundColor(const osg::Vec4& color)
Set the background color used in glClearColor().
[more]const osg::Vec4& getBackgroundColor() const
Get the background color
[more]void setGlobalStateSet(osg::StateSet* state)
[more]osg::StateSet* getGlobalStateSet()
[more]const osg::StateSet* getGlobalStateSet() const
[more]void setLightingMode(LightingMode mode)
[more]LightingMode getLightingMode() const
[more]void setLight(osg::Light* light)
[more]osg::Light* getLight()
[more]const osg::Light* getLight() const
[more]void setState(osg::State* state)
[more]osg::State* getState()
[more]const osg::State* getState() const
[more]void setCamera(osg::Camera* camera)
set an osg::Camera for the scene view to use for setting projection and modelview matrices internaly.
[more]osg::Camera* getCamera()
[more]const osg::Camera* getCamera() const
[more]void setProjectionMatrix(osg::Matrix* matrix)
set a projection matrix.
[more]osg::Matrix* getProjectionMatrix()
[more]const osg::Matrix* getProjectionMatrix() const
[more]void setModelViewMatrix(osg::Matrix* matrix)
set a modelview matrix.
[more]osg::Matrix* getModelViewMatrix()
[more]const osg::Matrix* getModelViewMatrix() const
[more]void setInitVisitor(osg::NodeVisitor* av)
[more]osg::NodeVisitor* getInitVisitor()
[more]const osg::NodeVisitor* getInitVisitor() const
[more]void setAppVisitor(osg::NodeVisitor* av)
[more]osg::NodeVisitor* getAppVisitor()
[more]const osg::NodeVisitor* getAppVisitor() const
[more]void setCullVisitor(osgUtil::CullVisitor* cv)
[more]osgUtil::CullVisitor* getCullVisitor()
[more]const osgUtil::CullVisitor* getCullVisitor() const
[more]void setRenderGraph(osgUtil::RenderGraph* rg)
[more]osgUtil::RenderGraph* getRenderGraph()
[more]const osgUtil::RenderGraph* getRenderGraph() const
[more]void setRenderStage(osgUtil::RenderStage* rs)
[more]osgUtil::RenderStage* getRenderStage()
[more]const osgUtil::RenderStage* getRenderStage() const
[more]void setLODBias(float bias)
[more]float getLODBias() const
[more]void setCullMask(const osg::Node::NodeMask nm)
[more]const osg::Node::NodeMask getCullMask() const
[more]void setCullMaskLeft(const osg::Node::NodeMask nm)
[more]const osg::Node::NodeMask getCullMaskLeft() const
[more]void setCullMaskRight(const osg::Node::NodeMask nm)
[more]const osg::Node::NodeMask getCullMaskRight() const
[more]void setCalcNearFar(bool calc)
Set to true if you want SceneView to automatically calculate values for the near/far clipping planes, each frame, set false to use camera's internal near and far planes.
[more]bool getCalcNearFar() const
return true if SceneView automatically calculates near and far clipping planes for each frame
[more]void setPrioritizeTextures(bool pt)
set whether the draw method should call renderer->prioritizeTexture
[more]bool getPrioritizeTextures() const
get whether the draw method should call renderer->prioritizeTexture
[more]bool projectWindowIntoObject(const osg::Vec3& window, osg::Vec3& object) const
Calculate, via glUnProject, the object coordinates of a window point.
[more]bool projectWindowXYIntoObject(int x, int y, osg::Vec3& near_point, osg::Vec3& far_point) const
Calculate, via glUnProject, the object coordinates of a window x,y when projected onto the near and far planes.
[more]bool projectObjectIntoWindow(const osg::Vec3& object, osg::Vec3& window) const
Calculate, via glProject, the object coordinates of a window.
[more]inline void setFrameStamp(osg::FrameStamp* fs)
Set the frame stamp for the current frame
[more]inline const osg::FrameStamp* getFrameStamp() const
Set the frame stamp for the current frame
[more]virtual void init()
Do init traversal of attached scene graph using Init NodeVisitor.
[more]virtual void app()
Do app traversal of attached scene graph using App NodeVisitor
[more]virtual void cull()
Do cull traversal of attached scene graph using Cull NodeVisitor
[more]virtual void draw()
Do draw traversal of draw bins generated by cull traversal

Public Members

[more]enum LightingMode

Protected Fields

[more]osg::ref_ptr<osg::Node> _sceneData
[more]osg::ref_ptr<osg::StateSet> _globalState
[more]osg::ref_ptr<osg::Light> _light
[more]osg::ref_ptr<osg::Camera> _camera
[more]osg::ref_ptr<osg::Matrix> _projectionMatrix
[more]osg::ref_ptr<osg::Matrix> _modelviewMatrix
[more]osg::ref_ptr<osg::DisplaySettings> _displaySettings
[more]osg::ref_ptr<osg::State> _state
[more]bool _initCalled
[more]osg::ref_ptr<osg::NodeVisitor> _initVisitor
[more]osg::ref_ptr<osg::NodeVisitor> _appVisitor
[more]osg::Node::NodeMask _cullMask
[more]osg::ref_ptr<osgUtil::CullVisitor> _cullVisitor
[more]osg::ref_ptr<osgUtil::RenderGraph> _rendergraph
[more]osg::ref_ptr<osgUtil::RenderStage> _renderStage
[more]osg::Node::NodeMask _cullMaskLeft
[more]osg::ref_ptr<osgUtil::CullVisitor> _cullVisitorLeft
[more]osg::ref_ptr<osgUtil::RenderGraph> _rendergraphLeft
[more]osg::ref_ptr<osgUtil::RenderStage> _renderStageLeft
[more]osg::Node::NodeMask _cullMaskRight
[more]osg::ref_ptr<osgUtil::CullVisitor> _cullVisitorRight
[more]osg::ref_ptr<osgUtil::RenderGraph> _rendergraphRight
[more]osg::ref_ptr<osgUtil::RenderStage> _renderStageRight
[more]osg::ref_ptr<osg::FrameStamp> _frameStamp
[more]bool _need_compile
[more]bool _calc_nearfar
[more]osg::Vec4 _backgroundColor
[more]double _near_plane
[more]double _far_plane
[more]float _lodBias
[more]osg::ref_ptr<osg::Viewport> _viewport
[more]LightingMode _lightingMode
[more]bool _prioritizeTextures

Protected Methods

[more]virtual ~SceneView()
[more]virtual void cullStage(osg::Matrix* projection, osg::Matrix* modelview, osgUtil::CullVisitor* cullVisitor, osgUtil::RenderGraph* rendergraph, osgUtil::RenderStage* renderStage)
Do cull traversal of attached scene graph using Cull NodeVisitor
[more]virtual void drawStage(osgUtil::RenderStage* renderStage)
[more]const osg::Matrix computeMVPW() const
[more]void clearArea(int x, int y, int width, int height, const osg::Vec4& color)


Documentation

SceneView is literally a view of a scene, encapsulating the camera, global state, lights and the scene itself. Provides methods for setting up the view and rendering it.
o SceneView(osg::DisplaySettings* ds=NULL)
Construct a default scene view

ovoid setDefaults()
Set scene view to use default global state, light, camera and render visitor

ovoid setSceneData(osg::Node* node)
Set the data which to view. The data will typically be an osg::Scene but can be any osg::Node type.

oosg::Node* getSceneData()
Get the scene data which to view. The data will typically be an osg::Scene but can be any osg::Node type.

oconst osg::Node* getSceneData() const
Get the const scene data which to view. The data will typically be an osg::Scene but can be any osg::Node type.

ovoid setViewport(osg::Viewport* viewport)
Set the viewport of the scene view to use specfied osg::Viewport.

ovoid setViewport(int x, int y, int width, int height)
Set the viewport of the scene view to specified dimensions.

oconst osg::Viewport* getViewport() const
Get the const viewport.

oosg::Viewport* getViewport()
Get the viewport.

ovoid getViewport(int& x, int& y, int& width, int& height)
Get the viewport of the scene view.

oinline void setDisplaySettings(osg::DisplaySettings* vs)
Set the DisplaySettings.

oinline const osg::DisplaySettings* getDisplaySettings() const
Get the const DisplaySettings

oinline osg::DisplaySettings* getDisplaySettings()
Get the DisplaySettings

ovoid setBackgroundColor(const osg::Vec4& color)
Set the background color used in glClearColor(). Defaults to an off blue color.

oconst osg::Vec4& getBackgroundColor() const
Get the background color

ovoid setGlobalStateSet(osg::StateSet* state)

oosg::StateSet* getGlobalStateSet()

oconst osg::StateSet* getGlobalStateSet() const

oenum LightingMode

o HEADLIGHT

o SKY_LIGHT

o NO_SCENEVIEW_LIGHT

ovoid setLightingMode(LightingMode mode)

oLightingMode getLightingMode() const

ovoid setLight(osg::Light* light)

oosg::Light* getLight()

oconst osg::Light* getLight() const

ovoid setState(osg::State* state)

oosg::State* getState()

oconst osg::State* getState() const

ovoid setCamera(osg::Camera* camera)
set an osg::Camera for the scene view to use for setting projection and modelview matrices internaly. However, the projection matrix from the camera will be overriden by a projection matrix which is set explicitly via setProjectionMatrix(..), see below. Also, the model matrix from the camera will be overriden by a modelview matrix which is set explicitly via setModelViewMatrix(..), see below.

oosg::Camera* getCamera()

oconst osg::Camera* getCamera() const

ovoid setProjectionMatrix(osg::Matrix* matrix)
set a projection matrix. Note, this will override a camera's projection matrix if it is not NULL.

oosg::Matrix* getProjectionMatrix()

oconst osg::Matrix* getProjectionMatrix() const

ovoid setModelViewMatrix(osg::Matrix* matrix)
set a modelview matrix. Note, this will override a camera's modelview matrix if it is not NULL.

oosg::Matrix* getModelViewMatrix()

oconst osg::Matrix* getModelViewMatrix() const

ovoid setInitVisitor(osg::NodeVisitor* av)

oosg::NodeVisitor* getInitVisitor()

oconst osg::NodeVisitor* getInitVisitor() const

ovoid setAppVisitor(osg::NodeVisitor* av)

oosg::NodeVisitor* getAppVisitor()

oconst osg::NodeVisitor* getAppVisitor() const

ovoid setCullVisitor(osgUtil::CullVisitor* cv)

oosgUtil::CullVisitor* getCullVisitor()

oconst osgUtil::CullVisitor* getCullVisitor() const

ovoid setRenderGraph(osgUtil::RenderGraph* rg)

oosgUtil::RenderGraph* getRenderGraph()

oconst osgUtil::RenderGraph* getRenderGraph() const

ovoid setRenderStage(osgUtil::RenderStage* rs)

oosgUtil::RenderStage* getRenderStage()

oconst osgUtil::RenderStage* getRenderStage() const

ovoid setLODBias(float bias)

ofloat getLODBias() const

ovoid setCullMask(const osg::Node::NodeMask nm)

oconst osg::Node::NodeMask getCullMask() const

ovoid setCullMaskLeft(const osg::Node::NodeMask nm)

oconst osg::Node::NodeMask getCullMaskLeft() const

ovoid setCullMaskRight(const osg::Node::NodeMask nm)

oconst osg::Node::NodeMask getCullMaskRight() const

ovoid setCalcNearFar(bool calc)
Set to true if you want SceneView to automatically calculate values for the near/far clipping planes, each frame, set false to use camera's internal near and far planes. Default value is true.

obool getCalcNearFar() const
return true if SceneView automatically calculates near and far clipping planes for each frame

ovoid setPrioritizeTextures(bool pt)
set whether the draw method should call renderer->prioritizeTexture

obool getPrioritizeTextures() const
get whether the draw method should call renderer->prioritizeTexture

obool projectWindowIntoObject(const osg::Vec3& window, osg::Vec3& object) const
Calculate, via glUnProject, the object coordinates of a window point. Note, current implementation requires that SceneView::draw() has been previously called for projectWindowIntoObject to produce valid values. Consistent with OpenGL windows coordinates are calculated relative to the bottom left of the window. Returns true on successful projection.

obool projectWindowXYIntoObject(int x, int y, osg::Vec3& near_point, osg::Vec3& far_point) const
Calculate, via glUnProject, the object coordinates of a window x,y when projected onto the near and far planes. Note, current implementation requires that SceneView::draw() has been previously called for projectWindowIntoObject to produce valid values. Consistent with OpenGL windows coordinates are calculated relative to the bottom left of the window. Returns true on successful projection.

obool projectObjectIntoWindow(const osg::Vec3& object, osg::Vec3& window) const
Calculate, via glProject, the object coordinates of a window. Note, current implementation requires that SceneView::draw() has been previously called for projectWindowIntoObject to produce valid values. Consistent with OpenGL windows coordinates are calculated relative to the bottom left of the window, whereas as window API's normally have the top left as the origin, so you may need to pass in (mouseX,window_height-mouseY,...). Returns true on successful projection.

oinline void setFrameStamp(osg::FrameStamp* fs)
Set the frame stamp for the current frame

oinline const osg::FrameStamp* getFrameStamp() const
Set the frame stamp for the current frame

ovirtual void init()
Do init traversal of attached scene graph using Init NodeVisitor. The init traversal is called once for each SceneView, and should be used to compile display list, texture objects intialize data not otherwise intializaed during scene graph loading. Note, is called automatically by app&cull if it hasn't already been called elsewhere. Also init() should only ever be called within a valid graphics context.

ovirtual void app()
Do app traversal of attached scene graph using App NodeVisitor

ovirtual void cull()
Do cull traversal of attached scene graph using Cull NodeVisitor

ovirtual void draw()
Do draw traversal of draw bins generated by cull traversal

ovirtual ~SceneView()

ovirtual void cullStage(osg::Matrix* projection, osg::Matrix* modelview, osgUtil::CullVisitor* cullVisitor, osgUtil::RenderGraph* rendergraph, osgUtil::RenderStage* renderStage)
Do cull traversal of attached scene graph using Cull NodeVisitor

ovirtual void drawStage(osgUtil::RenderStage* renderStage)

oconst osg::Matrix computeMVPW() const

ovoid clearArea(int x, int y, int width, int height, const osg::Vec4& color)

oosg::ref_ptr<osg::Node> _sceneData

oosg::ref_ptr<osg::StateSet> _globalState

oosg::ref_ptr<osg::Light> _light

oosg::ref_ptr<osg::Camera> _camera

oosg::ref_ptr<osg::Matrix> _projectionMatrix

oosg::ref_ptr<osg::Matrix> _modelviewMatrix

oosg::ref_ptr<osg::DisplaySettings> _displaySettings

oosg::ref_ptr<osg::State> _state

obool _initCalled

oosg::ref_ptr<osg::NodeVisitor> _initVisitor

oosg::ref_ptr<osg::NodeVisitor> _appVisitor

oosg::Node::NodeMask _cullMask

oosg::ref_ptr<osgUtil::CullVisitor> _cullVisitor

oosg::ref_ptr<osgUtil::RenderGraph> _rendergraph

oosg::ref_ptr<osgUtil::RenderStage> _renderStage

oosg::Node::NodeMask _cullMaskLeft

oosg::ref_ptr<osgUtil::CullVisitor> _cullVisitorLeft

oosg::ref_ptr<osgUtil::RenderGraph> _rendergraphLeft

oosg::ref_ptr<osgUtil::RenderStage> _renderStageLeft

oosg::Node::NodeMask _cullMaskRight

oosg::ref_ptr<osgUtil::CullVisitor> _cullVisitorRight

oosg::ref_ptr<osgUtil::RenderGraph> _rendergraphRight

oosg::ref_ptr<osgUtil::RenderStage> _renderStageRight

oosg::ref_ptr<osg::FrameStamp> _frameStamp

obool _need_compile

obool _calc_nearfar

oosg::Vec4 _backgroundColor

odouble _near_plane

odouble _far_plane

ofloat _lodBias

oosg::ref_ptr<osg::Viewport> _viewport

oLightingMode _lightingMode

obool _prioritizeTextures


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.