OpenWalnut
1.5.0dev
|
This class implements a HUD showing several textures on screen. More...
#include <WGETextureHud.h>
Classes | |
class | SafeUpdateCallback |
Callback which aligns and renders the textures. More... | |
class | WGETextureHudEntry |
Class implementing one texture HUD entry representing a texture in the HUD. More... | |
Public Member Functions | |
WGETextureHud () | |
Default constructor. More... | |
virtual | ~WGETextureHud () |
Destructor. More... | |
void | addTexture (osg::ref_ptr< WGETextureHudEntry > texture) |
Adds the specified HUD element to the HUD. More... | |
void | removeTexture (osg::ref_ptr< WGETextureHudEntry > texture) |
Remove the texture from the HUD. More... | |
void | removeTexture (osg::ref_ptr< osg::Texture > texture) |
Remove the texture from the HUD. More... | |
unsigned int | getMaxElementWidth () const |
Gets the maximum width of a tex element. More... | |
void | setMaxElementWidth (unsigned int width) |
Sets the new maximum width of a texture column. More... | |
void | setViewport (osg::Viewport *viewport) |
Sets the viewport of the camera housing this HUD. More... | |
void | coupleViewportWithTextureViewport (bool couple=true) |
Set the viewport to be used for textures too. More... | |
size_t | getRenderBin () const |
Returns the render bin used by the HUD. More... | |
Protected Attributes | |
osg::ref_ptr< WGEGroupNode > | m_group |
The group Node where all those texture reside in. More... | |
unsigned int | m_maxElementWidth |
The maximum element width. More... | |
size_t | m_renderBin |
The render bin to use. More... | |
osg::Viewport * | m_viewport |
The current viewport of. More... | |
bool | m_coupleTexViewport |
The viewport in texture space to allow viewing parts of the texture. More... | |
This class implements a HUD showing several textures on screen.
This is especially useful as debugging tool during offscreen rendering. It is possible to add and remove textures to it. The size of the texture on screen depends on the screen size, as well as the layout of each texture depends on the screen size.
Definition at line 46 of file WGETextureHud.h.
WGETextureHud::WGETextureHud | ( | ) |
Default constructor.
Definition at line 41 of file WGETextureHud.cpp.
References m_group, and m_renderBin.
|
virtual |
Destructor.
Definition at line 54 of file WGETextureHud.cpp.
void WGETextureHud::addTexture | ( | osg::ref_ptr< WGETextureHudEntry > | texture | ) |
Adds the specified HUD element to the HUD.
texture | the texture to show. |
Definition at line 118 of file WGETextureHud.cpp.
References m_group.
void WGETextureHud::coupleViewportWithTextureViewport | ( | bool | couple = true | ) |
Set the viewport to be used for textures too.
This is useful if an offscreen rendering renders only into a part of the texture. If coupling is disabled, the whole texture gets rendered.
couple | if true, the viewport set by setViewport gets also used for texture space. |
Definition at line 169 of file WGETextureHud.cpp.
References m_coupleTexViewport.
unsigned int WGETextureHud::getMaxElementWidth | ( | ) | const |
Gets the maximum width of a tex element.
Definition at line 305 of file WGETextureHud.cpp.
References m_maxElementWidth.
Referenced by WGETextureHud::SafeUpdateCallback::operator()().
size_t WGETextureHud::getRenderBin | ( | ) | const |
Returns the render bin used by the HUD.
Definition at line 320 of file WGETextureHud.cpp.
References m_renderBin.
void WGETextureHud::removeTexture | ( | osg::ref_ptr< osg::Texture > | texture | ) |
Remove the texture from the HUD.
texture | the texture to remove. |
Definition at line 150 of file WGETextureHud.cpp.
References m_group.
void WGETextureHud::removeTexture | ( | osg::ref_ptr< WGETextureHudEntry > | texture | ) |
Remove the texture from the HUD.
texture | the texture to remove. |
Definition at line 123 of file WGETextureHud.cpp.
References m_group.
void WGETextureHud::setMaxElementWidth | ( | unsigned int | width | ) |
Sets the new maximum width of a texture column.
width | the new width |
Definition at line 310 of file WGETextureHud.cpp.
References m_maxElementWidth.
void WGETextureHud::setViewport | ( | osg::Viewport * | viewport | ) |
Sets the viewport of the camera housing this HUD.
It is needed to have proper scaling of each texture tile. You can use WGEViewportCallback to handle this automatically.
viewport | the viewport |
Definition at line 164 of file WGETextureHud.cpp.
References m_viewport.
|
protected |
The viewport in texture space to allow viewing parts of the texture.
Definition at line 231 of file WGETextureHud.h.
Referenced by coupleViewportWithTextureViewport(), and WGETextureHud::SafeUpdateCallback::operator()().
|
protected |
The group Node where all those texture reside in.
Theoretically, it is nonsense to use a separate group inside a osg::Projection since it also is a group node. But WGEGroupNode offers all those nice and thread-safe insert/remove methods.
Definition at line 211 of file WGETextureHud.h.
Referenced by addTexture(), removeTexture(), and WGETextureHud().
|
protected |
The maximum element width.
Definition at line 216 of file WGETextureHud.h.
Referenced by getMaxElementWidth(), and setMaxElementWidth().
|
protected |
The render bin to use.
Definition at line 221 of file WGETextureHud.h.
Referenced by getRenderBin(), and WGETextureHud().
|
protected |
The current viewport of.
Definition at line 226 of file WGETextureHud.h.
Referenced by WGETextureHud::SafeUpdateCallback::operator()(), and setViewport().