VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Importing/Exporting Scenarios from Different File Formats (csvScenarioImporterExporterGui)

Table of Contents

The Importing/Exporting Scenarios from Different File Formats example demonstrates the following:

The Importing/Exporting scenarios example installes a new scenario importer/exporter that will read a comma delimited file and restore entity/aggregate laydown as well as tactical graphic objects.

Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces application. Make sure to enable the csvScenarioImporterExporter example from the launcher application

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. Load the BombMission.scnx scenario file.
  3. Click on File → Export Scenario Laydown...
  4. Enter a filename and select “CSV Scenario File (*.csv *.txt)” as the Save as type and press the Save button.
  5. Click on File → Close Scenario and the entities and tactical overlays should disappear
  6. Click on File → Import Scenario Objects... and select “CSV Scenario File (*.csv *.txt)” as the Files of type option
  7. If the File -> Import Scenario Objects menu option appears to be disabled. Create a new blank scenario using the same (Ala Moana) terrain. The Import Scenario Objects menu option should be enabled to import the previously exported .csv scenario file.
  8. Select the scenario file that was just exported and press the Open button
  9. The objects that were exported should reload;verify that objects were exported correctly

Notes

Scenario Import/Export does not export VR Forces specific data, such as Plans and Tasks.

Classes

DtExCSVScenarioDescriptionImporterExporterThe subclass of DtScenarioDescriptionImporterExporter has the implementation to import/export information to/from the csv scenario file.
DtVrfCSVScenarioDescriptionImporterExporterThe subclass of DtExCSVScenarioDescriptionImporterExporter that will fill in internal structures with information from a comma delimited file or write the comma delimited file from scenario information.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2012 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//\file examplePlugin.cxx
//\brief Loads the plugin and initializes menu items
//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 "csvScenarioImporterExporterGui.h"
#include <vrvCore/DtDe.h>
using namespace makVrv;
using namespace makVrf;
//This function is called after the DE has been initialized but before it starts ticking. This function
//will only be called once
{
DtScenarioDescriptionManager::instance(de).addScenarioDescriptionImporterExporter
}
//Entry point that must be defined by all plugins, this is called as part of the process that loads the plugin, before the de
//is fully initialized
bool initDeModule(DtDe* de)
{
return true;
}
{
info.pluginName = "CSV Importer Exporter Gui";
info.pluginDescription = "This is an example of how to import/export a comma delimeted format file to produce lay down information for entities and tactical graphics";
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)