The Entity List example demonstrates the following:
- How to build a plugin module for the VR-Forces 3D Gui
- How to add a new panel to the main window
- How to work with lists of entities and environment objects
- How to use callbacks to notify when an entity has changed and a new task is issued
The Entity List example demonstrates how to add a new panel to the application and to display task in that panel about 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.
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 and re-start VR-Forces.
-
Start vrfGui.
-
Start vrfSim.
-
Create a new scenario.
-
Create a tank.
-
Right click on the tank and assign a Move To task.
-
Play the scenario.
The 'Entity List' panel will display information about the tank and where it is moving to.
Classes
| DtEntityList | The toolbar widget that displays task information about all entities. |
Plugin Entry Points
#include <vrvCore/DtDe.h>
#include <vrvUtil/DtDeInitializer.h>
#include <vrvCore/DtUserInterfaceAssembler.h>
#include <vrvCoreQt/DtQtPageAssembler.h>
#include <vrvCore/DtVrvApplication.h>
using namespace makVrf;
{
makVrv::DtQtPageAssembler& qtPageAssembler = makVrv::DtQtPageAssembler::instance(*de);
makVrv::DtVrvApplication* igApp = makVrv::DtVrvApplication::findFromDe(*de);
if(igApp)
{
if (!igApp->masterModePageConfiguration().findPageCollectionTitle(
"DtEntityListPanel"))
{
igApp->masterModePageConfiguration().addPageCollection("DtEntityListPanel",
makVrv::DtUnicode::fromAscii("Entity List"), makVrv::DtPageConfiguration::DockLeft, true, "DtEntityList");
igApp->masterModePageConfiguration().addPagePath(
makVrv::DtPagePath::collection("DtEntityListPanel").page("DtEntityList"));
}
}
return true;
}
{
}