Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes

VgMyNavigationHelper Class Reference

This class a helper for natural navigation management. More...

Inheritance diagram for VgMyNavigationHelper:
Inheritance graph
[legend]
Collaboration diagram for VgMyNavigationHelper:
Collaboration graph
[legend]

List of all members.

Classes

struct  VgTranslatedInstruction
 This structure holds the result of a instruciton translation. More...

Public Types

enum  StringType {
  eStringFor, eStringThen, eStringAnd, eStringNear,
  eStringUsing, eStringCount
}
 

This enum is used as an identifier for localized versions of navigation texts.

More...

Public Member Functions

 VgMyNavigationHelper (VgNavigationModule::VgINavigationModule *pNavModule)
 Class constructor.
virtual ~VgMyNavigationHelper ()
 Class destructor.
void createNavigation (VgNavigationModule::VgINavigationRequestParameters &pParameters)
 Implementation of interface : VgMyNavigationCreator.

Static Public Member Functions

static void translateInstruction (VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &pInstruction, VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &pNavigation, VgTranslatedInstruction &pTranslated, VgMapModule::VgIMapModule &pMapModule, int pLang=0)
 This static method is used to translate a navigation instruction into a detailed message, along with other instruction-related data.
static int getLangId (const std::string &pLangSr)
 Thi static method is used to get the integer lang id corresponding to a named language.

Static Protected Member Functions

static std::string timeToText (float pTimeInMinutes, int pLang)
 Utility static method to generate a natural language "fuzzy" string for instruction duration.
static void replaceTokens (std::string &pStringWithTokens, VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &pInstructionCurrent, VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &pInstructionNext)
 Takes a language string with tokens, then replaces those tokens with contextual data.

Protected Attributes

VgNavigationModule::VgINavigationModule * mNavigationModule
 The navigationModule this helper is built on.

Static Protected Attributes

static const std::string cLanguageStrings [2]
 The language identifiers.
static const size_t cNumLanguages = sizeof(cLanguageStrings)/sizeof(std::string)
 The number of supported languages.
static const std::string cActionStringTable [cNumLanguages][VgNavigationModule::eVgManeuverTypeMax]
 Action string table for localization.
static const std::string cNextActionStringTable [cNumLanguages][VgNavigationModule::eVgManeuverTypeMax]
 Next action string table for localization (fr/en)
static const std::string cTimeStringTable [cNumLanguages][3]
 Time string table for localization (fr/en)
static const std::string cStringTable [cNumLanguages][eStringCount]
 Link words string table for localization (fr/en)

Detailed Description

This class a helper for natural navigation management.


Member Enumeration Documentation

This enum is used as an identifier for localized versions of navigation texts.

Enumerator:
eStringFor 

Duration link word ("for" in English, "pendant" in French)

eStringThen 

Duration link word ("then" in English, "puis" in French)

eStringAnd 

Duration link word ("and" in English, "et" in French)

eStringNear 

Duration link word ("near" in English, "à proximité de" in French)

eStringUsing 

Duration link word ("using" in English, "en empruntant" in French)

eStringCount 

Last entry does not identify a string it is the number of strings.


Constructor & Destructor Documentation

VgMyNavigationHelper::VgMyNavigationHelper ( VgNavigationModule::VgINavigationModule *  pNavModule )

Class constructor.

Parameters:
pNavModuleThe valid navigation module that will be used.
virtual VgMyNavigationHelper::~VgMyNavigationHelper (  ) [virtual]

Class destructor.


Member Function Documentation

void VgMyNavigationHelper::createNavigation ( VgNavigationModule::VgINavigationRequestParameters &  pParameters ) [virtual]

Implementation of interface : VgMyNavigationCreator.

Implements VgMyNavigationCreator.

static int VgMyNavigationHelper::getLangId ( const std::string &  pLangSr ) [static]

Thi static method is used to get the integer lang id corresponding to a named language.

Parameters:
pLangStrThe string identifying the language. Possible values (as of today) are "fr" or "en" or "fr_XX" or "en_XX"
Returns:
The language index to use with the translateInstruction method. Default language (0) if requested language doesn't exist.
static void VgMyNavigationHelper::replaceTokens ( std::string &  pStringWithTokens,
VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &  pInstructionCurrent,
VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &  pInstructionNext 
) [static, protected]

Takes a language string with tokens, then replaces those tokens with contextual data.

Parameters:
pStringWithTokensThe language string containing the tokens.
pInstructionCurrentThe current isntruction.
pInstructionNextThe next instruction.
static std::string VgMyNavigationHelper::timeToText ( float  pTimeInMinutes,
int  pLang 
) [static, protected]

Utility static method to generate a natural language "fuzzy" string for instruction duration.

static void VgMyNavigationHelper::translateInstruction ( VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > const &  pInstruction,
VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &  pNavigation,
VgTranslatedInstruction pTranslated,
VgMapModule::VgIMapModule &  pMapModule,
int  pLang = 0 
) [static]

This static method is used to translate a navigation instruction into a detailed message, along with other instruction-related data.

Parameters:
pInstructionThe instruction to translate.
pNavigationThe navigation object the instruction comes from.
pTranslatedA reference to the structure to feed with details.
pMapModuleThe application's VgMapModule (needed for near places and floor heights).
pLangThe index of the language to use (see getLangId).
See also:
VgMyNavigationHelper::getLangId

Member Data Documentation

const std::string VgMyNavigationHelper::cActionStringTable[cNumLanguages][VgNavigationModule::eVgManeuverTypeMax] [static, protected]

Action string table for localization.

const std::string VgMyNavigationHelper::cLanguageStrings[2] [static, protected]

The language identifiers.

const std::string VgMyNavigationHelper::cNextActionStringTable[cNumLanguages][VgNavigationModule::eVgManeuverTypeMax] [static, protected]

Next action string table for localization (fr/en)

const size_t VgMyNavigationHelper::cNumLanguages = sizeof(cLanguageStrings)/sizeof(std::string) [static, protected]

The number of supported languages.

const std::string VgMyNavigationHelper::cStringTable[cNumLanguages][eStringCount] [static, protected]

Link words string table for localization (fr/en)

const std::string VgMyNavigationHelper::cTimeStringTable[cNumLanguages][3] [static, protected]

Time string table for localization (fr/en)

VgNavigationModule::VgINavigationModule* VgMyNavigationHelper::mNavigationModule [protected]

The navigationModule this helper is built on.


The documentation for this class was generated from the following file:
VisioDevKit 2.0, Visioglobe® 2013