![]() |
VR-Forces 4.0.4 Class Documentation
|
The Interface Content example demonstrates the following:
The Interface Content example creates a new type of VRF interface message class MyInterfaceContent which demonstrates how to send and receive interface content messages from the front and back-end.
Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces 3D application
To view the new behavior:
A menu item to send the interface content message will be created under the Simulation menu. Type in a message. The back-end will receive the message and send an acknowledgement to the front-end
| MyInterfaceContent | The interface content message. |
/******************************************************************************* ** Copyright (c) 2011 MAK Technologies, Inc. ** All rights reserved. *******************************************************************************/ //\file interfaceContentPlugin.cxx //\brief Contains plugin function //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 <vrfGuiCore/vrfGuiExportPlugin.h> #include "../interfaceContentSim/myInterfaceContent.h" #include "DtInterfaceContentMenuItem.h" #include <vrfGuiConstants/vrfMenuIds.h> #include <vrfGuiCore/DtNetworkMessageCallbackManager.h> #include <vrfGuiCore/DtGuiThreadVrfRemoteController.h> #include <vrvCore/DtDe.h> #include <vrfGuiCoreQt/vrfMainMenu.h> using namespace makVrf; bool initDeModule(makVrv::DtDe* de) { DtVrfMainMenu::instance(*de).menuConfiguration().addMenuPathAfter( makVrv::DtMenuPath::mainMenu(DtSimulationMenuId).item("DtInterfaceContentMenuItem"), makVrv::DtMenuPath::mainMenu(DtSimulationMenuId).item(DtGlobalPlansMenuItemId)); DtVrfMainMenu::instance(*de).registerMenuItem(new vrfInterfaceContentExample::DtInterfaceContentMenuItem(*de)); //Register the creator for MyInterfaceContentType with the //DtInterfaceContentFactory DtGuiThreadVrfRemoteController::instance(*de).addInterfaceContentCreatorFcn(MyInterfaceContentType, MyInterfaceContent::creator); makVrf::DtNetworkMessageCallbackManager::instance(*de).simMessageSignal(MyInterfaceContentType).connect( boost::bind(&vrfInterfaceContentExample::DtInterfaceContentMenuItem::processInterfaceMessage, _1)); return true; } void DtPluginInformation(DtVrfPluginInformation& info) { info.pluginName = "interfaceContentGui"; info.pluginDescription = "This is an example of how to add a new interface message in the VRF back-end."; info.pluginVersion = "1.00"; info.pluginCreator = "MAK Technologies"; info.pluginCreatorEmail = "sales@mak.com"; info.pluginContactWebPage = "www.mak.com"; info.pluginContactMailingAddress = "68 Moulton Street - Cambridge, MA 02138"; info.pluginContactPhone = "(617) 876 8085"; }