CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_navigation.h>
Public Member Functions | |
NavigatorTurn (const RouteSegment &aPrevSegment, const RouteSegment &aCurSegment, double aDistance, double aTime) | |
NavigatorTurn (const RouteSegment &aPrevSegment, const RouteSegment *aCurSegment, double aDistance, double aTime) | |
void | Clear () |
bool | CanMerge (const NavigatorTurn &aFollowingTurn, const RouteProfile &aProfile) const |
bool | MergeIfPossible (const NavigatorTurn &aFollowingTurn, const RouteProfile &aProfile) |
void | Merge (const NavigatorTurn &aFollowingTurn, const RouteProfile &aProfile) |
void | SetInstructions (std::shared_ptr< CEngine > aEngine, const RouteProfile &aProfile, const char *aLocale, bool aMetricUnits, bool aAbbreviate) |
String | CreateInstructions (std::shared_ptr< CEngine > aEngine, const RouteProfile &aProfile, const char *aLocale, bool aMetricUnits, bool aAbbreviate, NavigationState aState=NavigationState::Turn, const NavigatorTurn *aNextTurn=nullptr, double aDistanceLeft=0, double aTimeLeft=0) const |
Bitmap | Diagram (std::shared_ptr< CEngine > aEngine, const RouteProfile &aProfile, int32_t aSizeInPixels, Color aColor) const |
Public Member Functions inherited from CartoTypeCore::Turn | |
void | Clear () |
void | SetTurn (double aInDir, double aOutDir, int32_t aChoices, int32_t aLeftAlternatives, int32_t aRightAlternatives, bool aIsFork, bool aTurnOff) |
void | SetTurn (double aTurnAngle) |
void | WriteAsXml (OutputStream &aOutput) const |
Public Attributes | |
double | Distance = 0 |
double | Time = 0 |
String | FromName |
String | FromRef |
FeatureInfo | FromRouteInfo = FeatureType::UnknownRoute |
String | ToName |
String | ToRef |
FeatureInfo | ToRouteInfo = FeatureType::UnknownRoute |
Point | Position |
String | Instructions |
Public Attributes inherited from CartoTypeCore::Turn | |
CartoTypeCore::TurnType | TurnType = CartoTypeCore::TurnType::None |
bool | IsContinue = true |
CartoTypeCore::RoundaboutState | RoundaboutState = CartoTypeCore::RoundaboutState::None |
double | TurnAngle = 0 |
double | InDirection = 0 |
double | OutDirection = 0 |
int32_t | ExitNumber = 0 |
int32_t | Choices = 0 |
int32_t | LeftAlternatives = 0 |
int32_t | RightAlternatives = 0 |
bool | IsFork = false |
bool | IsTurnOff = false |
String | JunctionName |
String | JunctionRef |
Turn information for navigation: the base Turn class plus the distance to the turn, road names and turn instruction.
|
inline |
Creates a turn from aPrevSegment to aCurSegment with a distance in meters and a time in seconds.
|
inline |
Creates a turn from aPrevSegment, optionally to aCurSegment if it is non-null, with a distance in meters and a time in seconds.
bool CartoTypeCore::NavigatorTurn::CanMerge | ( | const NavigatorTurn & | aFollowingTurn, |
const RouteProfile & | aProfile | ||
) | const |
Determines if two turns can be merged.
|
inline |
Sets the turn to its just-constructed state.
String CartoTypeCore::NavigatorTurn::CreateInstructions | ( | std::shared_ptr< CEngine > | aEngine, |
const RouteProfile & | aProfile, | ||
const char * | aLocale, | ||
bool | aMetricUnits, | ||
bool | aAbbreviate, | ||
NavigationState | aState = NavigationState::Turn , |
||
const NavigatorTurn * | aNextTurn = nullptr , |
||
double | aDistanceLeft = 0 , |
||
double | aTimeLeft = 0 |
||
) | const |
Creates instructions for this turn.
Bitmap CartoTypeCore::NavigatorTurn::Diagram | ( | std::shared_ptr< CEngine > | aEngine, |
const RouteProfile & | aProfile, | ||
int32_t | aSizeInPixels, | ||
Color | aColor | ||
) | const |
Creates a diagram of the turn: either a line with a bend in it, or two lines connected to a circle representing a roundabout. The parameter aEngine is needed to create a graphics context. The parameter aSizeInPixels is the width and height of a square enclosing the diagram. It is clamped to a minimum of 12. aColor is the color of the lines in the diagram. If the route profile obeys one-way restrictions a roundabout circle is drawn when the turn enters a roundabout. That rule prevents roundabouts from being drawn for walking routes, which may go the wrong way round them.
void CartoTypeCore::NavigatorTurn::Merge | ( | const NavigatorTurn & | aFollowingTurn, |
const RouteProfile & | aProfile | ||
) |
Merges a turn with a following turn.
bool CartoTypeCore::NavigatorTurn::MergeIfPossible | ( | const NavigatorTurn & | aFollowingTurn, |
const RouteProfile & | aProfile | ||
) |
Merges a turn with a following turn if possible.
void CartoTypeCore::NavigatorTurn::SetInstructions | ( | std::shared_ptr< CEngine > | aEngine, |
const RouteProfile & | aProfile, | ||
const char * | aLocale, | ||
bool | aMetricUnits, | ||
bool | aAbbreviate | ||
) |
Creates instructions for this turn and sets them in the turn object.
double CartoTypeCore::NavigatorTurn::Distance = 0 |
The distance in meters from the current position to the turn or the arrival point.
String CartoTypeCore::NavigatorTurn::FromName |
The name, if known, of the road before the turn.
String CartoTypeCore::NavigatorTurn::FromRef |
The reference code, if known, of the road before the turn.
FeatureInfo CartoTypeCore::NavigatorTurn::FromRouteInfo = FeatureType::UnknownRoute |
The type of the road before the turn.
String CartoTypeCore::NavigatorTurn::Instructions |
The localized turn instructions.
Point CartoTypeCore::NavigatorTurn::Position |
The position of the turn in map coordinates.
double CartoTypeCore::NavigatorTurn::Time = 0 |
The estimated time in seconds from the current position to the turn or arrival point.
String CartoTypeCore::NavigatorTurn::ToName |
The name, if known, of the road after the turn.
String CartoTypeCore::NavigatorTurn::ToRef |
The reference code, if known, of the road after the turn.
FeatureInfo CartoTypeCore::NavigatorTurn::ToRouteInfo = FeatureType::UnknownRoute |
The type of the road after the turn.