VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtBinocularsLasingOverlay Class Reference

Detailed Description

DtBinocularsLasingOverlay extends the basic binoculars overlay with laser ranging capabilities, providing measurement and display of target location, elevation, azimuth, and range information. It updates formatted display values for sensor location, target data, and north reference settings. The overlay maintains target data for a configurable period after lasing stops.

#include <vreBinocularsLasingOverlay.h>

Inheritance diagram for makVre::DtBinocularsLasingOverlay:
[legend]

Public Member Functions

 DtBinocularsLasingOverlay ()
 
virtual ~DtBinocularsLasingOverlay () override
 
virtual bool initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
virtual bool postInitialize () override
 
virtual void tick (double dt) override
 
virtual bool isOverlayVisible () override
 
- Public Member Functions inherited from makVre::DtBinocularsOverlay
 DtBinocularsOverlay (const std::string &className="DtBinocularsOverlay")
 
virtual ~DtBinocularsOverlay () override
 
void setReticleHeight (float height)
 
void setVisible (bool visible)
 
- Public Member Functions inherited from makVre::DtQtQuickOverlay
 DtQtQuickOverlay ()
 
virtual ~DtQtQuickOverlay () override
 
virtual void setRoot (QQuickItem *root)
 
virtual void initdoc (QQuickItem *root)
 
virtual DtVreMessageResult handleEnterPlayerState (DtVreMessage *msg)
 
virtual DtVreMessageResult handleExitPlayerState (DtVreMessage *msg)
 
virtual void setVisibility (bool visible)
 
virtual bool isVisible ()
 
virtual void setMenuState (bool on)
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Member Functions

virtual makVre::DtVreMessageResult handleStopLasingMessage (makVre::DtVreMessage *msg)
 
virtual void updateSensorData ()
 
virtual void updateNorthReference ()
 
virtual void updateTimeOfTargetLocation ()
 
virtual void updateTargetData ()
 
virtual std::string timeString ()
 
virtual void clearTargetData ()
 
virtual void calculateElevationAndAzimuthToTarget (const DtVector &geocentricObserverLocation, const DtVector &geocentricIntersectionPoint, double *targetElevation, double *targetAzimuth)
 
- Protected Member Functions inherited from makVre::DtBinocularsOverlay
virtual void computeReticleDimensions ()
 
virtual void slot_channelConfigurationModified (const std::string &deName, const std::string &winName, const std::string &oldChannelName, const makVrv::DtChannelConfiguration &config)
 
virtual void slot_channelDestroyed (makVrv::DtChannelManager *channelManager, makVrv::DtChannel *channel)
 
- Protected Member Functions inherited from makVre::DtQtQuickOverlay
virtual void updateVals (double dt)
 
virtual void disconnect ()
 
virtual bool buildConnections (DtInitTable &connections)
 
virtual void onVisibilityAttributeChanged (bool on)
 
virtual void removeModelSetAndSkyFromChannel ()
 
virtual void restoreModelSetAndSkyToChannel ()
 
- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Protected Attributes

double myCurrentTime
 
double myTimeLastObserverToTargetDistanceCalculated
 
double myTargetDataExpirationTime
 
makVrv::DtIntersector * myIntersector
 
makArchives::DtDisplayUnitsSettingsRecord::NorthUnits myLastNorthUnits
 
DtVector myLastLocalOwnshipPosition
 
DtVector myLastGeocentricIntersectionPoint
 
DtAttributeHandle myLasingHandle
 
- Protected Attributes inherited from makVre::DtBinocularsOverlay
float myReticleTotalMils
 
bool myUsePostEffect
 
makVrv::DtOsgChannel * myChannel
 
makVre::DtInitTable myConfig
 
- Protected Attributes inherited from makVre::DtQtQuickOverlay
DtInitTable myBindQmlPropertyToAttribute
 
QQuickItem * myRoot
 
std::string myTargetWindow
 
std::vector< ConnectionmyConnections
 
std::string myQmlFile
 
std::string myQmlDataItemName
 
bool myIsInMenuState
 
bool myCachedVisibility
 
DtAttributeHandleType< bool > myVisibilityAttribute
 
bool myRenderOverlayOnly
 
bool myWantSceneHidden
 
makVrv::DtOsgChannel * myChannel
 
makVrv::DtObserverObject * myObserver
 
QObject myQObject
 
bool myHasTickFunction
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtBinocularsLasingOverlay()

makVre::DtBinocularsLasingOverlay::DtBinocularsLasingOverlay ( )

Constructor for DtBinocularsLasingOverlay.

Initializes the component with default settings

◆ ~DtBinocularsLasingOverlay()

virtual makVre::DtBinocularsLasingOverlay::~DtBinocularsLasingOverlay ( )
overridevirtual

Virtual destructor for DtBinocularsLasingOverlay.

Cleans up resources including the intersector object

Member Function Documentation

◆ initialize()

virtual bool makVre::DtBinocularsLasingOverlay::initialize ( makVre::DtPlayerStation * player,
makVre::DtInitTable & config )
overridevirtual

Initializes the binoculars lasing overlay component.

Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing overlay settings
Returns
True if initialization succeeded, false otherwise

Sets up the intersector, initializes attribute state values, and registers message handlers

Reimplemented from makVre::DtBinocularsOverlay.

References makVre::DtPlayerComponent::player().

◆ shutdown()

virtual void makVre::DtBinocularsLasingOverlay::shutdown ( )
overridevirtual

Shuts down the binoculars lasing overlay component.

Removes message handlers and performs base class shutdown

Reimplemented from makVre::DtBinocularsOverlay.

◆ type()

virtual const char * makVre::DtBinocularsLasingOverlay::type ( ) const
overridevirtual

Returns the type identifier for this component.

Returns
The type string for DtBinocularsLasingOverlay

Reimplemented from makVre::DtBinocularsOverlay.

◆ postInitialize()

virtual bool makVre::DtBinocularsLasingOverlay::postInitialize ( )
overridevirtual

Performs post-initialization after all components are initialized.

Returns
True if post-initialization succeeded, false otherwise

Configures VR-specific settings if necessary

Reimplemented from makVre::DtBinocularsOverlay.

◆ tick()

virtual void makVre::DtBinocularsLasingOverlay::tick ( double dt)
overridevirtual

Called every frame to update the overlay state.

Parameters
dtDelta time since the last frame in seconds

Updates current time, sensor data, north reference, target data, and handles target data expiration if necessary

Reimplemented from makVre::DtBinocularsOverlay.

◆ isOverlayVisible()

virtual bool makVre::DtBinocularsLasingOverlay::isOverlayVisible ( )
overridevirtual

Determines if the overlay should be visible.

Returns
True if the overlay should be visible, false otherwise

Checks menu state, base overlay visibility, and laser availability to determine if the overlay should be displayed

Reimplemented from makVre::DtBinocularsOverlay.

◆ handleStopLasingMessage()

virtual makVre::DtVreMessageResult makVre::DtBinocularsLasingOverlay::handleStopLasingMessage ( makVre::DtVreMessage * msg)
protectedvirtual

Handles stop lasing messages.

Parameters
msgStop lasing message
Returns
Message handling result indicating if the message was handled

Sets target data to expire 30 seconds after lasing stops

◆ updateSensorData()

virtual void makVre::DtBinocularsLasingOverlay::updateSensorData ( )
protectedvirtual

Updates sensor location and elevation attributes.

Updates the following attributes:

  • lasing.sensorLocation.formatted: MGRS ten-digit grid (e.g. "11S GN 01234 56789")
  • lasing.sensorElevation.formatted: Elevation in meters MSL (e.g. "EL 01234 m MSL")

◆ updateNorthReference()

virtual void makVre::DtBinocularsLasingOverlay::updateNorthReference ( )
protectedvirtual

Updates the north reference attribute.

Updates lasing.northReference.formatted attribute with current north reference setting ("MAG", "TRUE", or "GRID")

◆ updateTimeOfTargetLocation()

virtual void makVre::DtBinocularsLasingOverlay::updateTimeOfTargetLocation ( )
protectedvirtual

Updates the time of target location attribute.

Updates lasing.timeOfTargetLocation.formatted attribute with current time in HH:MM:SS format

◆ updateTargetData()

virtual void makVre::DtBinocularsLasingOverlay::updateTargetData ( )
protectedvirtual

Updates all target-related attributes based on current lasing state.

Updates the following attributes when lasing is active:

  • lasing.targetLocation.formatted: MGRS ten-digit grid (e.g. "11S GN 01234 56789")
  • lasing.targetElevationMSL.formatted: Elevation in meters MSL (e.g. "EL 01234 m MSL")
  • lasing.targetRange.formatted: Range in meters (e.g. "RNG 01234 m")
  • lasing.targetElevation.formatted: Elevation in NATO MILS (e.g. "ELA 0123 MIL")
  • lasing.targetAzimuth.formatted: Azimuth in NATO MILS (e.g. "AZ 0123 MIL")
  • lasing.elrfStatus.formatted: "ELRF IDLE" or "GET TGT LOCATION" based on lasing state

◆ timeString()

virtual std::string makVre::DtBinocularsLasingOverlay::timeString ( )
protectedvirtual

Generates a formatted time string for the current time.

Returns
String containing the current time in HH:MM:SS format

◆ clearTargetData()

virtual void makVre::DtBinocularsLasingOverlay::clearTargetData ( )
protectedvirtual

Sets all target data attributes to null or default values.

Resets all target-related attributes to their default state when target data expires or becomes invalid

◆ calculateElevationAndAzimuthToTarget()

virtual void makVre::DtBinocularsLasingOverlay::calculateElevationAndAzimuthToTarget ( const DtVector & geocentricObserverLocation,
const DtVector & geocentricIntersectionPoint,
double * targetElevation,
double * targetAzimuth )
protectedvirtual

Calculates elevation and azimuth from observer to target.

Parameters
geocentricObserverLocationObserver position in geocentric coordinates
geocentricIntersectionPointTarget position in geocentric coordinates
targetElevationPointer to store calculated elevation angle in radians
targetAzimuthPointer to store calculated azimuth angle in radians

Transforms positions to topocentric coordinates and calculates elevation and azimuth angles, considering the current north reference setting

Member Data Documentation

◆ myCurrentTime

double makVre::DtBinocularsLasingOverlay::myCurrentTime
protected

Current simulation time in seconds.

◆ myTimeLastObserverToTargetDistanceCalculated

double makVre::DtBinocularsLasingOverlay::myTimeLastObserverToTargetDistanceCalculated
protected

Time when observer-to-target distance was last calculated.

◆ myTargetDataExpirationTime

double makVre::DtBinocularsLasingOverlay::myTargetDataExpirationTime
protected

Time when target data will expire.

◆ myIntersector

makVrv::DtIntersector* makVre::DtBinocularsLasingOverlay::myIntersector
protected

Intersector for performing raycasting to determine target position.

◆ myLastNorthUnits

makArchives::DtDisplayUnitsSettingsRecord::NorthUnits makVre::DtBinocularsLasingOverlay::myLastNorthUnits
protected

Last known north units setting for detecting changes.

◆ myLastLocalOwnshipPosition

DtVector makVre::DtBinocularsLasingOverlay::myLastLocalOwnshipPosition
protected

Last known local ownship position for detecting changes.

◆ myLastGeocentricIntersectionPoint

DtVector makVre::DtBinocularsLasingOverlay::myLastGeocentricIntersectionPoint
protected

Last known geocentric position of laser intersection point.

◆ myLasingHandle

DtAttributeHandle makVre::DtBinocularsLasingOverlay::myLasingHandle
protected

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