![]() |
VR-Forces Developer's Guide
|
Registry of customer SVG overrides for MIL-STD-2525D symbols.
Loaded from data/MilStd/overrides/sidc_svg_overrides.json at startup. After load() returns, myEntries is immutable - all scan methods are pure const and safe to call from any thread.
Follows the same DtDe registration pattern as DtTypeToSidcJsonRegistry.

Public Member Functions | |
| DtMilStdSvgOverrideRegistry () | |
| const char * | registryName () const override |
| virtual bool | load (const std::string &overridesDir) |
| virtual int | scanEntityType (int kind, int domain, int country, int category, int subcategory, int specific, int extra, int force=-1) const |
| virtual int | scanBySidc (const std::string &normalizedSidc, int force=-1) const |
| virtual void | addSidcOverride (const std::string &pattern, const std::string &svgContent, bool highlight, int force=-1) |
| virtual void | addEntityTypeOverride (const std::string &pattern, const std::string &svgContent, bool highlight, int force=-1) |
| virtual void | removeSidcOverride (const std::string &pattern, int force=-1) |
| virtual void | removeEntityTypeOverride (const std::string &pattern, int force=-1) |
| virtual void | clearOverrides () |
| virtual const std::vector < DtMilStdOverrideEntry > & | entries () const |
Public Member Functions inherited from makVrv::DtMilStdJsonRegistryBase | |
| DtMilStdJsonRegistryBase () | |
| virtual | ~DtMilStdJsonRegistryBase () |
| bool | isLoaded () const |
| DtMilStdJsonRegistryBase (const DtMilStdJsonRegistryBase &)=delete | |
| DtMilStdJsonRegistryBase (const DtMilStdJsonRegistryBase &&)=delete | |
| DtMilStdJsonRegistryBase & | operator= (const DtMilStdJsonRegistryBase &)=delete |
| DtMilStdJsonRegistryBase & | operator= (const DtMilStdJsonRegistryBase &&)=delete |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Member Functions | |
| static DtMilStdSvgOverrideRegistry & | instance (DtDe &de) |
| static void | registerInstance (DtDe &de, DtMilStdSvgOverrideRegistry *registry) |
| static const std::string & | instanceName () |
Static Public Attributes | |
| static constexpr int | npos = -1 |
Protected Member Functions | |
| virtual bool | validateStructure (const rapidjson::Document &doc, const std::string &filePath, int version) const override |
| virtual void | parseEntry (const rapidjson::Value &obj, const std::string &overridesDir) |
Protected Member Functions inherited from makVrv::DtMilStdJsonRegistryBase | |
| virtual bool | openAndParse (const std::string &filePath, rapidjson::Document &doc) const |
| virtual bool | setAndValidateVersions (const rapidjson::Document &doc, const std::string &filePath) |
| virtual bool | requireField (const rapidjson::Value &obj, const char *fieldName, const std::string &context) const |
Static Protected Member Functions | |
| template<std::size_t N> | |
| static bool | parsePattern (const std::string &pattern, std::array< int, N > &out) |
| static std::string | readFile (const std::string &path) |
Protected Attributes | |
| std::vector < DtMilStdOverrideEntry > | myEntries |
Protected Attributes inherited from makVrv::DtMilStdJsonRegistryBase | |
| int | myVersion |
| int | myMaxVersion |
| bool | myLoaded |
| makVrv::DtMilStdSvgOverrideRegistry::DtMilStdSvgOverrideRegistry | ( | ) |
|
inlineoverridevirtual |
Return the class name used in warning messages.
Implements makVrv::DtMilStdJsonRegistryBase.
|
static |
Retrieve the registry registered on de.
| de | The simulation data engine on which the registry was registered. |
|
static |
Register registry on de (transfers ownership to DtDe).
| de | The simulation data engine to register with. |
| registry | Heap-allocated registry; ownership transfers to de. |
|
static |
Return the canonical instance name used with DtDe::findInstance().
|
virtual |
Load overrides from the given directory.
Reads sidc_svg_overrides.json from overridesDir. Resolves relative svgFile paths against overridesDir and reads SVG content into entries. Silent no-op (returns true, zero entries) if the directory or file is absent.
| overridesDir | Absolute path to the overrides directory. |
|
virtual |
Scan for an entity-type pattern match.
Iterates myEntries for entity-type patterns matching all 7 fields (with -1 wildcards). Pure const - 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 setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force. |
|
virtual |
Scan for a SIDC pattern match.
Parses normalizedSidc into 10 integer slots and scans SIDC-pattern entries. Pure const - safe to call from any thread.
| normalizedSidc | 20-character SIDC string with dashes stripped. |
| force | VRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force. |
|
virtual |
Add or update a SIDC-pattern override.
If an entry for pattern already exists, the specified SVG slot is updated in-place. Callers must invoke regenerateAtlases() afterwards.
| pattern | 10-field colon-delimited SIDC slots, e.g. "10:-1:10:-1:-1:-1:14:12:11:-1". A -1 in any field acts as a wildcard. |
| svgContent | SVG document string to store. |
| highlight | true to set mySvgHighlightContent; false to set mySvgContent. |
| force | VRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force. |
|
virtual |
Add or update an entity-type-pattern override.
Same update-in-place semantics as addSidcOverride(). Callers must invoke regenerateAtlases() afterwards.
| pattern | 7-field colon-delimited DIS entity-type fields, e.g. "1:1:-1:12:-1:-1:-1". A -1 in any field acts as a wildcard. |
| svgContent | SVG document string to store. |
| highlight | true to set mySvgHighlightContent; false to set mySvgContent. |
| force | VRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force. |
|
virtual |
Remove the entry matching the given SIDC pattern and force.
| pattern | 10-field colon-delimited SIDC pattern to remove. |
| force | VRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match an entry that itself carries no force restriction. Callers must invoke regenerateAtlases() afterwards. |
|
virtual |
Remove the entry matching the given entity-type pattern and force.
| pattern | 7-field colon-delimited entity-type pattern to remove. |
| force | VRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match an entry that itself carries no force restriction. Callers must invoke regenerateAtlases() afterwards. |
|
virtual |
Remove all override entries. Callers must invoke regenerateAtlases() afterwards.
|
inlinevirtual |
Direct read-only access to the entry list (used by DtMilStdManager).
|
overrideprotectedvirtual |
Validate the structural layout of a parsed JSON document.
Called from each registry's load() after the version has been verified. The base implementation returns true unconditionally. Derived classes override this method to check registry-specific required fields and types. Overrides should call the base version first and propagate failure:
| doc | Parsed JSON document to validate. |
| filePath | Path to the source file, used in warning messages. |
| version | Version integer read from the file; passed for use in version-conditional structural checks. |
true when the document structure is acceptable; false otherwise. Reimplemented from makVrv::DtMilStdJsonRegistryBase.
|
protectedvirtual |
Parse one override JSON object and append to myEntries.
|
staticprotected |
Parse a colon-separated integer pattern string into an array. Returns false if the field count does not match N.
|
staticprotected |
Read file contents into a string. Returns empty string on failure.
|
static |
Sentinel index returned by scan methods when no entry matches (value: -1).
|
protected |