VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Overlay Organization (overlayOrganization)

Table of Contents

The Overlay Organization example demonstrates the following:

Organizing Overlay Folders

The overlay Organization example demonstrates how to organize folder in the overlay tree widget. These folders are local to the application (they are not published on the network). An overlay folder organization is made when an overlay identifier is assigned as a parent to an organized overlay folder:

int fixedWingIdentifier = tgm.addOrganizedCategory("FixedWingExample", *fixedWing, rank++, "TaskEscortUnit.svg", "Fixed Wing", true, parentCategory);
tgm.addOrganizedCategory("AttackExample", *fixedWingAttack, rank++, "AttackWithAntiAirMissile.svg", "Attack", true, fixedWingIdentifier);
tgm.addOrganizedCategory("CivilianExample", *fixedWingCivillian, rank++, "ClutterAir.svg", "Civilian", true, fixedWingIdentifier);
tgm.addOrganizedCategory("RotaryWingExample", *rotaryWing, rank++, "AirDrop.svg", "Rotary Wing", true, parentCategory);

The addOrganizedCategory call will know to add a child to that category by the use of the DtVrfSelectionFilter subclass. This subclass uses the DtTopLevelCategoryFilter class. The assignment of the categories to match will allow the folder to appropriately add objects to the specified overlay folder

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 scenario on any terrain.
  3. Create some attack aircraft, commercial aircraft or rotary wings.
  4. See the created items get added to the appropriate folder.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2023 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
//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
using namespace makVrf;
extern"C"
{
DtVrfSelectionFilter* CreateCategoryFilter(makVrv::DtDe* de, const std::vector<std::string>& categories)
{
// Make sure no spot report/tdl reports are added
DtVrfNotObjectFilter notGlobalEnv;
isSpTg.setNotFilter(spTg);
isSpEnt.setNotFilter(spEnt);
isTdlTg.setNotFilter(tdlTg);
isTdlEnt.setNotFilter(tdlEnt);
f->setCategories(categories);
f->setDe(de);
DtVrfAndFilter mainFilter;
mainFilter.addFilter(*f);
mainFilter.addFilter(isSpTg);
mainFilter.addFilter(isSpEnt);
mainFilter.addFilter(isTdlTg);
mainFilter.addFilter(isTdlEnt);
return f;
}
void AddOverlays(makVrv::DtDe* de)
{
int parentCategory = tgm.organizedCategoryToIdentifier("Aircraft");
if (parentCategory != -1)
{
// Add organized categories
int rank = 11;
DtVrfSelectionFilter* fixedWing = CreateCategoryFilter(de, {"Fixed Wing"});
DtVrfSelectionFilter* rotaryWing = CreateCategoryFilter(de, {"Rotary Wing"});
DtVrfSelectionFilter* fixedWingAttack = CreateCategoryFilter(de, {"Fixed Wing", "Attack"});
DtVrfSelectionFilter* fixedWingCivillian = CreateCategoryFilter(de, {"Fixed Wing", "Civilian"});
int fixedWingIdentifier = tgm.addOrganizedCategory("FixedWingExample", *fixedWing, rank++, "TaskEscortUnit.svg", "Fixed Wing", true, parentCategory);
tgm.addOrganizedCategory("AttackExample", *fixedWingAttack, rank++, "AttackWithAntiAirMissile.svg", "Attack", true, fixedWingIdentifier);
tgm.addOrganizedCategory("CivilianExample", *fixedWingCivillian, rank++, "ClutterAir.svg", "Civilian", true, fixedWingIdentifier);
tgm.addOrganizedCategory("RotaryWingExample", *rotaryWing, rank++, "AirDrop.svg", "Rotary Wing", true, parentCategory);
delete fixedWing;
delete rotaryWing;
delete fixedWingAttack;
delete fixedWingCivillian;
}
}
{
boost::bind(&AddOverlays, de));
return true;
}
{
info.pluginName = "Organize Overlay";
info.pluginDescription = "Example shows how to organize the overlay layer into a local folder structure.";
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 Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)