VR-Vantage
Loading...
Searching...
No Matches
16 - MIL-STD-2525D Symbology

VR-Vantage renders military symbols natively from the MIL-STD-2525D / APP-6D standard.

Given a DIS entity type, it produces a Symbol Identification Code (SIDC), rasterizes the corresponding symbol from SVG, and makes the image available for display. This chapter shows how a toolkit developer generates and renders a symbol programmatically, and how to customize both the DIS-to-symbol mapping and the symbol artwork through data files.

The chapter covers the public facade and the two data-driven customization paths. The internal icon caching and texture-atlas machinery is not covered here; you interact with it only through the manager interface.

16.1 - Core Concepts

  • SIDC. The 20-character Symbol Identification Code that uniquely designates a MIL-STD-2525D symbol. VR-Vantage generates it from a DIS entity type plus force, status, and echelon information.
  • Symbology standard. The variant of the standard to render against (for example 2525D or APP-6D), selected per call or from the manager's current setting.
  • Virtual key. A %-prefixed string, produced from a SIDC or from symbol parameters, that identifies a rendered symbol for retrieval as an image or a texture-atlas slot.
  • Override. A customer-supplied rule that replaces the default SVG for a given entity type or SIDC pattern.

16.2 - Generating a SIDC and Rendering a Symbol

Most toolkit code works through DtMilStdManagerInterface, the vrvCore-facing facade implemented by DtMilStdManager in vrvMilStd. Retrieve it with DtMilStdManagerInterface::instance(de) after vrvMilStd::init(de) has run.

Generate a SIDC from the fields of a DIS entity type, then obtain the rendered symbol as RGBA pixels:

using namespace makVrv;
// kind, domain, country, category, subcategory, specific, extra,
// forceId (0=Friend 1=Hostile 2=Neutral 3=Unknown).
std::string sidc = milStd.generateSIDC(
/*kind*/ 1, /*domain*/ 2, /*country*/ 225,
/*category*/ 1, /*subcategory*/ 1, /*specific*/ 0, /*extra*/ 0,
/*forceId*/ 0);
// Build a virtual key from symbol parameters and fetch the image.
params.mySidc = sidc;
std::string key = milStd.generateMilStdKey(params);
int width = 0;
int height = 0;
std::vector<uint8_t> rgba;
if (milStd.getSymbolRgba(key, width, height, rgba))
{
// rgba now holds width * height * 4 bytes ready to upload as a texture.
}
Abstract interface for rendering MIL-STD symbology icons as textures.
Definition DtMilStdManagerInterface.h:93
virtual std::string generateSIDC(int kind, int domain, int country, int category, int subcategory, int specific, int extra, int forceId, int context=0, int status=0, int hqtf=0, int echelon=0, DtSymbologyStandard standard=DtSymbologyStandard::Undefined)=0
Generate a MIL-STD virtual key from DIS entity-type fields.
virtual std::string generateMilStdKey(const DtMilStdKeyParams &params) const =0
Generate a MIL-STD virtual key from symbol parameters.
virtual bool getSymbolRgba(const std::string &key, int &widthOut, int &heightOut, std::vector< uint8_t > &rgbaOut)=0
Extract the RGBA pixel data for the symbol encoded in key.
static DtMilStdManagerInterface & instance(DtDe &de)
Get (or lazily create) the per-DtDe singleton (main thread).
Contains DtCreateSensorFieldOfViewCommand and DtCreateSensorFieldOfViewCommandCreator class declarati...
Definition DtGridLinesSettingsRecord.h:16
Parameters that describe a MIL-STD symbol key.
Definition DtMilStdManagerInterface.h:36
std::string mySidc
20-char SIDC; dashes are accepted on input.
Definition DtMilStdManagerInterface.h:37

The virtual key is also accepted directly by image-consuming APIs such as setBackgroundImage(), and textureAtlasSlot() returns the atlas slot and UV coordinates for a key when you render many symbols at once. Use svgSource() to retrieve the raw SVG for a key when debugging.

16.3 - Customizing DIS-to-SIDC Mapping

The rules that turn a DIS entity type into a SIDC are data-driven, loaded from data/MilStd/type_to_sidc_mappings.json by the type-to-SIDC registry. To adjust how entities are classified, edit that file:

  • Add or adjust entries under symbolSets.mappings to route a kind/domain combination to a symbol set.
  • Use per-entry overrides to special-case category, subcategory, specific, or country handling.
  • Update iconMappings entries to map DIS category branches to the six-digit function code that selects the symbol's icon.

Because the mapping is loaded at startup, changes take effect without recompiling. Keep the file plain ASCII with no byte-order mark; the JSON parser does not strip a BOM.

16.4 - Overriding Symbol SVGs

To replace the artwork for specific symbols, supply an SVG override. Overrides live under data/MilStd/overrides/ (the active file is sidc_svg_overrides.json) and are loaded by DtMilStdSvgOverrideRegistry. Each override entry:

  • matches an entityType (a seven-field DIS tuple, using -1 as a wildcard in any field) and an optional force, and
  • points at an svgFile and an optional svgHighlightFile.

You can also register overrides programmatically with DtMilStdSvgOverrideRegistry::addSidcOverride() and addEntityTypeOverride(). Override SVGs are rasterized by the LunaSVG-backed DtSvgRasterizer in vrvGraphics; like the mapping JSON, override SVG files must be plain ASCII with no BOM or the rasterizer will silently fall back to the default symbol.

Overrides keep the standard damage indication. When a symbol's status is FullyCapable, Damaged, Destroyed, or FullToCapacity, the manager composites the standard status marks (the capability color bar or the slash/X amplifier marks, per the operational condition mode) on top of the override art, and highlight overrides flow through the same path. Present and Planned draw no overlay. Compositing applies to entity-type entries and to SIDC entries that leave the status slot wildcarded; an entry that pins an exact status value is treated as authoritative per-state art and rendered untouched, so you can author your own damage-state artwork where the standard marks are not what you want.

16.5 - Complete Example

The exampleMilStdSymbology example is a complete plugin that loads the JSON registries and the override registry, wires up a manager, generates SIDCs and keys, and builds symbol widgets from the resulting images. It also demonstrates toggling planned/exercise state, switching to APP-6D, and adding and removing SVG overrides at runtime. See exampleMilStdSymbology for the walkthrough and source.

16.6 - Related Reference

  • DtMilStdManagerInterface
  • DtMilStdSIDCGenerator
  • DtMilStdSVGRenderer
  • DtMilStdSvgOverrideRegistry
  • DtSvgRasterizer
  • Release notes: vrvMilStd – MIL-STD-2525D Symbology
  • Release notes: migration_milstd_status_overlay