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

Detailed Description

The DtGlStudioHudMapperLogic handles configuration and management of cockpit displays and instrument panels created with GLStudio. It supports:

  • Mapping entity types to model definitions for cockpit displays
  • Creating and configuring multiple instrument panels
  • Handling configuration requests from GLStudio components
  • Managing panel properties and configurations

This component works in conjunction with GLStudio to provide a complete cockpit visualization system for vehicle roles.

#include <glstudioHudMapperLogic.h>

Inheritance diagram for makVre::DtGlStudioHudMapperLogic:
[legend]

Public Member Functions

 DtGlStudioHudMapperLogic ()
 
virtual ~DtGlStudioHudMapperLogic () override
 
virtual bool initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
virtual bool postInitialize ()
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Member Functions

virtual void createInstrumentPanels (makVre::DtInitTable &config)
 
virtual makVre::DtVreMessageResult handleGlsConfigRequest (makVre::DtVreMessage *msg)
 
- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Protected Attributes

std::vector< std::string > myModelDefinitions
 
std::map< std::string, DtInitTablemyPanelConfigurations
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtGlStudioHudMapperLogic()

makVre::DtGlStudioHudMapperLogic::DtGlStudioHudMapperLogic ( )

Constructor for DtGlStudioHudMapperLogic.

Initializes the component with the name "DtGlStudioHudMapperLogic" and empty model definitions and panel configurations.

◆ ~DtGlStudioHudMapperLogic()

virtual makVre::DtGlStudioHudMapperLogic::~DtGlStudioHudMapperLogic ( )
overridevirtual

Virtual destructor for DtGlStudioHudMapperLogic.

Member Function Documentation

◆ initialize()

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

Initializes the component with configuration from Lua.

Sets up the model definitions for cockpit displays, processes instrument panel configurations, and adds a handler for GLStudio configuration requests. The method also sets the "realCockpit" state attribute based on configuration.

Configuration parameters include:

  • modelDefinitions: String or table of strings defining cockpit model definitions
  • properties: Table of properties for the main cockpit display
  • realCockpit: Boolean flag indicating if this is a real cockpit (default: false)
  • instrumentPanels: Table of instrument panel configurations
Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing initialization parameters
Returns
True if initialization succeeds, false otherwise

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ tick()

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

Updates the component state (empty implementation)

This method is called each frame but currently has no implementation.

Parameters
dtDelta time in seconds since the last tick

Implements makVre::DtPlayerComponent.

◆ shutdown()

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

Shuts down the component.

Closes all instrument panels associated with this entity by sending a WindowOperationMessage with the OperationType_Destroy operation. Also removes the GLStudio configuration request handler.

Reimplemented from makVre::DtPlayerComponent.

◆ type()

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

Returns the component type identifier.

Returns
The component type string

Implements makVre::DtPlayerComponent.

◆ createInstrumentPanels()

virtual void makVre::DtGlStudioHudMapperLogic::createInstrumentPanels ( makVre::DtInitTable & config)
protectedvirtual

Creates instrument panels used by the current display layout.

Processes the "instrumentPanels" section from the configuration and creates instrument panels with the specified properties. For each panel, sends a WindowOperationMessage to create a new instrument panel window with the specified parameters.

Panel configuration parameters include:

  • modelDefinition: GLStudio model definition to use
  • panelPositionX/Y: Screen coordinates for panel position
  • panelSizeX/Y: Panel dimensions
  • screen: Screen index to display on
  • fullscreen: Whether the panel should be fullscreen
  • cockpitOnly: Whether to display only when in cockpit view
  • panelId: Unique identifier for the panel (for configuration)
  • additionalChannelKeywords: Additional channel keywords
Parameters
configConfiguration table containing instrument panel settings

◆ handleGlsConfigRequest()

virtual makVre::DtVreMessageResult makVre::DtGlStudioHudMapperLogic::handleGlsConfigRequest ( makVre::DtVreMessage * msg)
protectedvirtual

Handles configuration requests from GLStudio components.

Processes GlsConfigRequestMessages by looking up the requested panel ID in the myPanelConfigurations map. If found, sends a GlsConfigResponseMessage with the panel's properties.

Properties are defined in the "properties" section of a panel's configuration as key-value pairs.

Parameters
msgThe message to process (expected to be a GlsConfigRequestMessage)
Returns
HANDLED if the message was processed successfully

Member Data Documentation

◆ myModelDefinitions

std::vector<std::string> makVre::DtGlStudioHudMapperLogic::myModelDefinitions
protected

List of model definitions for cockpit displays.

These model definitions are registered with the DtSharedCockpitSettings to map entity types to cockpit models.

◆ myPanelConfigurations

std::map<std::string, DtInitTable> makVre::DtGlStudioHudMapperLogic::myPanelConfigurations
protected

Map of panel IDs to their configuration data.

This map stores initialization data for instrument panels, allowing the component to respond to panel configuration requests. The key is the panel ID, and the value is the configuration table containing the panel's properties.

An empty string key represents the main cockpit display's configuration.


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