VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUI Send Interaction (guiSendInteraction)

Table of Contents

The Entity List example demonstrates the following:

This example demonstrates how to access the VR-Link DtExerciseConnection from the VRF GUI application. This process is somewhat complex due to the fact that the DtExerciseConnection, and related networking classes are run in a seperate thread from the main application to improve performance. This thread is referred to as the "driver" thread, since the network is a driver of the VR-Vantage scene.

In this example, a new menu item is added to the VRF GUI, which triggers a user prompt for some text, and then that text is sent out in a comment interaction from the GUI using the DtExerciseConnection.

The DtExConnInterface class that is part of this example is the class that manages data flow from the main GUI thread (where the menu item is activated) to the driver thread. Actions that are taken on this object are put in a queue, and then processed by the driver thread. The DtGuiExConnAccessory class is a utility class that is used to add new functionallity to the driver in VR-Forces. This is used to set up the instance of the DtExConnInterface, and to set up the driver thread to call the processing queue in order to process the actions.

Usage

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 and re-start VR-Forces.

  1. Start vrfGui.
  2. Choose Simulation->Send Comment Interaction
  3. Enter some text
  4. Press OK
  5. A comment interaction will be sent. You can use VR-Link's NetDump program to view the network traffic.

Classes

DtExampleMenuItemThe menu item for sending a comment interaction
DtExConnInterfaceThe thread safe interface for calling the DtExerciseConnection from the main GUI thread.
DtGuiExConnAccessoryThe utility for adding the DtExConnInterface into the connection driver thread.

Plugin Entry Points

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2015 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//This file defines the generic DT_DLL_VRF_PLUGIN_EXPORT_MACRO. Use that macro when
//you want to export symbols. Also, in your CMakeLists.txt file, make sure to
//define the VRFPLUGIN_EXPORTS define to tell the compiler to define the macro as an
//export
#include <vl/diGuyObjectStateRepository.h>
#include <vrvCore/DtDe.h>
// This is the function called by VRF when this plugin is loaded.
{
// Add the accessory to the accessory manager. This will cause
// the accessory methods to get called when various driver actions occur,
// such as starting a connection, connecting and disconnecting.
// Set up the new menu item in the menu item structure.
makVrv::DtMenuPath::mainMenu("DtSimulationMenu").item("DtExampleMenuItem"),
makVrv::DtMenuPath::mainMenu("DtSimulationMenu").item("DtGlobalPlansMenuItem"));
return true;
}
// Function that is called by VRF to get general information about the plugin.
{
info.pluginName = "guiSendInteraction Example";
info.pluginDescription = "Example showing how to send PDUs using the DtExerciseConnection from a GUI plugin.";
info.pluginVersion = "1.00";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 USA";
info.pluginContactPhone = "(617) 876 8085";
}

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)