VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtElementAttributeManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
14 #include <vrvCore/DtElementEntry.h>
15 
17 
18 #include <unordered_set>
19 #include <unordered_map>
20 #include <vrvUtil/signalslib.h>
21 
22 namespace makVrv
23 {
24  class DtDe;
25  class DtElementAttribute;
26  class DtElementChanges;
27  class DtElementEntry;
28 
37  {
38  public:
39 
41  typedef std::vector<DtElementAttribute*> AttributeList;
43  typedef std::pair<DtElementEntry*, AttributeList> EntryAttributes;
44  typedef std::vector<EntryAttributes> EntryAttributesList;
46 
49 
52  friend class DtElementData;
53 
54  protected:
55 
59 
60  public:
62  virtual ~DtElementAttributeManager();
63 
65  virtual DtElementEntry::ElementType elementType(DtElementID elementId) const;
67  virtual DtElementEntry::ElementType elementType(const DtElementEntry& entry) const;
69 
71 
78  virtual bool getElementDisplayName(DtElementID elementId, std::string& value) const;
79 
86  virtual bool getElementDisplayName(const DtElementEntry& entry, std::string& value) const;
87 
93  virtual bool getElementObjectId(const DtElementEntry& entry, std::string& value) const;
94 
98  virtual bool getElementObjectId(DtElementID elementId, std::string& value) const;
99 
105  virtual bool getElementObjectType(const DtElementEntry& entry, std::string& value) const;
106 
110  virtual bool getElementObjectType(DtElementID elementId, std::string& value) const;
111 
120  virtual bool getElementSubtype(const DtElementEntry& entry, DtElementAttributes::ElementSubtypes& value) const;
121 
125  virtual bool getElementSubtype(DtElementID elementId, DtElementAttributes::ElementSubtypes& value) const;
126 
128  virtual bool getElementObjectSidc( const DtElementEntry& entry, std::string& value ) const;
129 
133  virtual bool getElementObjectSidc( DtElementID elementId, std::string& value ) const;
134 
136  virtual bool getElementObjectGlobalID( const DtElementEntry& entry, std::string& value ) const;
137 
141  virtual bool getElementObjectGlobalID( DtElementID elementId, std::string& value ) const;
142 
146  virtual bool getElementElementDefinitionName(const DtElementEntry& entry, DtUnicode& value) const;
147 
151  virtual bool getElementElementDefinitionName(DtElementID elementId, DtUnicode& value) const;
152 
157  virtual bool getElementDriverType(const DtElementEntry& entry, std::string& value) const;
158 
162  virtual bool getElementDriverType(DtElementID elementId, std::string& value) const;
163 
166  virtual bool getElementObjectVisibility(const DtElementEntry& entry, bool& value) const;
167 
171  virtual bool getElementObjectVisibility(DtElementID elementId, bool& value) const;
172 
175  virtual bool getElementIndicatorVisibility(const DtElementEntry& entry, bool& value) const;
176 
180  virtual bool getElementIndicatorVisibility(DtElementID elementId, bool& value) const;
181 
184  virtual bool getElementHeightAboveTerrainLinesEnabled(const DtElementEntry& entry, bool& value) const;
185 
189  virtual bool getElementHeightAboveTerrainLinesEnabled(DtElementID elementId, bool& value) const;
190 
194  virtual bool getElementIndicatorsOnSelect(const DtElementEntry& entry, bool& value) const;
195 
199  virtual bool getElementIndicatorsOnSelect(DtElementID elementId, bool& value) const;
200 
204  virtual bool getElementOverlayName(const DtElementEntry& entry, std::string& value) const;
205 
209  virtual bool getElementOverlayName(DtElementID elementId, std::string& value) const;
210 
216  virtual bool getElementKindAndCategory(const DtElementEntry& entry, std::pair<int, int>& value) const;
217 
221  virtual bool getElementKindAndCategory(DtElementID elementId, std::pair<int, int>& value) const;
222 
226  virtual bool getElementLocalScaleEnabled(const DtElementEntry& entry, bool& value) const;
227 
231  virtual bool getElementLocalScaleEnabled(DtElementID elementId, bool& value) const;
232 
236  virtual bool getElementLocalScaleAmount(const DtElementEntry& entry, float& value) const;
237 
241  virtual bool getElementLocalScaleAmount(DtElementID elementId, float& value) const;
242 
248  virtual bool getElementDamageState(const DtElementEntry& entry, EntityStateListener::DamageState& value) const;
249 
253  virtual bool getElementDamageState(DtElementID elementId, EntityStateListener::DamageState& value) const;
254 
259  virtual bool getElementDisplayUnitCollectionName(const DtElementEntry& entry, std::string& value) const;
260 
264  virtual bool getElementDisplayUnitCollectionName(DtElementID elementId, std::string& value) const;
265 
268  virtual bool getElementLightPointGroupCollectionName(const DtElementEntry& entry, std::string& value) const;
269 
273  virtual bool getElementLightPointGroupCollectionName(DtElementID elementId, std::string& value) const;
275 
277 
285  virtual void startNamedElementIteration() const;
286 
289  virtual bool getNextElementIdAndDisplayName(DtElementID& id, std::string& displayName) const;
290 
293  virtual bool getElementIdFromDisplayName(const std::string& displayName, DtElementID& elementId) const;
295 
298  boost::signalslib::signal< void(const EntryAttributesList&) > signal_attributesChanged;
299 
300  private:
302  DtElementAttributeManager() = delete;
303 
306 
308  DtElementAttributeManager& operator=(const DtElementAttributeManager& rhs) = delete;
309 
310  protected:
311 
313  virtual void applyElementAttributeChanges(const DtElementChanges::ElementAttributeMap& attributeChanges);
314 
316  virtual void applyElementRemovals(const DtElementChanges::UniqueIdList& elementsRemoved);
317 
320  virtual void addToElementIdDisplayNameMaps(DtElementID elementId, const std::string& displayName);
321 
323  virtual void removeFromElementIdDisplayNameMaps(DtElementID elementId);
324 
327  virtual void reportElementEntryNotFound(DtElementID elementId) const;
328 
329  protected:
330 
332 
334  // Unordered map from display name attribute to element ID
335  typedef std::unordered_map< std::string, DtElementID > DisplayNameToElementIdMap;
338 
340  // Unordered map from element ID to display name attribute
341  typedef std::unordered_map< DtElementID, std::string > ElementIdToDisplayNameMap;
344 
346  mutable ElementIdToDisplayNameMap::const_iterator myMutatableDisplayNameIterator;
347 
348  };
349 
352  {
353  public:
356 
359 
361  static DtElementAttributeManagerCreator& instance(DtDe& de);
362 
364  virtual DtElementAttributeManager* create(DtDe& de) const;
365  };
366 }
ElementIdToDisplayNameMap::const_iterator myMutatableDisplayNameIterator
Mutable iterator used on by startNamedElementIteration / getNextElementIdAndDisplayName.
Definition: DtElementAttributeManager.h:346
boost::signalslib::signal< void(const EntryAttributesList &) > signal_attributesChanged
Signal raised when attributes are changed. The EntryAttributesList contains all the attribute additio...
Definition: DtElementAttributeManager.h:298
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
std::unordered_map< std::string, DtElementID > DisplayNameToElementIdMap
Definition: DtElementAttributeManager.h:335
DamageState
Definition: DtEntityStateListener.h:65
DisplayNameToElementIdMap myDisplayNameToElementIdMap
Definition: DtElementAttributeManager.h:336
Creator class for the Network IO.
Definition: DtElementAttributeManager.h:351
std::pair< DtElementEntry *, AttributeList > EntryAttributes
Define the type used to signal changes to one or more attributes for one or more elements.
Definition: DtElementAttributeManager.h:43
The element data is all the information about all elements in the scene.
Definition: DtElementData.h:30
std::vector< DtUniqueID > UniqueIdList
Definition: DtElementChanges.h:34
DtElementEntry holds the non-simulation-specific data about an element, including its element type an...
Definition: DtElementEntry.h:22
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
ElementSubtypes
Definition: DtElementAttributes.h:59
Contains makVrv::DtVirtualBaseClass class.
The element attribute manager is used to provide access to element attribute data. It includes maps between the display name attribute and element id to make it easier to find an element by name. However, note that these maps only valid if display names are unique (and that is not the case internally for the VRF GUI). The DtElementData class creates and owns this manager using the.
Definition: DtElementAttributeManager.h:36
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
std::map< DtUniqueID, AttributeList > ElementAttributeMap
Definition: DtElementChanges.h:36
std::vector< EntryAttributes > EntryAttributesList
Define the type used to signal changes to one or more attributes for one or more elements.
Definition: DtElementAttributeManager.h:44
ElementType
Definition: DtElementEntry.h:26
std::unordered_map< DtElementID, std::string > ElementIdToDisplayNameMap
Definition: DtElementAttributeManager.h:341
Contains makVrv::DtElementAttributes class.
DtDe & myDe
Definition: DtElementAttributeManager.h:331
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
std::vector< DtElementAttribute * > AttributeList
Define the type used to signal changes to one or more attributes for one or more elements.
Definition: DtElementAttributeManager.h:42
Contains makVrv::DtElementChanges class.
ElementIdToDisplayNameMap myElementIdToDisplayNameMap
Definition: DtElementAttributeManager.h:342
Contains makVrv::DtElementEntry class.

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)