VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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.

/*******************************************************************************
** 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 <QtGui/QMainWindow>
#include <QtGui/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* main = dynamic_cast<QMainWindow*>(mainWindow);
if (main)
{
main->statusBar()->showMessage("");
main->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* main = dynamic_cast<QMainWindow*>(mainWindow);
if (main)
{
main->statusBar()->show();
main->statusBar()->showMessage("A spot report was selected");
return;
}
}
}
}
void slot_unhandledEdit(makVrv::DtElementID id, makVrv::DtDe* de)
{
QMainWindow* main = dynamic_cast<QMainWindow*>(mainWindow);
if (main)
{
{
main->statusBar()->show();
main->statusBar()->showMessage("A spot report was double clicked on");
}
else
{
main->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 Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)