VisioDevKit-Sample  v2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
VgMyNavigationHelper Class Reference

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

Inheritance diagram for VgMyNavigationHelper:
Inheritance graph

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. More...
 
virtual ~VgMyNavigationHelper ()
 Class destructor. More...
 
void createNavigation (VgNavigationModule::VgINavigationRequestParameters &pParameters)
 Implementation of interface : VgMyNavigationCreator. More...
 

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. More...
 
static int getLangId (const std::string &pLangSr)
 Thi static method is used to get the integer lang id corresponding to a named language. More...
 

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. More...
 
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. More...
 

Protected Attributes

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

Static Protected Attributes

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

Detailed Description

This class is a helper for natural navigation management.

IMPLEMENTATION TIPS: Customize this class to internationalize your instructions text.

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
pLangSrThe 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 
)
staticprotected

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 
)
staticprotected

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]
staticprotected

Action string table for localization.

const std::string VgMyNavigationHelper::cLanguageStrings[2]
staticprotected

The language identifiers.

const std::string VgMyNavigationHelper::cNextActionStringTable[cNumLanguages][VgNavigationModule::eVgManeuverTypeMax]
staticprotected

Next action string table for localization (fr/en)

const size_t VgMyNavigationHelper::cNumLanguages = sizeof(cLanguageStrings)/sizeof(std::string)
staticprotected

The number of supported languages.

const std::string VgMyNavigationHelper::cStringTable[cNumLanguages][eStringCount]
staticprotected

Link words string table for localization (fr/en)

const std::string VgMyNavigationHelper::cTimeStringTable[cNumLanguages][3]
staticprotected

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