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

Detailed Description

DtUpdateVisualsConnector responds to visual model definition changes by recreating and updating DtVrlinkElement objects to reflect the new visual definitions. It handles entities, aggregates, and tactical graphics, ensuring they use the latest visual model definitions from the current simulation model set (SMS).

#include <updateVisualsConnector.h>

Inheritance diagram for makVre::DtUpdateVisualsConnector:
[legend]

Public Member Functions

 DtUpdateVisualsConnector ()
 
virtual ~DtUpdateVisualsConnector () override
 
virtual void install (DtPlayerStationApp *app, makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection *connection) override
 
virtual void tick () override
 
virtual void shutdown () override
 
- Public Member Functions inherited from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector
 DtSimEventConnector ()
 
virtual ~DtSimEventConnector () override
 
- Public Member Functions inherited from makVre::DtConnector
 DtConnector ()
 
virtual ~DtConnector ()
 
virtual DtConnectorType type ()
 
virtual std::string name ()
 

Protected Member Functions

virtual makVre::DtVreMessageResult handleVisualModelDefinitionsLoaded (makVre::DtVreMessage *msg)
 
virtual makVre::DtVreMessageResult handleSmsLoadComplete (makVre::DtVreMessage *msg)
 

Protected Attributes

std::map< DtGlobalObjectDesignator, DtGlobalObjectDesignator > myEntitiesToReparent
 
int myTicksToReparent
 
- Protected Attributes inherited from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector
DtPlayerStationAppmyApp
 
makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection * myConnection
 
- Protected Attributes inherited from makVre::DtConnector
std::string myName
 
DtConnectorType myType
 

Additional Inherited Members

- Public Types inherited from makVre::DtConnector
enum  DtConnectorType {
  DIS , HLA13 , HLA1516 , HLA1516E ,
  HLA4
}
 
- Static Public Member Functions inherited from makVre::DtConnector
static std::string extension (DtConnectorType type)
 

Constructor & Destructor Documentation

◆ DtUpdateVisualsConnector()

makVre::DtUpdateVisualsConnector::DtUpdateVisualsConnector ( )

Default constructor.

Initializes the connector with name "UpdateVisuals"

◆ ~DtUpdateVisualsConnector()

virtual makVre::DtUpdateVisualsConnector::~DtUpdateVisualsConnector ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ install()

virtual void makVre::DtUpdateVisualsConnector::install ( DtPlayerStationApp * app,
makVrv::DT_PROTOCOL_NAMESPACE::DtVrlinkConnection * connection )
overridevirtual

Installs the visual update connector with the application and connection.

Parameters
appPointer to the player station application
connectionPointer to the protocol-specific VR-Link connection

Registers message handlers for VisualModelDefinitionsLoadedMessage messages

Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.

◆ tick()

virtual void makVre::DtUpdateVisualsConnector::tick ( )
overridevirtual

Performs periodic processing of entity reparenting.

Handles re-parenting of embarked entities that were discovered during SMS reload by attempting to re-establish parent-child relationships over several ticks

Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.

◆ shutdown()

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

Shuts down the visual update connector.

Removes message handlers for visual model definition updates

Reimplemented from makVre::DT_PROTOCOL_NAMESPACE::DtSimEventConnector.

◆ handleVisualModelDefinitionsLoaded()

virtual makVre::DtVreMessageResult makVre::DtUpdateVisualsConnector::handleVisualModelDefinitionsLoaded ( makVre::DtVreMessage * msg)
protectedvirtual

Handles visual model definition loaded messages.

Parameters
msgPointer to the visual model definitions loaded message
Returns
Message result indicating how the message was handled

Updates all visual DtVrlinkElements (entities, aggregates, tactical graphics) with the latest visual model definitions/mappings. For each element, it disables and re-enables the model sets, updates the element definition, and then re-visualizes the element using the new definitions.

◆ handleSmsLoadComplete()

virtual makVre::DtVreMessageResult makVre::DtUpdateVisualsConnector::handleSmsLoadComplete ( makVre::DtVreMessage * msg)
protectedvirtual

Handles SMS load complete messages.

Parameters
msgPointer to the SMS load complete message
Returns
Message result indicating how the message was handled

Sets up the reparenting process after SMS reload by initializing the myTicksToReparent counter and removing the handler since it's only needed once per reload

Member Data Documentation

◆ myEntitiesToReparent

std::map<DtGlobalObjectDesignator, DtGlobalObjectDesignator> makVre::DtUpdateVisualsConnector::myEntitiesToReparent
protected

Map of entities that need to be reparented.

Map of entity global designators to their parent entity global designators Used to track entities that need to be reparented after SMS reload

◆ myTicksToReparent

int makVre::DtUpdateVisualsConnector::myTicksToReparent
protected

Counter for reparenting attempts.

Number of ticks remaining to attempt reparenting of entities When this reaches zero, any remaining entities will have warning messages logged


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