MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLTrackGraphic Class Reference
Inheritance diagram for TSLTrackGraphic:

Detailed Description

A track graphic, for use with the TSLTrackDisplayManager

A track graphic is an object displayed by the track manager which may interact with fixed locations or tracks within the manager. Typically these may be used to draw links between tracks, or other geometry which interacts with a track.

A track graphic's coordinates are provided as 'control points'

  • Control points may be fixed locations provided as lat/lon in WGS84
  • Control points may be attached to tracks

If a control point is attached to a track the position of that point will automatically update whenever the track moves.

If the track is subsequently removed from the TSLTrackDisplayManager it will remain attached to the graphic. If the application no longer has a handle to the track it will remain in memory until the graphic is deleted, and the corresponding point of the graphic will no longer update.

This class is reference counted internally to allow objects to be shared within the track manager SDK

  • Ownership of this object will never be transferred from the application to MapLink
  • The application must call release() in order to relinquish its ownership, even if the object has been passed to another

Public Types

enum  ControlPointType { LatLonControlPoint , TrackControlPoint }
 The control point types supported by track graphics. More...
 
enum  GraphicType { TrackGraphicLink , TrackGraphicArrow , TrackGraphicRuler }
 The types of graphic provided by the MapLink Track Manager SDK. More...
 

Public Member Functions

TSLTrackGraphic::GraphicType type () const
 
void release ()
 
void featureID (TSLFeatureID featureID)
 
TSLFeatureID featureID () const
 
bool featureName (const char *featureName)
 
void userID (uint32_t id)
 
uint32_t userID () const
 
TSLTrack::TrackID graphicID () const
 
bool addControlPoint (double lat, double lon)
 
bool addControlPoint (TSLTrack *track)
 
bool getControlPointLocation (uint32_t index, double &lat, double &lon) const
 
TSLTrackgetControlPointTrack (uint32_t index) const
 
TSLTrackGraphic::ControlPointType controlPointType (uint32_t index) const
 
bool removeControlPoint (uint32_t index)
 
uint32_t numControlPoints () const
 
bool insertControlPoint (uint32_t index, double lat, double lon)
 
bool insertControlPoint (uint32_t index, TSLTrack *track)
 
bool moveControlPoint (uint32_t index, double lat, double lon)
 

Protected Member Functions

 TSLTrackGraphic ()
 
 TSLTrackGraphic (const TSLTrackGraphic &other)
 
virtual ~TSLTrackGraphic ()
 
void operator delete (void *ptr)
 

Member Enumeration Documentation

◆ ControlPointType

The control point types supported by track graphics.

Enumerator
LatLonControlPoint 

A control point representing a fixed location specified as latitude/longitude.

TrackControlPoint 

A control point representing the location of a track.

◆ GraphicType

The types of graphic provided by the MapLink Track Manager SDK.

Enumerator
TrackGraphicLink 

A simple link (polyline)

TrackGraphicArrow 

An arrow.

TrackGraphicRuler 

A ruler.

Constructor & Destructor Documentation

◆ TSLTrackGraphic() [1/2]

TSLTrackGraphic::TSLTrackGraphic ( )
protected

◆ TSLTrackGraphic() [2/2]

TSLTrackGraphic::TSLTrackGraphic ( const TSLTrackGraphic & other)
protected

◆ ~TSLTrackGraphic()

virtual TSLTrackGraphic::~TSLTrackGraphic ( )
protectedvirtual

Member Function Documentation

◆ addControlPoint() [1/2]

bool TSLTrackGraphic::addControlPoint ( double lat,
double lon )

Add a control point as a fixed location in latitude/longitude

All latitude and longitude values provided to the Track Manager SDK must be in the WGS84 datum.

Parameters
latThe latitude of the control point
lonThe longitude of the control point
Returns
true if the control point was added, false otherwise

◆ addControlPoint() [2/2]

bool TSLTrackGraphic::addControlPoint ( TSLTrack * track)

Add a control point attached to a track

When the track is moved on the display the track graphic will automatically be updated

Parameters
trackThe track to use as the control point
Returns
true if the control point was added, false otherwise

◆ controlPointType()

TSLTrackGraphic::ControlPointType TSLTrackGraphic::controlPointType ( uint32_t index) const

Query the type of a control point

Parameters
indexThe index of the control point to query
Returns
The type of the control point

◆ featureID() [1/2]

TSLFeatureID TSLTrackGraphic::featureID ( ) const

Get the feature ID of the graphic

Returns
The feature ID of the graphic.

◆ featureID() [2/2]

void TSLTrackGraphic::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

Parameters
featureIDThe feature ID of the graphic

◆ featureName()

bool TSLTrackGraphic::featureName ( const char * featureName)

Sets the feature type for the graphic by name.

Features must first be created on the data layer for the TSLTrackDisplayManager that this track is in.

Parameters
featureNameThe feature name for the graphic
Returns
true if the given feature name corresponds to a feature for the TSLTrackDisplayManager's data layer and the track's feature type is updated, false otherwise.

◆ getControlPointLocation()

bool TSLTrackGraphic::getControlPointLocation ( uint32_t index,
double & lat,
double & lon ) const

Query the location of a control point

If the control point is attached to a track the current display position of the track will be returned. The returned latitude and longitude values will be in the WGS84 datum.

Parameters
indexThe index of the control point to query
latWill be set to the latitude of the control point
lonWill be set to the longitude of the control point
Returns
true if the control point was queried, false otherwise

◆ getControlPointTrack()

TSLTrack * TSLTrackGraphic::getControlPointTrack ( uint32_t index) const

Query the track attached to a control point

If the control point is a fixed location NULL will be returned

Parameters
indexThe index of the control point to query
Returns
The track attached to the control point, or NULL on error

◆ graphicID()

TSLTrack::TrackID TSLTrackGraphic::graphicID ( ) const

Query the ID allocated for this track

This ID is assigned when the graphic is added to a TSLTrackDisplayManager This ID will be unique, and will not be shared with any other track or graphic within the TSLTrackDisplayManager.

Returns
The ID of the graphic

◆ insertControlPoint() [1/2]

bool TSLTrackGraphic::insertControlPoint ( uint32_t index,
double lat,
double lon )

Insert a control point as a fixed location in latitude/longitude.

All latitude and longitude values provided to the Track Manager SDK must be in the WGS84 datum.

Parameters
indexThe index in the control point list to insert at.
latThe latitude of the control point.
lonThe longitude of the control point.
Returns
true if the control point was inserted, false otherwise.

◆ insertControlPoint() [2/2]

bool TSLTrackGraphic::insertControlPoint ( uint32_t index,
TSLTrack * track )

Insert a control point attached to a track.

When the track is moved on the display the track graphic will automatically be updated.

Parameters
indexThe index in the control point list to insert at.
trackThe track to use as the control point.
Returns
true if the control point was inserted, false otherwise.

◆ moveControlPoint()

bool TSLTrackGraphic::moveControlPoint ( uint32_t index,
double lat,
double lon )

Move a control point.

This method will return false if the requested control point is attached to a track or other moving object.

All latitude and longitude values provided to the Track Manager SDK must be in the WGS84 datum.

Parameters
indexThe index of the control point to move.
latThe new latitude of the control point.
longThe new longitude of the control point.
Returns
true if the control point was moved, false otherwise.

◆ numControlPoints()

uint32_t TSLTrackGraphic::numControlPoints ( ) const

Query the number of control points defined for the graphic

Returns
The number of control points

◆ operator delete()

void TSLTrackGraphic::operator delete ( void * ptr)
protected

◆ release()

void TSLTrackGraphic::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

◆ removeControlPoint()

bool TSLTrackGraphic::removeControlPoint ( uint32_t index)

Remove a control point

Parameters
indexThe index of the control point to remove
Returns
true if the control point was removed, false otherwise

◆ type()

TSLTrackGraphic::GraphicType TSLTrackGraphic::type ( ) const

Query the type of the track graphic

Returns
The type of the graphic

◆ userID() [1/2]

uint32_t TSLTrackGraphic::userID ( ) const

Query the user ID of the graphic

Returns
The user ID of this graphic, or 0 if one has not been assigned.

◆ userID() [2/2]

void TSLTrackGraphic::userID ( uint32_t id)

Set the user ID of this graphic

This ID is provided for use by an application, and is unrelated to the TrackID used by the TSLTrackDisplayManager.

Parameters
idThe user ID to assign to this graphic.