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

Detailed Description

DtOsgSensorViewTimeOverlaySection provides a sensor view overlay that displays the current simulation time. This is useful for mission timing, coordination, and after-action review. The time is typically displayed in a standard format (HH:MM:SS) positioned in a non-intrusive location on the sensor view.

#include <osgSensorViewTimeOverlaySection.h>

Inheritance diagram for DtOsgSensorViewTimeOverlaySection:
[legend]

Public Member Functions

virtual ~DtOsgSensorViewTimeOverlaySection () 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

 DtOsgSensorViewTimeOverlaySection (makVrv::DtDe &de)
 

Protected Attributes

makVrv::DtTextProxy * myText
 

Friends

class DtOsgSensorViewTimeOverlaySectionCreator
 

Constructor & Destructor Documentation

◆ ~DtOsgSensorViewTimeOverlaySection()

virtual DtOsgSensorViewTimeOverlaySection::~DtOsgSensorViewTimeOverlaySection ( )
overridevirtual

Destructor.

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

◆ DtOsgSensorViewTimeOverlaySection()

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

Protected constructor.

Parameters
deReference to the display engine

Creates a new 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 DtOsgSensorViewTimeOverlaySection::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 simulation 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 DtOsgSensorViewTimeOverlaySection::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 time display maintains its relative position in the view.

◆ update()

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

Updates the 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 simulation time during each frame update. The time format is typically HH:MM:SS and is retrieved from the simulation environment rather than the system clock.

◆ sectionName()

virtual const std::string & DtOsgSensorViewTimeOverlaySection::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

◆ DtOsgSensorViewTimeOverlaySectionCreator

Friend declaration for creator class.

Only the creator class can construct instances of this section.

References DtOsgSensorViewTimeOverlaySectionCreator.

Referenced by DtOsgSensorViewTimeOverlaySectionCreator.

Member Data Documentation

◆ SectionName

const std::string DtOsgSensorViewTimeOverlaySection::SectionName
static

Static constant defining the section name.

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

◆ myText

makVrv::DtTextProxy* DtOsgSensorViewTimeOverlaySection::myText
protected

Text element displaying the simulation time.

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

Referenced by DtOsgSensorViewTimeOverlaySection().


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