VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Add Object List Folder (addObjectListFolder)

Table of Contents

The Add ObjectList Folder example demonstrates the following:

Adding a New Folder to the Simulation Object List

The Add Object List Folder example is a simple example that shows how to add a new folder to the Simulation Object list and then to assign objects to this folder. The example will place Routes into this folder instead of under the Tactical Graphics folder.

It should be noted that you should only put unorganized objects into this folder. If organized objects (such as Tanks or Humans) are placed into this folder you will not be able to change their force by dragging/dropping to a new Force level folder. If you do try and organize Simulation Objects this way do be aware of the limitiations

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 vrfGui.
  2. Start vrfSim.
  3. Create a new scenario (e.g. EntityLevel SMS on Ground_DB II terrain).
  4. Create a route.
  5. The 'Simulation Object' panel will display the new Routes folder with the newly created route underneath it. Without the plugin - the route objects are created within the Tactical Graphics folder.

Plugin Entry Points and Code

/*******************************************************************************
** Copyright (c) 2018 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
#include <QtWidgets/QTreeWidget>
#include <boost/bind.hpp>
using namespace makVrf;
using namespace makVrv;
void SetupRouteRootNode(DtVrfOrganizedObjectListPageLogic* logic, DtDe* de)
{
DtObjectListViewItem* item = logic->addOrganizedRootNode(QObject::tr("Routes"),
DtFilename((de->dePathConfiguration().dataPath() + "/images/overlays/small/line.png").c_str()),
DtVrfSelectionObjectFilter(DtEntityType(17, 0, 0, 2, 0, 0, 0)), 0,
QObject::tr("Tactical Graphics")); // Get this before the tactical graphic filter
// Comment this line to have the item be initially collapsed
item->setExpanded(true);
}
bool initDeModule(DtDe* de)
{
return true;
}
{
// Connect signals to set up the root node and to return it when a route is discovered
boost::bind(&SetupRouteRootNode, _1, &de));
}
{
info.pluginName = "Add Object List Folder";
info.pluginDescription = "This example will show how to add a folder to the object list for organizing routes";
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)