VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtOsgWidgetLabel Class Reference

The osg implementation of a label. More...

Inheritance diagram for makVrv::DtOsgWidgetLabel:
Inheritance graph
[legend]

Public Member Functions

 DtOsgWidgetLabel (DtDe &de, DtUniqueID id)
 CTOR.
virtual ~DtOsgWidgetLabel ()
 Virtual DTOR.
virtual void setOverlay (unsigned int layer)
 Sets the z layer of the widget.
virtual unsigned int overlay () const
 Gets the overlay of the widget.
virtual void setOrderGroup (unsigned int group)
 Sets the overlay of the widget.
virtual unsigned int orderGroup () const
 Gets the overlay of the widget.
virtual void setPosition (float x, float y, float z, float w=0)
 Set the position of the widget in screen space.
virtual void setText (const DtUnicode &string)
 Set the labels string.
virtual void setFont (const std::string &font, float size)
 Sets the font size.
virtual void setFontScale (float scale)
 Set the font scale for the label.
virtual float fontScale () const
 Gets the font scale.
virtual void setBackgroundImage (const std::string &filename)
 Set the background image.
virtual void setBackgroundImage (const std::string &filename, float left, float right, float bottom, float top)
virtual void setTextColor (float r, float g, float b, float a)
 Set the text color.
virtual void setColor (float r, float g, float b, float a)
 Set the color of the widget.
virtual void setOrigin (float originX, float originY)
 Sets the origin location, by default it is 0,0.
virtual void setSize (float w, float h)
 Sets the size of the widget in overlay coordinate space.
virtual void getSize (float &width, float &height)
 Returns the size of the widget set by setSize.
virtual void setPadding (float paddingX, float paddingY)
 Sets the size of the widget in overlay coordinate space.
virtual void setModelDefinition (const std::string &str)
 Set the widget's model definition ("theme")
virtual void setTextAlignment (DtWidgetLabel::HorizontalAlignment ha)
 Set the text's alignment.
virtual void setGlyphCenterPolicy (DtWidgetLabel::GlyphCenterPolicy gcp)
 Sets the policy for how the glyph is located wrt its origin.
virtual void setEventsEnabled (bool enabled)
 Enable or disable event handling for this widget.
virtual void setVisible (bool visible)
 Set the widget visible or hidden.
virtual void setBoundsLength (int len)
 Sets the length of the string to check when determining bounds.
virtual void setRotation (float angle)
 Sets the rotation applied to the label.
virtual double getRotation () const
 Return the current rotation.
virtual void setSizeConstraints (SizeConstraints)
 Sets the constraint of the text box.
- Public Member Functions inherited from makVrv::DtWidgetLabel
 DtWidgetLabel (DtDe &de, DtUniqueID id)
 A widget label CTOR.
virtual ~DtWidgetLabel ()
 DTOR.
virtual void setSizeConstraints (SizeConstraints)=0
 Sets the constraint of the text box.
- Public Member Functions inherited from makVrv::DtWidget
 DtWidget (DtDe &de, DtUniqueID id)
virtual ~DtWidget ()
virtual void setParentId (DtUniqueID id)
 Set the parent id.

Protected Member Functions

void updateBounds (bool calculateText)
void updateTextBounds (DtBoundingBox box, bool calculateText)
void updateFont (const std::string &font)

Protected Attributes

osg::ref_ptr< osg::Texture > myTexture
DtSpritemySprite
DtTextProxymyText
DtBoundingBox myTextBounds
unsigned int myOverlay
float myWidth
float myHeight
float myOriginX
float myOriginY
float myPaddingX
float myPaddingY
float myRotation
unsigned int myGroup
float myFontScale
int myFontSize
int myBoundsLength
GlyphCenterPolicy myCenterPolicy
SizeConstraints mySizeConstraints

Additional Inherited Members

- Public Types inherited from makVrv::DtWidgetLabel
enum  HorizontalAlignment { AlignLeft, AlignCenter, AlignRight, AlignJustify }
enum  GlyphCenterPolicy {
  CenterNone, CenterHorizontal, CenterVertical, CenterBoth,
  AlignToTextHeight
}
enum  SizeConstraints { ConstrainToText, ConstrainToBounds }

Detailed Description

The osg implementation of a label.

Constructor & Destructor Documentation

makVrv::DtOsgWidgetLabel::DtOsgWidgetLabel ( DtDe de,
DtUniqueID  id 
)

CTOR.

virtual makVrv::DtOsgWidgetLabel::~DtOsgWidgetLabel ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual void makVrv::DtOsgWidgetLabel::setOverlay ( unsigned int  layer)
virtual

Sets the z layer of the widget.

Implements makVrv::DtWidget.

virtual unsigned int makVrv::DtOsgWidgetLabel::overlay ( ) const
virtual

Gets the overlay of the widget.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setOrderGroup ( unsigned int  group)
virtual

Sets the overlay of the widget.

Implements makVrv::DtWidget.

virtual unsigned int makVrv::DtOsgWidgetLabel::orderGroup ( ) const
virtual

Gets the overlay of the widget.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setPosition ( float  x,
float  y,
float  z,
float  w = 0 
)
virtual

Set the position of the widget in screen space.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setText ( const DtUnicode string)
virtual

Set the labels string.

Labels support multi lines when the string contains new line characters.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setFont ( const std::string &  font,
float  size 
)
virtual

Sets the font size.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setFontScale ( float  scale)
virtual

Set the font scale for the label.

Implements makVrv::DtWidgetLabel.

virtual float makVrv::DtOsgWidgetLabel::fontScale ( ) const
virtual

Gets the font scale.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setBackgroundImage ( const std::string &  filename)
virtual

Set the background image.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setBackgroundImage ( const std::string &  filename,
float  left,
float  right,
float  bottom,
float  top 
)
virtual
virtual void makVrv::DtOsgWidgetLabel::setTextColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the text color.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color of the widget.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setOrigin ( float  originX,
float  originY 
)
virtual

Sets the origin location, by default it is 0,0.

The origin can be used to specify a offset from the position.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setSize ( float  w,
float  h 
)
virtual

Sets the size of the widget in overlay coordinate space.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::getSize ( float &  width,
float &  height 
)
virtual

Returns the size of the widget set by setSize.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setPadding ( float  paddingX,
float  paddingY 
)
virtual

Sets the size of the widget in overlay coordinate space.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setModelDefinition ( const std::string &  str)
virtual

Set the widget's model definition ("theme")

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setTextAlignment ( DtWidgetLabel::HorizontalAlignment  ha)
virtual

Set the text's alignment.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setGlyphCenterPolicy ( DtWidgetLabel::GlyphCenterPolicy  gcp)
virtual

Sets the policy for how the glyph is located wrt its origin.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setEventsEnabled ( bool  enabled)
virtual

Enable or disable event handling for this widget.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setVisible ( bool  visible)
virtual

Set the widget visible or hidden.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setBoundsLength ( int  len)
virtual

Sets the length of the string to check when determining bounds.

This is useful when needing text to line up.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setRotation ( float  angle)
virtual

Sets the rotation applied to the label.

Implements makVrv::DtWidgetLabel.

virtual double makVrv::DtOsgWidgetLabel::getRotation ( ) const
virtual

Return the current rotation.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setSizeConstraints ( SizeConstraints  )
virtual

Sets the constraint of the text box.

SizeToText is default. SizeToBounds will bound text to values set in setSize

void makVrv::DtOsgWidgetLabel::updateBounds ( bool  calculateText)
protected
void makVrv::DtOsgWidgetLabel::updateTextBounds ( DtBoundingBox  box,
bool  calculateText 
)
protected
void makVrv::DtOsgWidgetLabel::updateFont ( const std::string &  font)
protected

Member Data Documentation

osg::ref_ptr<osg::Texture> makVrv::DtOsgWidgetLabel::myTexture
protected
DtSprite* makVrv::DtOsgWidgetLabel::mySprite
protected
DtTextProxy* makVrv::DtOsgWidgetLabel::myText
protected
DtBoundingBox makVrv::DtOsgWidgetLabel::myTextBounds
protected
unsigned int makVrv::DtOsgWidgetLabel::myOverlay
protected
float makVrv::DtOsgWidgetLabel::myWidth
protected
float makVrv::DtOsgWidgetLabel::myHeight
protected
float makVrv::DtOsgWidgetLabel::myOriginX
protected
float makVrv::DtOsgWidgetLabel::myOriginY
protected
float makVrv::DtOsgWidgetLabel::myPaddingX
protected
float makVrv::DtOsgWidgetLabel::myPaddingY
protected
float makVrv::DtOsgWidgetLabel::myRotation
protected
unsigned int makVrv::DtOsgWidgetLabel::myGroup
protected
float makVrv::DtOsgWidgetLabel::myFontScale
protected
int makVrv::DtOsgWidgetLabel::myFontSize
protected
int makVrv::DtOsgWidgetLabel::myBoundsLength
protected
GlyphCenterPolicy makVrv::DtOsgWidgetLabel::myCenterPolicy
protected
SizeConstraints makVrv::DtOsgWidgetLabel::mySizeConstraints
protected

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)