![]() |
VR-Forces 4.3 Class Documentation
|
The Network Callback Manager example demonstrates the following:
In order to incorporate a protocol-specific extension in the VR-Forces front-end, the VR-Vantage Accessories concept is used. An accessory is an external plugin that can be used in association with a particular application driver (scene, transport, etc). In the case of this example, a transport driver is used to extend functionality of the system, in this case the HLA13 and HLA1516 drivers.
When using accessories to extend the protocol-specific workings, it is important to note the following:
This accessory introduces the concept of the DtNetworkMessageInterface which is used to as a base class for subclasses that want to send specific content of a PDU to the GUI thread. The developer will create a subclass (e.g. DtTestInteractionInterface) to store the content of the PDU they wish to communicate to the GUI. Then, the receivedNetworkMessage call of the DtVrfDriver is used to communicate that message to the GUI thread.
On the GUI side, the developer registers for callbacks for a particular network message by using the registerNetworkMessageInterfaceCallback method of the DtGuiThreadNetworkCallbackManager class. When a message of this type is received, the boost bound method is called in response.
This example also shows how to use an event signaler to signal events from the GUI thread to the network thread. In this case in response to a menu item being selected the VR-Link comment interaction being published on the network.
Since this example is loaded as a plugin Select Settings, Plugins... and on the Plugins Editor page, use the combo box at the top of the page to select the plug-in. Then enable the Load Plugin checkbox for the networkCallbackManager example and re-start VR-Forces.
| DtCallbackMenu | The menu that contains the item to send the interaction. |
| DtNetworkCallbackManagerAccessory | The accessory class used to send and receive the DtCommentInteraction. |
| DtTestInteractionInterface | Interface used to take network dependent content to transfer to the GUI thread. |
| DtExampleEventSignaler | Signaler used by the GUI to notify the network thread to send the comment interaction. |
examplePlugin.cxx