VR-Vantage
Loading...
Searching...
No Matches
DtWidget.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/DtUniqueID.h>
14
16
17#include <string>
18#include <vector>
19#include <limits>
20
21namespace makVrv
22{
23
24 class DtDe;
25 class DtWidgetUpdater;
26
30 {
31 public:
33 {
34 public:
35 DtDynamicSizeConfiguration(double altitude, float sizeX, float sizeY)
36 : myAltitude(altitude)
37 , mySizeX(sizeX)
38 , mySizeY(sizeY)
39 , myOffsetX(0.0)
40 , myOffsetY(0.0)
41 { }
42
43 DtDynamicSizeConfiguration( double altitude, float sizeX, float sizeY,
44 float offsetX, float offsetY )
45 : myAltitude( altitude )
46 , mySizeX( sizeX )
47 , mySizeY( sizeY )
48 , myOffsetX( offsetX )
49 , myOffsetY( offsetY )
50 {
51 }
52
54 : myAltitude(std::numeric_limits<double>::min())
55 , mySizeX(0.0f)
56 , mySizeY(0.0f)
57 , myOffsetX( 0.0f )
58 , myOffsetY( 0.0f )
59 { }
60
63 const DtDynamicSizeConfiguration &other) = default;
65 const DtDynamicSizeConfiguration &other) = default;
66
67 double myAltitude;
68 float mySizeX;
69 float mySizeY;
70 float myOffsetX;
71 float myOffsetY;
72 };
73
74 typedef std::vector<DtDynamicSizeConfiguration> DtDynamicSizeConfigurationCollection;
75
76 public:
78
79 virtual ~DtWidget();
80
82 DtWidget( const DtWidget& other ) = delete;
83
85 DtWidget& operator=( const DtWidget& other ) = delete;
86
88 DtWidget( const DtWidget&& other ) = delete;
89
91 DtWidget& operator=( const DtWidget&& other ) = delete;
92
93 public:
94
96 virtual void setOverlay(unsigned int overlay) = 0;
97
99 virtual unsigned int overlay() const = 0;
100
102 virtual void setOrderGroup(unsigned int group) = 0;
103
105 virtual void setRotation( float ) = 0;
106
108 virtual unsigned int orderGroup() const = 0;
109
111 virtual void setParentId( DtUniqueID id);
112
114 virtual void setPosition(float x,float y,float z,float w = 0) = 0;
115
117 virtual void setBackgroundImage(const std::string& filename) = 0;
118
127 virtual void setSvgSource( const std::string& svgString ) { (void)svgString; }
128
138 virtual void setRasterSize( int widthPixels, int heightPixels )
139 {
140 (void)widthPixels;
141 (void)heightPixels;
142 }
143
145 virtual void setColor(float r,float g,float b, float a) = 0;
146
150 virtual void setFadingEnabled( bool enabled );
151
153 virtual void setOriginOffset( int xOffset, int yOffset ) = 0;
154
156 virtual void setSize(float w, float h) = 0;
157
164
170
177 virtual void setIsForcedSizeByAltitudeEnabled(bool enabled);
178
182 virtual void setAltitudeForForcedSize(double minimumAltitudeForUse);
183
187 virtual void setLodOutAltitude(double lodOutAltitude) = 0;
188
192 virtual void setIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled) = 0;
193
195 virtual void setPadding(float paddingX, float paddingY) = 0;
196
199 virtual void setModelDefinition(const std::string& str) = 0;
200
202 virtual void setEventsEnabled(bool enabled) = 0;
203
205 virtual void setVisible(bool visible) = 0;
206
209 virtual DtUniqueID id() const;
210
215 virtual DtUniqueID parentId() const;
216
224
229
232
233 protected:
236 virtual void updateEventSignals() = 0;
237 protected:
243 };
244}
Base class to provide boost signal/slot management.
Contains makVrv::DtUniqueID type.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer,...
Definition DtDe.h:77
Class to manage disconnection of boost connections on deletion.
Definition DtSignalConnectionManager.h:21
float myOffsetY
Definition DtWidget.h:71
DtDynamicSizeConfiguration(double altitude, float sizeX, float sizeY)
Definition DtWidget.h:35
float mySizeY
Definition DtWidget.h:69
float mySizeX
Definition DtWidget.h:68
double myAltitude
Definition DtWidget.h:67
DtDynamicSizeConfiguration(const DtDynamicSizeConfiguration &other)=default
DtDynamicSizeConfiguration(double altitude, float sizeX, float sizeY, float offsetX, float offsetY)
Definition DtWidget.h:43
DtDynamicSizeConfiguration & operator=(const DtDynamicSizeConfiguration &other)=default
DtDynamicSizeConfiguration()
Definition DtWidget.h:53
float myOffsetX
Definition DtWidget.h:70
virtual void setRasterSize(int widthPixels, int heightPixels)
Set the pixel dimensions used when rasterizing SVG content.
Definition DtWidget.h:138
virtual unsigned int orderGroup() const =0
Gets the overlay of the widget.
virtual void setVisible(bool visible)=0
Set whether the widget is visible or not.
virtual void clearAltitudeSpecificSizes()
virtual void setSize(float w, float h)=0
Sets the size of the widget in overlay coordinate space.
DtWidget & operator=(const DtWidget &&other)=delete
Move Assignment Operator not implemented - Move Assignment not allowed.
DtWidget & operator=(const DtWidget &other)=delete
Assignment Operator not implemented - Assignment not allowed.
DtUniqueID myId
Definition DtWidget.h:239
DtWidget(const DtWidget &&other)=delete
Move Constructor not implemented - Move not allowed.
std::vector< DtDynamicSizeConfiguration > DtDynamicSizeConfigurationCollection
Definition DtWidget.h:74
virtual void setSvgSource(const std::string &svgString)
Set the widget's background from an SVG XML string.
Definition DtWidget.h:127
virtual void unregisterUpdater(DtWidgetUpdater *updater)
DtWidget(const DtWidget &other)=delete
Copy Constructor not implemented - Copy not allowed.
virtual void setAltitudeSpecificSizes(const DtWidget::DtDynamicSizeConfigurationCollection &configs)
virtual void setParentId(DtUniqueID id)
Set the parent id.
virtual void setIsForcedSizeByAltitudeEnabled(bool enabled)
DtWidgetUpdater * myUpdater
Definition DtWidget.h:242
virtual DtUniqueID parentId() const
virtual void setRotation(float)=0
Sets the rotation of the widget. Rotation is in radians. Default is no-op.
DtUniqueID myParentId
Definition DtWidget.h:240
virtual void setFadingEnabled(bool enabled)
Tag the widget with symbol-decoration eye-distance fade flags.
virtual void setOverlay(unsigned int overlay)=0
Sets the overlay of the widget.
virtual void setColor(float r, float g, float b, float a)=0
Set the color of the widget.
virtual void setOriginOffset(int xOffset, int yOffset)=0
Set the offset in pixels from the position.
virtual void setAltitudeForForcedSize(double minimumAltitudeForUse)
virtual void setPadding(float paddingX, float paddingY)=0
Sets the size of the widget in overlay coordinate space.
virtual void updateEventSignals()=0
DtDe & myDe
Definition DtWidget.h:238
virtual ~DtWidget()
virtual void setLodOutAltitude(double lodOutAltitude)=0
virtual unsigned int overlay() const =0
Gets the overlay of the widget.
virtual void setBackgroundImage(const std::string &filename)=0
Set the background image.
virtual void setPosition(float x, float y, float z, float w=0)=0
Set the position of the widget in screen space.
virtual void setEventsEnabled(bool enabled)=0
Enable or disable events for this widget.
DtSignalConnectionManager mySignalConnectionManager
Definition DtWidget.h:241
virtual void setModelDefinition(const std::string &str)=0
virtual DtWidgetUpdater * updater()
Returns the current updater that this widget is registered with.
virtual void setOrderGroup(unsigned int group)=0
Sets the overlay of the widget.
virtual void registerUpdater(DtWidgetUpdater *updater)
virtual DtUniqueID id() const
DtWidget(DtDe &de, DtUniqueID id)
virtual void setIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled)=0
Definition DtWidgetUpdater.h:32
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
unsigned long long DtUniqueID
Definition DtUniqueID.h:19
Contains DLL export macros.
#define DT_DLL_VRVCORE
Definition vrvCore.h:20