VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Enumerations Dictionary

Table of Contents

Overview

The Simulation Interoperability Standards Organization (SISO) develops a reference document called SISO-REF-010, Reference for Enumerations for Simulation Interoperability. This document is available from SISO and includes both a PDF and an XML file. It defines the values to be used in DIS and the RPR FOM for various enumerations, including things like entity type, warhead type, articulated part type classes and metrics, and more. MAK also adds new enumeration types and extends existing ones with new values.

The XML files that define these enumerations are read in and stored by the sim engine, GUI, and SOE at run-time. This enumerations dictionary is maintained by the VR-Link class DtEnumDictionary. The enum dictionary can be accessed by code in each application in the following ways:

Sim engine:

\\ Through the DtSimulationServices
const DtEnumDictionary* enumDict = simulationServices->enumerationDictionary();

GUI and SOE:

\\ Through the DtVrfEntityTypeDictionaryManager

The DtEnumDictionary can be used to convert a enum value to a display name. It can also be used to lookup a value from a name (or portion of a name).

Note
It is not recommended that code ever build logic around enumeration names or descriptions. Exact text can change, but the enumeration values are consistent. Always base your logic on enumeration values.

Loading Enumerations

VR-Forces uses the DtEnumLoader class to populate the DtEnumDictionary from any available XML files. The DtEnumLoader will not read every enumeration in the file, just those it is configured for. The default enumerations loaded are those listed in DtSisoEnumUid in the enumDictionary.h header file. Others can be added through the API.

VR-Forces loads all of the XML files found in the folder appData/settings/enumerations. Each XML file will be loaded and merged together. Individual enumerations will also be merged. This means that if SISO-REF-010 defines a set of enumerated values, more enumerated values can be added in other files such as MAK-Enums.xml, or even user created XML files. This allows for custom extensions to standard enumerations.

Entity Type Enumerations

Entity type enumerations are comprised of seven fields (for more information on entity types, please see the DIS standard and SISO-REF-010). These fields are somewhat hierarchical, with values at higher levels determining the meanings of values at lower levels. As a result, the DtEnumDictionary has several methods for looking up names and types at distinct field "levels" (e.g. category, subcategory, etc.).

However, the most useful method is probably the displayName() method. This method takes an entity type and returns a display name for it. This is used for display purposes in the GUI and SOE, and can be used for logging in the sim engine. Unfortunately, a displayName() can be hard to generate using a broad rule. For instance, you cannot always base the name on the highest level of detail. For instance, if you based it solely on the extra field, you would sometimes lose context available at the higher levels, and the name would become meaningless. Therefore, you might want to concatenate fields together. However, often portions of the description would be repeated at every level, so a pure concatenation would be repetitive and hard to read. As a result, we have made this configurable. In the appData directory, you will find a file called enumDictionaryConfig.json. This defines how display names are constructed by entity type. It configures the default display names to be based on subcategory. Then it defines rules for specific entity type categories (using wild card matching, where -1 is wild). Using these, you can define specific fields that should be used or concatenated together to produce a display name.

MAK Enumerations

The MAK-Enums.xml defines extensions to the standard SISO enumerations that are used across MAK products. These are primarily additional entity types and articulated part classes.

In addition to extending the available entity types, VR-Forces defines additional enumerations, as well. These are defined in VRF-Enums.xml and include:

Example Code

The following example code demonstrates some typical uses for the DtEnumDictionary.

// Find a resource display name from its entity type (sim engine)
DtString resourceDesc = simulationServices()->enumerationDictionary()->displayName(resourceType);
// Find the range ring name associated with a configured range ID (sim engine)
DtString rangeName = simulationServices()->enumerationDictionary()->enumNameFromValue(
DtVrfRangeRingUid, myDescriptor->rangeId());
// Find the display name of a muntion from its entity type (GUI)
DtString displayName = makVrf::DtVrfEntityTypeDictionaryManager::instance(myDe).dictionary()->displayName(munitionType);
// Find all possible resource storage bin values (GUI)
const DtEnumDictionary::EnumMap& bins =
makVrf::DtVrfEntityTypeDictionaryManager::instance(myDe).dictionary()->enumValues(DtVrfResourceBinsUid);
// Find the emitter beam function from its value (GUI)
DtString funcName =
makVrf::DtVrfEntityTypeDictionaryManager::instance(myDe).dictionary()->enumNameFromValue(DtEmitterBeamFunctionUid, func);

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)