CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_navigation.h>
Public Member Functions | |
TNavigatorTurn (const CRouteSegment &aPrevSegment, const CRouteSegment &aCurSegment, double aDistance, double aTime) | |
TNavigatorTurn (const CRouteSegment &aPrevSegment, const CRouteSegment *aCurSegment, double aDistance, double aTime) | |
void | Clear () |
bool | CanMerge (const TNavigatorTurn &aFollowingTurn, const TRouteProfile &aProfile) const |
bool | MergeIfPossible (const TNavigatorTurn &aFollowingTurn, const TRouteProfile &aProfile) |
void | Merge (const TNavigatorTurn &aFollowingTurn, const TRouteProfile &aProfile) |
void | CreateInstructions (std::shared_ptr< CEngine > aEngine, const TRouteProfile &aProfile, const char *aLocale, bool aMetricUnits, bool aAbbreviate) |
CString | Instructions (std::shared_ptr< CEngine > aEngine, const TRouteProfile &aProfile, const char *aLocale, bool aMetricUnits, bool aAbbreviate, TNavigationState aState=TNavigationState::Turn, const TNavigatorTurn *aNextTurn=nullptr) const |
CBitmap | Diagram (std::shared_ptr< CEngine > aEngine, const TRouteProfile &aProfile, int32_t aSizeInPixels, TColor aColor) const |
Public Member Functions inherited from CartoType::TTurn | |
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 (MOutputStream &aOutput) const |
Public Attributes | |
double | iDistance = 0 |
double | iTime = 0 |
CString | iFromName |
CString | iFromRef |
TRoadType | iFromRoadType = TRoadType::UnknownMajor |
CString | iToName |
CString | iToRef |
TRoadType | iToRoadType = TRoadType::UnknownMajor |
TPoint | iPosition |
CString | iInstructions |
Public Attributes inherited from CartoType::TTurn | |
TTurnType | iTurnType = TTurnType::None |
bool | iContinue = true |
TRoundaboutState | iRoundaboutState = TRoundaboutState::None |
double | iTurnAngle = 0 |
double | iInDirection = 0 |
double | iOutDirection = 0 |
int32_t | iExitNumber = 0 |
int32_t | iChoices = 0 |
int32_t | iLeftAlternatives = 0 |
int32_t | iRightAlternatives = 0 |
bool | iIsFork = false |
bool | iTurnOff = false |
CString | iJunctionName |
CString | iJunctionRef |
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 CartoType::TNavigatorTurn::CanMerge | ( | const TNavigatorTurn & | aFollowingTurn, |
const TRouteProfile & | aProfile | ||
) | const |
Determines if two turns can be merged.
|
inline |
Sets the turn to its just-constructed state.
void CartoType::TNavigatorTurn::CreateInstructions | ( | std::shared_ptr< CEngine > | aEngine, |
const TRouteProfile & | aProfile, | ||
const char * | aLocale, | ||
bool | aMetricUnits, | ||
bool | aAbbreviate | ||
) |
Creates instructions for this turn and sets them in the turn object.
CBitmap CartoType::TNavigatorTurn::Diagram | ( | std::shared_ptr< CEngine > | aEngine, |
const TRouteProfile & | aProfile, | ||
int32_t | aSizeInPixels, | ||
TColor | 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.
CString CartoType::TNavigatorTurn::Instructions | ( | std::shared_ptr< CEngine > | aEngine, |
const TRouteProfile & | aProfile, | ||
const char * | aLocale, | ||
bool | aMetricUnits, | ||
bool | aAbbreviate, | ||
TNavigationState | aState = TNavigationState::Turn , |
||
const TNavigatorTurn * | aNextTurn = nullptr |
||
) | const |
Returns instructions for this turn.
void CartoType::TNavigatorTurn::Merge | ( | const TNavigatorTurn & | aFollowingTurn, |
const TRouteProfile & | aProfile | ||
) |
Merges a turn with a following turn.
bool CartoType::TNavigatorTurn::MergeIfPossible | ( | const TNavigatorTurn & | aFollowingTurn, |
const TRouteProfile & | aProfile | ||
) |
Merges a turn with a following turn if possible.
double CartoType::TNavigatorTurn::iDistance = 0 |
The distance in meters from the current position to the turn or the arrival point.
CString CartoType::TNavigatorTurn::iFromName |
The name, if known, of the road before the turn.
CString CartoType::TNavigatorTurn::iFromRef |
The reference code, if known, of the road before the turn.
TRoadType CartoType::TNavigatorTurn::iFromRoadType = TRoadType::UnknownMajor |
The type of the road before the turn.
CString CartoType::TNavigatorTurn::iInstructions |
The localized turn instructions.
TPoint CartoType::TNavigatorTurn::iPosition |
The position of the turn in map coordinates.
double CartoType::TNavigatorTurn::iTime = 0 |
The estimated time in seconds from the current position to the turn or arrival point.
CString CartoType::TNavigatorTurn::iToName |
The name, if known, of the road after the turn.
CString CartoType::TNavigatorTurn::iToRef |
The reference code, if known, of the road after the turn.
TRoadType CartoType::TNavigatorTurn::iToRoadType = TRoadType::UnknownMajor |
The type of the road after the turn.