VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Spot Report Manipulation (spotReportManipulation)

The Spot Report example demonstrates the following:

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.

In order to use this example, you must do the following:

  1. Create a new Scenario.
  2. Create some friendly and opposing entities and set their Rules of Engagement to Hold Fire.
  3. Make sure that spot reports configuration is set up correctly by going to the Settings Application Settings Spot Reports tab.
  4. On the Viewpoint tab, select a viewpoint to look from (Friendly or Opposing).
  5. Go to the Enable/Disable spot reports tab and make sure that spot reporting is on.
  6. Play the scenario.
  7. When a spot report shows up, select the report. You can see the selection in the Last Selected Object panel.
/*******************************************************************************
** 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 Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)