The Create Local Object in GUI example demonstrates the following:
- How to build a plugin module for the VR-Forces Gui
- How to create a menu and menu items
- How to use the DtGuiLocalObjectManager to create and manage objects that are locally created in the GUI
- How to use the DtIntervisibilityDriver to create intervisibility objects
- How to use the DtCreateMenu class to convert a create name to the entity type it is going to create
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:
-
Start just the vrfGui through vrfLauncher.exe -F.
-
Load an existing terrain (e.g. Ground_DB II) through menu item File -> Terrain -> Open Terrain...
-
Choose 'Object Demo' menu item.
-
Select an item from the sub-menu list to create.
-
The item selected will be shown on the display.
-
Select the same item again fom the 'Object Demo' sub-menu list.
-
The previously created item will be removed from the display.
Classes
Plugin Entry Points
#include <QtWidgets/QMenu>
#include <QtWidgets/QMessageBox>
#include <boost/bind.hpp>
using namespace makVrf;
{
return true;
}
{
info.
pluginDescription =
"This example shows how to use the DtLocalObjectManager and create objects without publishing them on the network.";
}