VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Create Local Object in GUI (guiLocalCreateObject)

Table of Contents

The Create Local Object in GUI example demonstrates the following:

Creating Objects in the GUI

This example demonstrates how to use the DtGuiLocalObjectManager to create objects in the GUI that are not published on the network. It also demonstrates how to use the DtIntervisibility driver to create intervisiblity objects.

In this example, a new menu item is added to the VRF GUI which will show a list of items that will be used to create local objects. When created a check mark will be put next to the menu item. If the menu item is selected again the check mark will be removed. This example will create items in all views (2D and 3D)

In this example the intervisibility line will be drawn between the M1A2 and the Airbus. This item will not be enabled until both the M1A2 and Airbus are created.

How to Run the Example

Usage

In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the plugin.

To view the new behavior:

  1. Start just the vrfGui through vrfLauncher.exe -F.
  2. Load an existing terrain (e.g. Ground_DB II) through menu item File -> Terrain -> Open Terrain...
  3. Choose 'Object Demo' menu item.
  4. Select an item from the sub-menu list to create.
  5. The item selected will be shown on the display.
  6. Select the same item again fom the 'Object Demo' sub-menu list.
  7. The previously created item will be removed from the display.

Classes

DtGuiLocalCreateObjectMenuThe main menu for this example.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2014 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//\file guiLocalCreateObject.cxx
//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 <vrvCore/DtDe.h>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMessageBox>
#include <boost/bind.hpp>
using namespace makVrf;
{
//Now, add the menu to the master mode configuration. mainMenu indicates that
//the example menu is going to be used as a top-level main menu rather than a
//sub-menu. Add it before the Task menu. To leave off the path will
//put the menu at the end of the menu bar
//Now, register all the menu items with the menu configuration
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectLine"));
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectArea"));
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectWaypoint"));
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectM1A2"));
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectAirbus310"));
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectFan"));
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectAttachedLine"));
return true;
}
{
info.pluginName = "Gui Local Create Object";
info.pluginDescription = "This example shows how to use the DtLocalObjectManager and create objects without publishing them on the network.";
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)