VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Entity List (entityList)

Table of Contents

The Entity List example demonstrates the following:

Adding a New Panel

The Entity List example demonstrates how to add a new panel to the application and to display the task an entity is doing in that panel for all entities. This includes showing the destination point if the task is "move-to".

The example supplies a .ui file that shows how to create a dialog box using Qt Designer and how that .ui file translates itself into a .cpp and .h file that can be subclassed and extended for use in the VR-Forces GUI.

Using the Qt connection call, the panel connects to functions that send out updates when an entity is updated. This shows how user interface objects can have their states change when some aspect of an entity changes.

How to Run the Example

Usage

Since this example is loaded as a plugin, it will need to be enabled in the Launcher. In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the plugin.

  1. Start VR-Forces GUI and SIM.
  2. Create a new scenario - e.g. EntityLevel SMS on Ground_DB II terrain.
  3. Create a tank - e.g. M1A2 Abrams.
  4. Right click on the tank and assign a Move To Location task.
  5. Play the scenario.
  6. The 'Entity List' panel will display information about the tank and where it is moving to.

Classes

DtEntityListThe toolbar widget that displays task information about all entities.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2011 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//\file entityListPlugin.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 "DtEntityList.h"
#include <vrvCore/DtDe.h>
using namespace makVrf;
void DefaultLayoutLoaded(makVrv::DtDe* de, makVrv::DtVrvApplicationConfiguration::UIConfiguration& configuration)
{
//If the configuration for the panel already exists, this means that the
//display configuration file was saved with this plugin active. In this case,
//leave the panel where the display configuration file says. This will be
//where the user had it when they closed the app.
}
{
//Register new widget with the system so that it can be created.
//NOTE: This does not actually display the widget anywhere.
//Add the widget to the display configuration so that it will be displayed.
//Each page must be on a panel, so in this case we add a panel that will
//contain only this page.
if (igApp)
{
//If the configuration for the panel already exists, this means that the
//display configuration file was saved with this plugin active. In this case,
//leave the panel where the display configuration file says. This will be
//where the user had it when they closed the app.
"DtEntityListPanel"))
{
//If it was not in the configuration, make a new dockable panel, and start it on
//the left side dock area.
igApp->masterModePageConfiguration().addPageCollection("DtEntityListPanel",
//Add the widget to that panel.
makVrv::DtPagePath::collection("DtEntityListPanel").page("DtEntityList"));
}
// Since we want this page to be shown for whatever configuration is made current, connect to the layout
// manager's signal for a layout to be realized so this can be added to it
// Connect to pre-assemble message to add this right before assembly (to be shown)
DtLayoutManager::instance(*de).signal_layoutToBeRealized.connect(boost::bind(&DefaultLayoutLoaded, de, _2));
makVrv::DtMenuPath::mainMenu("DtViewMenu").item("DtEntityListPanel"),
makVrv::DtMenuPath::mainMenu("DtViewMenu").item("DtDisplayConfigEditorPanel"));
}
return true;
}
{
info.pluginName = "entityList";
info.pluginDescription = "This example shows how to work with entity lists.";
info.pluginVersion = "1.00";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "10 Fawcett Street, Suite 204, Cambridge, MA 02138 USA";
info.pluginContactPhone = "(617) 876 8085";
}

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)