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

Table of Contents

VR-Vantage can display MIL-STD-2525 control-measure graphics – linear and area tactical graphics such as Ambush, Block, Seize, and Withdraw – as first-class scenario elements.

This chapter explains how an application organizes those graphics into named, toggleable overlays, and how a plugin registers a new linear graphic geometry of its own.

Read this chapter if you write an application that places tactical graphics programmatically, or a plugin that extends the set of graphic shapes VR-Vantage knows how to draw. It focuses on the public API a toolkit developer calls; the internal vertex-generation and rendering machinery is not covered here.

\vrv_tacticalgraphics.1 - Core Concepts

The subsystem uses a small vocabulary that recurs throughout the API.

\vrv_tacticalgraphics.2 - Class Roles

Four public classes carry the API surface a toolkit developer touches.

DtTacticalGraphicOverlayManager is a per-DtDe singleton. It owns the set of overlays, tracks which overlay each graphic belongs to, and emits signals as overlays and graphics are added, renamed, removed, or toggled. Retrieve it with DtTacticalGraphicOverlayManager::instance(de).

DtTacticalGraphicOverlay represents a single overlay. It manages membership (addGraphic(), removeGraphic()) and visibility (setVisible()) for the graphics it contains.

DtOverlayGeometryManager is a per-DtDe singleton that maps a shape name to a linear-geometry creator function. Applications rarely call it directly; it is the registration point plugins use to add new shapes. Retrieve it with DtOverlayGeometryManager::instance(de).

DtLineStyleGeometryManager plays the same role for 2D and 3D line-style geometry, exposing add2DLineStyle() and add3DLineStyle().

Each built-in shape is declared in its own header (for example DtOverlayGeometryBlock.h) as a free function plus a convenience macro. The header for the Block shape, for instance, declares vrvTacticalGraphicUtilities::createVertexAndLabelDataBlock() and the macro DtOverlayGeometryBlockCreator. These are not class hierarchies – they are plain functions bound into the geometry manager.

\vrv_tacticalgraphics.3 - Organizing Graphics into Overlays

The overlay manager is the entry point for grouping and toggling graphics. Create an overlay, add graphics to it by unique ID, and control its visibility:

using namespace makVrv;
// Create a named overlay.
overlayMgr.addOverlay("Phase 1");
// Add an existing tactical graphic (identified by its unique ID) to it.
DtTacticalGraphicOverlay* overlay = overlayMgr.findOverlay("Phase 1");
if (overlay != nullptr)
{
overlay->addGraphic(graphicId);
}
// Show or hide the whole overlay.
overlayMgr.setOverlayVisible("Phase 1", true);
// Mark it as the overlay that receives newly created graphics.
overlayMgr.setCurrentOverlay("Phase 1");

The manager also emits Boost signals – signal_overlayAdded, signal_tacticalGraphicAdded, signal_overlayVisibilityChanged, and others – so a GUI can stay synchronized with the overlay set without polling.

\vrv_tacticalgraphics.4 - Data-Driven Definitions

The shape and default styling of a tactical graphic are supplied by element definition files rather than hard-coded. Point VR-Vantage at your definition files through the application configuration:

Prefer the data-driven path when you are adding new graphics that reuse an existing shape: author a definition and reference it by name. Reserve the programmatic geometry-registration path (below) for the case where you need a shape VR-Vantage does not already provide.

\vrv_tacticalgraphics.5 - Registering a Custom Linear Geometry

To teach VR-Vantage a new linear graphic shape, register a creator function with the geometry manager. A creator matches the signature

using LinearCreateFunction = std::function<bool(const makVrv::DtLinearModelData&)>;

and returns true when it successfully populates the supplied model data with vertices and labels. Register a built-in shape using its convenience macro, or a shape of your own by binding your function:

using namespace makVrv;
// Register a built-in shape by name.
geomMgr.addLinearCreate("Block", DtOverlayGeometryBlockCreator);
// Register a custom shape.
bool createMyGraphic(const DtLinearModelData& data); // your generator
geomMgr.addLinearCreate(
"MyGraphic",
boost::bind(&createMyGraphic, boost::placeholders::_1));

Once registered, a graphic whose definition names "MyGraphic" resolves to your generator when its geometry is built. The 2D and 3D line-style variants follow the same pattern through DtLineStyleGeometryManager::add2DLineStyle() and add3DLineStyle(), using the Dt2DLineStyleGeometryByFireAxisCreator and Dt3DLineStyleGeometryByFireAxisCreator macros for the built-in ByFireAxis style.

\vrv_tacticalgraphics.6 - Complete Example

The exampleTacticalGraphics example is a complete, buildable driver that creates overlays, builds tactical graphic elements, assigns their definitions, sets line, arrow, and fill styles, and adds the graphics to overlays. See exampleTacticalGraphics for the full walkthrough and source.

\vrv_tacticalgraphics.7 - Related Reference


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)