![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This class provides a track graphic which displays a ruler within the TSLTrackDisplayManager
The ruler will be displayed as a line, with optional ticks at regular intervals A symbol will be displayed at each of the control points. This may be any symbol provided as part of MapLink, or a user-defined symbol added to config/symbols/tslsymbolsuser.dat
This class is reference counted internally to allow objects to be shared within the track manager SDK
Public Types | |
enum | UnitOfMeasure { Metres , KiloMetres , Feet , Yards , Miles , NauticalMiles , CustomDistance } |
Specifies the unit of measure used by the ruler. More... | |
enum | UnitOfAngularMeasure { Degrees , Mils , CustomBearing } |
enum | LabelDisplayMode { LabelRelativeToRulerStart , LabelRelativeToSegmentStart , LabelCumulative } |
Defines the types of labels which can be displayed at each point. More... | |
![]() | |
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... | |
Static Public Member Functions | |
static TSLTrackGraphicRuler * | create () |
Additional Inherited Members | |
![]() | |
TSLTrackGraphic () | |
TSLTrackGraphic (const TSLTrackGraphic &other) | |
virtual | ~TSLTrackGraphic () |
void | operator delete (void *ptr) |
Defines the types of labels which can be displayed at each point.
Specifies the unit of measure used by the ruler.
double TSLTrackGraphicRuler::bearingLabelFactor | ( | ) | const |
Gets the multiplication factor value that is used to calculate the angular units. The factor is only used if the UnitOfAngularMeasure::CustomBearing value is set.
void TSLTrackGraphicRuler::bearingLabelFactor | ( | double | factor | ) |
Sets the multiplication factor value that is used to calculate the angular units. The factor is only used if the UnitOfAngularMeasure::CustomBearing value is set. The factor would be applied to a value in degrees in the range 0 - 360.
Default value is 1.0
factor | Multiplication factor |
const char * TSLTrackGraphicRuler::bearingLabelFormat | ( | TSLTrackGraphicRuler::LabelDisplayMode | mode | ) | const |
Get the formatting for the displayed bearing label.
mode | The Label Display mode that the format string will affect |
void TSLTrackGraphicRuler::bearingLabelFormat | ( | TSLTrackGraphicRuler::LabelDisplayMode | mode, |
const char * | formatString ) |
Set the formatting for the displayed bearing label.
This function expects a string that is compliant with the C/C++ printf formatting syntax. Passing null or an empty string will revert the formatting to display the default bearing formatting. If the TSLTrackGraphicRuler::UnitOfMeasure used is a standard UoM, reverting the formatting will ensure the bearing label has the associated suffix when it is displayed.
Examples:
mode | The Label Display mode that the format string will affect |
formatString | The sequence used to format the displayed distance label value |
TSLTrackGraphicRuler::UnitOfAngularMeasure TSLTrackGraphicRuler::bearingLabelUnitOfMeasure | ( | ) | const |
Get the unit of measure for bearing labels
void TSLTrackGraphicRuler::bearingLabelUnitOfMeasure | ( | TSLTrackGraphicRuler::UnitOfAngularMeasure | uom | ) |
Set the unit of measure for bearing labels
The unit of measure determines which units the bearing labels are displayed in, and whether fixed/automatic scaling between multiple units are used. The default unit of measure is TSLTrackGraphicRuler::Degrees
uom | The unit of measure for bearing labels |
|
static |
Create a ruler graphic
After calling this method the application must call addControlPoint at least 2 times in order to define the points of the ruler
After calling this method the application may set the graphic's rendering attributes via the rendering method
TSLSimpleString TSLTrackGraphicRuler::createTextLabel | ( | uint32_t | controlPoint, |
double | lat, | ||
double | lon ) const |
Create a text label
This method will calculate the distance between the provided control point and lat/lon position, and construct a TSLSimpleString which contains a readout of this calculation.
The contents of the text label will use the configuration of this object and will be constructed in the same way as all other ruler labels.
Calling this method will not affect the configuration/visualisation of the ruler graphic.
controlPoint | The text label will be calculated in relation to this control point |
lat | The latitude to calculate distance/bearing to (WGS84) |
lon | The longitude to calculate distance/bearing to (WGS84) |
bool TSLTrackGraphicRuler::displayBearingLabel | ( | TSLTrackGraphicRuler::LabelDisplayMode | mode | ) | const |
Get whether a type of bearing label is displayed
mode | The display mode for bearing labels. |
void TSLTrackGraphicRuler::displayBearingLabel | ( | TSLTrackGraphicRuler::LabelDisplayMode | mode, |
bool | display ) |
Set whether a type of bearing label should be displayed
The application may choose to enable any combination of label modes by calling this method multiple times.
mode | The display mode for bearing labels |
display | true if the label should be displayed in this mode, false otherwise. |
bool TSLTrackGraphicRuler::displayDistanceLabel | ( | TSLTrackGraphicRuler::LabelDisplayMode | mode | ) | const |
Get whether a type of distance label is displayed
mode | The display mode for distance labels. |
void TSLTrackGraphicRuler::displayDistanceLabel | ( | TSLTrackGraphicRuler::LabelDisplayMode | mode, |
bool | display ) |
Set whether a type of distance label should be displayed
The application may choose to enable any combination of label modes by calling this method multiple times.
mode | The display mode for distance labels |
display | true if the label should be displayed in this mode, false otherwise. |
bool TSLTrackGraphicRuler::displaySymbols | ( | ) | const |
Get whether symbols will be displayed at the control points
void TSLTrackGraphicRuler::displaySymbols | ( | bool | display | ) |
Set whether symbols should be displayed at the control points
The rendering of these symbols is controlled via the graphic's rendering attributes
display | true to display symbols, false otherwise |
bool TSLTrackGraphicRuler::displayTicks | ( | ) | const |
Get whether ticks are displayed
void TSLTrackGraphicRuler::displayTicks | ( | bool | display | ) |
Set whether ticks should be displayed
display | Whether ticks should be displayed |
double TSLTrackGraphicRuler::distanceLabelFactor | ( | ) | const |
Gets the multiplication factor value that is used to calculate the distance units. The factor is only used if the UnitOfMeasure::CustomDistance value is set.
void TSLTrackGraphicRuler::distanceLabelFactor | ( | double | factor | ) |
Sets the multiplication factor value that is used to calculate the distance units. The factor is only used if the UnitOfMeasure::CustomDistance value is set. The factor would be applied to a value in metres.
Default value is 0.001. (Displays the distance in kilometres when applied to a distance in metres)
factor | Multiplication factor |
const char * TSLTrackGraphicRuler::distanceLabelFormat | ( | TSLTrackGraphicRuler::LabelDisplayMode | mode | ) | const |
Get the formatting for the displayed distance label.
mode | The Label Display mode that the format string will affect |
void TSLTrackGraphicRuler::distanceLabelFormat | ( | TSLTrackGraphicRuler::LabelDisplayMode | mode, |
const char * | formatString ) |
Set the formatting for the displayed distance label.
This function expects a string that is compliant with the C/C++ printf formatting syntax. Passing null or an empty string will revert the formatting to display the default distance formatting. If the TSLTrackGraphicRuler::UnitOfMeasure used is a standard UoM, reverting the formatting will ensure the distance label has the associated suffix when it is displayed.
Passing an empty string will display just the value.
Examples:
mode | The Label Display mode that the format string will affect |
formatString | The sequence used to format the displayed distance label value |
TSLTrackGraphicRuler::UnitOfMeasure TSLTrackGraphicRuler::distanceLabelUnitOfMeasure | ( | ) | const |
Get the unit of measure for distance labels
void TSLTrackGraphicRuler::distanceLabelUnitOfMeasure | ( | TSLTrackGraphicRuler::UnitOfMeasure | uom | ) |
Set the unit of measure for distance labels
The unit of measure determines which units the distance labels are displayed in, and whether fixed/automatic scaling between multiple units are used. The default unit of measure is TSLTrackGraphicRuler::KiloMetres
uom | The unit of measure for distance labels |
const TSLRenderingAttributes & TSLTrackGraphicRuler::rendering | ( | ) | const |
Get the rendering attributes of the ruler
void TSLTrackGraphicRuler::rendering | ( | const TSLRenderingAttributes & | attribs | ) |
Set the rendering attributes of the ruler
The ruler is composed of the following components:
A single set of rendering attributes is used for all components of the ruler
double TSLTrackGraphicRuler::tickDistance | ( | ) | const |
Get the minimum distance between ticks
The units of this distance are specified by tickDistanceUnitOfMeasure
void TSLTrackGraphicRuler::tickDistance | ( | double | distance | ) |
Set the minimum distance between ticks
distance | The minimum distance between ticks |
TSLDeviceUnits TSLTrackGraphicRuler::tickDistanceDU | ( | ) | const |
Get the minimum distance between ticks in device units
void TSLTrackGraphicRuler::tickDistanceDU | ( | TSLDeviceUnits | distanceDU | ) |
Set the minimum distance between ticks in device units
distanceDU | The minimum distance between ticks in DU |
bool TSLTrackGraphicRuler::tickDistanceRound | ( | ) | const |
Get whether tick distances are rounded up
void TSLTrackGraphicRuler::tickDistanceRound | ( | bool | round | ) |
Set whether tick distances should be rounded up
If enabled the distance between ticks will be rounded up to the nearest power of 10 once tickDistance and tickDistanceDU have been taken into account. Rounding will be performing in the tickDistanceUnitOfMeasure.
By default this option is enabled
round | Whether tick distances should be rounded up |
TSLTrackGraphicRuler::UnitOfMeasure TSLTrackGraphicRuler::tickDistanceUnitOfMeasure | ( | ) | const |
Get the unit of measure for tick distances
void TSLTrackGraphicRuler::tickDistanceUnitOfMeasure | ( | TSLTrackGraphicRuler::UnitOfMeasure | uom | ) |
Set the unit of measure for tick distances
The default value is TSLTrackGraphicRuler::Metres
uom | The unit of measure for tickDistance |
double TSLTrackGraphicRuler::tickLength | ( | ) | const |
Get the length of ticks
void TSLTrackGraphicRuler::tickLength | ( | double | length, |
TSLDimensionUnits | units ) |
Set the length of ticks
length | The length of the ticks |
units | The units of the tick length |
TSLDimensionUnits TSLTrackGraphicRuler::tickLengthUnits | ( | ) | const |
Get the units of the tick length