VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Spot Report Manipulation (spotReportManipulation)

Table of Contents

The Spot Report example demonstrates the following:

How to Run the Example

The Spot Report Manipulation example demonstrates how to manipulate the selection of spot report objects by allowing for custom code when a spot report is selected.

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 VR-Forces GUI and SIM.
  2. Create a new Scenario - e.g. EntityLevel SMS on a Ground_DB II terrain.
  3. Create some friendly and opposing entities (e.g. US Army M16) and set their Rules of Engagement to Hold Fire.
  4. Make sure that spot reports configuration is set up correctly by going to the Settings Application Settings Spot Reports Options tab.
  5. Enable the "Send Spot Reports" check box.
  6. Select the Viewpoint tab and select Friendly or Opposing in the "Show spot reports from viewpoint of force" combo box.
  7. Select the Display tab and enable some of the Spot Report Labels - e.g. Reported By , Entity Type.
  8. Run the scenario.
  9. When a spot report shows up in the Objects List panel, select an entity from the report.
  10. You can see the details for the reported entity in the Last Selected Object panel.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2012 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//\file spotReportManipulationPlugin.cxx
//This file defines the generic DT_DLL_VRF_PLUGIN_EXPORT_MACRO. Use that macro when
//you want to export symbols.
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QStatusBar>
using namespace makVrf;
//This function is called by our plugin structure to make changes to the front end.
//To make sure all items are initialized properly, the bulk of the work will be done in the
//postInit entry point. This function needs to be defined in order to be considered a valid plugin
{
return true;
}
void slot_onCurrentSelectionChanged(
{
QMainWindow* mainQWindow = dynamic_cast<QMainWindow*>(mainWindow);
if (mainQWindow)
{
mainQWindow->statusBar()->showMessage("");
mainQWindow->statusBar()->hide();
}
makVrv::DtSelectionManager::IdSet::const_iterator it = selectedSet.begin();
for(; it != selectedSet.end(); ++it)
{
//Get data from the state view collection manager. If the item is a spot report, put up a dialog
//announcing selection
{
QMainWindow* mainQWindow = dynamic_cast<QMainWindow*>(mainWindow);
if (mainQWindow)
{
mainQWindow->statusBar()->show();
mainQWindow->statusBar()->showMessage("A spot report was selected");
return;
}
}
}
}
void slot_unhandledEdit(makVrv::DtElementID id, makVrv::DtDe* de)
{
QMainWindow* mainQWindow = dynamic_cast<QMainWindow*>(mainWindow);
if (mainQWindow)
{
{
mainQWindow->statusBar()->show();
mainQWindow->statusBar()->showMessage("A spot report was double clicked on");
}
else
{
mainQWindow->statusBar()->hide();
}
}
}
//Set up the fact that spot reports can be selected and connections for what to do when they are
//selected
{
&slot_onCurrentSelectionChanged, _1, &de));
//A signal is sent when a type is not editable. This is a signal that, potentially, a spot report
//was double clicked on, so, see if it was
boost::bind(&slot_unhandledEdit, _1, &de));
}
//This function is also called by our plugin structure and prints out information about this plugin
//to the logs. It's a good indicator that the plugin loaded if you are looking at the logs.
{
info.pluginName = "Spot Report Manipulation";
info.pluginDescription = "This example shows how to work with the selection of spot reports.";
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)