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

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.

See Also
DtElementAttributeManagerCreator.

Public Types

typedef std::vector
< DtElementAttribute * > 
AttributeList
 
typedef std::pair
< DtElementEntry
*, AttributeList
EntryAttributes
 
typedef std::vector
< EntryAttributes
EntryAttributesList
 

Public Member Functions

virtual ~DtElementAttributeManager ()
 
virtual DtElementEntry::ElementType elementType (DtElementID elementId) const
 
virtual DtElementEntry::ElementType elementType (const DtElementEntry &entry) const
 
virtual bool getElementDisplayName (DtElementID elementId, std::string &value) const
 
virtual bool getElementDisplayName (const DtElementEntry &entry, std::string &value) const
 
virtual bool getElementObjectId (const DtElementEntry &entry, std::string &value) const
 
virtual bool getElementObjectId (DtElementID elementId, std::string &value) const
 
virtual bool getElementObjectType (const DtElementEntry &entry, std::string &value) const
 
virtual bool getElementObjectType (DtElementID elementId, std::string &value) const
 
virtual bool getElementSubtype (const DtElementEntry &entry, DtElementAttributes::ElementSubtypes &value) const
 
virtual bool getElementSubtype (DtElementID elementId, DtElementAttributes::ElementSubtypes &value) const
 
virtual bool getElementElementDefinitionName (const DtElementEntry &entry, DtUnicode &value) const
 
virtual bool getElementElementDefinitionName (DtElementID elementId, DtUnicode &value) const
 
virtual bool getElementDriverType (const DtElementEntry &entry, std::string &value) const
 
virtual bool getElementDriverType (DtElementID elementId, std::string &value) const
 
virtual bool getElementObjectVisibility (const DtElementEntry &entry, bool &value) const
 
virtual bool getElementObjectVisibility (DtElementID elementId, bool &value) const
 
virtual bool getElementIndicatorVisibility (const DtElementEntry &entry, bool &value) const
 
virtual bool getElementIndicatorVisibility (DtElementID elementId, bool &value) const
 
virtual bool getElementHeightAboveTerrainLinesEnabled (const DtElementEntry &entry, bool &value) const
 
virtual bool getElementHeightAboveTerrainLinesEnabled (DtElementID elementId, bool &value) const
 
virtual bool getElementIndicatorsOnSelect (const DtElementEntry &entry, bool &value) const
 
virtual bool getElementIndicatorsOnSelect (DtElementID elementId, bool &value) const
 
virtual bool getElementOverlayName (const DtElementEntry &entry, std::string &value) const
 
virtual bool getElementOverlayName (DtElementID elementId, std::string &value) const
 
virtual bool getElementKindAndCategory (const DtElementEntry &entry, std::pair< int, int > &value) const
 
virtual bool getElementKindAndCategory (DtElementID elementId, std::pair< int, int > &value) const
 
virtual bool getElementLocalScaleEnabled (const DtElementEntry &entry, bool &value) const
 
virtual bool getElementLocalScaleEnabled (DtElementID elementId, bool &value) const
 
virtual bool getElementLocalScaleAmount (const DtElementEntry &entry, float &value) const
 
virtual bool getElementLocalScaleAmount (DtElementID elementId, float &value) const
 
virtual bool getElementDamageState (const DtElementEntry &entry, EntityStateListener::DamageState &value) const
 
virtual bool getElementDamageState (DtElementID elementId, EntityStateListener::DamageState &value) const
 
virtual bool getElementDisplayUnitCollectionName (const DtElementEntry &entry, std::string &value) const
 
virtual bool getElementDisplayUnitCollectionName (DtElementID elementId, std::string &value) const
 
virtual void startNamedElementIteration () const
 
virtual bool getNextElementIdAndDisplayName (DtElementID &id, std::string &displayName) const
 
virtual bool getElementIdFromDisplayName (const std::string &displayName, DtElementID &elementId) const
 

Public Attributes

boost::signalslib::signal
< void(const
EntryAttributesList &) > 
signal_attributesChanged
 

Protected Member Functions

 DtElementAttributeManager (DtDe &de)
 
virtual void applyElementAttributeChanges (const DtElementChanges::ElementAttributeMap &attributeChanges)
 
virtual void applyElementRemovals (const DtElementChanges::UniqueIdList &elementsRemoved)
 
virtual void addToElementIdDisplayNameMaps (DtElementID elementId, const std::string &displayName)
 
virtual void removeFromElementIdDisplayNameMaps (DtElementID elementId)
 
virtual void reportElementEntryNotFound (DtElementID elementId) const
 

Protected Attributes

DtDemyDe
 
ElementIdToDisplayNameMap::const_iterator myMutatableDisplayNameIterator
 

Private Member Functions

 DtElementAttributeManager ()=delete
 
 DtElementAttributeManager (const DtElementAttributeManager &orig)=delete
 
DtElementAttributeManageroperator= (const DtElementAttributeManager &rhs)=delete
 

Friends

class DtElementAttributeManagerCreator
 
class DtElementData
 
typedef boost::unordered_map
< std::string, DtElementID
DisplayNameToElementIdMap
 
DisplayNameToElementIdMap myDisplayNameToElementIdMap
 
typedef boost::unordered_map
< DtElementID, std::string > 
ElementIdToDisplayNameMap
 
ElementIdToDisplayNameMap myElementIdToDisplayNameMap
 

Member Typedef Documentation

Define the type used to signal changes to one or more attributes for one or more elements.

Define the type used to signal changes to one or more attributes for one or more elements.

Define the type used to signal changes to one or more attributes for one or more elements.

typedef boost::unordered_map< std::string, DtElementID > makVrv::DtElementAttributeManager::DisplayNameToElementIdMap
protected
typedef boost::unordered_map< DtElementID, std::string > makVrv::DtElementAttributeManager::ElementIdToDisplayNameMap
protected

Constructor & Destructor Documentation

makVrv::DtElementAttributeManager::DtElementAttributeManager ( DtDe de)
protected

CTOR. This constructor is protected, and can only be called by DtElementAttributeManagerCreator, which is friended.

virtual makVrv::DtElementAttributeManager::~DtElementAttributeManager ( )
virtual

DTOR.

makVrv::DtElementAttributeManager::DtElementAttributeManager ( )
privatedelete

Unimplemented Default CTOR.

makVrv::DtElementAttributeManager::DtElementAttributeManager ( const DtElementAttributeManager orig)
privatedelete

Unimplemented Default Copy Constructor.

Member Function Documentation

virtual DtElementEntry::ElementType makVrv::DtElementAttributeManager::elementType ( DtElementID  elementId) const
virtual

Get the element type from given an element id or element entry.

virtual DtElementEntry::ElementType makVrv::DtElementAttributeManager::elementType ( const DtElementEntry entry) const
virtual

Get the element type from given an element id or element entry.

virtual bool makVrv::DtElementAttributeManager::getElementDisplayName ( DtElementID  elementId,
std::string &  value 
) const
virtual

Optional Attributes.

Get the display name from an element id. Returns false if no entry is found for the element id in the element id to display name map. For a VR-Link connection, the display name will be the marking text; for a CIGI connection, the display name will be "CIGI Entity <n>" where <n> is the entity id. Other drivers may choose different display names.

virtual bool makVrv::DtElementAttributeManager::getElementDisplayName ( const DtElementEntry entry,
std::string &  value 
) const
virtual

Get the display name from an element entry. Returns false if no entry is found for the element id in the element id to display name map for that element entry's id. For a VR-Link connection, the display name will be the marking text; for a CIGI connection, the display name will be "CIGI Entity <n>" where <n> is the entity id. Other drivers may choose different display names.

virtual bool makVrv::DtElementAttributeManager::getElementObjectId ( const DtElementEntry entry,
std::string &  value 
) const
virtual

Get the 'object id' from an element entry. Returns false if no connection object id attribute is found for the element entry. Drivers can manage there own object id spaces and report them in string form. VR-Link drivers will report DIS/RPR ids of the form "site:app:entity"; CIGI drivers use a simple integer scheme. Other drivers may optionally create other ID spaces.

virtual bool makVrv::DtElementAttributeManager::getElementObjectId ( DtElementID  elementId,
std::string &  value 
) const
virtual

Get the 'object id' from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementObjectId(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementObjectType ( const DtElementEntry entry,
std::string &  value 
) const
virtual

Get the 'object type' from an element entry. Returns false if no connection object type attribute is found for the element entry. Drivers can manage their own object type spaces. VR-Link drivers will return DIS/RPR entity type tuples in string form as defined by the DIS and RPR standards. CIGI drivers use the simple integer scheme defined by the CIGI standard. Other drivers may optionally chose to define and use their own object types.

virtual bool makVrv::DtElementAttributeManager::getElementObjectType ( DtElementID  elementId,
std::string &  value 
) const
virtual

Get the 'object type' from an element id Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementObjectType(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementSubtype ( const DtElementEntry entry,
DtElementAttributes::ElementSubtypes value 
) const
virtual

Get the 'element subtype' from an element entry Returns false if no subtype attribute is found for the element entry. This is an optional 'subtype' to the element type above. Currently used for display purposes, it subdivides the DtElementEntry::Aggregate types into DtElementAttributes::Friendly, DtElementAttributes::Opposing, DtElementAttributes::Neutral, and DtElementAttributes::Other; and the DtElementEntry::Entity types into DtElementAttributes::Friendly, DtElementAttributes::FriendlyMunitions, DtElementAttributes::Opposing, DtElementAttributes::OpposingMunitions, DtElementAttributes::Neutral, DtElementAttributes::NeutralMunitions, DtElementAttributes::Other, and DtElementAttributes::OtherMunitions.

virtual bool makVrv::DtElementAttributeManager::getElementSubtype ( DtElementID  elementId,
DtElementAttributes::ElementSubtypes value 
) const
virtual

Get the 'element subype' from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementSubtype(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementElementDefinitionName ( const DtElementEntry entry,
DtUnicode value 
) const
virtual

Get the Element Definition name from an element entry. Returns false if no Element Definition name attribute is found for the element entry. Currently only VR-Link drivers map entities to Element Definitions, so the attribute is only reported by them.

virtual bool makVrv::DtElementAttributeManager::getElementElementDefinitionName ( DtElementID  elementId,
DtUnicode value 
) const
virtual

Get the Element Definition name from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementElementDefinitionName(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementDriverType ( const DtElementEntry entry,
std::string &  value 
) const
virtual

Get the Driver type from an element entry. Returns false if no Driver type attribute is found for the element entry. Currently the VR-Link Drivers, CIGI Driver, Input Driver, and Scene Driver report this attribute (as well as some examples).

virtual bool makVrv::DtElementAttributeManager::getElementDriverType ( DtElementID  elementId,
std::string &  value 
) const
virtual

Get the Driver type from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementDriverType(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementObjectVisibility ( const DtElementEntry entry,
bool value 
) const
virtual

Get the object visibility from an element entry. Returns false if no visibility attribute is found for the element entry.

virtual bool makVrv::DtElementAttributeManager::getElementObjectVisibility ( DtElementID  elementId,
bool value 
) const
virtual

Get the object visibility from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementObjectVisibility(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementIndicatorVisibility ( const DtElementEntry entry,
bool value 
) const
virtual

Get the indicator visibility from an element entry. Returns false if no indicator visibility attribute is found for the element entry.

virtual bool makVrv::DtElementAttributeManager::getElementIndicatorVisibility ( DtElementID  elementId,
bool value 
) const
virtual

Get the indicator visibility from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementIndicatorVisibility(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementHeightAboveTerrainLinesEnabled ( const DtElementEntry entry,
bool value 
) const
virtual

Get whether height above terrain lines are enabled from an element entry. Returns false if no height above terrain lines attribute is found for the element entry.

virtual bool makVrv::DtElementAttributeManager::getElementHeightAboveTerrainLinesEnabled ( DtElementID  elementId,
bool value 
) const
virtual

Get whether height above terrain lines are enabled from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementHeightAboveTerrainLinesEnabled(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementIndicatorsOnSelect ( const DtElementEntry entry,
bool value 
) const
virtual

Get the (show) indicators on select attribute from an element entry. Returns false if no indicators on select attribute is found for the element entry. This attribute is reported by the VR-Link drivers for tactical graphics.

virtual bool makVrv::DtElementAttributeManager::getElementIndicatorsOnSelect ( DtElementID  elementId,
bool value 
) const
virtual

Get the indicators on select attribute from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementIndicatorsOnSelect(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementOverlayName ( const DtElementEntry entry,
std::string &  value 
) const
virtual

Get the overlay name attribute from an element entry. Returns false if no overlay name attribute is found for the element entry. This attribute is reported by the VR-Link drivers for tactical graphics that are placed on overlays.

virtual bool makVrv::DtElementAttributeManager::getElementOverlayName ( DtElementID  elementId,
std::string &  value 
) const
virtual

Get the overlay name attribute from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementOverlayName(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementKindAndCategory ( const DtElementEntry entry,
std::pair< int, int > &  value 
) const
virtual

Get the DIS/RPR entity type kind and category attribute from an element entry. Returns false if no kind and category attribute is found for the element entry. This attribute is reported by the VR-Link drivers for tactical graphics. It is then used to create the equivalent of subtypes for tactical graphics. At some point this should be replaced by the object subtype mechanism.

virtual bool makVrv::DtElementAttributeManager::getElementKindAndCategory ( DtElementID  elementId,
std::pair< int, int > &  value 
) const
virtual

Get the Get the DIS/RPR entity type kind and category attribute from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementKindAndCategory(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementLocalScaleEnabled ( const DtElementEntry entry,
bool value 
) const
virtual

Get the local scale enabled attribute from an element entry. Returns false if no local scale enabled attribute is found for the element entry. This attribute is reported by observers when attached to an entity element in SpaceFollow mode.

virtual bool makVrv::DtElementAttributeManager::getElementLocalScaleEnabled ( DtElementID  elementId,
bool value 
) const
virtual

Get the local scale enabled attribute from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementLocalScaleEnabled(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementLocalScaleAmount ( const DtElementEntry entry,
float &  value 
) const
virtual

Get the local scale amount attribute from an element entry. Returns false if no local scale amount attribute is found for the element entry. This attribute is reported by observers when attached to an entity element in SpaceFollow mode.

virtual bool makVrv::DtElementAttributeManager::getElementLocalScaleAmount ( DtElementID  elementId,
float &  value 
) const
virtual

Get the local scale amount attribute from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementLocalScaleAmount(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementDamageState ( const DtElementEntry entry,
EntityStateListener::DamageState value 
) const
virtual

Get the damage state attribute from an element entry. Returns false if no damage state attribute is found for the element entry. This attribute is reported by VR-Link drivers for entities and elements whenever entity or aggregate element damage state is set from the DIS or RPR connection. It will have values 0-3 as defined by the DIS / RPR standards.

virtual bool makVrv::DtElementAttributeManager::getElementDamageState ( DtElementID  elementId,
EntityStateListener::DamageState value 
) const
virtual

Get the damage state attribute from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementDamageState(const DtElementEntry& entry, std::string& value).
virtual bool makVrv::DtElementAttributeManager::getElementDisplayUnitCollectionName ( const DtElementEntry entry,
std::string &  value 
) const
virtual

Get the display unit collection name from an element entry. Returns false if no display unit collection name attribute is found for the element entry. This attribute is reported by the VR-Vantage DtEntityKinStateVisualizer whenever an entity element display unit collection name is set from its visualizer definition.

virtual bool makVrv::DtElementAttributeManager::getElementDisplayUnitCollectionName ( DtElementID  elementId,
std::string &  value 
) const
virtual

Get the display unit collection name from an element id. Returns false if no entry for the element is found (and raises an error). Then calls and returns the value from.

See Also
getElementDisplayUnitCollectionName(const DtElementEntry& entry, std::string& value).
virtual void makVrv::DtElementAttributeManager::startNamedElementIteration ( ) const
virtual

Iterate through element ID / displayName pairs These methods provide a mechanism to inspect all of the entries in the Element Id to Display Name map (and therefore also the Display Name to Element Id map). N.B. All of these methods require the name/id maps to be valid, which means unique display names must be used. Do not use these routines internally to VRV or the VRF GUI, because the VRF GUI violates that restriction.

Set the display name map iterator to the beginning of the map

virtual bool makVrv::DtElementAttributeManager::getNextElementIdAndDisplayName ( DtElementID id,
std::string &  displayName 
) const
virtual

Get the current element id and display name for the iterator; returns true if values are returned, false if the list is empty or at the end.

virtual bool makVrv::DtElementAttributeManager::getElementIdFromDisplayName ( const std::string &  displayName,
DtElementID elementId 
) const
virtual

Find the element id given a display name. Returns false if no entry is found in the displayName to element id map for the specified element.

DtElementAttributeManager& makVrv::DtElementAttributeManager::operator= ( const DtElementAttributeManager rhs)
privatedelete

Unimplemented Default assignment operator.

virtual void makVrv::DtElementAttributeManager::applyElementAttributeChanges ( const DtElementChanges::ElementAttributeMap attributeChanges)
protectedvirtual

Apply all new attribute data reported by a driver in a frame.

virtual void makVrv::DtElementAttributeManager::applyElementRemovals ( const DtElementChanges::UniqueIdList elementsRemoved)
protectedvirtual

Remove all attribute data associated with element removals reported by a driver in a frame.

virtual void makVrv::DtElementAttributeManager::addToElementIdDisplayNameMaps ( DtElementID  elementId,
const std::string &  displayName 
)
protectedvirtual

Associate a display name with an element. The assumption is that display names are unique (and that will be enforced in the maps).

virtual void makVrv::DtElementAttributeManager::removeFromElementIdDisplayNameMaps ( DtElementID  elementId)
protectedvirtual

Remove the entries from the display name to element id and vice versa with this element ID.

virtual void makVrv::DtElementAttributeManager::reportElementEntryNotFound ( DtElementID  elementId) const
protectedvirtual

Helper function to raise a DtDeError when something requests an attribute for an element and no Element Entry is found with that element ID.

Friends And Related Function Documentation

friend class DtElementAttributeManagerCreator
friend

Friend the creator so it can use the constructor.

friend class DtElementData
friend

friend DtElementData so it can pass attribute changes and element removals to the manager

Member Data Documentation

boost::signalslib::signal< void(const EntryAttributesList&) > makVrv::DtElementAttributeManager::signal_attributesChanged

Signal raised when attributes are changed. The EntryAttributesList contains all the attribute additions/changes for all elements from one driver in a frame.

DtDe& makVrv::DtElementAttributeManager::myDe
protected
DisplayNameToElementIdMap makVrv::DtElementAttributeManager::myDisplayNameToElementIdMap
protected
ElementIdToDisplayNameMap makVrv::DtElementAttributeManager::myElementIdToDisplayNameMap
protected
ElementIdToDisplayNameMap::const_iterator makVrv::DtElementAttributeManager::myMutatableDisplayNameIterator
mutableprotected

Mutable iterator used on by startNamedElementIteration / getNextElementIdAndDisplayName.


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

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)