OpenWalnut  1.5.0dev
Classes | Public Member Functions | Protected Attributes | List of all members
WGETextureHud Class Reference

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

#include <WGETextureHud.h>

+ Inheritance diagram for WGETextureHud:
+ Collaboration diagram for WGETextureHud:

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< WGEGroupNodem_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...
 

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

◆ WGETextureHud()

WGETextureHud::WGETextureHud ( )

Default constructor.

Definition at line 41 of file WGETextureHud.cpp.

References m_group, and m_renderBin.

◆ ~WGETextureHud()

WGETextureHud::~WGETextureHud ( )
virtual

Destructor.

Definition at line 54 of file WGETextureHud.cpp.

Member Function Documentation

◆ addTexture()

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

Adds the specified HUD element to the HUD.

Parameters
texturethe texture to show.

Definition at line 118 of file WGETextureHud.cpp.

References m_group.

◆ coupleViewportWithTextureViewport()

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.

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

Definition at line 169 of file WGETextureHud.cpp.

References m_coupleTexViewport.

◆ getMaxElementWidth()

unsigned int WGETextureHud::getMaxElementWidth ( ) const

Gets the maximum width of a tex element.

Returns
the maximum width.

Definition at line 305 of file WGETextureHud.cpp.

References m_maxElementWidth.

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

+ Here is the caller graph for this function:

◆ getRenderBin()

size_t WGETextureHud::getRenderBin ( ) const

Returns the render bin used by the HUD.

Returns
the bin number

Definition at line 320 of file WGETextureHud.cpp.

References m_renderBin.

◆ removeTexture() [1/2]

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

Remove the texture from the HUD.

Parameters
texturethe texture to remove.

Definition at line 150 of file WGETextureHud.cpp.

References m_group.

◆ removeTexture() [2/2]

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

Remove the texture from the HUD.

Parameters
texturethe texture to remove.

Definition at line 123 of file WGETextureHud.cpp.

References m_group.

◆ setMaxElementWidth()

void WGETextureHud::setMaxElementWidth ( unsigned int  width)

Sets the new maximum width of a texture column.

Parameters
widththe new width

Definition at line 310 of file WGETextureHud.cpp.

References m_maxElementWidth.

◆ setViewport()

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 164 of file WGETextureHud.cpp.

References m_viewport.

Member Data Documentation

◆ m_coupleTexViewport

bool WGETextureHud::m_coupleTexViewport
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()().

◆ m_group

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

◆ m_maxElementWidth

unsigned int WGETextureHud::m_maxElementWidth
protected

The maximum element width.

Definition at line 216 of file WGETextureHud.h.

Referenced by getMaxElementWidth(), and setMaxElementWidth().

◆ m_renderBin

size_t WGETextureHud::m_renderBin
protected

The render bin to use.

Definition at line 221 of file WGETextureHud.h.

Referenced by getRenderBin(), and WGETextureHud().

◆ m_viewport

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: