![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
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) |
envitia::maplink::earth::Track::Track | ( | ) |
Constructor.
envitia::maplink::earth::Track::Track | ( | const TrackSymbol & | sym | ) |
Constructor.
sym | The default visualisation of the track. |
envitia::maplink::earth::Track::Track | ( | const Track & | other | ) |
Copy Constructor.
envitia::maplink::earth::Track::~Track | ( | ) |
Destructor.
double envitia::maplink::earth::Track::altitude | ( | ) | const |
Query the altitude of the Track.
void envitia::maplink::earth::Track::altitude | ( | double | alt | ) |
Set the Altitude of the Track.
const char * envitia::maplink::earth::Track::attributeName | ( | unsigned int | index | ) | const |
Query the name of an attribute.
index | The index in the attribute array to query. |
const char * envitia::maplink::earth::Track::attributeValue | ( | unsigned int | index | ) | const |
Query the value of an attribute.
index | The index in the attribute array to query. |
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.
surface | The drawing surface to clear the visualisation for. |
float envitia::maplink::earth::Track::declutterPriority | ( | ) | const |
Query the declutter priority of the track.
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.
p | The declutter priority of the track. |
const char * envitia::maplink::earth::Track::getAttribute | ( | const char * | name | ) | const |
Get the value of an attribute
name | The name of the attribute to query. |
double envitia::maplink::earth::Track::latitude | ( | ) | const |
Query the latitude of the Track.
void envitia::maplink::earth::Track::latitude | ( | double | lat | ) |
Set the latitude of the Track.
double envitia::maplink::earth::Track::longitude | ( | ) | const |
Query the longitude of the Track.
void envitia::maplink::earth::Track::longitude | ( | double | lon | ) |
Set the longitude of the Track.
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:
GeodeticPoint envitia::maplink::earth::Track::position | ( | ) | const |
Query the position of the Track.
void envitia::maplink::earth::Track::position | ( | GeodeticPoint | p | ) |
Set the position of the Track.
bool envitia::maplink::earth::Track::removeAttribute | ( | const char * | name | ) |
Remove an attribute from the track.
name | The name of the attribute to remove. |
bool envitia::maplink::earth::Track::removeAttribute | ( | unsigned int | index | ) |
Remove an attribute from the track.
index | The index in the attribute array to remove. |
double envitia::maplink::earth::Track::rotation | ( | ) | const |
Query the rotation of the Track. Value is in degrees. Range 0.0 - 360.0
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
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.
name | The name of the attribute to set. |
value | The value to set. |
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.
sym | The visualisation to use for this Track instance. |
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.
sym | The visualisation to use for this Track instance. |
surface | The drawing surface to configure the visualisation for. |
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.
v | The visibility of the track. |
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.
v | The visibility of the track. |
surface | The surface to set the visibility for. |
bool envitia::maplink::earth::Track::visibilityOnSurface | ( | const Surface3D * | surface | ) | const |
Query the visibility of the track.
surface | The surface to check the track visibility for. |