VR-Engage  2.2
Loading...
Searching...
No Matches
vreOsgSensorViewPitchOverlaySection.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file vreOsgSensorViewPitchOverlaySection.h
7//! \brief Defines the overlay section for displaying pitch information
8//!
9//! This file contains the DtVreOsgSensorViewPitchOverlaySection class which
10//! provides an overlay section for displaying pitch angle information on the
11//! sensor view. This helps users understand the current viewing angle and
12//! orientation of the sensor relative to the horizon.
13
14#pragma once
15
17
18#include <vrvOsg/DtOsgSensorViewPitchOverlaySection.h>
19
20
21namespace makVrv
22{
23class DtTextProxy;
24}
25
26namespace makVre
27{
28//! \brief Overlay section for displaying pitch angle information
29//!
30//! DtVreOsgSensorViewPitchOverlaySection is responsible for displaying
31//! the current pitch angle of the sensor view. It renders this information
32//! as text on the sensor display, helping users understand the current
33//! viewing angle relative to the horizon. This is particularly useful
34//! in applications like aerial observation or targeting systems.
35class PLAYERSTATION_DLL DtVreOsgSensorViewPitchOverlaySection : public makVrv::DtOsgSensorViewPitchOverlaySection
36{
37public:
38 //! \brief Friend declaration for creator class
39 //!
40 //! Allows the creator class to access protected constructor.
42
43 //! \brief Destructor
44 //!
45 //! Cleans up resources used by the pitch overlay section.
47
48 //! \brief Initializes the overlay section
49 //! \param overlayRenderer Reference to the overlay renderer
50 //! \param channelWidth Width of the channel in pixels
51 //! \param channelHeight Height of the channel in pixels
52 //! \param channelXOffset X offset of the channel in pixels
53 //! \param channelYOffset Y offset of the channel in pixels
54 //!
55 //! Sets up the overlay section with the specified renderer and dimensions.
56 //! This must be called before update() is called.
57 virtual void initialize(makVrv::DtOverlayRenderer& overlayRenderer, unsigned int channelWidth,
58 unsigned int channelHeight, unsigned int channelXOffset, unsigned int channelYOffset) override;
59
60 //! \brief Updates the channel size
61 //! \param channelWidth New width of the channel in pixels
62 //! \param channelHeight New height of the channel in pixels
63 //! \param channelXOffset New X offset of the channel in pixels
64 //! \param channelYOffset New Y offset of the channel in pixels
65 //!
66 //! Updates the overlay section for a new channel size or position.
67 //! This is typically called when the view is resized or repositioned.
68 virtual void setChannelSize(unsigned int channelWidth, unsigned int channelHeight, unsigned int channelXOffset,
69 unsigned int channelYOffset) override;
70
71 //! \brief Updates the overlay with current pitch information
72 //! \param observer Reference to the observer object
73 //! \param state Current sensor field of view data
74 //!
75 //! Updates the text display with pitch angle information from the
76 //! current sensor state. This calculates the current pitch angle
77 //! using getPitchDegrees() and formats it for display.
78 virtual void update(const makVrv::DtOsgObserverObject& observer,
79 const makVrv::DtSensorFieldOfViewData& state) override;
80
81protected:
82 //! \brief Calculates the pitch angle in degrees
83 //! \param observer Reference to the observer object
84 //! \param state Current sensor field of view data
85 //! \return Current pitch angle in degrees
86 //!
87 //! Computes the current pitch angle in degrees based on the observer
88 //! orientation and sensor field of view state. This is used to determine
89 //! the angle value to display in the overlay.
90 virtual double getPitchDegrees(
91 const makVrv::DtOsgObserverObject& observer, const makVrv::DtSensorFieldOfViewData& state);
92
93 //! \brief Protected constructor
94 //! \param de Reference to the display engine
95 //!
96 //! Creates a new pitch overlay section for the specified display engine.
97 //! This constructor is protected because instances should only be created by
98 //! the DtVreOsgSensorViewPitchOverlaySectionCreator.
100
101 //! \brief Gets the name of this overlay section
102 //! \return Reference to the section name string
103 //!
104 //! Returns the name of this section, which can be used to retrieve it
105 //! from the DtOsgSensorViewOverlay. The name uniquely identifies this
106 //! section type in the overlay system.
107 virtual const std::string& sectionName() const override;
108
109public:
110 static const std::string SectionName;
111
112protected:
113 //! \brief Text display object for the pitch angle
114 //!
115 //! Proxy for the text object that displays the pitch angle information.
116 makVrv::DtTextProxy* myDegreeText;
117};
118
119//! \brief Factory creator for pitch overlay sections
120//!
121//! DtVreOsgSensorViewPitchOverlaySectionCreator is a factory class that
122//! creates pitch overlay section instances. It allows the overlay sections
123//! to be created on demand by the overlay system using the factory pattern.
125 : public makVrv::DtOsgSensorViewPitchOverlaySectionCreator
126{
127public:
128 //! \brief Creates a new pitch overlay section
129 //! \param de Reference to the display engine
130 //! \return Pointer to a newly created overlay section
131 //!
132 //! Factory method that creates a new pitch overlay section
133 //! instance for the specified display engine.
134 virtual makVrv::DtOsgSensorViewPitchOverlaySection* create(makVrv::DtDe& de) override;
135
136 //! \brief Creates a copy of this creator
137 //! \return Pointer to a new creator instance of the same type
138 //!
139 //! Creates a new instance of this creator class, used by the overlay system
140 //! for creator registration and management.
141 virtual makVrv::DtOsgSensorViewPitchOverlaySectionCreator* clone() const override;
142};
143} // namespace makVre
Factory creator for pitch overlay sections.
Definition vreOsgSensorViewPitchOverlaySection.h:126
virtual makVrv::DtOsgSensorViewPitchOverlaySectionCreator * clone() const override
Creates a copy of this creator.
virtual makVrv::DtOsgSensorViewPitchOverlaySection * create(makVrv::DtDe &de) override
Creates a new pitch overlay section.
virtual void initialize(makVrv::DtOverlayRenderer &overlayRenderer, unsigned int channelWidth, unsigned int channelHeight, unsigned int channelXOffset, unsigned int channelYOffset) override
Initializes the overlay section.
virtual void update(const makVrv::DtOsgObserverObject &observer, const makVrv::DtSensorFieldOfViewData &state) override
Updates the overlay with current pitch information.
DtVreOsgSensorViewPitchOverlaySection(makVrv::DtDe &de)
Protected constructor.
virtual const std::string & sectionName() const override
Gets the name of this overlay section.
makVrv::DtTextProxy * myDegreeText
Text display object for the pitch angle.
Definition vreOsgSensorViewPitchOverlaySection.h:116
virtual void setChannelSize(unsigned int channelWidth, unsigned int channelHeight, unsigned int channelXOffset, unsigned int channelYOffset) override
Updates the channel size.
friend class DtVreOsgSensorViewPitchOverlaySectionCreator
Friend declaration for creator class.
Definition vreOsgSensorViewPitchOverlaySection.h:41
virtual double getPitchDegrees(const makVrv::DtOsgObserverObject &observer, const makVrv::DtSensorFieldOfViewData &state)
Calculates the pitch angle in degrees.
static const std::string SectionName
Definition vreOsgSensorViewPitchOverlaySection.h:110
virtual ~DtVreOsgSensorViewPitchOverlaySection() override
Destructor.
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
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.