VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Modify Set (modifySet)

The Modify Set example demonstrates the following:

To observe the plugin:

  1. Start vrfGui and vrfSim
  2. Create an M1A2 entity
  3. Select the entity and Set > Location...
  4. Observe the combo-box labeled "Example Combo". It should have options "Item 1" and "Item 2"
/*******************************************************************************
** Copyright (c) 2011 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//\file modifySetPlugin.cxx
//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 <vrvCore/DtDe.h>
#include <QtGui/QComboBox>
#include <QtGui/QLabel>
#include <QtGui/QLayout>
//Override of task move to dialog. Will hide choice of path plan or regular movement mode
class MySetLocationDialog : public makVrf::DtSetLocationDialog
{
public:
MySetLocationDialog(makVrv::DtDe& de, QWidget* parent, const Qt::WindowFlags& flags = 0)
: makVrf::DtSetLocationDialog(de, parent, flags)
{
}
protected:
//Override the contents method, calling the parent method first to create the contents, then
//hide the movement box
virtual QWidget* contents(const std::vector<makVrv::DtSimEntry*>& data)
{
QHBoxLayout* comboLayout = new QHBoxLayout;
comboLayout->setMargin(0);
comboLayout->setSpacing(2);
QLabel* label = new QLabel(tr("Example Combo"), this);
comboLayout->addWidget(label);
QComboBox* combo = new QComboBox(this);
comboLayout->addWidget(combo);
combo->addItem(tr("Item 1"));
combo->addItem(tr("Item 2"));
myContentLayout->addLayout(comboLayout);
return canvas;
}
};
//Override of creator for task move to dialog. Will create new instance
//of the move to dialog
class MySetLocationDialogCreator : public makVrf::DtSetLocationDialogCreator
{
public:
{
return new MySetLocationDialog(de, parent, theTaskSetCreationFlags);
}
};
{
//The DtVrfTaskSetDialogManager is the class that holds all the creators
//for task and set dialogs. Install an override creator here to create
//an instance of the move to dialog
//And add the new creator
manager.addSetDialogCreator(DtSetLocationAction, new MySetLocationDialogCreator);
return true;
}
{
info.pluginName = "Modify Set";
info.pluginDescription = "This example shows how to modify an existing set dialog (set location) to add your own functionality.";
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 Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)