VR-Forces 4.8 Class Documentation
 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. More...

Public Types

typedef std::vector
< DtElementAttribute * > 
AttributeList
 Define the type used to signal changes to one or more attributes for one or more elements. More...
 
typedef std::pair
< DtElementEntry
*, AttributeList
EntryAttributes
 
typedef std::vector
< EntryAttributes
EntryAttributesList
 

Public Member Functions

virtual ~DtElementAttributeManager ()
 DTOR. More...
 
virtual DtElementEntry::ElementType elementType (DtElementID elementId) const
 Get the element type from given an element id or element entry. More...
 
virtual DtElementEntry::ElementType elementType (const DtElementEntry &entry) const
 
virtual bool getElementDisplayName (DtElementID elementId, std::string &value) const
 Optional Attributes. More...
 
virtual bool getElementDisplayName (const DtElementEntry &entry, std::string &value) const
 Get the display name from an element entry. More...
 
virtual bool getElementIdFromDisplayName (const std::string &displayName, DtElementID &elementId) const
 Find the element id given a display name. More...
 
virtual bool getElementObjectId (const DtElementEntry &entry, std::string &value) const
 Get the 'object id' from an element entry. More...
 
virtual bool getElementObjectId (DtElementID elementId, std::string &value) const
 Get the 'object id' from an element id. More...
 
virtual bool getElementObjectType (const DtElementEntry &entry, std::string &value) const
 Get the 'object type' from an element entry. More...
 
virtual bool getElementObjectType (DtElementID elementId, std::string &value) const
 Get the 'object type' from an element id Returns false if no entry for the element is found (and raises an error). More...
 
virtual bool getElementSubtype (const DtElementEntry &entry, DtElementAttributes::ElementSubtypes &value) const
 Get the 'element subtype' from an element entry Returns false if no subtype attribute is found for the element entry. More...
 
virtual bool getElementSubtype (DtElementID elementId, DtElementAttributes::ElementSubtypes &value) const
 Get the 'element subype' from an element id. More...
 
virtual bool getElementElementDefinitionName (const DtElementEntry &entry, DtUnicode &value) const
 Get the Element Definition name from an element entry. More...
 
virtual bool getElementElementDefinitionName (DtElementID elementId, DtUnicode &value) const
 Get the Element Definition name from an element id. More...
 
virtual bool getElementDriverType (const DtElementEntry &entry, std::string &value) const
 Get the Driver type from an element entry. More...
 
virtual bool getElementDriverType (DtElementID elementId, std::string &value) const
 Get the Driver type from an element id. More...
 
virtual bool getElementObjectVisibility (const DtElementEntry &entry, bool &value) const
 Get the object visibility from an element entry. More...
 
virtual bool getElementObjectVisibility (DtElementID elementId, bool &value) const
 Get the object visibility from an element id. More...
 
virtual bool getElementIndicatorVisibility (const DtElementEntry &entry, bool &value) const
 Get the indicator visibility from an element entry. More...
 
virtual bool getElementIndicatorVisibility (DtElementID elementId, bool &value) const
 Get the indicator visibility from an element id. More...
 
virtual bool getElementHeightAboveTerrainLinesEnabled (const DtElementEntry &entry, bool &value) const
 Get whether height above terrain lines are enabled from an element entry. More...
 
virtual bool getElementHeightAboveTerrainLinesEnabled (DtElementID elementId, bool &value) const
 Get whether height above terrain lines are enabled from an element id. More...
 
virtual bool getElementIndicatorsOnSelect (const DtElementEntry &entry, bool &value) const
 Get the (show) indicators on select attribute from an element entry. More...
 
virtual bool getElementIndicatorsOnSelect (DtElementID elementId, bool &value) const
 Get the indicators on select attribute from an element id. More...
 
virtual bool getElementOverlayName (const DtElementEntry &entry, std::string &value) const
 Get the overlay name attribute from an element entry. More...
 
virtual bool getElementOverlayName (DtElementID elementId, std::string &value) const
 Get the overlay name attribute from an element id. More...
 
virtual bool getElementKindAndCategory (const DtElementEntry &entry, std::pair< int, int > &value) const
 Get the DIS/RPR entity type kind and category attribute from an element entry. More...
 
virtual bool getElementKindAndCategory (DtElementID elementId, std::pair< int, int > &value) const
 Get the Get the DIS/RPR entity type kind and category attribute from an element id. More...
 
virtual bool getElementLocalScaleEnabled (const DtElementEntry &entry, bool &value) const
 Get the local scale enabled attribute from an element entry. More...
 
virtual bool getElementLocalScaleEnabled (DtElementID elementId, bool &value) const
 Get the local scale enabled attribute from an element id. More...
 
virtual bool getElementLocalScaleAmount (const DtElementEntry &entry, float &value) const
 Get the local scale amount attribute from an element entry. More...
 
virtual bool getElementLocalScaleAmount (DtElementID elementId, float &value) const
 Get the local scale amount attribute from an element id. More...
 
virtual bool getElementDamageState (const DtElementEntry &entry, int &value) const
 Get the damage state attribute from an element entry. More...
 
virtual bool getElementDamageState (DtElementID elementId, int &value) const
 Get the damage state attribute from an element id. More...
 
virtual void startNamedElementIteration () const
 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). More...
 
virtual bool getNextElementIdAndDisplayName (DtElementID &id, std::string &displayName) const
 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. More...
 

Public Attributes

boost::signal< void(const
EntryAttributesList &) > 
signal_attributesChanged
 Signal raised when attributes are changed. More...
 

Protected Member Functions

 DtElementAttributeManager (DtDe &de)
 CTOR. More...
 
virtual void applyElementAttributeChanges (const DtElementChanges::ElementAttributeMap &attributeChanges)
 Apply all new attribute data reported by a driver in a frame. More...
 
virtual void applyElementRemovals (const DtElementChanges::UniqueIdList &elementsRemoved)
 Remove all attribute data associated with element removals reported by a driver in a frame. More...
 
virtual void addToElementIdDisplayNameMaps (DtElementID elementId, const std::string &displayName)
 Associate a display name with an element. More...
 
virtual void removeFromElementIdDisplayNameMaps (DtElementID elementId)
 Remove the entries from the display name to element id and vice versa with this element ID. More...
 
virtual void reportElementEntryNotFound (DtElementID elementId) const
 Helper function to raise a DtDeError when something requests an attribute for an element and no Element Entry is found with that element ID. More...
 

Protected Attributes

DtDemyDe
 
ElementIdToDisplayNameMap::const_iterator myMutatableDisplayNameIterator
 Mutable iterator used on by startNamedElementIteration / getNextElementIdAndDisplayName. More...
 

Private Member Functions

 DtElementAttributeManager ()
 Unimplemented Default CTOR. More...
 
 DtElementAttributeManager (const DtElementAttributeManager &orig)
 Unimplemented Default Copy Constructor. More...
 
DtElementAttributeManageroperator= (const DtElementAttributeManager &rhs)
 Unimplemented Default assignment operator. More...
 

Friends

class DtElementAttributeManagerCreator
 Friend the creator so it can use the constructor. More...
 
class DtElementData
 friend DtElementData so it can pass attribute changes and element removals to the manager More...
 
typedef boost::unordered_map
< std::string, DtElementID
DisplayNameToElementIdMap
 
DisplayNameToElementIdMap myDisplayNameToElementIdMap
 
typedef boost::unordered_map
< DtElementID, std::string > 
ElementIdToDisplayNameMap
 
ElementIdToDisplayNameMap myElementIdToDisplayNameMap
 

Detailed Description

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

See Also
DtElementAttributeManagerCreator.

Member Typedef Documentation

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 ( )
private

Unimplemented Default CTOR.

makVrv::DtElementAttributeManager::DtElementAttributeManager ( const DtElementAttributeManager orig)
private

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
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::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.

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,
int 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,
int 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 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).

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.

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

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::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 Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)