VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtWidgetLabel.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 <vrvCore/vrvCore.h>
13 #include <vrvCore/DtWidget.h>
14 
15 #include <vrvUtil/DtUnicode.h>
16 
18 
19 #include <limits>
20 
21 namespace makVrv
22 {
26  {
27  public:
32  {
33  AlignLeft, // Aligns text left
34  AlignCenter, // Aligns text center
35  AlignRight, // Aligns text right
36  AlignJustify // Fully justifies text
37  };
38 
41  {
42  BottomLeft, // Bottom left corner of label.
43  BottomRight, // Bottom right corner of label.
44  BottomMiddle, // Middle of the bottom edge of the label.
45  LeftMiddle, // Middle of the left edge of the label.
46  RightMiddle, // Middle of the left edge of the label.
47  Center, // Center, both horizontally and vertically, of the label.
48  BelowBottomLeftByLineHeight, // (BottomLeft.x, BottomLeft.y - lineHeight)
49  BelowBottomLeftByHalfLineHeight, // (BottomLeft.x, BottomLeft.y - lineHeight / 2)
50  BelowBottomRightByLineHeight, // (BottomRight.x, BottomRight.y - lineHeight)
51  BelowBottomRightByHalfLineHeight,// (BottomRight.x, BottomRight.y - lineHeight / 2)
52  OffsetFromBottomLeftByBounds, // (BottomLeft.x - lineWidth, BottomLeft.y - lineHeight)
53  OffsetFromBottomRightByBounds, // (BottomRight.x + lineWidth, BottomRight.y - lineHeight)
54  AboveTopLeftByLineHeight, // (TopLeft.x, TopLeft.y + lineHeight)
55  AboveTopRightByLineHeight // (TopRight.x, TopRight.y + lineHeight)
56  };
57 
59  enum class TextBoundsPolicy
60  {
61  ConstrainToLine, // Use bounds that include the line height.
62  ConstrainToBounds, // Use bounds set in setSize.
63  ConstrainToText, // Use minimal bounds for text (don't include line height).
64  ConstrainToNone // Don't use bounds.
65  };
66 
67  public:
69  DtWidgetLabel( DtDe& de, DtUniqueID id );
70 
72  virtual ~DtWidgetLabel();
73 
75  DtWidgetLabel() = delete;
76 
78  DtWidgetLabel( const DtWidgetLabel &other) = delete;
79 
81  DtWidgetLabel &operator=( const DtWidgetLabel &other) = delete;
82 
84  DtWidgetLabel( const DtWidgetLabel&& other ) = delete;
85 
87  DtWidgetLabel& operator=( const DtWidgetLabel&& other ) = delete;
88  public:
91  virtual void setText(const DtUnicode& string) = 0;
92 
94  virtual void setTextColor(float r, float g, float b, float a) = 0;
95 
98  virtual void setTextHorizontalAlignmentPolicy(TextHorizontalAlignmentPolicy ha) = 0;
99 
101  virtual void setFont(const std::string& fontFace, float size) = 0;
102 
104  virtual void setTextBoundsPolicy(TextBoundsPolicy) = 0;
105 
110  virtual void setFontScale(float scale) = 0;
111 
113  virtual float fontScale(double minimumAltitudeForUse
114  = std::numeric_limits<double>::min()) const = 0;
115 
121  virtual void setAltitudeBasedConfigurations(
123 
127  virtual void clearAltitudeBasedConfigurations() = 0;
128 
134  virtual void setIsForcedAltitudeBasedFontScaleEnabled(bool enabled) = 0;
135 
139  virtual void setBaseAltitudeToUseForForcedFontScale(double baseAltitude) = 0;
140 
143  virtual void setLodOutAltitude(double lodOutAltitude) = 0;
144 
148  virtual void setIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled) = 0;
149  virtual bool isLodOutAltitudeEnabled() const = 0;
150 
153  virtual void setBoundsLength(int len) = 0;
154 
156  virtual void setOriginPlacementPolicy( OriginPlacementPolicy gcp) = 0;
157 
160  virtual void setRotation( float angle ) = 0;
161 
164  virtual double getRotation() const = 0;
165 
171  virtual void setIsRotationInScreenSpace(bool isRotationInScreenSpace) = 0;
172 
174  virtual bool isRotationInScreenSpace() const = 0;
175 
180  virtual void setMaximumWorldHeight(double worldHeightInMeters) = 0;
181 
183  virtual double maximumWorldHeight() const = 0;
184 
189  virtual void setMaximumWorldWidth(double worldWidthInMeters) = 0;
190 
192  virtual double maximumWorldWidth() const = 0;
193 
195  virtual void setSize(float width, float height) = 0;
196 
198  virtual void getSize(float& width, float& height) = 0;
199  };
200 }
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
OriginPlacementPolicy
Policy that determines where the origin of the label is.
Definition: DtWidgetLabel.h:40
Icon appears in the center zone of the status bar.
voidpf void uLong size
Definition: ioapi.h:39
Contains makVrv::DtWidget class.
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
The abstract base class for widgets.
Definition: DtWidget.h:29
This is the implementation independent widget class for showing text.
Definition: DtWidgetLabel.h:25
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
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
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
std::vector< DtAltitudeBasedScaleConfigurationRecord > DtAltitudeBasedScaleConfigurationRecordCollection
Definition: DtAltitudeBasedScaleConfigurationRecord.h:45
Contains DLL export macros.

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)