VR-Forces 5.0.1 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) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
14 #include <vrvCore/DtElementEntry.h>
16 
18 
19 #include <boost/unordered_map.hpp>
20 #include <boost/unordered_set.hpp>
21 #include <vrvUtil/signalslib.h>
22 
23 namespace makVrv
24 {
25  class DtDe;
26  class DtElementAttribute;
27  class DtElementChanges;
28  class DtElementEntry;
29 
36  {
37  public:
38 
40  typedef std::vector<DtElementAttribute*> AttributeList;
42  typedef std::pair<DtElementEntry*, AttributeList> EntryAttributes;
43  typedef std::vector<EntryAttributes> EntryAttributesList;
45 
48 
51  friend class DtElementData;
52 
53  protected:
54 
58 
59  public:
61  virtual ~DtElementAttributeManager();
62 
64  virtual DtElementEntry::ElementType elementType(DtElementID elementId) const;
66  virtual DtElementEntry::ElementType elementType(const DtElementEntry& entry) const;
68 
70 
77  virtual bool getElementDisplayName(DtElementID elementId, std::string& value) const;
78 
85  virtual bool getElementDisplayName(const DtElementEntry& entry, std::string& value) const;
86 
89  virtual bool getElementIdFromDisplayName(const std::string& displayName, DtElementID& elementId) const;
90 
96  virtual bool getElementObjectId(const DtElementEntry& entry, std::string& value) const;
97 
101  virtual bool getElementObjectId(DtElementID elementId, std::string& value) const;
102 
108  virtual bool getElementObjectType(const DtElementEntry& entry, std::string& value) const;
109 
113  virtual bool getElementObjectType(DtElementID elementId, std::string& value) const;
114 
123  virtual bool getElementSubtype(const DtElementEntry& entry, DtElementAttributes::ElementSubtypes& value) const;
124 
128  virtual bool getElementSubtype(DtElementID elementId, DtElementAttributes::ElementSubtypes& value) const;
129 
133  virtual bool getElementElementDefinitionName(const DtElementEntry& entry, DtUnicode& value) const;
134 
138  virtual bool getElementElementDefinitionName(DtElementID elementId, DtUnicode& value) const;
139 
144  virtual bool getElementDriverType(const DtElementEntry& entry, std::string& value) const;
145 
149  virtual bool getElementDriverType(DtElementID elementId, std::string& value) const;
150 
153  virtual bool getElementObjectVisibility(const DtElementEntry& entry, bool& value) const;
154 
158  virtual bool getElementObjectVisibility(DtElementID elementId, bool& value) const;
159 
162  virtual bool getElementIndicatorVisibility(const DtElementEntry& entry, bool& value) const;
163 
167  virtual bool getElementIndicatorVisibility(DtElementID elementId, bool& value) const;
168 
171  virtual bool getElementHeightAboveTerrainLinesEnabled(const DtElementEntry& entry, bool& value) const;
172 
176  virtual bool getElementHeightAboveTerrainLinesEnabled(DtElementID elementId, bool& value) const;
177 
181  virtual bool getElementIndicatorsOnSelect(const DtElementEntry& entry, bool& value) const;
182 
186  virtual bool getElementIndicatorsOnSelect(DtElementID elementId, bool& value) const;
187 
191  virtual bool getElementOverlayName(const DtElementEntry& entry, std::string& value) const;
192 
196  virtual bool getElementOverlayName(DtElementID elementId, std::string& value) const;
197 
203  virtual bool getElementKindAndCategory(const DtElementEntry& entry, std::pair<int, int>& value) const;
204 
208  virtual bool getElementKindAndCategory(DtElementID elementId, std::pair<int, int>& value) const;
209 
213  virtual bool getElementLocalScaleEnabled(const DtElementEntry& entry, bool& value) const;
214 
218  virtual bool getElementLocalScaleEnabled(DtElementID elementId, bool& value) const;
219 
223  virtual bool getElementLocalScaleAmount(const DtElementEntry& entry, float& value) const;
224 
228  virtual bool getElementLocalScaleAmount(DtElementID elementId, float& value) const;
229 
235  virtual bool getElementDamageState(const DtElementEntry& entry, EntityStateListener::DamageState& value) const;
236 
240  virtual bool getElementDamageState(DtElementID elementId, EntityStateListener::DamageState& value) const;
241 
246  virtual bool getElementDisplayUnitCollectionName(const DtElementEntry& entry, std::string& value) const;
247 
251  virtual bool getElementDisplayUnitCollectionName(DtElementID elementId, std::string& value) const;
253 
255 
260  virtual void startNamedElementIteration() const;
261 
264  virtual bool getNextElementIdAndDisplayName(DtElementID& id, std::string& displayName) const;
266 
269  boost::signalslib::signal< void(const EntryAttributesList&) > signal_attributesChanged;
270 
271  private:
273  DtElementAttributeManager() = delete;
274 
277 
279  DtElementAttributeManager& operator=(const DtElementAttributeManager& rhs) = delete;
280 
281  protected:
282 
284  virtual void applyElementAttributeChanges(const DtElementChanges::ElementAttributeMap& attributeChanges);
285 
287  virtual void applyElementRemovals(const DtElementChanges::UniqueIdList& elementsRemoved);
288 
291  virtual void addToElementIdDisplayNameMaps(DtElementID elementId, const std::string& displayName);
292 
294  virtual void removeFromElementIdDisplayNameMaps(DtElementID elementId);
295 
298  virtual void reportElementEntryNotFound(DtElementID elementId) const;
299 
300  protected:
301 
303 
305  // Unordered map from display name attribute to element ID
306  typedef boost::unordered_map< std::string, DtElementID > DisplayNameToElementIdMap;
309 
311  // Unordered map from element ID to display name attribute
312  typedef boost::unordered_map< DtElementID, std::string > ElementIdToDisplayNameMap;
315 
317  mutable ElementIdToDisplayNameMap::const_iterator myMutatableDisplayNameIterator;
318 
319  };
320 
323  {
324  public:
327 
330 
332  static DtElementAttributeManagerCreator& instance(DtDe& de);
333 
335  virtual DtElementAttributeManager* create(DtDe& de) const;
336  };
337 }
ElementIdToDisplayNameMap::const_iterator myMutatableDisplayNameIterator
Mutable iterator used on by startNamedElementIteration / getNextElementIdAndDisplayName.
Definition: DtElementAttributeManager.h:317
boost::signalslib::signal< void(const EntryAttributesList &) > signal_attributesChanged
Signal raised when attributes are changed. The EntryAttributesList contains all the attribute additio...
Definition: DtElementAttributeManager.h:269
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
DamageState
Definition: DtEntityStateListener.h:59
DisplayNameToElementIdMap myDisplayNameToElementIdMap
Definition: DtElementAttributeManager.h:307
boost::unordered_map< DtElementID, std::string > ElementIdToDisplayNameMap
Definition: DtElementAttributeManager.h:312
Creator class for the Network IO.
Definition: DtElementAttributeManager.h:322
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:42
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
ElementSubtypes
Definition: DtElementAttributes.h:56
Contains makVrv::DtVirtualBaseClass class.
Contains makVrv:DtEntityStateListener 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. The DtElementData class creates and owns this manager using the.
Definition: DtElementAttributeManager.h:35
#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:43
boost::unordered_map< std::string, DtElementID > DisplayNameToElementIdMap
Definition: DtElementAttributeManager.h:306
ElementType
Definition: DtElementEntry.h:26
Contains makVrv::DtElementAttributes class.
DtDe & myDe
Definition: DtElementAttributeManager.h:302
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:70
std::vector< DtElementAttribute * > AttributeList
Define the type used to signal changes to one or more attributes for one or more elements.
Definition: DtElementAttributeManager.h:41
Contains makVrv::DtElementChanges class.
ElementIdToDisplayNameMap myElementIdToDisplayNameMap
Definition: DtElementAttributeManager.h:313
Contains makVrv::DtElementEntry class.

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)