![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
TSLTrackBase class for use with the Track Display Manager This class defines a common set of attributes and functionality for TSLTrack and TSLTrackGroup
This class is reference counted internally to allow objects to be shared within the track manager SDK
Public Types | |
enum | TrackType { Track , TrackGroup } |
enum | AggregationState { AggregationDisabled , AggregationEnabled , AggregationDisabledByGraphic } |
typedef uint32_t | TrackID |
Public Member Functions | |
virtual TSLTrackBase::TrackType | type () const =0 |
void | release () |
virtual TSLTrackBase * | clone () const =0 |
AggregationState | aggregationState () const |
void | allowAggregation (bool allow) |
void | hierarchyLevel (uint32_t level) |
uint32_t | hierarchyLevel () const |
TSLTrackBase::TrackID | trackNumber () const |
void | aggregator (TSLTrackAggregator *aggregator) |
TSLTrackAggregator * | aggregator () const |
void | hierarchyAggregator (TSLTrackAggregatorEchelon *aggregator) |
TSLTrackAggregatorEchelon * | hierarchyAggregator () const |
double | latitude () const |
double | currentLatitude () const |
double | longitude () const |
double | currentLongitude () const |
double | velocity () const |
double | currentVelocity () const |
double | heading () const |
double | currentHeading () const |
double | altitude () const |
double | currentAltitude () const |
bool | addAttribute (const char *name, const char *key, bool staticAttribute) |
bool | setAttributeValue (const char *name, const char *value) |
const char * | getAttributeName (const char *key) const |
const char * | getAttributeKey (const char *name) const |
const char * | getAttributeValue (const char *name) const |
const char * | getCurrentAttributeValue (const char *name) const |
bool | queryAttribute (unsigned int index, TSLSimpleString *name, TSLSimpleString *key, TSLSimpleString *value) const |
unsigned int | numAttributes () const |
bool | deleteAttribute (const char *name) |
void | deleteAttributes () |
Delete all attributes. | |
bool | addSymbol (TSLTrackSymbol *symbol) |
void | clearHistoryPointColour () |
Clear the override colour for history points/symbols. | |
void | historyPointColour (const TSLRGBA &colour) |
bool | updateSymbol (uint32_t index, TSLTrackSymbol *symbol) |
void | removeSymbol (uint32_t index) |
uint32_t | numberOfSymbols () const |
TSLTrackSymbol * | symbolAt (uint32_t index) const |
void | visible (int drawingSurfaceID, bool visibility) |
void | select (int drawingSurfaceID, bool selected) |
bool | selected (int drawingSurfaceID) |
void | velocity (double velocity) |
void | heading (double heading) |
void | altitude (double altitude) |
void | trackName (const char *name) |
void | userID (uint32_t id) |
uint32_t | userID () const |
const char * | trackName () const |
void | historyPointsVisible (int drawingSurfaceID, bool visibility) |
void | featureID (TSLFeatureID featureID) |
TSLFeatureID | featureID () const |
bool | featureName (const char *featureName) |
void | parentGroup (TSLTrackBase *parentGroup) |
TSLTrackBase * | parentGroup () |
void * | p () const |
Protected Member Functions | |
TSLTrackBase () | |
TSLTrackBase (const TSLTrackBase &other) | |
virtual | ~TSLTrackBase () |
void | operator delete (void *ptr) |
typedef uint32_t TSLTrackBase::TrackID |
A numeric identifier for a Track These IDs are unique within a TSLTrackDisplayManager
|
protected |
|
protected |
|
protectedvirtual |
bool TSLTrackBase::addAttribute | ( | const char * | name, |
const char * | key, | ||
bool | staticAttribute ) |
Add an attribute to the track to be used in its texts and symbols.
To visualise the attribute [for example with key: AK]:
This method will fail if:
name | Name of the attribute to set. |
key | This should be in the form of the 2 character key. |
staticAttribute | Flag to be set to treat the attribute as static for optimisation. |
bool TSLTrackBase::addSymbol | ( | TSLTrackSymbol * | symbol | ) |
Add a track visualisation defined by a TSLTrackSymbol
The symbol should have the desired display resolution set via the TSLTrackSymbol::maximumResolution method prior to calling this method. Each symbol added in this fashion should have a unique maximum resolution set to provide a different visualisation at multiple resolutions.
The Symbol must be a TSLTrackPointSymbol.
The track will take a reference to the TSLTrackSymbol, which may be shared between multiple tracks. The application may continue to use the symbol for as long as it holds a reference.
symbol | The symbol to add |
AggregationState TSLTrackBase::aggregationState | ( | ) | const |
Getter only for the aggregation state The only way the user can affect this is to assign an aggregator to the track
TSLTrackAggregator * TSLTrackBase::aggregator | ( | ) | const |
void TSLTrackBase::aggregator | ( | TSLTrackAggregator * | aggregator | ) |
Setter/getter for the aggregator
void TSLTrackBase::allowAggregation | ( | bool | allow | ) |
Setter to allow the user to prevent aggregation of this track or to allow aggregation to be performed by the aggregator
Regardless of what the user passes here tracks will never be aggregated if they are referenced by a track graphic
There is intentionally not a getter here. Users must call aggregationState() which will say whether aggregation is enabled or not, and the reason why it is disabled if applicable.
double TSLTrackBase::altitude | ( | ) | const |
Query the altitude of this track at the display time of the TSLTrackDisplayManager.
void TSLTrackBase::altitude | ( | double | altitude | ) |
Set the altitude of this track at the current time.
altitude | The new altitude. |
void TSLTrackBase::clearHistoryPointColour | ( | ) |
Clear the override colour for history points/symbols.
|
pure virtual |
Create a clone of this TSLTrack.
The cloned object will not be attached to any TSLTrackDisplayManager Historic data from the source track and referenced symbols will be copied, however the per-surface state and history points will not.
If a clone needs to be created while preserving this data, the TSLTrackDisplayManager::cloneTrackInto method should be used.
Implemented in TSLTrack, and TSLTrackGroup.
double TSLTrackBase::currentAltitude | ( | ) | const |
Query the altitude of this track at the current time.
double TSLTrackBase::currentHeading | ( | ) | const |
Query the heading of this track, in degrees at the current time.
double TSLTrackBase::currentLatitude | ( | ) | const |
Query the latitude of the track at the current time.
double TSLTrackBase::currentLongitude | ( | ) | const |
Query the longitude of the track at the current time.
double TSLTrackBase::currentVelocity | ( | ) | const |
Query the velocity of this track at the current time.
bool TSLTrackBase::deleteAttribute | ( | const char * | name | ) |
Delete an attribute.
If the input name is a 2-characters name, it will search for the attribute with the same key. If the input name is not found as a key or it is more that 2 characters, it will search for the attribute with the same name.
name | Name of the attribute to clear. |
void TSLTrackBase::deleteAttributes | ( | ) |
Delete all attributes.
TSLFeatureID TSLTrackBase::featureID | ( | ) | const |
void TSLTrackBase::featureID | ( | TSLFeatureID | featureID | ) |
Sets the feature type for the track by ID. Features must first be created on the data layer for the TSLTrackDisplayManager that this track is in.
Setting a feature type on the track allows it to be decluttered.
featureID | The ID of the feature type for this track. |
bool TSLTrackBase::featureName | ( | const char * | featureName | ) |
Sets the feature type for the track by name. Features must first be created on the data layer for the TSLTrackDisplayManager that this track is in.
featureName | The name of the feature type for this track. |
const char * TSLTrackBase::getAttributeKey | ( | const char * | name | ) | const |
Query the value of an attribute's 2 characters key.
name | Name of the attribute to query. |
const char * TSLTrackBase::getAttributeName | ( | const char * | key | ) | const |
Query the name of the attribute.
the | attribute's 2 characters key. |
const char * TSLTrackBase::getAttributeValue | ( | const char * | name | ) | const |
Query the value of an attribute at the 'display time'.
If the input name is a 2-characters name, it will search for the attribute with the same key. If the input name is not found as a key or it is more that 2 characters, it will search for the attribute with the same name.
name | Name of the attribute to query. |
const char * TSLTrackBase::getCurrentAttributeValue | ( | const char * | name | ) | const |
Query the value of an attribute at the 'current latest time'.
If the input name is a 2-characters name, it will search for the attribute with the same key. If the input name is not found as a key or it is more that 2 characters, it will search for the attribute with the same name.
name | Name of the attribute to query. |
double TSLTrackBase::heading | ( | ) | const |
Query the heading of this track, in degrees at the display time of the TSLTrackDisplayManager.
void TSLTrackBase::heading | ( | double | heading | ) |
Set the heading of this track, in degrees at the current time.
heading | The new heading. |
TSLTrackAggregatorEchelon * TSLTrackBase::hierarchyAggregator | ( | ) | const |
void TSLTrackBase::hierarchyAggregator | ( | TSLTrackAggregatorEchelon * | aggregator | ) |
Setter/getter for the hierarchy aggregator This is intended to be for Echelon type aggregators where it is required that the aggregator be processed first and the output passed to the other aggregator (if set).
uint32_t TSLTrackBase::hierarchyLevel | ( | ) | const |
void TSLTrackBase::hierarchyLevel | ( | uint32_t | level | ) |
Setters/getter for the hierarchy level This is a numeric index which specifies which aggregation level the track is considered part of
While the default structure would be to have 0 at the leaves and increasing further up the tree there is no specific order to this value. This will allow users to pass in enums such as the TSLAPP6ASymbol::UnitSize directly to use as the hierarchy level/echelon number
This is just a stored attribute here and will not have any direct effect on the track itself This will however then be used by the aggregator in order to determine what the rules are/which parent should be drawn if any
This disconnect is intentional such that:
void TSLTrackBase::historyPointColour | ( | const TSLRGBA & | colour | ) |
Set the override colour for the history points/symbols.
If this is not set:
If this is set:
This colour may be cleared using the clearHistoryPointColour method.
colour | The colour to use when drawing history points/symbol. |
void TSLTrackBase::historyPointsVisible | ( | int | drawingSurfaceID, |
bool | visibility ) |
Set the visibility of history points, for a given drawing surface.
drawingSurfaceID | The ID of the drawing surface. |
visibility | The visibility of history points on the drawing surface. |
double TSLTrackBase::latitude | ( | ) | const |
Query the latitude of the track at the display time of the TSLTrackDisplayManager.
double TSLTrackBase::longitude | ( | ) | const |
Query the longitude of the track at the display time of the TSLTrackDisplayManager.
unsigned int TSLTrackBase::numAttributes | ( | ) | const |
Query the number of attributes.
uint32_t TSLTrackBase::numberOfSymbols | ( | ) | const |
Query the number of symbols used by this track.
|
protected |
void * TSLTrackBase::p | ( | ) | const |
TSLTrackBase * TSLTrackBase::parentGroup | ( | ) |
void TSLTrackBase::parentGroup | ( | TSLTrackBase * | parentGroup | ) |
Sets the parent TrackGroup for this track.
This is intended to be used to facilitate the setting up of a hierarchy of tracks and trackgroups. For example, when an Echelon structure is desired to be used with Aggregation.
parentGroup | The parent TrackGroup object for this track. |
bool TSLTrackBase::queryAttribute | ( | unsigned int | index, |
TSLSimpleString * | name, | ||
TSLSimpleString * | key, | ||
TSLSimpleString * | value ) const |
Query an attribute by index at the 'display time'.
index | The index of the attribute to query. |
name | Will be set to the name of the attribute. |
key | Will be set to the value of the attribute's 2 characters key. |
value | Will be set to the value of the attribute at the 'display time'. |
void TSLTrackBase::release | ( | ) |
Release ownership of this object
The object will be deleted once the application has called release and any references held by MapLink have been released
void TSLTrackBase::removeSymbol | ( | uint32_t | index | ) |
Remove a symbol from the track.
index | The symbol to remove. |
void TSLTrackBase::select | ( | int | drawingSurfaceID, |
bool | selected ) |
Set the selection marker status of this track, for a given drawing surface.
drawingSurfaceID | The drawing surface to set the visibility for. |
selected | The selection marker state. |
bool TSLTrackBase::selected | ( | int | drawingSurfaceID | ) |
Queries the selection status of this track, for a given drawing surface.
drawingSurfaceID | The drawing surface to query the select status for. |
bool TSLTrackBase::setAttributeValue | ( | const char * | name, |
const char * | value ) |
Update the value of an attribute at the 'current time' [cannot set it in the past].
If the input name is a 2-characters name, it will search for the attribute with the same key. If the input name is not found as a key or it is more that 2 characters, it will search for the attribute with the same name.
name | Name of the attribute to set. |
value | Value of the attribute. |
TSLTrackSymbol * TSLTrackBase::symbolAt | ( | uint32_t | index | ) | const |
Query a track visualisation
Symbols are returned in level of detail order, which may be different to the order the symbols were originally added to the track in.
The returned symbol may be modified by the application however the application must not call release on the returned pointer
index | The symbol to query |
const char * TSLTrackBase::trackName | ( | ) | const |
Query the displayed name of this track.
void TSLTrackBase::trackName | ( | const char * | name | ) |
Set the displayed name of this track.
The parameters for displaying the track name are defined by the currently displayed TSLTrackPointSymbol object.
name | The name of this track. |
TSLTrackBase::TrackID TSLTrackBase::trackNumber | ( | ) | const |
Query the track number allocated for this track.
|
pure virtual |
Implemented in TSLTrack, and TSLTrackGroup.
bool TSLTrackBase::updateSymbol | ( | uint32_t | index, |
TSLTrackSymbol * | symbol ) |
Update a track visualisation defined by a TSLTrackSymbol
The provided Symbol must be a TSLTrackPointSymbol
The track will take a reference to the TSLTrackSymbol, which may be shared between multiple tracks. The application may continue to use the symbol for as long as it holds a reference.
index | The symbol to update. |
symbol | The new parameters for the symbol. |
uint32_t TSLTrackBase::userID | ( | ) | const |
Query the user ID of this track.
void TSLTrackBase::userID | ( | uint32_t | id | ) |
Set the user ID of this track.
This ID is provided for use by an application, and is unrelated to the TrackID used by the TSLTrackDisplayManager.
id | The user ID to assign to this Track. |
double TSLTrackBase::velocity | ( | ) | const |
Query the velocity of this track at the display time of the TSLTrackDisplayManager.
void TSLTrackBase::velocity | ( | double | velocity | ) |
Set the velocity of this track at the current time.
velocity | The new velocity. |
void TSLTrackBase::visible | ( | int | drawingSurfaceID, |
bool | visibility ) |
Set the visibility of the track, for a given drawing surface.
drawingSurfaceID | The drawing surface to set the visibility for. |
visibility | The new visibility value. |