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) 2023 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  };
55 
57  enum class TextBoundsPolicy
58  {
59  ConstrainToLine, // Use bounds that include the line height.
60  ConstrainToBounds, // Use bounds set in setSize.
61  ConstrainToText, // Use minimal bounds for text (don't include line height).
62  ConstrainToNone // Don't use bounds.
63  };
64 
65  public:
67  DtWidgetLabel( DtDe& de, DtUniqueID id );
68 
70  virtual ~DtWidgetLabel();
71 
73  DtWidgetLabel() = delete;
74 
76  DtWidgetLabel( const DtWidgetLabel &other) = delete;
77 
79  DtWidgetLabel &operator=( const DtWidgetLabel &other) = delete;
80 
82  DtWidgetLabel( const DtWidgetLabel&& other ) = delete;
83 
85  DtWidgetLabel& operator=( const DtWidgetLabel&& other ) = delete;
86  public:
89  virtual void setText(const DtUnicode& string) = 0;
90 
92  virtual void setTextColor(float r, float g, float b, float a) = 0;
93 
96  virtual void setTextHorizontalAlignmentPolicy(TextHorizontalAlignmentPolicy ha) = 0;
97 
99  virtual void setFont(const std::string& fontFace, float size) = 0;
100 
102  virtual void setTextBoundsPolicy(TextBoundsPolicy) = 0;
103 
108  virtual void setFontScale(float scale) = 0;
109 
111  virtual float fontScale(double minimumAltitudeForUse
112  = std::numeric_limits<double>::min()) const = 0;
113 
119  virtual void setAltitudeBasedConfigurations(
121 
125  virtual void clearAltitudeBasedConfigurations() = 0;
126 
132  virtual void setIsForcedAltitudeBasedFontScaleEnabled(bool enabled) = 0;
133 
137  virtual void setBaseAltitudeToUseForForcedFontScale(double baseAltitude) = 0;
138 
141  virtual void setLodOutAltitude(double lodOutAltitude) = 0;
142 
146  virtual void setIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled) = 0;
147  virtual bool isLodOutAltitudeEnabled() const = 0;
148 
151  virtual void setBoundsLength(int len) = 0;
152 
154  virtual void setOriginPlacementPolicy( OriginPlacementPolicy gcp) = 0;
155 
158  virtual void setRotation( float angle ) = 0;
159 
162  virtual double getRotation() const = 0;
163 
169  virtual void setIsRotationInScreenSpace(bool isRotationInScreenSpace) = 0;
170 
172  virtual bool isRotationInScreenSpace() const = 0;
173 
178  virtual void setMaximumWorldHeight(double worldHeightInMeters) = 0;
179 
181  virtual double maximumWorldHeight() const = 0;
182 
187  virtual void setMaximumWorldWidth(double worldWidthInMeters) = 0;
188 
190  virtual double maximumWorldWidth() const = 0;
191 
193  virtual void setSize(float width, float height) = 0;
194 
196  virtual void getSize(float& width, float& height) = 0;
197  };
198 }
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
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:28
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:57
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:72
std::vector< DtAltitudeBasedScaleConfigurationRecord > DtAltitudeBasedScaleConfigurationRecordCollection
Definition: DtAltitudeBasedScaleConfigurationRecord.h:45
Contains DLL export macros.

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)