class OSGUTIL_EXPORT osgUtil::SceneView

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

Inheritance:


Public Methods

[more] SceneView()
Constrcut a default scene view
[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(int x, int y, int width, int height)
Set the viewport of the scene view.
[more]void getViewport(int& x, int& y, int& width, int& height)
Get the viewport of the scene view.
[more]void setDefaults()
Set scene view to use default global state, light, camera and render visitor
[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 setGlobalState(osg::StateSet* state)
[more]osg::StateSet* getGlobalState()
[more]const osg::StateSet* getGlobalState() 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 setCamera(osg::Camera* camera)
[more]osg::Camera* getCamera()
[more]const osg::Camera* getCamera() const
[more]void setState(osg::State* state)
[more]osg::State* getState()
[more]const osg::State* getState() 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 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 caclculates 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]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 App CullVisitor
[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::State> _state
[more]osg::ref_ptr<osg::NodeVisitor> _appVisitor
[more]osg::ref_ptr<osgUtil::CullVisitor> _cullVisitor
[more]osg::ref_ptr<osgUtil::RenderGraph> _rendergraph
[more]osg::ref_ptr<osgUtil::RenderStage> _renderStage
[more]bool _need_compile
[more]bool _calc_nearfar
[more]osg::Vec4 _backgroundColor
[more]double _near_plane
[more]double _far_plane
[more]float _lodBias
[more]GLint _view[4]
[more]LightingMode _lightingMode
[more]bool _prioritizeTextures
[more]int _frameNumber

Protected Methods

[more]virtual ~SceneView()


Documentation

SceneView is literaly 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()
Constrcut a default scene view

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(int x, int y, int width, int height)
Set the viewport of the scene view.

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

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

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 setGlobalState(osg::StateSet* state)

oosg::StateSet* getGlobalState()

oconst osg::StateSet* getGlobalState() 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 setCamera(osg::Camera* camera)

oosg::Camera* getCamera()

oconst osg::Camera* getCamera() const

ovoid setState(osg::State* state)

oosg::State* getState()

oconst osg::State* getState() 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 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 caclculates 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.

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

ovirtual void cull()
do cull traversal of attached scene graph using App CullVisitor

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

ovirtual ~SceneView()

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::State> _state

oosg::ref_ptr<osg::NodeVisitor> _appVisitor

oosg::ref_ptr<osgUtil::CullVisitor> _cullVisitor

oosg::ref_ptr<osgUtil::RenderGraph> _rendergraph

oosg::ref_ptr<osgUtil::RenderStage> _renderStage

obool _need_compile

obool _calc_nearfar

oosg::Vec4 _backgroundColor

odouble _near_plane

odouble _far_plane

ofloat _lodBias

oGLint _view[4]

oLightingMode _lightingMode

obool _prioritizeTextures

oint _frameNumber


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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