Google

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::RefMatrix* matrix)
set a projection matrix.
[more]osg::RefMatrix* getProjectionMatrix()
[more]const osg::RefMatrix* getProjectionMatrix() const
[more]void setModelViewMatrix(osg::RefMatrix* matrix)
set a modelview matrix.
[more]osg::RefMatrix* getModelViewMatrix()
[more]const osg::RefMatrix* getModelViewMatrix() const
[more]void setInitVisitor(osg::NodeVisitor* av)
[more]osg::NodeVisitor* getInitVisitor()
[more]const osg::NodeVisitor* getInitVisitor() const
[more]void setUpdateVisitor(osg::NodeVisitor* av)
[more]osg::NodeVisitor* getUpdateVisitor()
[more]const osg::NodeVisitor* getUpdateVisitor() 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 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 setLODScale(float bias)
Set the LOD bias for the CullVisitor to use
[more]float getLODScale() const
Get the LOD bias
[more]void setSmallFeatureCullingPixelSize(float value)
Set the Small Feature Culling Pixel Size
[more]float getSmallFeatureCullingPixelSize() const
Get the Small Feature Culling Pixel Size
[more]void setCullingMode(osg::CullStack::CullingMode mode)
Set the culling mode for the CullVisitor to use
[more]osg::CullStack::CullingMode getCullingMode() const
Returns the current CullingMode
[more]void setComputeNearFarMode(CullVisitor::ComputeNearFarMode cnfm)
Set the ComputeNearFarMode for the CullVisitor to use
[more]CullVisitor::ComputeNearFarMode getComputeNearFarMode() const
Get the ComputeNearFarMode
[more]void setFusionDistance(FusionDistanceMode mode, float value=1.0f)
Set the FusionDistanceMode and Value.
[more]FusionDistanceMode getFusionDistanceMode() const
Get the FusionDistanceMode
[more]float getFusionDistanceValue() const
Get the FusionDistanceValue.
[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 update()
Do app traversal of attached scene graph using App NodeVisitor
[more]virtual void app()
[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
[more]enum FusionDistanceMode
FusionDistanceMode is used only when working in stereo

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::RefMatrix> _projectionMatrix
[more]osg::ref_ptr<osg::RefMatrix> _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> _updateVisitor
[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]osg::Vec4 _backgroundColor
[more]CullVisitor::ComputeNearFarMode _computeNearFar
[more]osg::CullStack::CullingMode _cullingMode
[more]float _LODScale
[more]float _smallFeatureCullingPixelSize
[more]FusionDistanceMode _fusionDistanceMode
[more]float _fusionDistanceValue
[more]osg::ref_ptr<osg::Viewport> _viewport
[more]LightingMode _lightingMode
[more]bool _prioritizeTextures

Protected Methods

[more]virtual ~SceneView()
[more]virtual void cullStage(osg::RefMatrix* projection, osg::RefMatrix* modelview, osgUtil::CullVisitor* cullVisitor, osgUtil::RenderGraph* rendergraph, osgUtil::RenderStage* renderStage)
Do cull traversal of attached scene graph using Cull NodeVisitor
[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::RefMatrix* matrix)
set a projection matrix. Note, this will override a camera's projection matrix if it is not NULL.

oosg::RefMatrix* getProjectionMatrix()

oconst osg::RefMatrix* getProjectionMatrix() const

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

oosg::RefMatrix* getModelViewMatrix()

oconst osg::RefMatrix* getModelViewMatrix() const

ovoid setInitVisitor(osg::NodeVisitor* av)

oosg::NodeVisitor* getInitVisitor()

oconst osg::NodeVisitor* getInitVisitor() const

ovoid setUpdateVisitor(osg::NodeVisitor* av)

oosg::NodeVisitor* getUpdateVisitor()

oconst osg::NodeVisitor* getUpdateVisitor() 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 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 setLODScale(float bias)
Set the LOD bias for the CullVisitor to use

ofloat getLODScale() const
Get the LOD bias

ovoid setSmallFeatureCullingPixelSize(float value)
Set the Small Feature Culling Pixel Size

ofloat getSmallFeatureCullingPixelSize() const
Get the Small Feature Culling Pixel Size

ovoid setCullingMode(osg::CullStack::CullingMode mode)
Set the culling mode for the CullVisitor to use

oosg::CullStack::CullingMode getCullingMode() const
Returns the current CullingMode

ovoid setComputeNearFarMode(CullVisitor::ComputeNearFarMode cnfm)
Set the ComputeNearFarMode for the CullVisitor to use

oCullVisitor::ComputeNearFarMode getComputeNearFarMode() const
Get the ComputeNearFarMode

oenum FusionDistanceMode
FusionDistanceMode is used only when working in stereo

o USE_CAMERA_FUSION_DISTANCE
Use fusion distance from the attached camera if one exist

o USE_FUSION_DISTANCE_VALUE
Use fusion distance from the value set on the SceneView

o PROPORTIONAL_TO_SCREEN_DISTANCE
Compute the fusion distance by multiplying the screen distance by the fusion distance value

ovoid setFusionDistance(FusionDistanceMode mode, float value=1.0f)
Set the FusionDistanceMode and Value. Note, is used only when working in stereo.

oFusionDistanceMode getFusionDistanceMode() const
Get the FusionDistanceMode

ofloat getFusionDistanceValue() const
Get the FusionDistanceValue. Note, only used for USE_FUSION_DISTANCE_VALUE & PROPORTIONAL_TO_SCREEN_DISTANCE modes.

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 update&cull if it hasn't already been called elsewhere. Also init() should only ever be called within a valid graphics context.

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

ovirtual void app()

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::RefMatrix* projection, osg::RefMatrix* modelview, osgUtil::CullVisitor* cullVisitor, osgUtil::RenderGraph* rendergraph, osgUtil::RenderStage* renderStage)
Do cull traversal of attached scene graph using Cull NodeVisitor

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::RefMatrix> _projectionMatrix

oosg::ref_ptr<osg::RefMatrix> _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> _updateVisitor

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

oosg::Vec4 _backgroundColor

oCullVisitor::ComputeNearFarMode _computeNearFar

oosg::CullStack::CullingMode _cullingMode

ofloat _LODScale

ofloat _smallFeatureCullingPixelSize

oFusionDistanceMode _fusionDistanceMode

ofloat _fusionDistanceValue

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++.