VR-Engage  2.2
Loading...
Searching...
No Matches
vreOsgSensorViewPlatformInfoOverlaySection.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file vreOsgSensorViewPlatformInfoOverlaySection.h
7//! \brief Defines the overlay section for displaying platform information
8//!
9//! This file contains the DtVreOsgSensorViewPlatformInfoOverlaySection class which
10//! provides an overlay section for displaying information about the platform
11//! (vehicle or entity) on which the sensor is mounted. This information includes
12//! altitude above ground level, time, and other platform-specific data.
13
14#pragma once
15
17
18#include <vrvOsg/DtOsgSensorViewPlatformInfoOverlaySection.h>
19#include <vrvCore/DtDisplayUnitsSettingsManager.h>
20
22
23namespace makVrv
24{
25class DtTextProxy;
26}
27
28namespace makVre
29{
30//! \brief Overlay section for displaying platform information
31//!
32//! This version is extended to handle simulation AGL messages.
33class PLAYERSTATION_DLL DtVreOsgSensorViewPlatformInfoOverlaySection : public makVrv::DtOsgSensorViewPlatformInfoOverlaySection
34{
35public:
36 //! \brief Friend declaration for creator class
37 //!
38 //! Allows the creator class to access protected constructor.
40
41 //! \brief Destructor
42 //!
43 //! Cleans up resources used by the platform info overlay section.
45
46 //! \brief Updates the overlay with current platform information
47 //! \param observer Reference to the observer object
48 //! \param state Current sensor field of view data
49 //!
50 //! Updates the text display with platform information based on the current
51 //! sensor and platform state. This includes date, time, altitude above ground
52 //! level, and other relevant platform data.
53 virtual void update(const makVrv::DtOsgObserverObject& observer,
54 const makVrv::DtSensorFieldOfViewData& state) override;
55
56 //! \brief Gets the name of this overlay section
57 //! \return Reference to the section name string
58 //!
59 //! Returns the name of this section, which can be used to retrieve it
60 //! from the DtOsgSensorViewOverlay. The name uniquely identifies this
61 //! section type in the overlay system.
62 virtual const std::string& sectionName() const override;
63
64public:
65 //! \brief Static section name identifier
66 //!
67 //! Constant string that identifies this type of overlay section.
68 static const std::string SectionName;
69
70protected:
71 //! \brief Handles simulation state update messages
72 //! \param msg Pointer to the simulation state message
73 //! \return Message handling result
74 //!
75 //! Processes simulation state messages to extract and update the altitude
76 //! above ground level (AGL) value for display in the overlay. This method
77 //! parses the incoming message and updates the internal AGL value.
79
80 //! \brief Protected constructor
81 //! \param de Reference to the display engine
82 //!
83 //! Creates a new platform info overlay section for the specified display engine.
84 //! This constructor is protected because instances should only be created by
85 //! the DtVreOsgSensorViewPlatformInfoOverlaySectionCreator.
87
88protected:
89
90 //! \brief Flag for first update handling
91 //!
92 //! True until the first update has been processed, used to subscribe
93 //! to simulation engine AGL updates on first update.
95
96 //! \brief Flag indicating if simulation AGL is being used
97 //!
98 //! When true, altitude above ground level is taken from simulation state
99 //! messages rather than computed from other sources.
101
102 //! \brief Entity identifier of the host platform
103 //!
104 //! Identifies the platform (entity) to which this sensor is attached.
105 DtEntityIdentifier myHostEntityId;
106
107 //! \brief Current AGL value from simulation
108 //!
109 //! Stores the most recent altitude above ground level value received
110 //! from simulation state messages, in the simulation's internal units.
111 makVrv::DtUnicode mySimAglText;
112};
113
114//! \brief Factory creator for platform info overlay sections
115//!
116//! DtVreOsgSensorViewPlatformInfoOverlaySectionCreator is a factory class that
117//! creates platform info overlay section instances. It allows the overlay sections
118//! to be created on demand by the overlay system using the factory pattern.
120 : public makVrv::DtOsgSensorViewOverlaySectionCreator
121{
122public:
123 //! \brief Creates a new platform info overlay section
124 //! \param de Reference to the display engine
125 //! \return Pointer to a newly created overlay section
126 //!
127 //! Factory method that creates a new platform info overlay section
128 //! instance for the specified display engine.
129 virtual makVrv::DtOsgSensorViewOverlaySection* create(makVrv::DtDe& de) override;
130
131 //! \brief Creates a copy of this creator
132 //! \return Pointer to a new creator instance of the same type
133 //!
134 //! Creates a new instance of this creator class, used by the overlay system
135 //! for creator registration and management.
136 virtual makVrv::DtOsgSensorViewOverlaySectionCreator* clone() const override;
137
138 //! \brief Destructor
139 //!
140 //! Cleans up resources used by the creator.
142};
143} // namespace makVre
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Factory creator for platform info overlay sections.
Definition vreOsgSensorViewPlatformInfoOverlaySection.h:121
virtual ~DtVreOsgSensorViewPlatformInfoOverlaySectionCreator() override
Destructor.
virtual makVrv::DtOsgSensorViewOverlaySectionCreator * clone() const override
Creates a copy of this creator.
virtual makVrv::DtOsgSensorViewOverlaySection * create(makVrv::DtDe &de) override
Creates a new platform info overlay section.
bool myFirstUpdate
Flag for first update handling.
Definition vreOsgSensorViewPlatformInfoOverlaySection.h:94
virtual const std::string & sectionName() const override
Gets the name of this overlay section.
virtual void update(const makVrv::DtOsgObserverObject &observer, const makVrv::DtSensorFieldOfViewData &state) override
Updates the overlay with current platform information.
DtVreOsgSensorViewPlatformInfoOverlaySection(makVrv::DtDe &de)
Protected constructor.
bool myUsingSimAgl
Flag indicating if simulation AGL is being used.
Definition vreOsgSensorViewPlatformInfoOverlaySection.h:100
virtual ~DtVreOsgSensorViewPlatformInfoOverlaySection() override
Destructor.
friend class DtVreOsgSensorViewPlatformInfoOverlaySectionCreator
Friend declaration for creator class.
Definition vreOsgSensorViewPlatformInfoOverlaySection.h:39
DtEntityIdentifier myHostEntityId
Entity identifier of the host platform.
Definition vreOsgSensorViewPlatformInfoOverlaySection.h:105
makVrv::DtUnicode mySimAglText
Current AGL value from simulation.
Definition vreOsgSensorViewPlatformInfoOverlaySection.h:111
virtual makVre::DtVreMessageResult handleSimulationState(makVre::DtVreMessage *msg)
Handles simulation state update messages.
static const std::string SectionName
Static section name identifier.
Definition vreOsgSensorViewPlatformInfoOverlaySection.h:68
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.
Defines the base class for all VREngage messages.