VR-Forces 4.0.4 Class Documentation
Interface Content Example

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:

  1. Start vrfSim.
  2. Start vrfGui.

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

Classes

MyInterfaceContentThe interface content message.

Plugin Entry Points

/*******************************************************************************
** 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";
}

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)