VR-Forces 4.7 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. Make sure that spot reports configuration is set up correctly by going to the Settings Application Settings Spot Reports tab.
  3. On the Viewpoint tab, select a viewpoint to look from (Friendly or Opposing).
  4. Go to the Enable/Disable spot reports tab and make sure that spot reporting is on.
  5. When load a scenario, load the developer_toolkit_examples scenario.
  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 = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 USA";
info.pluginContactPhone = "(617) 876 8085";
}

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)