VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgWidgetLabel.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <vrvCore/DtWidgetLabel.h>
15 
16 #include <vrvCore/DtBoundingBox.h>
17 
19 
20 #include <osg/ref_ptr>
21 #include <limits>
22 
23 namespace makVrv
24 {
25  class DtSprite;
26  class DtTextProxyInterface;
27  class DtOsgTextureWrapper;
28 
32  {
33  public:
34 
36  DtOsgWidgetLabel( DtDe& de, DtUniqueID id );
37 
39  virtual ~DtOsgWidgetLabel();
40 
42  DtOsgWidgetLabel() = delete;
43 
46  const DtOsgWidgetLabel &other) = delete;
47 
49  DtOsgWidgetLabel &operator=(
50  const DtOsgWidgetLabel &other) = delete;
51 
54  const DtOsgWidgetLabel&& other ) = delete;
55 
57  DtOsgWidgetLabel& operator=(
58  const DtOsgWidgetLabel&& other ) = delete;
59  public:
60 
62  virtual void setParentId( DtUniqueID id ) override;
63 
65  virtual void setOverlay( unsigned int layer ) override;
66 
68  virtual unsigned int overlay() const override;
69 
71  virtual void setOrderGroup( unsigned int group ) override;
72 
74  virtual unsigned int orderGroup() const override;
75 
77  virtual void setPosition( float x, float y, float z, float w = 0 ) override;
78 
81  virtual void setText( const DtUnicode& string ) override;
82 
84  virtual void setFont( const std::string& font, float size) override;
85 
90  virtual void setFontScale( float scale ) override;
91 
93  virtual float fontScale(double minimumAltitudeForUse = std::numeric_limits<double>::min()) const override;
94 
100  virtual void setAltitudeBasedConfigurations(
102 
105  virtual void clearAltitudeBasedConfigurations() override;
106 
112  virtual void setIsForcedAltitudeBasedFontScaleEnabled(bool isEnabled) override;
113 
116  virtual void setBaseAltitudeToUseForForcedFontScale(double minimumAltitudeForUse) override;
117 
120  virtual void setLodOutAltitude(double lodOutAltitude) override;
121 
125  virtual void setIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled) override;
126 
129  virtual bool isLodOutAltitudeEnabled() const override;
130 
132  virtual void setBackgroundImage( const std::string& filename ) override;
133  virtual void setBackgroundImage( const std::string& filename,
134  float left, float right, float bottom, float top );
135 
143  virtual void setSvgSource( const std::string& svgString ) override;
144 
151  virtual void setRasterSize( int widthPixels, int heightPixels ) override;
152 
154  virtual void setTextColor( float r,float g,float b, float a ) override;
155 
157  virtual void setColor( float r, float g, float b, float a ) override;
158 
160  virtual void setOriginOffset( int xOffset, int yOffset) override;
161 
163  virtual void setSize( float w, float h) override;
164 
166  virtual void getSize(float& width, float& height) override;
167 
169  virtual void setPadding( float paddingX, float paddingY ) override;
170 
172  virtual void setModelDefinition( const std::string& str ) override;
173 
175  virtual void setTextHorizontalAlignmentPolicy( DtWidgetLabel::TextHorizontalAlignmentPolicy ha ) override;
176 
178  virtual void setOriginPlacementPolicy( DtWidgetLabel::OriginPlacementPolicy gcp ) override;
179 
181  virtual void setEventsEnabled( bool enabled ) override;
182 
184  virtual void setVisible( bool visible ) override;
185 
188  virtual void setBoundsLength( int len ) override;
189 
192  virtual void setRotation( float angle ) override;
193 
196  virtual double getRotation() const override;
197 
204  virtual void setIsRotationInScreenSpace(bool isRotationInScreenSpace) override;
205 
208  virtual bool isRotationInScreenSpace() const override;
209 
214  virtual void setMaximumWorldHeight(double worldHeightInMeters) override;
215 
217  virtual double maximumWorldHeight() const override;
218 
223  virtual void setMaximumWorldWidth(double worldWidthInMeters) override;
224 
226  virtual double maximumWorldWidth() const override;
227 
230  virtual void setTextBoundsPolicy(TextBoundsPolicy) override;
231 
232  protected:
233 
234  virtual void updateBounds( bool calculateText ) ;
235  virtual void updateFont();
238  virtual void updateEventSignals() override;
239  protected:
240 
244  unsigned int myOverlay;
245  float myWidth;
246  float myHeight;
252  float myPaddingX;
253  float myPaddingY;
254  float myRotation;
255  unsigned int myGroup;
256 
259 
261 
264 
265  int myRasterWidth = 0;
266  int myRasterHeight = 0;
267 
268  std::string myFontFile;
270  std::vector<DtBoundingBox> myTextBoundsCache;
271  std::vector<float> myFontLineHeightCache;
273 
278  };
279 
280 }
Contains the DtAltitudeBasedScaleConfigurationRecord class declaration.
DT_DLL_readerWriter int getSize(const DtString &val)
The number of bytes required to encode the value.
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
double myMaximumWorldHeight
Definition: DtOsgWidgetLabel.h:258
DtOsgTextureWrapper * myTexture
Definition: DtOsgWidgetLabel.h:241
A synchronized Quad and Widget for a interactive visible 2D graphic.
Definition: DtSprite.h:26
Contains the makVrv::DtBoundingBox class declaration.
int myFontSize
Definition: DtOsgWidgetLabel.h:272
std::vector< float > myFontLineHeightCache
Definition: DtOsgWidgetLabel.h:271
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
OriginPlacementPolicy
Policy that determines where the origin of the label is.
Definition: DtWidgetLabel.h:40
TextBoundsPolicy myTextBoundsPolicy
Definition: DtOsgWidgetLabel.h:276
std::string myFontFile
Definition: DtOsgWidgetLabel.h:268
voidpf void uLong size
Definition: ioapi.h:39
double myMaximumWorldWidth
Definition: DtOsgWidgetLabel.h:257
float myPaddingX
Definition: DtOsgWidgetLabel.h:252
unsigned int myOverlay
Definition: DtOsgWidgetLabel.h:244
int myBoundsLength
Definition: DtOsgWidgetLabel.h:274
The osg implementation of a label.
Definition: DtOsgWidgetLabel.h:31
bool myIsLodOutAltitudeEnabled
Definition: DtOsgWidgetLabel.h:262
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
A class for controlling text owned by the TextRenderer.
Definition: DtTextProxyInterface.h:30
float myHeight
Definition: DtOsgWidgetLabel.h:246
Contains the makVrv::DtWidgetLabel class declaration.
This is the implementation independent widget class for showing text.
Definition: DtWidgetLabel.h:25
bool myIsRotationInScreenSpace
Definition: DtOsgWidgetLabel.h:260
OriginPlacementPolicy myOriginPlacementPolicy
Definition: DtOsgWidgetLabel.h:275
DtTextProxyInterface * myText
Definition: DtOsgWidgetLabel.h:243
TextBoundsPolicy
Policy that determines which bounds to use when rendering the text-portion of the label...
Definition: DtWidgetLabel.h:59
TextHorizontalAlignmentPolicy
Policy that determines how label is aligned within its bounds - only used when the Size Constraint Po...
Definition: DtWidgetLabel.h:31
Interface for a texture. Used to pass in a texture to vrvGraphics.
Definition: DtOsgTextureWrapper.h:27
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
std::vector< DtBoundingBox > myTextBoundsCache
Definition: DtOsgWidgetLabel.h:270
makArchives::DtAltitudeBasedScaleConfigurationRecordCollection myFontScaleFromMinimumAltitudeVector
Definition: DtOsgWidgetLabel.h:269
float myWidth
Definition: DtOsgWidgetLabel.h:245
DtUnicode myString
Definition: DtOsgWidgetLabel.h:277
double myLodOutAltitude
Definition: DtOsgWidgetLabel.h:263
float myRotation
Definition: DtOsgWidgetLabel.h:254
int myOriginXOffset
Pixels.
Definition: DtOsgWidgetLabel.h:249
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
float myPaddingY
Definition: DtOsgWidgetLabel.h:253
std::vector< DtAltitudeBasedScaleConfigurationRecord > DtAltitudeBasedScaleConfigurationRecordCollection
Definition: DtAltitudeBasedScaleConfigurationRecord.h:45
DtSprite * mySprite
Definition: DtOsgWidgetLabel.h:242
unsigned int myGroup
Definition: DtOsgWidgetLabel.h:255
int myOriginYOffset
Pixels.
Definition: DtOsgWidgetLabel.h:250

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)