VR-Forces 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
 
 DtOsgWidgetLabel (const DtOsgWidgetLabel &&other)=delete
 
DtOsgWidgetLabeloperator= (const DtOsgWidgetLabel &&other)=delete
 
virtual void setParentId (DtUniqueID id) override
 
virtual void setOverlay (unsigned int layer) override
 
virtual unsigned int overlay () const override
 
virtual void setOrderGroup (unsigned int group) override
 
virtual unsigned int orderGroup () const override
 
virtual void setPosition (float x, float y, float z, float w=0) override
 
virtual void setText (const DtUnicode &string) override
 
virtual void setFont (const std::string &font, float size) override
 
virtual void setFontScale (float scale) override
 
virtual float fontScale (double minimumAltitudeForUse=std::numeric_limits< double >::min()) const override
 
virtual void setAltitudeBasedConfigurations (const makArchives::DtAltitudeBasedScaleConfigurationRecordCollection &configs) override
 
virtual void clearAltitudeBasedConfigurations () override
 
virtual void setIsForcedAltitudeBasedFontScaleEnabled (bool isEnabled) override
 
virtual void setBaseAltitudeToUseForForcedFontScale (double minimumAltitudeForUse) override
 
virtual void setLodOutAltitude (double lodOutAltitude) override
 
virtual void setIsLodOutAltitudeEnabled (bool isLodOutAltitudeEnabled) override
 
virtual bool isLodOutAltitudeEnabled () const override
 
virtual void setBackgroundImage (const std::string &filename) override
 
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) override
 
virtual void setColor (float r, float g, float b, float a) override
 
virtual void setOriginOffset (int xOffset, int yOffset) override
 
virtual void setSize (float w, float h) override
 
virtual void getSize (float &width, float &height) override
 
virtual void setPadding (float paddingX, float paddingY) override
 
virtual void setModelDefinition (const std::string &str) override
 
virtual void setTextHorizontalAlignmentPolicy (DtWidgetLabel::TextHorizontalAlignmentPolicy ha) override
 
virtual void setOriginPlacementPolicy (DtWidgetLabel::OriginPlacementPolicy gcp) override
 
virtual void setEventsEnabled (bool enabled) override
 
virtual void setVisible (bool visible) override
 
virtual void setBoundsLength (int len) override
 
virtual void setRotation (float angle) override
 
virtual double getRotation () const override
 
virtual void setIsRotationInScreenSpace (bool isRotationInScreenSpace) override
 
virtual bool isRotationInScreenSpace () const override
 
virtual void setMaximumWorldHeight (double worldHeightInMeters) override
 
virtual double maximumWorldHeight () const override
 
virtual void setMaximumWorldWidth (double worldWidthInMeters) override
 
virtual double maximumWorldWidth () const override
 
virtual void setTextBoundsPolicy (TextBoundsPolicy) override
 
- 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
 
 DtWidgetLabel (const DtWidgetLabel &&other)=delete
 
DtWidgetLabeloperator= (const DtWidgetLabel &&other)=delete
 
virtual void setTextBoundsPolicy (TextBoundsPolicy)=0
 
- Public Member Functions inherited from makVrv::DtWidget
 DtWidget (DtDe &de, DtUniqueID id)
 
virtual ~DtWidget ()
 
 DtWidget (const DtWidget &other)=delete
 
DtWidgetoperator= (const DtWidget &other)=delete
 
 DtWidget (const DtWidget &&other)=delete
 
DtWidgetoperator= (const DtWidget &&other)=delete
 
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
 
virtual void registerUpdater (DtWidgetUpdater *updater)
 
virtual void unregisterUpdater (DtWidgetUpdater *updater)
 
virtual DtWidgetUpdaterupdater ()
 

Protected Member Functions

virtual void updateBounds (bool calculateText)
 
virtual void updateFont ()
 
virtual void updateEventSignals () override
 

Protected Attributes

DtOsgTextureWrappermyTexture
 
DtSpritemySprite
 
DtTextProxyInterfacemyText
 
unsigned int myOverlay
 
float myWidth
 
float myHeight
 
float myPaddingX
 
float myPaddingY
 
float myRotation
 
unsigned int myGroup
 
double myMaximumWorldWidth
 
double myMaximumWorldHeight
 
bool myIsRotationInScreenSpace
 
bool myIsLodOutAltitudeEnabled
 
double myLodOutAltitude
 
std::string myFontFile
 
makArchives::DtAltitudeBasedScaleConfigurationRecordCollection myFontScaleFromMinimumAltitudeVector
 
std::vector< DtBoundingBoxmyTextBoundsCache
 
std::vector< float > myFontLineHeightCache
 
int myFontSize
 
int myBoundsLength
 
OriginPlacementPolicy myOriginPlacementPolicy
 
TextBoundsPolicy myTextBoundsPolicy
 
DtUnicode myString
 
int myOriginXOffset
 
int myOriginYOffset
 
- Protected Attributes inherited from makVrv::DtWidget
DtDemyDe
 
DtUniqueID myId
 
DtUniqueID myParentId
 
DtSignalConnectionManager mySignalConnectionManager
 
DtWidgetUpdatermyUpdater
 

Additional Inherited Members

- Public Types inherited from makVrv::DtWidgetLabel
enum  TextHorizontalAlignmentPolicy { TextHorizontalAlignmentPolicy::AlignLeft, TextHorizontalAlignmentPolicy::AlignCenter, TextHorizontalAlignmentPolicy::AlignRight, TextHorizontalAlignmentPolicy::AlignJustify }
 
enum  OriginPlacementPolicy {
  OriginPlacementPolicy::BottomLeft, OriginPlacementPolicy::BottomRight, OriginPlacementPolicy::BottomMiddle, OriginPlacementPolicy::LeftMiddle,
  OriginPlacementPolicy::RightMiddle, OriginPlacementPolicy::Center, OriginPlacementPolicy::BelowBottomLeftByLineHeight, OriginPlacementPolicy::BelowBottomLeftByHalfLineHeight,
  OriginPlacementPolicy::BelowBottomRightByLineHeight, OriginPlacementPolicy::BelowBottomRightByHalfLineHeight, OriginPlacementPolicy::OffsetFromBottomLeftByBounds, OriginPlacementPolicy::OffsetFromBottomRightByBounds
}
 
enum  TextBoundsPolicy { TextBoundsPolicy::ConstrainToLine, TextBoundsPolicy::ConstrainToBounds, TextBoundsPolicy::ConstrainToText, TextBoundsPolicy::ConstrainToNone }
 
- 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.

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

Move Constructor not implemented - Move not allowed.

Member Function Documentation

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

Assignment Operator not implemented - Assignment not allowed.

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

Move Assignment Operator not implemented - Move Assignment not allowed.

virtual void makVrv::DtOsgWidgetLabel::setParentId ( DtUniqueID  id)
overridevirtual

Set the parent id.

Reimplemented from makVrv::DtWidget.

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

Sets the z layer of the widget.

Implements makVrv::DtWidget.

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

Gets the overlay of the widget.

Implements makVrv::DtWidget.

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

Sets the overlay of the widget.

Implements makVrv::DtWidget.

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

Gets the overlay of the widget.

Implements makVrv::DtWidget.

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

Set the position of the widget in screen space.

Implements makVrv::DtWidget.

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

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 
)
overridevirtual

Sets the font size.

Implements makVrv::DtWidgetLabel.

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

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
overridevirtual

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::DtAltitudeBasedScaleConfigurationRecordCollection configs)
overridevirtual

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

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)
overridevirtual

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)
overridevirtual

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)
overridevirtual

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)
overridevirtual

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 bool makVrv::DtOsgWidgetLabel::isLodOutAltitudeEnabled ( ) const
overridevirtual

Get whether or not this label widget will use the LOD Out Altitude property.

Implements makVrv::DtWidgetLabel.

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

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 
)
overridevirtual

Set the text color.

Implements makVrv::DtWidgetLabel.

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

Set the color of the widget.

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setOriginOffset ( int  xOffset,
int  yOffset 
)
overridevirtual

Set the offset in pixels from the position.

Implements makVrv::DtWidget.

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

Sets the size of the widget in overlay coordinate space.

Implements makVrv::DtWidgetLabel.

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

Returns the size of the widget set by setSize.

Implements makVrv::DtWidgetLabel.

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

Sets the size of the widget in overlay coordinate space.

Implements makVrv::DtWidget.

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

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

Implements makVrv::DtWidget.

virtual void makVrv::DtOsgWidgetLabel::setTextHorizontalAlignmentPolicy ( DtWidgetLabel::TextHorizontalAlignmentPolicy  ha)
overridevirtual

Set the text's alignment.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setOriginPlacementPolicy ( DtWidgetLabel::OriginPlacementPolicy  gcp)
overridevirtual

Sets the policy for how the glyph is located with respect to its position.

Implements makVrv::DtWidgetLabel.

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

Enable or disable event handling for this widget.

Implements makVrv::DtWidget.

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

Set the widget visible or hidden.

Implements makVrv::DtWidget.

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

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)
overridevirtual

Sets the rotation, in screen space or in world space, applied to the label.

See Also
setIsRotationInScreenSpace(bool)

Implements makVrv::DtWidgetLabel.

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

Return the current rotation, in screen space or in world space.

See Also
isRotationInScreenSpace()

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setIsRotationInScreenSpace ( bool  isRotationInScreenSpace)
overridevirtual

Set whether or not the rotation of the text object is in screen space. If rotation is in screen space, a 0 degrees rotation means the top of the user's computer monitor. If rotation is not in screen space, it is in world space with a 0 degrees rotation meaning the direction of True North. Default is true.

See Also
setRotation(float)

Implements makVrv::DtWidgetLabel.

virtual bool makVrv::DtOsgWidgetLabel::isRotationInScreenSpace ( ) const
overridevirtual

Get whether or not the rotation of the text object is in screen space.

See Also
getRotation(float)

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setMaximumWorldHeight ( double  worldHeightInMeters)
overridevirtual

Set the maximum world-space width for the this widget, in meters. Once the widget exceeds the maximum world-space height, the widget will not be rendered. To disable this mechanism altogether (for height), set this property to -1.0. By default, this property is set to -1.0 (and as a result this mechanism is unused by default).

Implements makVrv::DtWidgetLabel.

virtual double makVrv::DtOsgWidgetLabel::maximumWorldHeight ( ) const
overridevirtual

Returns the maximum world-space height for the this widget, in meters.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setMaximumWorldWidth ( double  worldWidthInMeters)
overridevirtual

Set the maximum world-space width for the this proxy, in meters. Once the widget exceeds the maximum world-space width the widget will not be rendered. To disable this mechanism altogether (for width), set this property to -1.0. By default, this property is set to -1.0 (and as a result this mechanism is unused by default).

Implements makVrv::DtWidgetLabel.

virtual double makVrv::DtOsgWidgetLabel::maximumWorldWidth ( ) const
overridevirtual

Returns the maximum world-space width for the this widget, in meters.

Implements makVrv::DtWidgetLabel.

virtual void makVrv::DtOsgWidgetLabel::setTextBoundsPolicy ( TextBoundsPolicy  )
overridevirtual

Sets the Text Bounds Policy for the label. The default is ConstrainToLine.

virtual void makVrv::DtOsgWidgetLabel::updateBounds ( bool  calculateText)
protectedvirtual
virtual void makVrv::DtOsgWidgetLabel::updateFont ( )
protectedvirtual
virtual void makVrv::DtOsgWidgetLabel::updateEventSignals ( )
overrideprotectedvirtual

Disconnect all signals on the signal manager, and reconnects if the pickable widget has events enabled.

Implements makVrv::DtWidget.

Member Data Documentation

DtOsgTextureWrapper* makVrv::DtOsgWidgetLabel::myTexture
protected
DtSprite* makVrv::DtOsgWidgetLabel::mySprite
protected
DtTextProxyInterface* makVrv::DtOsgWidgetLabel::myText
protected
unsigned int makVrv::DtOsgWidgetLabel::myOverlay
protected
float makVrv::DtOsgWidgetLabel::myWidth
protected
float makVrv::DtOsgWidgetLabel::myHeight
protected
int makVrv::DtOsgWidgetLabel::myOriginXOffset
protected

Pixels.

int makVrv::DtOsgWidgetLabel::myOriginYOffset
protected

Pixels.

float makVrv::DtOsgWidgetLabel::myPaddingX
protected
float makVrv::DtOsgWidgetLabel::myPaddingY
protected
float makVrv::DtOsgWidgetLabel::myRotation
protected
unsigned int makVrv::DtOsgWidgetLabel::myGroup
protected
double makVrv::DtOsgWidgetLabel::myMaximumWorldWidth
protected
double makVrv::DtOsgWidgetLabel::myMaximumWorldHeight
protected
bool makVrv::DtOsgWidgetLabel::myIsRotationInScreenSpace
protected
bool makVrv::DtOsgWidgetLabel::myIsLodOutAltitudeEnabled
protected
double makVrv::DtOsgWidgetLabel::myLodOutAltitude
protected
std::string makVrv::DtOsgWidgetLabel::myFontFile
protected
makArchives::DtAltitudeBasedScaleConfigurationRecordCollection makVrv::DtOsgWidgetLabel::myFontScaleFromMinimumAltitudeVector
protected
std::vector<DtBoundingBox> makVrv::DtOsgWidgetLabel::myTextBoundsCache
protected
std::vector<float> makVrv::DtOsgWidgetLabel::myFontLineHeightCache
protected
int makVrv::DtOsgWidgetLabel::myFontSize
protected
int makVrv::DtOsgWidgetLabel::myBoundsLength
protected
OriginPlacementPolicy makVrv::DtOsgWidgetLabel::myOriginPlacementPolicy
protected
TextBoundsPolicy makVrv::DtOsgWidgetLabel::myTextBoundsPolicy
protected
DtUnicode makVrv::DtOsgWidgetLabel::myString
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)