25 #ifndef WGETEXTUREHUD_H
26 #define WGETEXTUREHUD_H
31 #include <boost/thread.hpp>
33 #include <osg/Projection>
35 #include <osg/Texture2D>
37 #include <osgText/Text>
39 #include "WGEGroupNode.h"
72 WGETextureHudEntry( osg::ref_ptr< osg::Texture2D > texture, std::string name,
bool transparency =
false );
112 osg::ref_ptr< osg::Texture2D >
getTexture()
const;
153 void addTexture( osg::ref_ptr< WGETextureHudEntry > texture );
160 void removeTexture( osg::ref_ptr< WGETextureHudEntry > texture );
255 virtual void operator()( osg::Node* node, osg::NodeVisitor* nv );
Callback which aligns and renders the textures.
SafeUpdateCallback(WGETextureHud *hud)
Constructor.
WGETextureHud * m_hud
Pointer used to access members of the hud.
virtual void operator()(osg::Node *node, osg::NodeVisitor *nv)
operator () - called during the update traversal.
Class implementing one texture HUD entry representing a texture in the HUD.
osg::ref_ptr< osg::Texture2D > getTexture() const
Gets the texture associated with the entry.
~WGETextureHudEntry()
Destructor.
std::string m_name
The name for this HUD entry.
osgText::Text * m_label
The label text.
std::string getName() const
Returns the name of the entry.
unsigned int getRealHeight() const
Returns the real height of the contained texture.
osg::ref_ptr< osg::Texture2D > m_texture
The texture.
osg::ref_ptr< osg::TexMat > getTextureMatrix() const
Get the texture matrix state for this entry.
unsigned int getRealWidth() const
Returns the real width of the contained texture.
float m_maxTextWidth
Mqx text width.
WGETextureHudEntry(osg::ref_ptr< osg::Texture2D > texture, std::string name, bool transparency=false)
Constructor.
void setMaxTextWidth(float width)
Set maximum text width.
osg::ref_ptr< osg::TexMat > m_texMat
The texture matrix for this entry.
This class implements a HUD showing several textures on screen.
virtual ~WGETextureHud()
Destructor.
void removeTexture(osg::ref_ptr< WGETextureHudEntry > texture)
Remove the texture from the HUD.
osg::Viewport * m_viewport
The current viewport of.
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.
unsigned int getMaxElementWidth() const
Gets the maximum width of a tex element.
void addTexture(osg::ref_ptr< WGETextureHudEntry > texture)
Adds the specified HUD element to the HUD.
unsigned int m_maxElementWidth
The maximum element width.
void setMaxElementWidth(unsigned int width)
Sets the new maximum width of a texture column.
bool m_coupleTexViewport
The viewport in texture space to allow viewing parts of the texture.
osg::ref_ptr< WGEGroupNode > m_group
The group Node where all those texture reside in.
size_t m_renderBin
The render bin to use.
WGETextureHud()
Default constructor.