![]() |
VR-Forces 4.0.4 Class Documentation
|
The Entity List example demonstrates the following:
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.
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.
The 'Entity List' panel will display information about the tank and where it is moving to.
| DtEntityList | The toolbar widget that displays task information about all entities. |
/******************************************************************************* ** Copyright (c) 2011 MAK Technologies, Inc. ** All rights reserved. *******************************************************************************/ //\file entityListPlugin.cxx //\brief Contains plugin function //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 <vrfGuiCore/vrfGuiExportPlugin.h> #include "DtEntityList.h" #include <vrvCore/DtDe.h> #include <vrvUtil/DtDeInitializer.h> #include <vrvCore/DtUserInterfaceAssembler.h> #include <vrvCoreQt/DtQtPageAssembler.h> #include <vrvCore/DtVrvApplication.h> using namespace makVrf; bool initDeModule(makVrv::DtDe* de) { //Register new widget with the system so that it can be created. //NOTE: This does not actually display the widget anywhere. makVrv::DtQtPageAssembler& qtPageAssembler = makVrv::DtQtPageAssembler::instance(*de); qtPageAssembler.registerPageCreator(new makVrfEntityListExample::DtEntityListWidgetCreator(*de)); //Add the widget to the display configuration so that it will be displayed. //Each page must be on a panel, so in this case we add a panel that will //contain only this page. makVrv::DtVrvApplication* igApp = makVrv::DtVrvApplication::findFromDe(*de); if(igApp) { //If the configuration for the panel already exists, this means that the //display configuration file was saved with this plugin active. In this case, //leave the panel where the display configuration file says. This will be //where the user had it when they closed the app. if (!igApp->masterModePageConfiguration().findPageCollectionTitle( "DtEntityListPanel")) { //If it was not in the configuration, make a new dockable panel, and start it on //the left side dock area. igApp->masterModePageConfiguration().addPageCollection("DtEntityListPanel", makVrv::DtUnicode::fromAscii("Entity List"), makVrv::DtPageConfiguration::DockLeft, true, "DtEntityList"); //Add the widget to that panel. igApp->masterModePageConfiguration().addPagePath( makVrv::DtPagePath::collection("DtEntityListPanel").page("DtEntityList")); } } return true; } void DtPluginInformation(DtVrfPluginInformation& info) { info.pluginName = "entityList"; info.pluginDescription = "This example shows how to work with entity lists."; info.pluginVersion = "1.00"; info.pluginCreator = "MAK Technologies"; info.pluginCreatorEmail = "sales@mak.com"; info.pluginContactWebPage = "www.mak.com"; info.pluginContactMailingAddress = "68 Moulton Street - Cambridge, MA 02138"; info.pluginContactPhone = "(617) 876 8085"; }