CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Public Attributes | List of all members
CartoType::TNavigatorTurn Class Reference

#include <cartotype_navigation.h>

Inheritance diagram for CartoType::TNavigatorTurn:
CartoType::TTurn

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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ TNavigatorTurn() [1/2]

CartoType::TNavigatorTurn::TNavigatorTurn ( const CRouteSegment aPrevSegment,
const CRouteSegment aCurSegment,
double  aDistance,
double  aTime 
)
inline

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

◆ TNavigatorTurn() [2/2]

CartoType::TNavigatorTurn::TNavigatorTurn ( const CRouteSegment aPrevSegment,
const CRouteSegment 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 CartoType::TNavigatorTurn::CanMerge ( const TNavigatorTurn aFollowingTurn,
const TRouteProfile aProfile 
) const

Determines if two turns can be merged.

◆ Clear()

void CartoType::TNavigatorTurn::Clear ( )
inline

Sets the turn to its just-constructed state.

◆ CreateInstructions()

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.

◆ Diagram()

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.

◆ Instructions()

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.

◆ Merge()

void CartoType::TNavigatorTurn::Merge ( const TNavigatorTurn aFollowingTurn,
const TRouteProfile aProfile 
)

Merges a turn with a following turn.

◆ MergeIfPossible()

bool CartoType::TNavigatorTurn::MergeIfPossible ( const TNavigatorTurn aFollowingTurn,
const TRouteProfile aProfile 
)

Merges a turn with a following turn if possible.

Member Data Documentation

◆ iDistance

double CartoType::TNavigatorTurn::iDistance = 0

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

◆ iFromName

CString CartoType::TNavigatorTurn::iFromName

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

◆ iFromRef

CString CartoType::TNavigatorTurn::iFromRef

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

◆ iFromRoadType

TRoadType CartoType::TNavigatorTurn::iFromRoadType = TRoadType::UnknownMajor

The type of the road before the turn.

◆ iInstructions

CString CartoType::TNavigatorTurn::iInstructions

The localized turn instructions.

◆ iPosition

TPoint CartoType::TNavigatorTurn::iPosition

The position of the turn in map coordinates.

◆ iTime

double CartoType::TNavigatorTurn::iTime = 0

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

◆ iToName

CString CartoType::TNavigatorTurn::iToName

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

◆ iToRef

CString CartoType::TNavigatorTurn::iToRef

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

◆ iToRoadType

TRoadType CartoType::TNavigatorTurn::iToRoadType = TRoadType::UnknownMajor

The type of the road after the turn.


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