CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Public Attributes | List of all members
CartoTypeCore::NavigatorTurn Class Reference

#include <cartotype_navigation.h>

Inheritance diagram for CartoTypeCore::NavigatorTurn:
CartoTypeCore::Turn

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
 

Detailed Description

Turn information for navigation: the base Turn class plus the distance to the turn, road names and turn instruction.

Constructor & Destructor Documentation

◆ NavigatorTurn() [1/2]

CartoTypeCore::NavigatorTurn::NavigatorTurn ( const RouteSegment aPrevSegment,
const RouteSegment aCurSegment,
double  aDistance,
double  aTime 
)
inline

Creates a turn from aPrevSegment to aCurSegment with a distance in meters and a time in seconds.

◆ NavigatorTurn() [2/2]

CartoTypeCore::NavigatorTurn::NavigatorTurn ( const RouteSegment aPrevSegment,
const RouteSegment aCurSegment,
double  aDistance,
double  aTime 
)
inline

Creates a turn from aPrevSegment, optionally to aCurSegment if it is non-null, with a distance in meters and a time in seconds.

Member Function Documentation

◆ CanMerge()

bool CartoTypeCore::NavigatorTurn::CanMerge ( const NavigatorTurn aFollowingTurn,
const RouteProfile aProfile 
) const

Determines if two turns can be merged.

◆ Clear()

void CartoTypeCore::NavigatorTurn::Clear ( )
inline

Sets the turn to its just-constructed state.

◆ CreateInstructions()

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.

◆ Diagram()

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.

◆ Merge()

void CartoTypeCore::NavigatorTurn::Merge ( const NavigatorTurn aFollowingTurn,
const RouteProfile aProfile 
)

Merges a turn with a following turn.

◆ MergeIfPossible()

bool CartoTypeCore::NavigatorTurn::MergeIfPossible ( const NavigatorTurn aFollowingTurn,
const RouteProfile aProfile 
)

Merges a turn with a following turn if possible.

◆ SetInstructions()

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.

Member Data Documentation

◆ Distance

double CartoTypeCore::NavigatorTurn::Distance = 0

The distance in meters from the current position to the turn or the arrival point.

◆ FromName

String CartoTypeCore::NavigatorTurn::FromName

The name, if known, of the road before the turn.

◆ FromRef

String CartoTypeCore::NavigatorTurn::FromRef

The reference code, if known, of the road before the turn.

◆ FromRouteInfo

FeatureInfo CartoTypeCore::NavigatorTurn::FromRouteInfo = FeatureType::UnknownRoute

The type of the road before the turn.

◆ Instructions

String CartoTypeCore::NavigatorTurn::Instructions

The localized turn instructions.

◆ Position

Point CartoTypeCore::NavigatorTurn::Position

The position of the turn in map coordinates.

◆ Time

double CartoTypeCore::NavigatorTurn::Time = 0

The estimated time in seconds from the current position to the turn or arrival point.

◆ ToName

String CartoTypeCore::NavigatorTurn::ToName

The name, if known, of the road after the turn.

◆ ToRef

String CartoTypeCore::NavigatorTurn::ToRef

The reference code, if known, of the road after the turn.

◆ ToRouteInfo

FeatureInfo CartoTypeCore::NavigatorTurn::ToRouteInfo = FeatureType::UnknownRoute

The type of the road after the turn.


The documentation for this class was generated from the following file: