OpenFrames
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpenFrames::RenderRectangle Class Reference

Encapsulates a rectangle in which a scene can be rendered. More...

#include <RenderRectangle.hpp>

Inheritance diagram for OpenFrames::RenderRectangle:

Public Types

typedef std::vector< osg::ref_ptr< View > > ViewList
 

Public Member Functions

 RenderRectangle (OpenVRDevice *ovrDevice=NULL, VRTextureBuffer *vrTextureBuffer=NULL)
 
void setFrameManager (FrameManager *fm)
 
FrameManagergetFrameManager () 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)
 
SkySpheregetSkySphere () 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)
 
ViewgetCurrentView ()
 
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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RenderRectangle()

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

◆ ~RenderRectangle()

virtual OpenFrames::RenderRectangle::~RenderRectangle ( )
protectedvirtual

Enable VR mode. Currently it cannot be disabled after being enabled.

Member Function Documentation

◆ addView()

void OpenFrames::RenderRectangle::addView ( View view)

Add/remove a view to the view list that can be iterated through

◆ applyCurrentViewProjection()

void OpenFrames::RenderRectangle::applyCurrentViewProjection ( )

Apply the current View's projection matrix to the SceneView.

◆ getCurrentView()

View* OpenFrames::RenderRectangle::getCurrentView ( )

Get the current View, or the default View if none have been set.

◆ getHUD()

osg::Group* OpenFrames::RenderRectangle::getHUD ( ) const
inline

Get the HUD group, which can be used to add HUD decorations such as text

◆ getSceneView()

osgViewer::View* OpenFrames::RenderRectangle::getSceneView ( ) const
inline

Get the OpenSceneGraph View associated with this RenderRectangle

◆ getSkySphere()

SkySphere* OpenFrames::RenderRectangle::getSkySphere ( ) const
inline

Get the sky sphere, e.g. to set its transform

◆ nextView()

void OpenFrames::RenderRectangle::nextView ( )

Iterate through the view list

◆ selectView()

void OpenFrames::RenderRectangle::selectView ( View view)

Select a particular view if it exists in the view list.

◆ setBackgroundColor()

void OpenFrames::RenderRectangle::setBackgroundColor ( float  r,
float  g,
float  b 
)

Set the background color. Only valid if no sky texture or stars are specified

◆ setDepthPartitioningEnabled()

void OpenFrames::RenderRectangle::setDepthPartitioningEnabled ( bool  enable)
inline

Enable/disable the automatic depth partitioner

◆ setFrameManager()

void OpenFrames::RenderRectangle::setFrameManager ( FrameManager fm)

Set the FrameManager containing the scene to be viewed

◆ setGraphicsContext()

void OpenFrames::RenderRectangle::setGraphicsContext ( osg::GraphicsContext *  gc)

Set the graphics context that is used for all OpenGL rendering

◆ setSelected()

void OpenFrames::RenderRectangle::setSelected ( bool  select)

Set the border color to red if selected, and green if deselected.

◆ setShowBorder()

void OpenFrames::RenderRectangle::setShowBorder ( bool  show)

Set whether the "selected" border rectangle is shown or not

◆ setSkySphereStarData()

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

◆ setSkySphereTexture()

void OpenFrames::RenderRectangle::setSkySphereTexture ( const std::string &  fname)

Set the sky sphere texture

◆ setViewport()

void OpenFrames::RenderRectangle::setViewport ( int  x,
int  y,
int  w,
int  h 
)

Set the size of the viewport to render into


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