VR-Forces 5.0.2 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 
38  {
39  public:
40 
42  typedef std::vector<DtElementAttribute*> AttributeList;
44  typedef std::pair<DtElementEntry*, AttributeList> EntryAttributes;
45  typedef std::vector<EntryAttributes> EntryAttributesList;
47 
50 
53  friend class DtElementData;
54 
55  protected:
56 
60 
61  public:
63  virtual ~DtElementAttributeManager();
64 
66  virtual DtElementEntry::ElementType elementType(DtElementID elementId) const;
68  virtual DtElementEntry::ElementType elementType(const DtElementEntry& entry) const;
70 
72 
79  virtual bool getElementDisplayName(DtElementID elementId, std::string& value) const;
80 
87  virtual bool getElementDisplayName(const DtElementEntry& entry, std::string& value) const;
88 
94  virtual bool getElementObjectId(const DtElementEntry& entry, std::string& value) const;
95 
99  virtual bool getElementObjectId(DtElementID elementId, std::string& value) const;
100 
106  virtual bool getElementObjectType(const DtElementEntry& entry, std::string& value) const;
107 
111  virtual bool getElementObjectType(DtElementID elementId, std::string& value) const;
112 
121  virtual bool getElementSubtype(const DtElementEntry& entry, DtElementAttributes::ElementSubtypes& value) const;
122 
126  virtual bool getElementSubtype(DtElementID elementId, DtElementAttributes::ElementSubtypes& value) const;
127 
131  virtual bool getElementElementDefinitionName(const DtElementEntry& entry, DtUnicode& value) const;
132 
136  virtual bool getElementElementDefinitionName(DtElementID elementId, DtUnicode& value) const;
137 
142  virtual bool getElementDriverType(const DtElementEntry& entry, std::string& value) const;
143 
147  virtual bool getElementDriverType(DtElementID elementId, std::string& value) const;
148 
151  virtual bool getElementObjectVisibility(const DtElementEntry& entry, bool& value) const;
152 
156  virtual bool getElementObjectVisibility(DtElementID elementId, bool& value) const;
157 
160  virtual bool getElementIndicatorVisibility(const DtElementEntry& entry, bool& value) const;
161 
165  virtual bool getElementIndicatorVisibility(DtElementID elementId, bool& value) const;
166 
169  virtual bool getElementHeightAboveTerrainLinesEnabled(const DtElementEntry& entry, bool& value) const;
170 
174  virtual bool getElementHeightAboveTerrainLinesEnabled(DtElementID elementId, bool& value) const;
175 
179  virtual bool getElementIndicatorsOnSelect(const DtElementEntry& entry, bool& value) const;
180 
184  virtual bool getElementIndicatorsOnSelect(DtElementID elementId, bool& value) const;
185 
189  virtual bool getElementOverlayName(const DtElementEntry& entry, std::string& value) const;
190 
194  virtual bool getElementOverlayName(DtElementID elementId, std::string& value) const;
195 
201  virtual bool getElementKindAndCategory(const DtElementEntry& entry, std::pair<int, int>& value) const;
202 
206  virtual bool getElementKindAndCategory(DtElementID elementId, std::pair<int, int>& value) const;
207 
211  virtual bool getElementLocalScaleEnabled(const DtElementEntry& entry, bool& value) const;
212 
216  virtual bool getElementLocalScaleEnabled(DtElementID elementId, bool& value) const;
217 
221  virtual bool getElementLocalScaleAmount(const DtElementEntry& entry, float& value) const;
222 
226  virtual bool getElementLocalScaleAmount(DtElementID elementId, float& value) const;
227 
233  virtual bool getElementDamageState(const DtElementEntry& entry, EntityStateListener::DamageState& value) const;
234 
238  virtual bool getElementDamageState(DtElementID elementId, EntityStateListener::DamageState& value) const;
239 
244  virtual bool getElementDisplayUnitCollectionName(const DtElementEntry& entry, std::string& value) const;
245 
249  virtual bool getElementDisplayUnitCollectionName(DtElementID elementId, std::string& value) const;
251 
253 
261  virtual void startNamedElementIteration() const;
262 
265  virtual bool getNextElementIdAndDisplayName(DtElementID& id, std::string& displayName) const;
266 
269  virtual bool getElementIdFromDisplayName(const std::string& displayName, DtElementID& elementId) const;
271 
274  boost::signalslib::signal< void(const EntryAttributesList&) > signal_attributesChanged;
275 
276  private:
278  DtElementAttributeManager() = delete;
279 
282 
284  DtElementAttributeManager& operator=(const DtElementAttributeManager& rhs) = delete;
285 
286  protected:
287 
289  virtual void applyElementAttributeChanges(const DtElementChanges::ElementAttributeMap& attributeChanges);
290 
292  virtual void applyElementRemovals(const DtElementChanges::UniqueIdList& elementsRemoved);
293 
296  virtual void addToElementIdDisplayNameMaps(DtElementID elementId, const std::string& displayName);
297 
299  virtual void removeFromElementIdDisplayNameMaps(DtElementID elementId);
300 
303  virtual void reportElementEntryNotFound(DtElementID elementId) const;
304 
305  protected:
306 
308 
310  // Unordered map from display name attribute to element ID
311  typedef boost::unordered_map< std::string, DtElementID > DisplayNameToElementIdMap;
314 
316  // Unordered map from element ID to display name attribute
317  typedef boost::unordered_map< DtElementID, std::string > ElementIdToDisplayNameMap;
320 
322  mutable ElementIdToDisplayNameMap::const_iterator myMutatableDisplayNameIterator;
323 
324  };
325 
328  {
329  public:
332 
335 
337  static DtElementAttributeManagerCreator& instance(DtDe& de);
338 
340  virtual DtElementAttributeManager* create(DtDe& de) const;
341  };
342 }
ElementIdToDisplayNameMap::const_iterator myMutatableDisplayNameIterator
Mutable iterator used on by startNamedElementIteration / getNextElementIdAndDisplayName.
Definition: DtElementAttributeManager.h:322
boost::signalslib::signal< void(const EntryAttributesList &) > signal_attributesChanged
Signal raised when attributes are changed. The EntryAttributesList contains all the attribute additio...
Definition: DtElementAttributeManager.h:274
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:312
boost::unordered_map< DtElementID, std::string > ElementIdToDisplayNameMap
Definition: DtElementAttributeManager.h:317
Creator class for the Network IO.
Definition: DtElementAttributeManager.h:327
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:44
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. 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:37
#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:45
boost::unordered_map< std::string, DtElementID > DisplayNameToElementIdMap
Definition: DtElementAttributeManager.h:311
ElementType
Definition: DtElementEntry.h:26
Contains makVrv::DtElementAttributes class.
DtDe & myDe
Definition: DtElementAttributeManager.h:307
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:43
Contains makVrv::DtElementChanges class.
ElementIdToDisplayNameMap myElementIdToDisplayNameMap
Definition: DtElementAttributeManager.h:318
Contains makVrv::DtElementEntry class.

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)