OpenFrames
|
Encapsulates a rectangle in which a scene can be rendered. More...
#include <RenderRectangle.hpp>
Public Types | |
typedef std::vector< osg::ref_ptr< View > > | ViewList |
Public Member Functions | |
RenderRectangle (OpenVRDevice *ovrDevice=NULL, VRTextureBuffer *vrTextureBuffer=NULL) | |
void | setFrameManager (FrameManager *fm) |
FrameManager * | getFrameManager () const |
osgViewer::View * | getSceneView () const |
osg::Group * | getHUD () const |
void | setGraphicsContext (osg::GraphicsContext *gc) |
void | setViewport (int x, int y, int w, int h) |
void | setSelected (bool select) |
bool | getSelected () |
void | setShowBorder (bool show) |
bool | getShowBorder () |
void | setSkySphereTexture (const std::string &fname) |
bool | setSkySphereStarData (const std::string &catalogName, float minMag, float maxMag, unsigned int maxNumStars=100000, float minPixSize=1.0, float maxPixSize=10.0, float minDimRatio=0.5f) |
SkySphere * | getSkySphere () const |
void | setBackgroundColor (float r, float g, float b) |
void | setDepthPartitioningEnabled (bool enable) |
void | addView (View *view) |
void | removeView (View *view) |
void | removeAllViews () |
void | nextView () |
void | previousView () |
void | selectView (View *view) |
void | selectView (unsigned int newView) |
View * | getCurrentView () |
void | applyCurrentViewProjection () |
Protected Member Functions | |
virtual | ~RenderRectangle () |
void | _init () |
void | selectCurrentView () |
void | updateViewProjection (View *view) |
Protected Attributes | |
ViewList | _views |
osg::ref_ptr< View > | _defaultView |
unsigned int | _currView |
osg::ref_ptr< osgViewer::View > | _sceneView |
osg::ref_ptr< DepthPartitioner > | _depthPartitioner |
osg::ref_ptr< osg::Group > | _scene |
osg::ref_ptr< osg::Camera > | _hudCamera |
osg::ref_ptr< osg::Camera > | _backCamera |
osg::ref_ptr< osg::Camera > | _mirrorCamera |
osg::ref_ptr< VRCamera > | _backCameraVR |
osg::observer_ptr< VRTextureBuffer > | _vrTextureBuffer |
osg::observer_ptr< OpenVRDevice > | _ovrDevice |
bool | _useVR |
osg::ref_ptr< osg::Geode > | _borderGeode |
osg::ref_ptr< SkySphere > | _skySphere |
osg::ref_ptr< FrameManager > | _frameManager |
Encapsulates a rectangle in which a scene can be rendered.
This class encapsulates a rectangle in which a scene can be rendered. It provides decorations for the scene, such as a border around the rectangle. It also automatically analyzes a scene and (if needed) renders it in multiple stages in case there are large z distances involved.
OpenFrames::RenderRectangle::RenderRectangle | ( | OpenVRDevice * | ovrDevice = NULL , |
VRTextureBuffer * | vrTextureBuffer = NULL |
||
) |
Create a new RenderRectangle to render a scene. VR width/height only applicable if useVR = true
|
protectedvirtual |
Enable VR mode. Currently it cannot be disabled after being enabled.
void OpenFrames::RenderRectangle::addView | ( | View * | view | ) |
Add/remove a view to the view list that can be iterated through
void OpenFrames::RenderRectangle::applyCurrentViewProjection | ( | ) |
Apply the current View's projection matrix to the SceneView.
View* OpenFrames::RenderRectangle::getCurrentView | ( | ) |
|
inline |
Get the HUD group, which can be used to add HUD decorations such as text
|
inline |
Get the OpenSceneGraph View associated with this RenderRectangle
|
inline |
Get the sky sphere, e.g. to set its transform
void OpenFrames::RenderRectangle::nextView | ( | ) |
Iterate through the view list
void OpenFrames::RenderRectangle::selectView | ( | View * | view | ) |
Select a particular view if it exists in the view list.
void OpenFrames::RenderRectangle::setBackgroundColor | ( | float | r, |
float | g, | ||
float | b | ||
) |
Set the background color. Only valid if no sky texture or stars are specified
|
inline |
Enable/disable the automatic depth partitioner
void OpenFrames::RenderRectangle::setFrameManager | ( | FrameManager * | fm | ) |
Set the FrameManager containing the scene to be viewed
void OpenFrames::RenderRectangle::setGraphicsContext | ( | osg::GraphicsContext * | gc | ) |
Set the graphics context that is used for all OpenGL rendering
void OpenFrames::RenderRectangle::setSelected | ( | bool | select | ) |
Set the border color to red if selected, and green if deselected.
void OpenFrames::RenderRectangle::setShowBorder | ( | bool | show | ) |
Set whether the "selected" border rectangle is shown or not
bool OpenFrames::RenderRectangle::setSkySphereStarData | ( | const std::string & | catalogName, |
float | minMag, | ||
float | maxMag, | ||
unsigned int | maxNumStars = 100000 , |
||
float | minPixSize = 1.0 , |
||
float | maxPixSize = 10.0 , |
||
float | minDimRatio = 0.5f |
||
) |
Set the star field data
void OpenFrames::RenderRectangle::setSkySphereTexture | ( | const std::string & | fname | ) |
Set the sky sphere texture
void OpenFrames::RenderRectangle::setViewport | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Set the size of the viewport to render into