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) 2023 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 
137  virtual void setTextColor( float r,float g,float b, float a ) override;
138 
140  virtual void setColor( float r, float g, float b, float a ) override;
141 
143  virtual void setOriginOffset( int xOffset, int yOffset) override;
144 
146  virtual void setSize( float w, float h) override;
147 
149  virtual void getSize(float& width, float& height) override;
150 
152  virtual void setPadding( float paddingX, float paddingY ) override;
153 
155  virtual void setModelDefinition( const std::string& str ) override;
156 
158  virtual void setTextHorizontalAlignmentPolicy( DtWidgetLabel::TextHorizontalAlignmentPolicy ha ) override;
159 
161  virtual void setOriginPlacementPolicy( DtWidgetLabel::OriginPlacementPolicy gcp ) override;
162 
164  virtual void setEventsEnabled( bool enabled ) override;
165 
167  virtual void setVisible( bool visible ) override;
168 
171  virtual void setBoundsLength( int len ) override;
172 
175  virtual void setRotation( float angle ) override;
176 
179  virtual double getRotation() const override;
180 
187  virtual void setIsRotationInScreenSpace(bool isRotationInScreenSpace) override;
188 
191  virtual bool isRotationInScreenSpace() const override;
192 
197  virtual void setMaximumWorldHeight(double worldHeightInMeters) override;
198 
200  virtual double maximumWorldHeight() const override;
201 
206  virtual void setMaximumWorldWidth(double worldWidthInMeters) override;
207 
209  virtual double maximumWorldWidth() const override;
210 
213  virtual void setTextBoundsPolicy(TextBoundsPolicy) override;
214 
215  protected:
216 
217  virtual void updateBounds( bool calculateText ) ;
218  virtual void updateFont();
221  virtual void updateEventSignals() override;
222  protected:
223 
227  unsigned int myOverlay;
228  float myWidth;
229  float myHeight;
235  float myPaddingX;
236  float myPaddingY;
237  float myRotation;
238  unsigned int myGroup;
239 
242 
244 
247 
248  std::string myFontFile;
250  std::vector<DtBoundingBox> myTextBoundsCache;
251  std::vector<float> myFontLineHeightCache;
253 
258  };
259 
260 }
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:241
DtOsgTextureWrapper * myTexture
Definition: DtOsgWidgetLabel.h:224
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:252
std::vector< float > myFontLineHeightCache
Definition: DtOsgWidgetLabel.h:251
#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:256
std::string myFontFile
Definition: DtOsgWidgetLabel.h:248
voidpf void uLong size
Definition: ioapi.h:39
double myMaximumWorldWidth
Definition: DtOsgWidgetLabel.h:240
float myPaddingX
Definition: DtOsgWidgetLabel.h:235
unsigned int myOverlay
Definition: DtOsgWidgetLabel.h:227
int myBoundsLength
Definition: DtOsgWidgetLabel.h:254
The osg implementation of a label.
Definition: DtOsgWidgetLabel.h:31
bool myIsLodOutAltitudeEnabled
Definition: DtOsgWidgetLabel.h:245
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:229
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:243
OriginPlacementPolicy myOriginPlacementPolicy
Definition: DtOsgWidgetLabel.h:255
DtTextProxyInterface * myText
Definition: DtOsgWidgetLabel.h:226
TextBoundsPolicy
Policy that determines which bounds to use when rendering the text-portion of the label...
Definition: DtWidgetLabel.h:57
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:24
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
std::vector< DtBoundingBox > myTextBoundsCache
Definition: DtOsgWidgetLabel.h:250
makArchives::DtAltitudeBasedScaleConfigurationRecordCollection myFontScaleFromMinimumAltitudeVector
Definition: DtOsgWidgetLabel.h:249
float myWidth
Definition: DtOsgWidgetLabel.h:228
DtUnicode myString
Definition: DtOsgWidgetLabel.h:257
double myLodOutAltitude
Definition: DtOsgWidgetLabel.h:246
float myRotation
Definition: DtOsgWidgetLabel.h:237
int myOriginXOffset
Pixels.
Definition: DtOsgWidgetLabel.h:232
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:236
std::vector< DtAltitudeBasedScaleConfigurationRecord > DtAltitudeBasedScaleConfigurationRecordCollection
Definition: DtAltitudeBasedScaleConfigurationRecord.h:45
DtSprite * mySprite
Definition: DtOsgWidgetLabel.h:225
unsigned int myGroup
Definition: DtOsgWidgetLabel.h:238
int myOriginYOffset
Pixels.
Definition: DtOsgWidgetLabel.h:233

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)