MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
envitia::maplink::earth::Track Class Reference

Detailed Description

A track object, displayed within the 3D scene

This class is used to model a real-world entity such as a unit or vehicle within the scene. The track will be displayed within the scene based on the TrackSymbol assigned to it. The position of the track within the scene may be modified via the position, latitude, longitude, and altitude methods.

A Track instance may be added to one or more surfaces via Surface3D::addTrack. The track may be rendered using a single visualisation, or may be assigned a TrackSymbol on a per-surface basis.

This class also allows for per-track attributes to be set, such as the name, type, or other classification of the object. These may be displayed as textual annotations as part of a TrackSymbol. See TrackSymbol::addAnnotation.

Public Member Functions

 Track ()
 Constructor.
 
 Track (const TrackSymbol &sym)
 
 Track (const Track &other)
 Copy Constructor.
 
 ~Track ()
 Destructor.
 
void symbol (const TrackSymbol &sym)
 
void symbol (const TrackSymbol &sym, const Surface3D *surface)
 
void clearSymbol (const Surface3D *surface)
 
void position (GeodeticPoint p)
 Set the position of the Track.
 
GeodeticPoint position () const
 Query the position of the Track.
 
void latitude (double lat)
 Set the latitude of the Track.
 
double latitude () const
 Query the latitude of the Track.
 
void longitude (double lon)
 Set the longitude of the Track.
 
double longitude () const
 Query the longitude of the Track.
 
void altitude (double alt)
 Set the Altitude of the Track.
 
double altitude () const
 Query the altitude of the Track.
 
void rotation (double rot)
 
double rotation () const
 
void declutterPriority (float p)
 
float declutterPriority () const
 Query the declutter priority of the track.
 
void visibility (bool v)
 
void visibilityOnSurface (bool v, const Surface3D *surface)
 
bool visibilityOnSurface (const Surface3D *surface) const
 
bool setAttribute (const char *name, const char *value)
 
const char * getAttribute (const char *name) const
 
bool removeAttribute (const char *name)
 
unsigned int numAttributes () const
 
const char * attributeName (unsigned int index) const
 
const char * attributeValue (unsigned int index) const
 
bool removeAttribute (unsigned int index)
 

Constructor & Destructor Documentation

◆ Track() [1/3]

envitia::maplink::earth::Track::Track ( )

Constructor.

◆ Track() [2/3]

envitia::maplink::earth::Track::Track ( const TrackSymbol & sym)

Constructor.

Parameters
symThe default visualisation of the track.

◆ Track() [3/3]

envitia::maplink::earth::Track::Track ( const Track & other)

Copy Constructor.

◆ ~Track()

envitia::maplink::earth::Track::~Track ( )

Destructor.

Member Function Documentation

◆ altitude() [1/2]

double envitia::maplink::earth::Track::altitude ( ) const

Query the altitude of the Track.

◆ altitude() [2/2]

void envitia::maplink::earth::Track::altitude ( double alt)

Set the Altitude of the Track.

◆ attributeName()

const char * envitia::maplink::earth::Track::attributeName ( unsigned int index) const

Query the name of an attribute.

Parameters
indexThe index in the attribute array to query.
Returns
The name of the attribute, or null if index >= numAttributes().

◆ attributeValue()

const char * envitia::maplink::earth::Track::attributeValue ( unsigned int index) const

Query the value of an attribute.

Parameters
indexThe index in the attribute array to query.
Returns
The value of the attribute, or null if index >= numAttributes().

◆ clearSymbol()

void envitia::maplink::earth::Track::clearSymbol ( const Surface3D * surface)

Clear the track's visualisation on a specific surface.

Once cleared the track will be displayed based on its default symbol.

Parameters
surfaceThe drawing surface to clear the visualisation for.

◆ declutterPriority() [1/2]

float envitia::maplink::earth::Track::declutterPriority ( ) const

Query the declutter priority of the track.

◆ declutterPriority() [2/2]

void envitia::maplink::earth::Track::declutterPriority ( float p)

Set the declutter priority of the track.

If track decluttering is enabled via Surface3D::trackDeclutter this value will specify how important this track is on the display.

Tracks with a higher priority value will be displayed in preference of those with a lower priority, where the tracks overlap on the display.

A negative value will disable decluttering for the track.

Parameters
pThe declutter priority of the track.

◆ getAttribute()

const char * envitia::maplink::earth::Track::getAttribute ( const char * name) const

Get the value of an attribute

Parameters
nameThe name of the attribute to query.
Returns
The value of the attribute, or null if not set.

◆ latitude() [1/2]

double envitia::maplink::earth::Track::latitude ( ) const

Query the latitude of the Track.

◆ latitude() [2/2]

void envitia::maplink::earth::Track::latitude ( double lat)

Set the latitude of the Track.

◆ longitude() [1/2]

double envitia::maplink::earth::Track::longitude ( ) const

Query the longitude of the Track.

◆ longitude() [2/2]

void envitia::maplink::earth::Track::longitude ( double lon)

Set the longitude of the Track.

◆ numAttributes()

unsigned int envitia::maplink::earth::Track::numAttributes ( ) const

Query the number of attributes.

In most cases applications should refer to attributes by name. The following methods are provided to allow applications to iterate through the attribute set:

Returns
The number of attributes configured on the Track.

◆ position() [1/2]

GeodeticPoint envitia::maplink::earth::Track::position ( ) const

Query the position of the Track.

◆ position() [2/2]

void envitia::maplink::earth::Track::position ( GeodeticPoint p)

Set the position of the Track.

◆ removeAttribute() [1/2]

bool envitia::maplink::earth::Track::removeAttribute ( const char * name)

Remove an attribute from the track.

Parameters
nameThe name of the attribute to remove.
Returns
true if the attribute was removed, false otherwise.

◆ removeAttribute() [2/2]

bool envitia::maplink::earth::Track::removeAttribute ( unsigned int index)

Remove an attribute from the track.

Parameters
indexThe index in the attribute array to remove.
Returns
true if the attribute was removed, false otherwise.

◆ rotation() [1/2]

double envitia::maplink::earth::Track::rotation ( ) const

Query the rotation of the Track. Value is in degrees. Range 0.0 - 360.0

◆ rotation() [2/2]

void envitia::maplink::earth::Track::rotation ( double rot)

Set the rotation of the Track. This is the clockwise angle where 0 is up. The rotation is relative to the screen. Value is in degrees. Value will be internally wrapped to the range 0.0 - 360.0

◆ setAttribute()

bool envitia::maplink::earth::Track::setAttribute ( const char * name,
const char * value )

Set the value of an attribute.

If the TrackSymbol assigned to this track contains an annotation with the same name the annotation will be updated to display the value of the attribute.

If the named attribute doesn't exist it will be added by calling this method.

Parameters
nameThe name of the attribute to set.
valueThe value to set.
Returns
true if the attribute was set, false otherwise.

◆ symbol() [1/2]

void envitia::maplink::earth::Track::symbol ( const TrackSymbol & sym)

Set the track's default visualisation.

When called this method will update the Track to be displayed as per the TrackSymbol, as a rasterised 2D 'billboard'.

If the TrackSymbol contains annotations, the value of these will be read from the track's attribute information if the information is available. If a referenced attribute is not set on the Track it will not be displayed.

This method sets the default visualisation, which will be used if no per-surface visualisation has been configured.

Parameters
symThe visualisation to use for this Track instance.

◆ symbol() [2/2]

void envitia::maplink::earth::Track::symbol ( const TrackSymbol & sym,
const Surface3D * surface )

Set the track's visualisation on a specific surface.

When called this method will update the Track to be displayed as per the TrackSymbol, as a rasterised 2D 'billboard'.

If the TrackSymbol contains annotations, the value of these will be read from the track's attribute information if the information is available. If a referenced attribute is not set on the Track it will not be displayed.

This method sets the visualisation of the track on a specific drawing surface. If this is not set the surface will render the track based on its default visualisation.

Parameters
symThe visualisation to use for this Track instance.
surfaceThe drawing surface to configure the visualisation for.
Returns
true if the visualisation was set, false otherwise.

◆ visibility()

void envitia::maplink::earth::Track::visibility ( bool v)

Set the visibility of the track on all surfaces.

Calling this method will override any per-surface visibility settings.

Parameters
vThe visibility of the track.

◆ visibilityOnSurface() [1/2]

void envitia::maplink::earth::Track::visibilityOnSurface ( bool v,
const Surface3D * surface )

Set the visibility of the track on a specific surface.

Calling this method will set the visibility of the track on the specified surface. This method will not affect the track's visibility on other surfaces.

Parameters
vThe visibility of the track.
surfaceThe surface to set the visibility for.

◆ visibilityOnSurface() [2/2]

bool envitia::maplink::earth::Track::visibilityOnSurface ( const Surface3D * surface) const

Query the visibility of the track.

Parameters
surfaceThe surface to check the track visibility for.
Returns
The visibility of the track on all surfaces.