VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
makVrv::DtMilStdSvgOverrideRegistry Class Reference

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.

Inheritance diagram for makVrv::DtMilStdSvgOverrideRegistry:
Inheritance graph
[legend]

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
 

Constructor & Destructor Documentation

makVrv::DtMilStdSvgOverrideRegistry::DtMilStdSvgOverrideRegistry ( )

Member Function Documentation

const char* makVrv::DtMilStdSvgOverrideRegistry::registryName ( ) const
inlineoverridevirtual

Return the class name used in warning messages.

Implements makVrv::DtMilStdJsonRegistryBase.

static DtMilStdSvgOverrideRegistry& makVrv::DtMilStdSvgOverrideRegistry::instance ( DtDe &  de)
static

Retrieve the registry registered on de.

Parameters
deThe simulation data engine on which the registry was registered.
Precondition
registerInstance() must have been called first.
static void makVrv::DtMilStdSvgOverrideRegistry::registerInstance ( DtDe &  de,
DtMilStdSvgOverrideRegistry *  registry 
)
static

Register registry on de (transfers ownership to DtDe).

Parameters
deThe simulation data engine to register with.
registryHeap-allocated registry; ownership transfers to de.
static const std::string& makVrv::DtMilStdSvgOverrideRegistry::instanceName ( )
static

Return the canonical instance name used with DtDe::findInstance().

Returns
Canonical instance name string.
virtual bool makVrv::DtMilStdSvgOverrideRegistry::load ( const std::string &  overridesDir)
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.

Parameters
overridesDirAbsolute path to the overrides directory.
Returns
true on success or if no file is present; false on parse error.
virtual int makVrv::DtMilStdSvgOverrideRegistry::scanEntityType ( int  kind,
int  domain,
int  country,
int  category,
int  subcategory,
int  specific,
int  extra,
int  force = -1 
) const
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.

Parameters
kindDIS entity kind.
domainDIS entity domain.
countryDIS entity country code.
categoryDIS entity category.
subcategoryDIS entity subcategory.
specificDIS entity specific.
extraDIS entity extra.
forceVRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force.
Returns
Zero-based index of first match, or npos (-1) on miss.
virtual int makVrv::DtMilStdSvgOverrideRegistry::scanBySidc ( const std::string &  normalizedSidc,
int  force = -1 
) const
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.

Parameters
normalizedSidc20-character SIDC string with dashes stripped.
forceVRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force.
Returns
Zero-based index of first match, or npos (-1) on miss.
virtual void makVrv::DtMilStdSvgOverrideRegistry::addSidcOverride ( const std::string &  pattern,
const std::string &  svgContent,
bool  highlight,
int  force = -1 
)
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.

Parameters
pattern10-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.
svgContentSVG document string to store.
highlighttrue to set mySvgHighlightContent; false to set mySvgContent.
forceVRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force.
virtual void makVrv::DtMilStdSvgOverrideRegistry::addEntityTypeOverride ( const std::string &  pattern,
const std::string &  svgContent,
bool  highlight,
int  force = -1 
)
virtual

Add or update an entity-type-pattern override.

Same update-in-place semantics as addSidcOverride(). Callers must invoke regenerateAtlases() afterwards.

Parameters
pattern7-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.
svgContentSVG document string to store.
highlighttrue to set mySvgHighlightContent; false to set mySvgContent.
forceVRV/VRF force ID (the raw integer assigned via setForceId()), not the MIL-STD-2525 standard identity. Use -1 to match any force.
virtual void makVrv::DtMilStdSvgOverrideRegistry::removeSidcOverride ( const std::string &  pattern,
int  force = -1 
)
virtual

Remove the entry matching the given SIDC pattern and force.

Parameters
pattern10-field colon-delimited SIDC pattern to remove.
forceVRV/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 void makVrv::DtMilStdSvgOverrideRegistry::removeEntityTypeOverride ( const std::string &  pattern,
int  force = -1 
)
virtual

Remove the entry matching the given entity-type pattern and force.

Parameters
pattern7-field colon-delimited entity-type pattern to remove.
forceVRV/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 void makVrv::DtMilStdSvgOverrideRegistry::clearOverrides ( )
virtual

Remove all override entries. Callers must invoke regenerateAtlases() afterwards.

virtual const std::vector<DtMilStdOverrideEntry>& makVrv::DtMilStdSvgOverrideRegistry::entries ( ) const
inlinevirtual

Direct read-only access to the entry list (used by DtMilStdManager).

Returns
Const reference to the vector of loaded override entries.
virtual bool makVrv::DtMilStdSvgOverrideRegistry::validateStructure ( const rapidjson::Document &  doc,
const std::string &  filePath,
int  version 
) const
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:

return false;
Parameters
docParsed JSON document to validate.
filePathPath to the source file, used in warning messages.
versionVersion integer read from the file; passed for use in version-conditional structural checks.
Returns
true when the document structure is acceptable; false otherwise.

Reimplemented from makVrv::DtMilStdJsonRegistryBase.

virtual void makVrv::DtMilStdSvgOverrideRegistry::parseEntry ( const rapidjson::Value &  obj,
const std::string &  overridesDir 
)
protectedvirtual

Parse one override JSON object and append to myEntries.

template<std::size_t N>
static bool makVrv::DtMilStdSvgOverrideRegistry::parsePattern ( const std::string &  pattern,
std::array< int, N > &  out 
)
staticprotected

Parse a colon-separated integer pattern string into an array. Returns false if the field count does not match N.

static std::string makVrv::DtMilStdSvgOverrideRegistry::readFile ( const std::string &  path)
staticprotected

Read file contents into a string. Returns empty string on failure.

Member Data Documentation

constexpr int makVrv::DtMilStdSvgOverrideRegistry::npos = -1
static

Sentinel index returned by scan methods when no entry matches (value: -1).

std::vector<DtMilStdOverrideEntry> makVrv::DtMilStdSvgOverrideRegistry::myEntries
protected

The documentation for this class was generated from the following file:

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)