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 DtLocalObjectManager to create and manage objects that are locally created to 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
This example demonstrates how to use the DtLocalObjectManager 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.
Usage
Since this example is loaded as a plugin Select Settings, Plugins... and on the Plugins Editor page, use the combo box at the top of the page to select the plug-in. Then enable the Load Plugin checkbox for the guiLocalCreateObject example and re-start VR-Forces.
-
Start vrfGui.
-
Choose Object Demo Menu
-
Select an item to create
-
The item selected will be shown on the display.
-
Select the item just created
-
The item selected will be removed from the display.
Classes
Plugin Entry Points
#include <vrvCore/DtDe.h>
#include <QtGui/QMenu>
#include <QtGui/QMessageBox>
#include <boost/bind.hpp>
using namespace makVrf;
{
makVrv::DtMenuPath::mainMenu("DtTaskMenu"));
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("DtGuiLocalCreateObjectAirbus320"));
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectFan"));
makVrv::DtMenuPath::mainMenu("DtGuiLocalCreateObjectMenu").item("DtGuiLocalCreateObjectAttachedLine"));
return true;
}
{
info.
pluginDescription =
"This example shows how to use the DtLocalObjectManager and create objects without publishing them on the network.";
}