VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtMilStdSvgOverrideRegistry.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
6 #pragma once
7 
10 
11 #include <vrvMilStd/vrvMilStd.h>
13 
14 #include <array>
15 #include <string>
16 #include <vector>
17 
18 namespace makVrv
19 {
20  class DtDe;
21 
28  {
29  std::array<int, 7> myEntityTypeFields;
30  std::array<int, 10> mySidcFields;
31  bool myUseEntityType = false;
32  std::string mySvgContent;
33  std::string mySvgHighlightContent;
34  int myForce = -1;
35 
37  {
38  myEntityTypeFields.fill( -1 );
39  mySidcFields.fill( -1 );
40  }
41 
52  bool matchesAnyStatus() const { return myUseEntityType || mySidcFields[3] == -1; }
53  };
54 
63  {
64  public:
66  static constexpr int npos = -1;
67 
69 
71  const char* registryName() const override { return "DtMilStdSvgOverrideRegistry"; }
72 
76  static DtMilStdSvgOverrideRegistry& instance( DtDe& de );
77 
81  static void registerInstance( DtDe& de, DtMilStdSvgOverrideRegistry* registry );
82 
85  static const std::string& instanceName();
86 
94  virtual bool load( const std::string& overridesDir );
95 
110  virtual int scanEntityType( int kind, int domain, int country,
111  int category, int subcategory,
112  int specific, int extra,
113  int force = -1 ) const;
114 
123  virtual int scanBySidc( const std::string& normalizedSidc, int force = -1 ) const;
124 
135  virtual void addSidcOverride( const std::string& pattern,
136  const std::string& svgContent,
137  bool highlight,
138  int force = -1 );
139 
150  virtual void addEntityTypeOverride( const std::string& pattern,
151  const std::string& svgContent,
152  bool highlight,
153  int force = -1 );
154 
161  virtual void removeSidcOverride( const std::string& pattern, int force = -1 );
162 
169  virtual void removeEntityTypeOverride( const std::string& pattern, int force = -1 );
170 
173  virtual void clearOverrides();
176  virtual const std::vector<DtMilStdOverrideEntry>& entries() const { return myEntries; }
177 
178  protected:
179  virtual bool validateStructure( const rapidjson::Document& doc,
180  const std::string& filePath,
181  int version ) const override;
182 
183  protected:
185  virtual void parseEntry( const rapidjson::Value& obj, const std::string& overridesDir );
186 
189  template<std::size_t N>
190  static bool parsePattern( const std::string& pattern, std::array<int, N>& out );
191 
193  static std::string readFile( const std::string& path );
194 
195  std::vector<DtMilStdOverrideEntry> myEntries;
196  };
197 
198 } // namespace makVrv
std::vector< DtMilStdOverrideEntry > myEntries
Definition: DtMilStdSvgOverrideRegistry.h:195
Registry of customer SVG overrides for MIL-STD-2525D symbols.
Definition: DtMilStdSvgOverrideRegistry.h:62
Base class for MIL-STD-2525D JSON registry loaders.
std::array< int, 10 > mySidcFields
Ten 2-char SIDC slots as integers; all -1 for entity-type patterns.
Definition: DtMilStdSvgOverrideRegistry.h:30
std::string mySvgContent
Normal SVG document string.
Definition: DtMilStdSvgOverrideRegistry.h:32
DtMilStdOverrideEntry()
Definition: DtMilStdSvgOverrideRegistry.h:36
#define DT_DLL_VRVMILSTD
Definition: vrvMilStd.h:20
IMGUI_API void Value(const char *prefix, bool b)
virtual const std::vector< DtMilStdOverrideEntry > & entries() const
Direct read-only access to the entry list (used by DtMilStdManager).
Definition: DtMilStdSvgOverrideRegistry.h:176
const char * registryName() const override
Return the class name used in warning messages.
Definition: DtMilStdSvgOverrideRegistry.h:71
std::array< int, 7 > myEntityTypeFields
kind:domain:country:category:subcategory:specific:extra. All -1 for SIDC patterns.
Definition: DtMilStdSvgOverrideRegistry.h:29
bool matchesAnyStatus() const
True when this entry matches regardless of the symbol&#39;s status.
Definition: DtMilStdSvgOverrideRegistry.h:52
One SVG override entry loaded from sidc_svg_overrides.json.
Definition: DtMilStdSvgOverrideRegistry.h:27
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Base class for MIL-STD-2525D JSON registry loaders.
Definition: DtMilStdJsonRegistryBase.h:26
std::string mySvgHighlightContent
Highlight SVG document string. Empty = fall back to mySvgContent.
Definition: DtMilStdSvgOverrideRegistry.h:33
Contains DLL export macros.

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)