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

Detailed Description

The DtInstrumentPanelManager handles creation, modification, and deletion of extra channels, windows, or instrument panels used by various roles. For example:

  • Gimbaled Sensor and PVD views for fixed wing pilots
  • The guard house's security panel window
  • The launcher's scope channel
  • The render-to-texture channels used by the T-38 and M1A2 3D models Interaction with this class is mostly done through sending WindowOperationMessage events. The manager maintains mappings between entities and their associated panels/cameras, and provides functionality for controlling sensor modes and overlay elements.

#include <instrumentPanelManager.h>

Public Member Functions

 DtInstrumentPanelManager ()
 
virtual ~DtInstrumentPanelManager ()
 
virtual void init (makVrv::DtDe *de, DtPlayerStationApp *app, DtEntityResolver *resolver, DtInitTable windowConfig)
 
virtual bool onDisengage (const DtEntityIdentifier &id)
 
virtual DtPanelStructgetPanelStruct (const DtEntityIdentifier &id) const
 
virtual DtCameraStructgetCameraStruct (const DtPanelStruct *panelStruct, const std::string &name) const
 
virtual void setObserverSensorMode (makVrv::DtObserver *observer, const std::string &modeName)
 
virtual void slot_onPostTick ()
 
virtual void slot_channelToBeDestroyed (makVrv::DtChannelManager *mgr, makVrv::DtChannel *channel)
 
virtual void slot_WindowToBeDestroyed (makVrv::DtWindow *window)
 
virtual DtVreMessageResult handleEntityRemoved (DtVreMessage *msg)
 
virtual void setAutoDisableHdrAutoExposure (bool value)
 
virtual void addOverlaySectionCreator (const std::string &key, makVrv::DtOsgSensorViewOverlaySectionCreator *creator)
 

Protected Types

using DtEntityPanelMap = std::map<DtEntityIdentifier, DtPanelStruct*>
 
using DtStringOverlayCreatorMap = std::map<std::string, makVrv::DtOsgSensorViewOverlaySectionCreator*>
 

Protected Member Functions

virtual void addDefaultOverlayCreators ()
 
virtual DtVreMessageResult handleWindowOperation (DtVreMessage *msg)
 
virtual DtVreMessageResult handleSetGimbalOverlaySections (DtVreMessage *msg)
 
virtual DtVreMessageResult handleRestoreGimbalOverlaySections (DtVreMessage *msg)
 
virtual DtVreMessageResult handleReassignPanelOwnership (DtVreMessage *msg)
 
virtual void processGimbalOperation (WindowOperationMessage *msg)
 
virtual void processStealthOperation (WindowOperationMessage *msg)
 
virtual void processPlanViewOperation (WindowOperationMessage *msg)
 
virtual void processInstrumentPanelOperation (WindowOperationMessage *msg)
 
virtual void createGimbal (WindowOperationMessage *msg)
 
virtual void destroyGimbal (WindowOperationMessage *msg)
 
virtual void createPlanView (WindowOperationMessage *msg)
 
virtual void destroyPlanView (WindowOperationMessage *msg)
 
virtual void createInstrumentPanel (WindowOperationMessage *msg)
 
virtual void destroyInstrumentPanel (WindowOperationMessage *msg)
 
virtual void createInstrumentPanelRtt (WindowOperationMessage *msg)
 
virtual void destroyInstrumentPanelRtt (WindowOperationMessage *msg)
 
virtual void createStealth (WindowOperationMessage *msg)
 
virtual void destroyStealth (WindowOperationMessage *msg, bool &destroyed)
 
virtual void destroyAllStealth (WindowOperationMessage *msg)
 
virtual DtVreMessageResult handleMinimapMessage (DtVreMessage *msg)
 
virtual DtVreMessageResult handleSetGimbalSensorMode (DtVreMessage *msg)
 
virtual void setCurrentSelection (makVrv::DtUniqueID id)
 
virtual void clearCurrentSelection ()
 
virtual DtPanelStructfindOrCreatePanelStruct (const WindowOperationMessage *msg)
 
virtual DtCameraStructfindOrCreateCameraStruct (DtPanelStruct *panelStruct, DtCameraType cameraType, std::string name)
 
virtual void slot_observerCreated (makVrv::DtInputDriver *inputDriver, makVrv::DtObserver *observer, DtCameraStruct *cameraStruct)
 

Protected Attributes

makVrv::DtDe * myDe
 
DtPlayerStationAppmyApp
 
DtEntityResolvermyEntityResolver
 
std::string myGimbalViewSensorMode
 
DtVector2DI myGimbalPosition
 
DtVector2DI myGimbalSize
 
int myPlanViewResolution
 
DtVector2DI myPlanViewPosition
 
DtVector2DI myPlanViewSize
 
DtEntityPanelMap myEntityPanelMap
 
std::string myObserverModeSuffix
 
std::vector< WindowOperationMessage * > myPendingFieldOfView
 
DtStringOverlayCreatorMap myOverlayCreatorMap
 
bool myAutoDisableHdrAutoExposure
 

Member Typedef Documentation

◆ DtEntityPanelMap

using makVre::DtInstrumentPanelManager::DtEntityPanelMap = std::map<DtEntityIdentifier, DtPanelStruct*>
protected

Map of entity identifiers to panel structures.

◆ DtStringOverlayCreatorMap

using makVre::DtInstrumentPanelManager::DtStringOverlayCreatorMap = std::map<std::string, makVrv::DtOsgSensorViewOverlaySectionCreator*>
protected

Map of overlay section keys to their creator objects.

Maps string keys to DtOsgSensorViewOverlaySectionCreators, allowing users to configure which overlay sections to use depending on their role or entity.

Constructor & Destructor Documentation

◆ DtInstrumentPanelManager()

makVre::DtInstrumentPanelManager::DtInstrumentPanelManager ( )

Default constructor.

Initializes member variables to default values. Full initialization occurs when the init method is called.

◆ ~DtInstrumentPanelManager()

virtual makVre::DtInstrumentPanelManager::~DtInstrumentPanelManager ( )
virtual

Virtual destructor.

Cleans up any remaining panel structures and resources.

Member Function Documentation

◆ init()

virtual void makVre::DtInstrumentPanelManager::init ( makVrv::DtDe * de,
DtPlayerStationApp * app,
DtEntityResolver * resolver,
DtInitTable windowConfig )
virtual

Initializes the instrument panel manager.

Sets up message handlers, configures default settings for gimbal and plan views, and adds default overlay creators.

Parameters
dePointer to the rendering engine
appPointer to the player station application
resolverPointer to the entity resolver
windowConfigConfiguration table containing window settings

References de().

◆ onDisengage()

virtual bool makVre::DtInstrumentPanelManager::onDisengage ( const DtEntityIdentifier & id)
virtual

Handles entity disengagement.

Cleans up resources associated with an entity when it's disengaged.

Parameters
idThe identifier of the entity being disengaged
Returns
true if successful, false otherwise

◆ getPanelStruct()

virtual DtPanelStruct * makVre::DtInstrumentPanelManager::getPanelStruct ( const DtEntityIdentifier & id) const
virtual

Retrieves the panel structure for a given entity.

Parameters
idThe entity identifier
Returns
Pointer to the panel structure or nullptr if not found

◆ getCameraStruct()

virtual DtCameraStruct * makVre::DtInstrumentPanelManager::getCameraStruct ( const DtPanelStruct * panelStruct,
const std::string & name ) const
virtual

Retrieves a camera structure by name from a panel structure.

Parameters
panelStructThe panel structure containing the camera
nameThe name of the camera to retrieve
Returns
Pointer to the camera structure or nullptr if not found

◆ setObserverSensorMode()

virtual void makVre::DtInstrumentPanelManager::setObserverSensorMode ( makVrv::DtObserver * observer,
const std::string & modeName )
virtual

Sets the sensor mode for an observer.

Attempts to set the sensor mode, and if the mode isn't found, tries appending the configurable mode suffix.

Parameters
observerThe observer to modify
modeNameThe name of the sensor mode to set

◆ slot_onPostTick()

virtual void makVre::DtInstrumentPanelManager::slot_onPostTick ( )
virtual

Slot called on post-tick to check for pending field of view messages.

Processes pending stealth window creation messages when their required fields of view become available.

◆ slot_channelToBeDestroyed()

virtual void makVre::DtInstrumentPanelManager::slot_channelToBeDestroyed ( makVrv::DtChannelManager * mgr,
makVrv::DtChannel * channel )
virtual

Slot called when a channel is about to be destroyed.

Performs necessary cleanup for the channel and updates associated panel structures.

Parameters
mgrThe channel manager
channelThe channel being destroyed

◆ slot_WindowToBeDestroyed()

virtual void makVre::DtInstrumentPanelManager::slot_WindowToBeDestroyed ( makVrv::DtWindow * window)
virtual

Slot called when a window is about to be destroyed.

Performs necessary cleanup for the window and updates associated panel structures.

Parameters
windowThe window being destroyed

◆ handleEntityRemoved()

virtual DtVreMessageResult makVre::DtInstrumentPanelManager::handleEntityRemoved ( DtVreMessage * msg)
virtual

Handles entity removal messages.

Cleans up resources associated with an entity when it's removed.

Parameters
msgThe entity removed message
Returns
Message handling result

◆ setAutoDisableHdrAutoExposure()

virtual void makVre::DtInstrumentPanelManager::setAutoDisableHdrAutoExposure ( bool value)
virtual

Sets whether to automatically disable HDR auto exposure on certain views.

Parameters
valuetrue to automatically disable HDR auto exposure, false to leave it as is

◆ addOverlaySectionCreator()

virtual void makVre::DtInstrumentPanelManager::addOverlaySectionCreator ( const std::string & key,
makVrv::DtOsgSensorViewOverlaySectionCreator * creator )
virtual

Adds or replaces an overlay section creator.

Each key is mapped to a creator that can generate a specific overlay section type for sensor views. This allows for configurable overlay sections.

Parameters
keyThe identifier for the overlay section type
creatorThe creator object for generating the overlay section

◆ addDefaultOverlayCreators()

virtual void makVre::DtInstrumentPanelManager::addDefaultOverlayCreators ( )
protectedvirtual

Adds default overlay section creators.

Adds creators for the following keys:

  • "Crosshair" - Displays 4 corners of a box
  • "PlatformInfo" - Displays information about ownship entity
  • "VrePlatformInfo" - Adds Date and Time displays to PlatformInfo
  • "TargetInfo" - Displays ownship coordinates
  • "VreTargetInfo" - Displays center of sensor's view coordinates
  • "VreMgrsTargetInfo" - Displays coordinates in MGRS format
  • "DisplayInfo" - Displays sensor view information
  • "VreDisplayInfo" - Strips off sensor mode suffixes
  • "Pitch" - Displays ladder showing sensor elevation
  • "VrePitch" - Adds Pitch readout to arrow
  • "Compass" - Displays sensor azimuth and platform heading
  • "Reticle" - Displays cross in the middle of the screen
  • "DateTime" - Displays date and time
  • "Time" - Displays time only
  • "Rec" - Displays static "REC" text

◆ handleWindowOperation()

virtual DtVreMessageResult makVre::DtInstrumentPanelManager::handleWindowOperation ( DtVreMessage * msg)
protectedvirtual

Handles window operation messages.

Routes messages to the appropriate handler based on the operation type.

Parameters
msgThe window operation message
Returns
Message handling result

◆ handleSetGimbalOverlaySections()

virtual DtVreMessageResult makVre::DtInstrumentPanelManager::handleSetGimbalOverlaySections ( DtVreMessage * msg)
protectedvirtual

Handles messages to set gimbal overlay sections.

Parameters
msgThe message containing overlay section information
Returns
Message handling result

◆ handleRestoreGimbalOverlaySections()

virtual DtVreMessageResult makVre::DtInstrumentPanelManager::handleRestoreGimbalOverlaySections ( DtVreMessage * msg)
protectedvirtual

Handles messages to restore gimbal overlay sections.

Parameters
msgThe message to restore overlay sections
Returns
Message handling result

◆ handleReassignPanelOwnership()

virtual DtVreMessageResult makVre::DtInstrumentPanelManager::handleReassignPanelOwnership ( DtVreMessage * msg)
protectedvirtual

Handles messages to reassign panel ownership.

Parameters
msgThe message containing reassignment information
Returns
Message handling result

◆ processGimbalOperation()

virtual void makVre::DtInstrumentPanelManager::processGimbalOperation ( WindowOperationMessage * msg)
protectedvirtual

Processes gimbal operations (create, destroy, modify)

Handles creation, destruction, and modification of gimbal views for Multi-function Displays (MFDs). Modification cycles through sensor modes.

Parameters
msgThe window operation message

◆ processStealthOperation()

virtual void makVre::DtInstrumentPanelManager::processStealthOperation ( WindowOperationMessage * msg)
protectedvirtual

Processes stealth operations.

Parameters
msgThe window operation message

◆ processPlanViewOperation()

virtual void makVre::DtInstrumentPanelManager::processPlanViewOperation ( WindowOperationMessage * msg)
protectedvirtual

Processes plan view operations.

Parameters
msgThe window operation message

◆ processInstrumentPanelOperation()

virtual void makVre::DtInstrumentPanelManager::processInstrumentPanelOperation ( WindowOperationMessage * msg)
protectedvirtual

Processes instrument panel operations.

Parameters
msgThe window operation message

◆ createGimbal()

virtual void makVre::DtInstrumentPanelManager::createGimbal ( WindowOperationMessage * msg)
protectedvirtual

Creates a gimbal view.

Parameters
msgThe window operation message with gimbal creation parameters

◆ destroyGimbal()

virtual void makVre::DtInstrumentPanelManager::destroyGimbal ( WindowOperationMessage * msg)
protectedvirtual

Destroys a gimbal view.

Parameters
msgThe window operation message identifying the gimbal to destroy

◆ createPlanView()

virtual void makVre::DtInstrumentPanelManager::createPlanView ( WindowOperationMessage * msg)
protectedvirtual

Creates a plan view.

Parameters
msgThe window operation message with plan view creation parameters

◆ destroyPlanView()

virtual void makVre::DtInstrumentPanelManager::destroyPlanView ( WindowOperationMessage * msg)
protectedvirtual

Destroys a plan view.

Parameters
msgThe window operation message identifying the plan view to destroy

◆ createInstrumentPanel()

virtual void makVre::DtInstrumentPanelManager::createInstrumentPanel ( WindowOperationMessage * msg)
protectedvirtual

Creates an instrument panel.

Parameters
msgThe window operation message with instrument panel creation parameters

◆ destroyInstrumentPanel()

virtual void makVre::DtInstrumentPanelManager::destroyInstrumentPanel ( WindowOperationMessage * msg)
protectedvirtual

Destroys an instrument panel.

Parameters
msgThe window operation message identifying the instrument panel to destroy

◆ createInstrumentPanelRtt()

virtual void makVre::DtInstrumentPanelManager::createInstrumentPanelRtt ( WindowOperationMessage * msg)
protectedvirtual

Creates a render-to-texture instrument panel.

Parameters
msgThe window operation message with RTT panel creation parameters

◆ destroyInstrumentPanelRtt()

virtual void makVre::DtInstrumentPanelManager::destroyInstrumentPanelRtt ( WindowOperationMessage * msg)
protectedvirtual

Destroys a render-to-texture instrument panel.

Parameters
msgThe window operation message identifying the RTT panel to destroy

◆ createStealth()

virtual void makVre::DtInstrumentPanelManager::createStealth ( WindowOperationMessage * msg)
protectedvirtual

Creates a stealth window.

Parameters
msgThe window operation message with stealth window creation parameters

◆ destroyStealth()

virtual void makVre::DtInstrumentPanelManager::destroyStealth ( WindowOperationMessage * msg,
bool & destroyed )
protectedvirtual

Destroys a stealth window.

Parameters
msgThe window operation message identifying the stealth window to destroy
[out]destroyedSet to true if the window was successfully destroyed; false otherwise

◆ destroyAllStealth()

virtual void makVre::DtInstrumentPanelManager::destroyAllStealth ( WindowOperationMessage * msg)
protectedvirtual

Destroys all stealth windows.

Parameters
msgThe window operation message

◆ handleMinimapMessage()

virtual DtVreMessageResult makVre::DtInstrumentPanelManager::handleMinimapMessage ( DtVreMessage * msg)
protectedvirtual

Handles minimap-related messages.

Parameters
msgThe minimap message
Returns
Message handling result

◆ handleSetGimbalSensorMode()

virtual DtVreMessageResult makVre::DtInstrumentPanelManager::handleSetGimbalSensorMode ( DtVreMessage * msg)
protectedvirtual

Handles messages to set gimbal sensor mode.

Parameters
msgThe message containing sensor mode information
Returns
Message handling result

◆ setCurrentSelection()

virtual void makVre::DtInstrumentPanelManager::setCurrentSelection ( makVrv::DtUniqueID id)
protectedvirtual

Sets the current selection.

Parameters
idThe ID of the entity to select

◆ clearCurrentSelection()

virtual void makVre::DtInstrumentPanelManager::clearCurrentSelection ( )
protectedvirtual

Clears the current selection.

◆ findOrCreatePanelStruct()

virtual DtPanelStruct * makVre::DtInstrumentPanelManager::findOrCreatePanelStruct ( const WindowOperationMessage * msg)
protectedvirtual

Finds or creates a panel structure for a given message.

Parameters
msgThe window operation message
Returns
Pointer to the panel structure

◆ findOrCreateCameraStruct()

virtual DtCameraStruct * makVre::DtInstrumentPanelManager::findOrCreateCameraStruct ( DtPanelStruct * panelStruct,
DtCameraType cameraType,
std::string name )
protectedvirtual

Finds or creates a camera structure.

Parameters
panelStructThe panel structure to add the camera to
cameraTypeThe type of camera to create
nameThe name of the camera
Returns
Pointer to the camera structure

◆ slot_observerCreated()

virtual void makVre::DtInstrumentPanelManager::slot_observerCreated ( makVrv::DtInputDriver * inputDriver,
makVrv::DtObserver * observer,
DtCameraStruct * cameraStruct )
protectedvirtual

Slot called when an observer is created.

Sets the observer name and sensor mode in the camera.

Parameters
inputDriverThe input driver
observerThe observer that was created
cameraStructThe camera structure to update

Member Data Documentation

◆ myDe

makVrv::DtDe* makVre::DtInstrumentPanelManager::myDe
protected

Pointer to the rendering engine.

◆ myApp

DtPlayerStationApp* makVre::DtInstrumentPanelManager::myApp
protected

Pointer to the player station application.

◆ myEntityResolver

DtEntityResolver* makVre::DtInstrumentPanelManager::myEntityResolver
protected

Pointer to the entity resolver.

◆ myGimbalViewSensorMode

std::string makVre::DtInstrumentPanelManager::myGimbalViewSensorMode
protected

Current sensor mode for gimbal views.

◆ myGimbalPosition

DtVector2DI makVre::DtInstrumentPanelManager::myGimbalPosition
protected

Default position for gimbal views.

◆ myGimbalSize

DtVector2DI makVre::DtInstrumentPanelManager::myGimbalSize
protected

Default size for gimbal views.

◆ myPlanViewResolution

int makVre::DtInstrumentPanelManager::myPlanViewResolution
protected

Resolution for plan views.

◆ myPlanViewPosition

DtVector2DI makVre::DtInstrumentPanelManager::myPlanViewPosition
protected

Default position for plan views.

◆ myPlanViewSize

DtVector2DI makVre::DtInstrumentPanelManager::myPlanViewSize
protected

Default size for plan views.

◆ myEntityPanelMap

DtEntityPanelMap makVre::DtInstrumentPanelManager::myEntityPanelMap
protected

Map storing all entity-panel associations.

◆ myObserverModeSuffix

std::string makVre::DtInstrumentPanelManager::myObserverModeSuffix
protected

Suffix to append when searching for observer modes.

If a requested observer mode can't be found, append either " (CameraFX)" or " (SensorFX)" and search again.

◆ myPendingFieldOfView

std::vector<WindowOperationMessage*> makVre::DtInstrumentPanelManager::myPendingFieldOfView
protected

Storage for pending field of view messages.

Stores copies of messages when the required field of view does not exist yet.

◆ myOverlayCreatorMap

DtStringOverlayCreatorMap makVre::DtInstrumentPanelManager::myOverlayCreatorMap
protected

Map storing all overlay section creators.

◆ myAutoDisableHdrAutoExposure

bool makVre::DtInstrumentPanelManager::myAutoDisableHdrAutoExposure
protected

Flag to control HDR auto exposure behavior.

When true, HDR auto exposure will be automatically disabled for certain types of views.


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