OpenWalnut  1.4.0
Classes | Public Member Functions | Protected Attributes
WGETextureHud Class Reference

This class implements a HUD showing several textures on screen. More...

#include <WGETextureHud.h>

+ Inheritance diagram for WGETextureHud:

List of all members.

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.
virtual ~WGETextureHud ()
 Destructor.
void addTexture (osg::ref_ptr< WGETextureHudEntry > texture)
 Adds the specified HUD element to the HUD.
void removeTexture (osg::ref_ptr< WGETextureHudEntry > texture)
 Remove the texture from the HUD.
void removeTexture (osg::ref_ptr< osg::Texture > texture)
 Remove the texture from the HUD.
unsigned int getMaxElementWidth () const
 Gets the maximum width of a tex element.
void setMaxElementWidth (unsigned int width)
 Sets the new maximum width of a texture column.
void setViewport (osg::Viewport *viewport)
 Sets the viewport of the camera housing this HUD.
void coupleViewportWithTextureViewport (bool couple=true)
 Set the viewport to be used for textures too.
size_t getRenderBin () const
 Returns the render bin used by the HUD.

Protected Attributes

osg::ref_ptr< WGEGroupNodem_group
 The group Node where all those texture reside in.
unsigned int m_maxElementWidth
 The maximum element width.
size_t m_renderBin
 The render bin to use.
osg::Viewport * m_viewport
 The current viewport of.
bool m_coupleTexViewport
 The viewport in texture space to allow viewing parts of the texture.

Detailed Description

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.


Constructor & Destructor Documentation

Default constructor.

Definition at line 42 of file WGETextureHud.cpp.

References m_group, and m_renderBin.

Destructor.

Definition at line 55 of file WGETextureHud.cpp.


Member Function Documentation

void WGETextureHud::addTexture ( osg::ref_ptr< WGETextureHudEntry texture)

Adds the specified HUD element to the HUD.

Parameters:
texturethe texture to show.

Definition at line 119 of file WGETextureHud.cpp.

References m_group.

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.

Parameters:
coupleif true, the viewport set by setViewport gets also used for texture space.

Definition at line 170 of file WGETextureHud.cpp.

References m_coupleTexViewport.

unsigned int WGETextureHud::getMaxElementWidth ( ) const

Gets the maximum width of a tex element.

Returns:
the maximum width.

Definition at line 306 of file WGETextureHud.cpp.

References m_maxElementWidth.

Referenced by WGETextureHud::SafeUpdateCallback::operator()().

Returns the render bin used by the HUD.

Returns:
the bin number

Definition at line 321 of file WGETextureHud.cpp.

References m_renderBin.

void WGETextureHud::removeTexture ( osg::ref_ptr< WGETextureHudEntry texture)

Remove the texture from the HUD.

Parameters:
texturethe texture to remove.

Definition at line 124 of file WGETextureHud.cpp.

References m_group.

void WGETextureHud::removeTexture ( osg::ref_ptr< osg::Texture >  texture)

Remove the texture from the HUD.

Parameters:
texturethe texture to remove.

Definition at line 151 of file WGETextureHud.cpp.

References m_group.

void WGETextureHud::setMaxElementWidth ( unsigned int  width)

Sets the new maximum width of a texture column.

Parameters:
widththe new width

Definition at line 311 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.

Parameters:
viewportthe viewport

Definition at line 165 of file WGETextureHud.cpp.

References m_viewport.


Member Data Documentation

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()().

osg::ref_ptr< WGEGroupNode > WGETextureHud::m_group [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().

unsigned int WGETextureHud::m_maxElementWidth [protected]

The maximum element width.

Definition at line 216 of file WGETextureHud.h.

Referenced by getMaxElementWidth(), and setMaxElementWidth().

The render bin to use.

Definition at line 221 of file WGETextureHud.h.

Referenced by getRenderBin(), and WGETextureHud().

osg::Viewport* WGETextureHud::m_viewport [protected]

The current viewport of.

Definition at line 226 of file WGETextureHud.h.

Referenced by WGETextureHud::SafeUpdateCallback::operator()(), and setViewport().


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