![]() |
VR-Forces 4.8 Class Documentation
|
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 | |
| DtDe & | myDe |
| 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... | |
| DtElementAttributeManager & | operator= (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 |
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
| typedef std::vector<DtElementAttribute*> makVrv::DtElementAttributeManager::AttributeList |
Define the type used to signal changes to one or more attributes for one or more elements.
| typedef std::pair<DtElementEntry*, AttributeList> makVrv::DtElementAttributeManager::EntryAttributes |
| typedef std::vector<EntryAttributes> makVrv::DtElementAttributeManager::EntryAttributesList |
|
protected |
|
protected |
|
protected |
CTOR.
This constructor is protected, and can only be called by DtElementAttributeManagerCreator, which is friended
|
virtual |
DTOR.
|
private |
Unimplemented Default CTOR.
|
private |
Unimplemented Default Copy Constructor.
|
virtual |
Get the element type from given an element id or element entry.
|
virtual |
|
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 |
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 |
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 |
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 |
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
|
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 |
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
|
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 |
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
|
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 |
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
|
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 |
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
|
virtual |
Get the object visibility from an element entry.
Returns false if no visibility attribute is found for the element entry.
|
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
|
virtual |
Get the indicator visibility from an element entry.
Returns false if no indicator visibility attribute is found for the element entry.
|
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
|
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 |
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
|
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 |
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
|
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 |
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
|
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 |
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
|
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 |
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
|
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 |
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
|
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 |
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
|
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 |
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.
|
private |
Unimplemented Default assignment operator.
|
protectedvirtual |
Apply all new attribute data reported by a driver in a frame.
|
protectedvirtual |
Remove all attribute data associated with element removals reported by a driver in a frame.
|
protectedvirtual |
Associate a display name with an element.
The assumption is that display names are unique (and that will be enforced in the maps).
|
protectedvirtual |
Remove the entries from the display name to element id and vice versa with this element ID.
|
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.
|
friend |
Friend the creator so it can use the constructor.
|
friend |
friend DtElementData so it can pass attribute changes and element removals to the manager
| 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.
|
protected |
|
protected |
|
protected |
|
mutableprotected |
Mutable iterator used on by startNamedElementIteration / getNextElementIdAndDisplayName.