VR-Engage  2.2
Loading...
Searching...
No Matches
DtOsgSensorViewDateTimeOverlaySection Class Reference

Detailed Description

DtOsgSensorViewDateTimeOverlaySection provides a sensor view overlay that displays the current date and time in a specified location. This information is useful for situational awareness, data logging, and mission planning. The overlay is positioned in the upper right corner of the sensor view by default.

#include <osgSensorViewDateTimeOverlaySection.h>

Inheritance diagram for DtOsgSensorViewDateTimeOverlaySection:
[legend]

Public Member Functions

virtual ~DtOsgSensorViewDateTimeOverlaySection () override
 
virtual void initialize (makVrv::DtOverlayRenderer &overlayRenderer, unsigned int windowWidth, unsigned int windowHeight, unsigned int channelXOffset, unsigned int channelYOffset) override
 
virtual void setChannelSize (unsigned int windowWidth, unsigned int windowHeight, unsigned int channelXOffset, unsigned int channelYOffset) override
 
virtual void update (const makVrv::DtOsgObserverObject &observer, const makVrv::DtSensorFieldOfViewData &state) override
 
virtual const std::string & sectionName () const override
 

Static Public Attributes

static const std::string SectionName
 

Protected Member Functions

 DtOsgSensorViewDateTimeOverlaySection (makVrv::DtDe &de)
 

Protected Attributes

makVrv::DtTextProxy * myText
 

Private Attributes

const double TextHorizLocation = 0.98
 
const double TextVertLocation = 0.95
 
const double DefaultFontSize = 12
 
const double TextBoxWidth = 0.3
 
const double TextBoxHeight = 0.3
 

Friends

class DtOsgSensorViewDateTimeOverlaySectionCreator
 

Constructor & Destructor Documentation

◆ ~DtOsgSensorViewDateTimeOverlaySection()

virtual DtOsgSensorViewDateTimeOverlaySection::~DtOsgSensorViewDateTimeOverlaySection ( )
overridevirtual

Destructor.

Cleans up resources used by the date/time overlay section, particularly the text display objects.

◆ DtOsgSensorViewDateTimeOverlaySection()

DtOsgSensorViewDateTimeOverlaySection::DtOsgSensorViewDateTimeOverlaySection ( makVrv::DtDe & de)
inlineprotected

Protected constructor.

Parameters
deReference to the display engine

Creates a new date/time overlay section. This constructor is protected because instances should only be created through the creator class.

References de(), and myText.

Member Function Documentation

◆ initialize()

virtual void DtOsgSensorViewDateTimeOverlaySection::initialize ( makVrv::DtOverlayRenderer & overlayRenderer,
unsigned int windowWidth,
unsigned int windowHeight,
unsigned int channelXOffset,
unsigned int channelYOffset )
overridevirtual

Initializes the overlay section.

Parameters
overlayRendererRenderer for creating overlay elements
windowWidthWidth of the window in pixels
windowHeightHeight of the window in pixels
channelXOffsetX offset of the channel in pixels
channelYOffsetY offset of the channel in pixels

Initializes the overlay section by creating the text element that displays the date and time. This must be called prior to any update calls. The position of the text is calculated based on the window dimensions and channel offsets.

◆ setChannelSize()

virtual void DtOsgSensorViewDateTimeOverlaySection::setChannelSize ( unsigned int windowWidth,
unsigned int windowHeight,
unsigned int channelXOffset,
unsigned int channelYOffset )
overridevirtual

Updates the overlay when the channel size changes.

Parameters
windowWidthNew width of the window in pixels
windowHeightNew height of the window in pixels
channelXOffsetNew X offset of the channel in pixels
channelYOffsetNew Y offset of the channel in pixels

Adjusts the position and size of the text element when the channel dimensions or position change. This ensures the date/time display maintains its relative position in the view.

◆ update()

virtual void DtOsgSensorViewDateTimeOverlaySection::update ( const makVrv::DtOsgObserverObject & observer,
const makVrv::DtSensorFieldOfViewData & state )
overridevirtual

Updates the date and time display.

Parameters
observerObserver object representing the viewer's position and orientation
stateCurrent state of the sensor field of view

Updates the overlay text with the current system date and time during each frame update. The date and time format is based on system settings.

◆ sectionName()

virtual const std::string & DtOsgSensorViewDateTimeOverlaySection::sectionName ( ) const
overridevirtual

Gets the unique name of this overlay section.

Returns
Reference to the section name string

Returns the name of this section with which it may be retrieved from the DtOsgSensorViewOverlay. Each section type has a unique name.

Friends And Related Symbol Documentation

◆ DtOsgSensorViewDateTimeOverlaySectionCreator

Friend declaration for creator class.

Only the creator class can construct instances of this section.

References DtOsgSensorViewDateTimeOverlaySectionCreator.

Referenced by DtOsgSensorViewDateTimeOverlaySectionCreator.

Member Data Documentation

◆ TextHorizLocation

const double DtOsgSensorViewDateTimeOverlaySection::TextHorizLocation = 0.98
private

Horizontal position of the text as a fraction of display width (0.0-1.0)

Value of 0.98 positions the text near the right edge of the display

◆ TextVertLocation

const double DtOsgSensorViewDateTimeOverlaySection::TextVertLocation = 0.95
private

Vertical position of the text as a fraction of display height (0.0-1.0)

Value of 0.95 positions the text near the top edge of the display

◆ DefaultFontSize

const double DtOsgSensorViewDateTimeOverlaySection::DefaultFontSize = 12
private

Default font size for the date/time text in points.

◆ TextBoxWidth

const double DtOsgSensorViewDateTimeOverlaySection::TextBoxWidth = 0.3
private

Width of the text box as a fraction of display width.

◆ TextBoxHeight

const double DtOsgSensorViewDateTimeOverlaySection::TextBoxHeight = 0.3
private

Height of the text box as a fraction of display height.

◆ SectionName

const std::string DtOsgSensorViewDateTimeOverlaySection::SectionName
static

Static constant defining the section name.

This string identifier is used to register and retrieve this overlay section.

◆ myText

makVrv::DtTextProxy* DtOsgSensorViewDateTimeOverlaySection::myText
protected

Text element displaying the date and time.

Pointer to the text proxy object that renders the date and time text. This is created during initialization and updated during each update call.

Referenced by DtOsgSensorViewDateTimeOverlaySection().


The documentation for this class was generated from the following file: