VR-Forces 5.0.3 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) 2022 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 
17 
19 
20 #include <osg/ref_ptr>
21 #include <osg/Texture>
22 #include <limits>
23 
24 namespace osg
25 {
26  class Texture;
27 }
28 
29 namespace makVrv
30 {
31 
32  class DtSprite;
33  class DtTextProxy;
34 
38  {
39  public:
40 
42  DtOsgWidgetLabel( DtDe& de, DtUniqueID id );
43 
45  virtual ~DtOsgWidgetLabel();
46 
48  DtOsgWidgetLabel() = delete;
49 
52  const DtOsgWidgetLabel &other) = delete;
53 
55  DtOsgWidgetLabel &operator=(
56  const DtOsgWidgetLabel &other) = delete;
57 
58  public:
59 
61  virtual void setOverlay( unsigned int layer );
62 
64  virtual unsigned int overlay() const;
65 
67  virtual void setOrderGroup( unsigned int group );
68 
70  virtual unsigned int orderGroup() const;
71 
73  virtual void setPosition( float x, float y, float z, float w = 0 );
74 
77  virtual void setText( const DtUnicode& string );
78 
80  virtual void setFont( const std::string& font, float size);
81 
86  virtual void setFontScale( float scale );
87 
89  virtual float fontScale(double minimumAltitudeForUse = std::numeric_limits<double>::min()) const;
90 
96  virtual void setAltitudeBasedConfigurations(
98 
101  virtual void clearAltitudeBasedConfigurations();
102 
108  virtual void setIsForcedAltitudeBasedFontScaleEnabled(bool isEnabled);
109 
112  virtual void setBaseAltitudeToUseForForcedFontScale(double minimumAltitudeForUse);
113 
116  virtual void setLodOutAltitude(double lodOutAltitude);
117 
121  virtual void setIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled);
122 
124  virtual void setBackgroundImage( const std::string& filename );
125  virtual void setBackgroundImage( const std::string& filename,
126  float left, float right, float bottom, float top );
127 
129  virtual void setTextColor( float r,float g,float b, float a );
130 
132  virtual void setColor( float r, float g, float b, float a );
133 
136  virtual void setOrigin( float originX, float originY);
137 
139  virtual void setSize( float w, float h);
140 
142  virtual void getSize(float& width, float& height);
143 
145  virtual void setPadding( float paddingX, float paddingY );
146 
148  virtual void setModelDefinition( const std::string& str );
149 
151  virtual void setTextAlignment( DtWidgetLabel::HorizontalAlignment ha );
152 
154  virtual void setGlyphCenterPolicy( DtWidgetLabel::GlyphCenterPolicy gcp );
155 
157  virtual void setEventsEnabled( bool enabled );
158 
160  virtual void setVisible( bool visible );
161 
164  virtual void setBoundsLength( int len );
165 
167  virtual void setRotation( float angle );
168 
170  virtual double getRotation() const;
171 
174  virtual void setSizeConstraints(SizeConstraints);
175 
176  protected:
177 
178  virtual void updateBounds( bool calculateText );
179  virtual void updateTextBounds( DtBoundingBox box, bool calculateText, double altitude );
180  virtual void updateFont();
181 
182  protected:
183 
188  unsigned int myOverlay;
189  float myWidth;
190  float myHeight;
191  float myOriginX;
192  float myOriginY;
193  float myPaddingX;
194  float myPaddingY;
195  float myRotation;
196  unsigned int myGroup;
197 
198  std::string myFontFile;
201 
205  };
206 
207 }
GlyphCenterPolicy
Definition: DtWidgetLabel.h:38
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
float myOriginX
Definition: DtOsgWidgetLabel.h:191
A synchronized Quad and Widget for a interactive visible 2D graphic.
Definition: DtSprite.h:25
GlyphCenterPolicy myCenterPolicy
Definition: DtOsgWidgetLabel.h:203
Contains the makVrv::DtBoundingBox class declaration.
int myFontSize
Definition: DtOsgWidgetLabel.h:200
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
float myOriginY
Definition: DtOsgWidgetLabel.h:192
std::string myFontFile
Definition: DtOsgWidgetLabel.h:198
voidpf void uLong size
Definition: ioapi.h:39
A class for controlling text owned by the TextRenderer.
Definition: DtTextRenderer.h:197
float myPaddingX
Definition: DtOsgWidgetLabel.h:193
unsigned int myOverlay
Definition: DtOsgWidgetLabel.h:188
DtTextProxy * myText
Definition: DtOsgWidgetLabel.h:186
int myBoundsLength
Definition: DtOsgWidgetLabel.h:202
The osg implementation of a label.
Definition: DtOsgWidgetLabel.h:37
SizeConstraints mySizeConstraints
Definition: DtOsgWidgetLabel.h:204
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
float myHeight
Definition: DtOsgWidgetLabel.h:190
Contains the makVrv::DtWidgetLabel class declaration.
SizeConstraints
Definition: DtWidgetLabel.h:47
This is the implementation independent widget class for showing text.
Definition: DtWidgetLabel.h:26
std::vector< DtDynamicScaleConfiguration > DtDynamicScaleConfigurationCollection
Definition: DtEntitySettingsRecord.h:54
osg::ref_ptr< osg::Texture > myTexture
Definition: DtOsgWidgetLabel.h:184
float myWidth
Definition: DtOsgWidgetLabel.h:189
makArchives::DtDynamicScaleConfigurationCollection myFontScaleFromMinimumAltitudeVector
Definition: DtOsgWidgetLabel.h:199
float myRotation
Definition: DtOsgWidgetLabel.h:195
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:70
float myPaddingY
Definition: DtOsgWidgetLabel.h:194
HorizontalAlignment
Definition: DtWidgetLabel.h:30
DtBoundingBox myTextBounds
Definition: DtOsgWidgetLabel.h:187
DtSprite * mySprite
Definition: DtOsgWidgetLabel.h:185
unsigned int myGroup
Definition: DtOsgWidgetLabel.h:196
Contains the DtEntitySettingsRecord class declaration.
A simple bounding box.
Definition: DtBoundingBox.h:101

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)