VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Modify Set (modifySet)

Table of Contents

The Modify Set example demonstrates the following:

How to Run the Example

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 scneario - e.g EntityLevel SMS on a Ground_DB II terrain.
  3. Create an M1A2 entity.
  4. Select the entity and Set -> Position -> Location... context menu item.
  5. Observe that a new combo-box labeled "Example Combo" has been added to the Location dialog. It should have options "Item 1" and "Item 2".

Plugin Entry Points

/*******************************************************************************
** 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 <QtWidgets/QComboBox>
#include <QtWidgets/QLabel>
#include <QtWidgets/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)
{
QWidget* canvas = makVrf::DtSetLocationDialog::contents(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:
virtual makVrf::DtTaskSetDialogInterface* create(makVrv::DtDe& de, QWidget* parent)
{
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);
// Modify the set Fire now to include waypoints (as an example)
// See vrfGuiConstants/vrfSelectionFilterCollections.h for a list of all the filters available
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 = "10 Fawcett Street, Suite 204, Cambridge, MA 02138 USA";
info.pluginContactPhone = "(617) 876 8085";
}

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)