![]() |
VR-Forces Developer's Guide
|
Concrete MIL-STD manager - renders SIDC symbols to DtTextureInterface.
Registered with each DtDe by vrvMilStd::init(). Callers reach it through DtMilStdManagerInterface::instance(de).
On the connection/render thread the manager is cloned via copyInstance(); the clone holds a DtBaseConnection* so createMilStdWidgetAgent() can call the correct sceneInterface().
Instances are accessed via DtMilStdManagerInterface::instance(de) and DtMilStdManagerInterface::instance(conn).

Public Member Functions | |
| DtMilStdManager (DtDe &de) | |
| DtMilStdManager (DtBaseConnection &sim) | |
| virtual | ~DtMilStdManager () |
| virtual DtMilStdManagerInterface * | clone (DtBaseConnection &sim) override |
| virtual void | initialize (int symbolSize) |
| void | setSymbolSize (int size) |
| virtual void | connectToDecorationSettings () override |
| virtual DtTextureInterface * | textureAtlasSlot (const std::string &key, float &u0Out, float &u1Out, float &v0Out, float &v1Out) override |
| virtual const std::string & | lastKey () const override |
| virtual DtWidgetLabelAgent * | createMilStdWidgetAgent () override |
| 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) override |
| virtual std::string | generateMilStdKey (const DtMilStdKeyParams ¶ms) const override |
| virtual void | setHighlightFrameColor (uint32_t abgr) override |
| virtual uint32_t | highlightFrameColor () const override |
| virtual void | svgSource (const std::string &key, std::string &svg) const override |
| virtual bool | getSymbolRgba (const std::string &key, int &widthOut, int &heightOut, std::vector< uint8_t > &rgbaOut) override |
| virtual int | symbolSize () const override |
| virtual int | decoratedSymbolHeight () const override |
| virtual int | renderHeight (const std::string &sidc) const override |
| virtual bool | isDecorated (const std::string &sidc) const override |
| virtual DtMilStdSVGRenderer & | renderer () |
| virtual const DtMilStdSVGRenderer & | renderer () const |
| virtual DtMilStdSIDCGenerator & | sidcGenerator () |
| virtual const DtMilStdSIDCGenerator & | sidcGenerator () const |
| virtual bool | parseMilStdSidcKey (const std::string &key, DtMilStdKeyParams ¶ms) const override |
| virtual int | isEntityTypeOverridden (int kind, int domain, int country, int category, int subcategory, int specific, int extra, int force=-1) const override |
| virtual int | isSidcOverridden (const std::string &normalizedSidc, int force=-1) const override |
| virtual DtColorScheme | buildSymbolColorScheme (const DtMilStdSymbol &symbol, bool highlighted) const |
| virtual void | setOperationalConditionMode (DtOperationalConditionMode mode) |
| virtual DtOperationalConditionMode | operationalConditionMode () const |
| virtual bool | isInitialized () const |
| DtMilStdManager ()=delete | |
| DtMilStdManager (const DtMilStdManager &)=delete | |
| DtMilStdManager (const DtMilStdManager &&)=delete | |
| DtMilStdManager & | operator= (const DtMilStdManager &)=delete |
| DtMilStdManager & | operator= (const DtMilStdManager &&)=delete |
Public Member Functions inherited from makVrv::DtMilStdManagerInterface | |
| virtual | ~DtMilStdManagerInterface () |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Attributes | |
| static constexpr int | theDefaultSlotSize = 50 |
| static constexpr int | theDefaultDecoratedHeight = 120 |
Protected Member Functions | |
| virtual void | slot_milSymbolStandardChanged (DtSymbologyStandard standard) |
| virtual void | slot_colorSymbolByForceChanged (bool enabled) |
| virtual void | slot_symbolOutlineColorOverrideChanged (bool enabled, const DtColorValue &outline, const DtColorValue &highlight) |
| virtual void | regenerateAtlases () |
| virtual DtMilStdSymbol * | buildSymbol (const std::string &milStdKey, const DtMilStdKeyParams ¶ms, DtSymbologyStandard standard, int size) |
| virtual bool | buildBitmap (const DtMilStdSymbol &symbol, DtBitmapData &bitmap) |
| virtual std::unique_ptr < DtMilStdSIDCGenerator > | createSidcGenerator (const DtTypeToSidcJsonRegistry ®istry) |
| virtual std::unique_ptr < DtMilStdSVGRenderer > | createRenderer (const DtMilStdJsonRegistry ®istry) |
| virtual int | parseMilStdOverrideFromKey (const std::string &key) const |
| virtual void | slot_postInitialize () |
Protected Attributes | |
| DtDe * | myDe |
| DtBaseConnection * | myConnection |
| std::string | myLastKey |
| bool | myInitialized = false |
| int | mySlotSize = theDefaultSlotSize |
| int | myDecoratedHeight = theDefaultDecoratedHeight |
| DtSymbologyStandard | myCurrentMilStandard |
| bool | myFrameOutlineColorOverrideEnabled |
| std::unordered_map < std::string, DtMilStdSymbol > | mySymbolCache |
| std::unique_ptr< DtTextureAtlas > | myStandardAtlas |
| std::unique_ptr< DtTextureAtlas > | myDecoratedAtlas |
| uint32_t | myFrameOutlineHighlightColor |
| uint32_t | myFrameOutlineHighlightColorOverride |
| uint32_t | myFrameOutlineColorOverride |
| DtOperationalConditionMode | myOcMode |
| DtSignalConnectionManager | myConnections |
| const DtMilStdJsonRegistry * | myJsonRegistry |
| const DtTypeToSidcJsonRegistry * | mySidcRegistry |
| const DtMilStdSvgOverrideRegistry * | myOverrideRegistry |
| std::unique_ptr < DtMilStdSIDCGenerator > | mySidcGenerator |
| std::unique_ptr < DtMilStdSVGRenderer > | myRenderer |
| vrvSignalsLib::connection | myPostInitializeConnection |
Additional Inherited Members | |
Static Public Member Functions inherited from makVrv::DtMilStdManagerInterface | |
| static DtMilStdManagerInterface & | instance (DtDe &de) |
| static DtMilStdManagerInterface & | instance (DtBaseConnection &sim) |
| static void | registerInstance (DtDe &de, DtMilStdManagerInterface *mgr) |
| static void | copyInstance (DtBaseConnection &sim, DtDe &de) |
| static const std::string & | instanceName () |
| static bool | isMilStdKey (const std::string &filename) |
| makVrv::DtMilStdManager::DtMilStdManager | ( | DtDe & | de | ) |
Main-thread CTOR (registered on DtDe by vrvMilStd::init()).
| makVrv::DtMilStdManager::DtMilStdManager | ( | DtBaseConnection & | sim | ) |
Connection-thread CTOR (created by clone()).
|
virtual |
DTOR.
|
delete |
not allowed
|
delete |
not allowed
|
delete |
not allowed
|
overridevirtual |
Clone this manager for use on the connection/render thread.
Reimplemented from makVrv::DtMilStdManagerInterface.
|
delete |
not allowed
|
delete |
not allowed
|
virtual |
Initialize the manager's internal state. Called by vrvMilStd::init() immediately after construction.
| void makVrv::DtMilStdManager::setSymbolSize | ( | int | size | ) |
Configure the symbol raster size and derived decorated-slot height. Must be called before the first texture() or textureAtlasSlot() call. Called by vrvMilStd::init() immediately after construction.
|
overridevirtual |
Connect to DtSymbolDecorationSettingsSignaler and apply the initial milSymbolStandard setting. Must be called after the manager is registered and after vrvCore settings infrastructure is initialised. Only valid on the main-thread instance (myDe != nullptr).
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Get or create an atlas slot for the symbol encoded in key.
Renders and packs the symbol on first call; subsequent calls for the same key return from cache instantly. The returned texture is a non-owning pointer into the atlas page and must not be deleted by the caller. UV coordinates address the symbol's sub-rect within the page and map to DtQuadProxyInterface::setTextureParameters() left/right/bottom/top.
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Return the most recent key passed to texture().
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Create a DtMilStdWidgetAgent on the correct scene interface. On the main-thread instance uses myDe.agentManager(); on the connection-thread clone uses myConnection->sceneInterface().
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Generate an SIDC key from DIS entity-type integers.
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Generate a MIL-STD virtual key from symbol parameters.
| params | Symbol parameters. mySidc may contain dashes; they are stripped internally. |
% -prefixed key for setBackgroundImage(), or empty on failure. Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Set the frame color used when rendering highlight (mouse over/selection) symbol variants.
| abgr | Color in ABGR format (same convention as DtMilStdColors constants). Default is white (0xFFFFFFFF), matching the font-path highlight behaviour. |
Reimplemented from makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Return the current highlight frame color in ABGR format.
Reimplemented from makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Return the SVG source string for the symbol encoded in key. Debugging aid - not used by the manager itself. Returns empty string on failure. Used by imgui.
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Extract the RGBA pixel data for the symbol encoded in key.
Triggers atlas build for key on first call. On success fills rgbaOut with widthOut * heightOut * 4 bytes of RGBA data (row-major, R at byte 0).
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Return the configured symbol slot size in pixels (set via setSymbolSize()). This is the width of a standard (non-decorated) atlas slot.
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Return the total height in pixels of a decorated symbol slot.
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Return the actual rendered pixel height for the given SIDC (size + topHatSize + bottomHatSize).
| sidc | 20-character SIDC string (dashes accepted). |
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Return true when the given SIDC string is decorated.
| sidc | 20-character SIDC string (dashes accepted). |
Implements makVrv::DtMilStdManagerInterface.
|
virtual |
Return the SVG renderer owned by this manager.
|
virtual |
|
virtual |
Return the SIDC generator owned by this manager.
|
virtual |
|
overridevirtual |
Parse a MIL-STD virtual key back into symbol parameters.
Fills all fields of params. Fields for absent optional segments retain their default values (myHighlight=false, myOverrideIndex=-1, myMilStdOverride=-1, myFillColorOverride=0, myFrameColorOverride=0).
| key | Virtual key produced by generateMilStdKey(). |
| params | Receives the parsed symbol parameters. |
key is not a valid MIL-STD key. Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Test whether the given entity-type fields match any SVG override entry.
Pure const scan of the immutable override registry - safe to call from any thread.
| kind | DIS entity kind. |
| domain | DIS entity domain. |
| country | DIS entity country code. |
| category | DIS entity category. |
| subcategory | DIS entity subcategory. |
| specific | DIS entity specific. |
| extra | DIS entity extra. |
| force | VRV/VRF force ID (the raw integer assigned via DtMilStdIconVisualizer::setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force. |
Implements makVrv::DtMilStdManagerInterface.
|
overridevirtual |
Test whether the given normalized SIDC string matches any SVG override entry.
Pure const scan of the immutable override registry - safe to call from any thread.
| normalizedSidc | 20-character SIDC string with dashes stripped. |
| force | VRV/VRF force ID (the raw integer assigned via DtMilStdIconVisualizer::setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force. |
Implements makVrv::DtMilStdManagerInterface.
|
virtual |
Build a fully-resolved DtColorScheme for symbol.
Applies five layers in priority order (later layers win):
| symbol | Symbol whose identity, civilian flag, and per-symbol overrides are used. |
| highlighted | Whether the symbol is currently highlighted. |
|
virtual |
Set the operational condition display mode.
AlternateColorBar (default) draws Table 1-4 colour bars below the frame. Amplifier draws Table 1-3 slash/X marks on the frame for Damaged/Destroyed. Changing the mode triggers atlas regeneration.
| mode | The display mode to apply to all subsequent symbol renders. |
|
virtual |
Return the current operational condition display mode.
|
virtual |
Return true when the manager has completed initialisation and is ready to build symbols.
Implements makVrv::DtMilStdManagerInterface.
|
protectedvirtual |
Called by the settings signaler when the milSymbolStandard changes.
|
protectedvirtual |
Called when color-symbol-by-force toggles; regenerates atlases.
|
protectedvirtual |
Called when outline color override changes; regenerates atlases.
|
protectedvirtual |
Re-render every cached atlas slot using the current standard.
|
protectedvirtual |
Build and cache a symbol for milStdKey. If params.myMilStdOverride != -1, uses that standard instead of standard.
|
protectedvirtual |
Render the symbol encoded in key to a bitmap and fill bitmap with the result.
|
protectedvirtual |
Factory: create the SIDC generator.
Customer override point - return a subclass to inject custom SIDC generation logic.
| registry | Entity-type SIDC registry owned by the DtDe. |
Reimplemented in DtExampleMilStd::DtExampleMilStdManager.
|
protectedvirtual |
Factory: create the SVG renderer.
Customer override point - return a subclass to inject custom rendering logic. Not called for the connection-thread clone.
| registry | JSON frame/icon registry owned by the DtDe. |
Reimplemented in DtExampleMilStd::DtExampleMilStdManager.
|
protectedvirtual |
Parse only the MilStd/<N> segment from a MIL-STD key.
Returns the integer value of the segment when present, or -1 when the key contains no MilStd/ segment or the value cannot be parsed. The rest of the key is ignored - this is intentionally lighter than parseMilStdSidcKey().
| key | A key as produced by generateMilStdKey(). |
-1 if absent.
|
protectedvirtual |
Slot connected to DtDe post initialization signal; used to connect to signals and call init.
|
static |
Default slot and decorated-slot height before setSymbolSize() is called.
|
static |
|
protected |
Non-null on the main-thread instance.
|
protected |
Non-null on the connection-thread clone.
|
protected |
|
protected |
True after initialize() completes successfully.
|
protected |
Standard slot edge length in px.
|
protected |
Decorated slot total height in px.
|
protected |
0 = MIL-STD-2525D, 1 = APP-6D, 999 = Font Icons (deprecated)
|
protected |
Set from the GUI Symbol settings page.
|
protected |
Cache of parsed SIDC symbols, keyed by MilStdSIDC string see generateMilStdKey.
|
protected |
Atlas for standard (non-decorated) symbols.
|
protected |
Atlas for symbols with echelon/HQ decorators.
|
protected |
ABGR frame color applied to highlight (/H) atlas variants.
|
protected |
|
protected |
|
protected |
Current operational condition display mode.
|
protected |
|
protected |
DtDe-owned JSON frame/icon registry; non-null on main-thread instance. Instance on the DtDe.
|
protected |
DtDe-owned entity-type SIDC registry; non-null on main-thread instance. Instance on the DtDe.
|
protected |
Non-owning pointer to the SVG override registry; null on the connection-thread clone or when none was registered.
|
protected |
Owned SIDC generator; populated in both main-thread and connection-thread instances.
|
protected |
Owned SVG renderer; null on connection-thread clone.
|
protected |
Connection to DtDe post-initialization signal; used to call connectToDecorationSettings() and initialize().