VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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.

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

Public Member Functions

 DtOsgWidgetLabel (DtDe &de, DtUniqueID id)
 
virtual ~DtOsgWidgetLabel ()
 
 DtOsgWidgetLabel ()=delete
 
 DtOsgWidgetLabel (const DtOsgWidgetLabel &other)=delete
 
DtOsgWidgetLabeloperator= (const DtOsgWidgetLabel &other)=delete
 
virtual void setOverlay (unsigned int layer)
 
virtual unsigned int overlay () const
 
virtual void setOrderGroup (unsigned int group)
 
virtual unsigned int orderGroup () const
 
virtual void setPosition (float x, float y, float z, float w=0)
 
virtual void setText (const DtUnicode &string)
 
virtual void setFont (const std::string &font, float size)
 
virtual void setFontScale (float scale)
 
virtual float fontScale (double minimumAltitudeForUse=std::numeric_limits< double >::min()) const
 
virtual void setAltitudeBasedConfigurations (const makArchives::DtDynamicScaleConfigurationCollection &configs)
 
virtual void clearAltitudeBasedConfigurations ()
 
virtual void setIsForcedAltitudeBasedFontScaleEnabled (bool isEnabled)
 
virtual void setBaseAltitudeToUseForForcedFontScale (double minimumAltitudeForUse)
 
virtual void setLodOutAltitude (double lodOutAltitude)
 
virtual void setIsLodOutAltitudeEnabled (bool isLodOutAltitudeEnabled)
 
virtual void setBackgroundImage (const std::string &filename)
 
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)
 
virtual void setColor (float r, float g, float b, float a)
 
virtual void setOrigin (float originX, float originY)
 
virtual void setSize (float w, float h)
 
virtual void getSize (float &width, float &height)
 
virtual void setPadding (float paddingX, float paddingY)
 
virtual void setModelDefinition (const std::string &str)
 
virtual void setTextAlignment (DtWidgetLabel::HorizontalAlignment ha)
 
virtual void setGlyphCenterPolicy (DtWidgetLabel::GlyphCenterPolicy gcp)
 
virtual void setEventsEnabled (bool enabled)
 
virtual void setVisible (bool visible)
 
virtual void setBoundsLength (int len)
 
virtual void setRotation (float angle)
 
virtual double getRotation () const
 
virtual void setSizeConstraints (SizeConstraints)
 
- Public Member Functions inherited from makVrv::DtWidgetLabel
 DtWidgetLabel (DtDe &de, DtUniqueID id)
 
virtual ~DtWidgetLabel ()
 
 DtWidgetLabel ()=delete
 
 DtWidgetLabel (const DtWidgetLabel &other)=delete
 
DtWidgetLabeloperator= (const DtWidgetLabel &other)=delete
 
- Public Member Functions inherited from makVrv::DtWidget
 DtWidget (DtDe &de, DtUniqueID id)
 
virtual ~DtWidget ()
 
virtual void setParentId (DtUniqueID id)
 
virtual void setAltitudeSpecificSizes (const DtWidget::DtDynamicSizeConfigurationCollection &configs)
 
virtual void clearAltitudeSpecificSizes ()
 
virtual void setIsForcedSizeByAltitudeEnabled (bool enabled)
 
virtual void setAltitudeForForcedSize (double minimumAltitudeForUse)
 
virtual DtUniqueID id () const
 
virtual DtUniqueID parentId () const
 

Protected Member Functions

virtual void updateBounds (bool calculateText)
 
virtual void updateTextBounds (DtBoundingBox box, bool calculateText, double altitude)
 
virtual void updateFont ()
 

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
 
std::string myFontFile
 
makArchives::DtDynamicScaleConfigurationCollection myFontScaleFromMinimumAltitudeVector
 
int myFontSize
 
int myBoundsLength
 
GlyphCenterPolicy myCenterPolicy
 
SizeConstraints mySizeConstraints
 
- Protected Attributes inherited from makVrv::DtWidget
DtDemyDe
 
DtUniqueID myId
 
DtUniqueID myParentId
 

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 }
 
- Public Types inherited from makVrv::DtWidget
typedef std::vector
< DtDynamicSizeConfiguration
DtDynamicSizeConfigurationCollection
 

Constructor & Destructor Documentation

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

CTOR.

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

Virtual DTOR.

makVrv::DtOsgWidgetLabel::DtOsgWidgetLabel ( )
delete

Default Constructor not implemented.

makVrv::DtOsgWidgetLabel::DtOsgWidgetLabel ( const DtOsgWidgetLabel other)
delete

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtOsgWidgetLabel& makVrv::DtOsgWidgetLabel::operator= ( const DtOsgWidgetLabel other)
delete

Assignment Operator not implemented - Assignment not allowed.

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. This will multiply the font size times the scale to get an effective font size. Allows for scaling of font without changing font size. Akin to calling setFontScaleByMinimumAltitude(scale).

Implements makVrv::DtWidgetLabel.

virtual float makVrv::DtOsgWidgetLabel::fontScale ( double  minimumAltitudeForUse = std::numeric_limits< double >::min()) const
virtual

Gets the font scale to use based on the current altitude of the observer rendering the label.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setAltitudeBasedConfigurations ( const makArchives::DtDynamicScaleConfigurationCollection configs)
virtual

Set an altitude-specific (meters) font scale for the label. This will multiply the font size times the scale to get an effective font size. Allows for 1) scaling of font without changing font size and 2) the use of different font scales depending on the altitude of the camera rendering the label.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::clearAltitudeBasedConfigurations ( )
virtual

Clear altitude-specific fonts, if any were defined. Altitude-specific fonts are defined using setFontScaleByMinimumAltitude(...).

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setIsForcedAltitudeBasedFontScaleEnabled ( bool  isEnabled)
virtual

Set whether or not a particular font scale is used, regardless of altitude. This only matters if altitude-specific font scales are used. The font scale used is provided by the altitude-specific configuration corresponding to the altitude provided using: setBaseAltitudeToUseForForcedFontScale(...)

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setBaseAltitudeToUseForForcedFontScale ( double  minimumAltitudeForUse)
virtual

Set the altitude, in meters, to use when determining the forced font scale. This is only used if setIsForcedAltitudeBasedFontScaleEnabled(true).

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setLodOutAltitude ( double  lodOutAltitude)
virtual

Set the altitude, in meters, at which this label will no longer appear. This is only used if setIsLodOutAltitudeEnabled(true).

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setIsLodOutAltitudeEnabled ( bool  isLodOutAltitudeEnabled)
virtual

Set whether or not this label widget will use the LOD Out Altitude property. The LOD Out Altitude property is set using setLodOutAltitude(...).

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.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::updateBounds ( bool  calculateText)
protectedvirtual
virtual void makVrv::DtOsgWidgetLabel::updateTextBounds ( DtBoundingBox  box,
bool  calculateText,
double  altitude 
)
protectedvirtual
virtual void makVrv::DtOsgWidgetLabel::updateFont ( )
protectedvirtual

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
std::string makVrv::DtOsgWidgetLabel::myFontFile
protected
makArchives::DtDynamicScaleConfigurationCollection makVrv::DtOsgWidgetLabel::myFontScaleFromMinimumAltitudeVector
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)