Public Member Functions | Protected Member Functions | Protected Attributes

VgMyBasicApplicationController Class Reference

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

List of all members.

Public Member Functions

 VgMyBasicApplicationController (VgApplication::VgIApplication &pApplication, VgMyTextureLoader *pTextureLoader)
virtual ~VgMyBasicApplicationController ()
bool loadConfiguration (const std::string &pConfiguration, const unsigned int pSecretKey, const std::string &pLicenseURL, const int pDataset=0)
void unloadConfiguration ()
void setLayerAndCameraHandler (VgMyLayerAndCameraHandler *pHandler)
void setRouteCreator (VgMyRouteCreator *pCreator)
VgMyRouteCreatorgetRouteCreator () const
void addRouteDisplay (VgMyRouteDisplay *pDisplay)
void setNavigationCreator (VgMyNavigationCreator *pCreator)
void addNavigationPositionDisplay (VgMyNavigationPositionDisplay *pDisplay)
void addInstructionDisplay (VgMyInstructionDisplay *pDisplay)
bool has3DModule () const
bool hasMapModule () const
bool hasRoutingModule () const
bool hasNavigationModule () const
void addLayerAndCameraListener (VgMyLayerAndCameraListener *pListener)
void deleteRoute ()
bool setRoutePoint (VgMyRouteCreator::RoutePoint pPoint, const std::string &pPlaceID)
 Sets a RoutePoint to a specific place.
bool setRoutePoint (VgMyRouteCreator::RoutePoint pPoint, const VgEngine::VgPosition pPosition)
 Sets a RoutePoint to a position within the map.
void resetRoutePoint (VgMyRouteCreator::RoutePoint pPoint)
 Resets the place ID associated with a point.
bool isRoutePointSet (VgMyRouteCreator::RoutePoint pPoint)
void computeRoute ()
 Computes a route.
VgRoutingModule::VgIRouteRequestParameters * editRoutingRequestParameters ()
 Returns a reference to the routing request parameters that computeRoute uses.
void resetRoutingRequestParameters ()
 Resets the routing request parameters to their initial state.
virtual VgEngine::VgRefPtr
< VgEngine::VgAnimationDescriptor > 
getRoutePointHighlightAnimationDescriptor ()
 Returns the descriptor of an animation intended to emphasize routing points.
virtual void setAvoidStairs (bool pDisabledFriendly)
 Sets up the routing request parameters to include/exclude non disabled-friendly attributes.
void layerWillChangeFrom (VgMyLayerAndCameraHandler *pSender, const std::string &pFloorFrom, const std::string &pFloorTo)
 Notification that the layer focus is about to change.
void layerChangedTo (VgMyLayerAndCameraHandler *pSender, const std::string &pFloorFrom, const std::string &pFloorTo)
 Notification that the layer focus did change.
void viewWillChange (VgMyLayerAndCameraHandler *pSender, const bool pDoesChangeFromGlobalToDetailed)
 Notification that the view will change its 'mode' (global or detailed)
void viewDidChange (VgMyLayerAndCameraHandler *pSender, const bool pDoesChangeFromGlobalToDetailed)
 Notification that the view has changed its 'mode' (global or detailed)
void goToInstruction (const unsigned int pInstructionIndex)
 Updates the current instruction.
bool isGlobalView ()
void switchToGlobalView (bool pIsAnimated=true)
 Switches from the detailledView to the global view.
void switchToDetailedView (bool pIsAnimated=true)
 Switches from the global to the detailled view.
const std::string & getFocusedLayerName ()
 Gets the focused layer's name.
void gotoLayer (const std::string &pLayerName, bool pIsAnimated=true)
 Focus a specific layer.
void gotoLayer (const unsigned int pLayerIndex, bool pIsAnimated=true)
 Focus a specific layer.
unsigned int getNumberOfLayers ()
 Returns the number of layers.
bool getLayerName (const unsigned int pLayerIndex, std::string &pLayerNameOut)
 Returns the layer name for a given indes.
void gotoViewpoint (const VgEngine::VgIViewPoint &pViewPoint, const std::string &pLayerName, bool pIsAnimated=true)
 Moves the camera to a specific view point.
void gotoLookAtPosition (const VgEngine::VgPosition &pPosition, const std::string &pLayerName, bool pIsAnimated=true)
 Moves the camera so that it is focused on a given position.
void refreshParameters (unsigned int pWidth, unsigned int pHeight)
 Refreshes the inner parameters.
void notifyRouteComputed (VgRoutingModule::VgRouteRequestStatus pStatus, VgEngine::VgRefPtr< VgRoutingModule::VgIRoute > const &pRoute)
bool notifyNavigationComputed (VgNavigationModule::VgNavigationRequestStatus pStatus, VgEngine::VgRefPtr< VgNavigationModule::VgINavigation > const &pNavigation)
void notifyPositionUpdated (VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &pNavigation, const VgEngine::VgPosition &pPosition, double pTime)
void notifyNewInstruction (VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &pNavigation, unsigned int pIndex)
void updatePosition (const VgEngine::VgPosition &pPosition)
 Updates the current position.
void clearNavigationPositionDisplays ()
VgEngine::VgRefPtr
< VgRoutingModule::VgIRouteCallback > 
getRouteCallback ()

Protected Member Functions

void animateToInstruction (VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &pNavigation, unsigned int pIndex)

Protected Attributes

VgApplication::VgIApplication & mVgApplication
VgMyLayerAndCameraHandlermLayerAndCameraHandler
VgMyRouteCreatormRouteCreator
VgMyNavigationCreatormNavigationCreator
std::list
< VgMyLayerAndCameraListener * > 
mLayerAndCameraListeners
std::list< VgMyRouteDisplay * > mRouteDisplays
std::list
< VgMyNavigationPositionDisplay * > 
mPositionDisplays
std::list
< VgMyInstructionDisplay * > 
mInstructionsDisplays
VgEngine::VgRefPtr
< VgRoutingModule::VgIRoute > 
mRoute
 Current Route of NULL if no route request succeed.
VgEngine::VgRefPtr
< VgNavigationModule::VgINavigation > 
mNavigation
 Current Navigation of NULL if no route request succeed.
unsigned int mMaximumInstructionNumber
VgMyTextureLoadermTextureLoader
VgEngine::VgRefPtr
< VgMyBasicRouteCallback
mRouteCallback
VgEngine::VgRefPtr
< VgMyBasicNavigationCallback
mNavigationCallback
VgEngine::VgRefPtr
< VgMyBasicNavigationListener
mNavigationListener

Constructor & Destructor Documentation

VgMyBasicApplicationController::VgMyBasicApplicationController ( VgApplication::VgIApplication &  pApplication,
VgMyTextureLoader pTextureLoader 
)
virtual VgMyBasicApplicationController::~VgMyBasicApplicationController (  ) [virtual]

Member Function Documentation

void VgMyBasicApplicationController::addInstructionDisplay ( VgMyInstructionDisplay pDisplay )
void VgMyBasicApplicationController::addLayerAndCameraListener ( VgMyLayerAndCameraListener pListener )
void VgMyBasicApplicationController::addNavigationPositionDisplay ( VgMyNavigationPositionDisplay pDisplay )
void VgMyBasicApplicationController::addRouteDisplay ( VgMyRouteDisplay pDisplay )
void VgMyBasicApplicationController::animateToInstruction ( VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &  pNavigation,
unsigned int  pIndex 
) [protected]
void VgMyBasicApplicationController::clearNavigationPositionDisplays (  )
void VgMyBasicApplicationController::computeRoute (  ) [virtual]

Computes a route.

Remarks:
Works only if both end points are set.

Implements VgMyRouteCreator.

void VgMyBasicApplicationController::deleteRoute (  )
VgRoutingModule::VgIRouteRequestParameters* VgMyBasicApplicationController::editRoutingRequestParameters (  ) [virtual]

Returns a reference to the routing request parameters that computeRoute uses.

Returns:
a reference to the routing request parameters to be used on the next computeRoute.

Implements VgMyRouteCreator.

const std::string& VgMyBasicApplicationController::getFocusedLayerName (  ) [virtual]

Gets the focused layer's name.

The "focused" layer is the one that is displayed in the detailled view. if the global view is displayed, the focused layer should be the most visible one.

Returns:
The focused layer's name.

Implements VgMyLayerAndCameraHandler.

bool VgMyBasicApplicationController::getLayerName ( const unsigned int  pLayerIndex,
std::string &  pLayerNameOut 
) [virtual]

Returns the layer name for a given indes.

Parameters:
pLayerIndexLayer index, should be less than getNumberOfLayers().
pLayerNameOutstring to set with layer name.
Returns:
true if name was set, false if pLayerIndex is greater or equal to getNumberOfLayers().

Implements VgMyLayerAndCameraHandler.

unsigned int VgMyBasicApplicationController::getNumberOfLayers (  ) [virtual]

Returns the number of layers.

Implements VgMyLayerAndCameraHandler.

VgEngine::VgRefPtr< VgRoutingModule::VgIRouteCallback > VgMyBasicApplicationController::getRouteCallback (  ) [inline]
VgMyRouteCreator* VgMyBasicApplicationController::getRouteCreator (  ) const
virtual VgEngine::VgRefPtr< VgEngine::VgAnimationDescriptor > VgMyBasicApplicationController::getRoutePointHighlightAnimationDescriptor (  ) [virtual]

Returns the descriptor of an animation intended to emphasize routing points.

Implements VgMyRouteCreator.

void VgMyBasicApplicationController::goToInstruction ( const unsigned int  pInstructionIndex ) [virtual]

Updates the current instruction.

Parameters:
pInstructionIndexThe new instruction index to use as the current one.

Implements VgMyInstructionUpdateListener.

void VgMyBasicApplicationController::gotoLayer ( const std::string &  pLayerName,
bool  pIsAnimated = true 
) [virtual]

Focus a specific layer.

Parameters:
pLayerNameLayer that will be focused. keeps current mode.
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyBasicApplicationController::gotoLayer ( const unsigned int  pLayerIndex,
bool  pIsAnimated = true 
) [virtual]

Focus a specific layer.

Parameters:
pLayerNameLayer index which is associated with the returned list given by VgLayerManager::getLayers(). keeps current mode.
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyBasicApplicationController::gotoLookAtPosition ( const VgEngine::VgPosition &  pPosition,
const std::string &  pLayerName,
bool  pIsAnimated = true 
) [virtual]

Moves the camera so that it is focused on a given position.

The camera's view, heading, pitch are always conserved. The altitude of pPosition is automatically set to zero.

If the pLayerName isn't the currently focused layer, then before any camera movement is invoked, pLayerName becomes the focused layer.

Note:
If the stack is in global view, the camera will not change.
Parameters:
pPositionThe position to focus on.
pLayerNameThe name of the layer associated with the position.
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyBasicApplicationController::gotoViewpoint ( const VgEngine::VgIViewPoint &  pViewPoint,
const std::string &  pLayerName,
bool  pIsAnimated = true 
) [virtual]

Moves the camera to a specific view point.

If the pLayerName isn't the currently focused layer, then before any camera movement is invoked, pLayerName becomes the focused layer.

Note:
If the stack is in global view, the camera will not change.
Parameters:
pViewPointThe view point to associate with the camera
pLayerNameThe layer which should be given the focus.
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

bool VgMyBasicApplicationController::has3DModule (  ) const
bool VgMyBasicApplicationController::hasMapModule (  ) const
bool VgMyBasicApplicationController::hasNavigationModule (  ) const
bool VgMyBasicApplicationController::hasRoutingModule (  ) const
bool VgMyBasicApplicationController::isGlobalView (  ) [virtual]
Returns:
TRUE if the Handler displays the global view. FALSE if displaying the detailed view.

Implements VgMyLayerAndCameraHandler.

bool VgMyBasicApplicationController::isRoutePointSet ( VgMyRouteCreator::RoutePoint  pPoint ) [virtual]
Parameters:
pPointRoutePoint to test.
Returns:
True if the specified point is already set.

Implements VgMyRouteCreator.

void VgMyBasicApplicationController::layerChangedTo ( VgMyLayerAndCameraHandler pSender,
const std::string &  pFloorFrom,
const std::string &  pFloorTo 
) [virtual]

Notification that the layer focus did change.

Parameters:
pSender
pFloorFromThe layer which previously had the focus.
pFloorToThe layer which currently has the focus.
Remarks:
do not use, as it is not called yet, use layerWillChangeFrom.

Implements VgMyLayerAndCameraListener.

void VgMyBasicApplicationController::layerWillChangeFrom ( VgMyLayerAndCameraHandler pSender,
const std::string &  pFloorFrom,
const std::string &  pFloorTo 
) [virtual]

Notification that the layer focus is about to change.

Parameters:
pSender
pLayerFromThe layer which currently has focus
pLayerToThe layer which will soon have the focus

Implements VgMyLayerAndCameraListener.

bool VgMyBasicApplicationController::loadConfiguration ( const std::string &  pConfiguration,
const unsigned int  pSecretKey,
const std::string &  pLicenseURL,
const int  pDataset = 0 
)
bool VgMyBasicApplicationController::notifyNavigationComputed ( VgNavigationModule::VgNavigationRequestStatus  pStatus,
VgEngine::VgRefPtr< VgNavigationModule::VgINavigation > const &  pNavigation 
)
void VgMyBasicApplicationController::notifyNewInstruction ( VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &  pNavigation,
unsigned int  pIndex 
)
void VgMyBasicApplicationController::notifyPositionUpdated ( VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation > const &  pNavigation,
const VgEngine::VgPosition &  pPosition,
double  pTime 
)
void VgMyBasicApplicationController::notifyRouteComputed ( VgRoutingModule::VgRouteRequestStatus  pStatus,
VgEngine::VgRefPtr< VgRoutingModule::VgIRoute > const &  pRoute 
)
void VgMyBasicApplicationController::refreshParameters ( unsigned int  pWidth,
unsigned int  pHeight 
) [virtual]

Refreshes the inner parameters.

Typically, subclasses can use it to recompute their view parameters when the rendering size changes.

Implements VgMyLayerAndCameraHandler.

void VgMyBasicApplicationController::resetRoutePoint ( VgMyRouteCreator::RoutePoint  pPoint ) [virtual]

Resets the place ID associated with a point.

Parameters:
pPointRoutePoint to reset.

Implements VgMyRouteCreator.

void VgMyBasicApplicationController::resetRoutingRequestParameters (  ) [virtual]

Resets the routing request parameters to their initial state.

Implements VgMyRouteCreator.

virtual void VgMyBasicApplicationController::setAvoidStairs ( bool  pDisabledFriendly ) [virtual]

Sets up the routing request parameters to include/exclude non disabled-friendly attributes.

Parameters:
pDisabledFriendlyTrue if disabled friendly routing is wanted, false if not

Implements VgMyRouteCreator.

void VgMyBasicApplicationController::setLayerAndCameraHandler ( VgMyLayerAndCameraHandler pHandler )
void VgMyBasicApplicationController::setNavigationCreator ( VgMyNavigationCreator pCreator )
void VgMyBasicApplicationController::setRouteCreator ( VgMyRouteCreator pCreator )
bool VgMyBasicApplicationController::setRoutePoint ( VgMyRouteCreator::RoutePoint  pPoint,
const std::string &  pPlaceID 
) [virtual]

Sets a RoutePoint to a specific place.

Parameters:
pPointRoutePoint to set
pPlaceIDPlace to associates with pPoint.
Returns:
False if the specified placeID is not routable.

Implements VgMyRouteCreator.

bool VgMyBasicApplicationController::setRoutePoint ( VgMyRouteCreator::RoutePoint  pPoint,
const VgEngine::VgPosition  pPosition 
) [virtual]

Sets a RoutePoint to a position within the map.

Finds the closest routing node from the routing network to the given position.

  • pPosition.getMZOrAltitude() is used to determine what layer the position is associated to.
  • Use the method VgMapModule::VgIMapModule::getHeightRangeForLayer() to find the appropriate altitude value for pPosition. For example:
            ...
            double lFloorHeight = 0.0;
    
            float pHeightMax;
            float pHeightMin;
            std::sring lLayerName = "0";
            if ( mMapModule->getHeightRangeForLayer(pLayer, pHeightMax, pHeightMin))
            {
                lFloorHeight = ((pHeightMax + pHeightMin) / 2);
            }
         
            lPosition.mZOrAltitude = lFloorHeight;
            ...
    
    Parameters:
    pPointRoutePoint to set
    pPositionPosition to associates with pPoint.
    Returns:
    False if the pPosition is not routable.

Implements VgMyRouteCreator.

void VgMyBasicApplicationController::switchToDetailedView ( bool  pIsAnimated = true ) [virtual]

Switches from the global to the detailled view.

Do nothing if alrady in detailled view.

Parameters:
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyBasicApplicationController::switchToGlobalView ( bool  pIsAnimated = true ) [virtual]

Switches from the detailledView to the global view.

Do nothing if already in global view.

Parameters:
pIsAnimatedIf true then animates the transition, otherwise does not.

Implements VgMyLayerAndCameraHandler.

void VgMyBasicApplicationController::unloadConfiguration (  )
void VgMyBasicApplicationController::updatePosition ( const VgEngine::VgPosition &  pPosition ) [virtual]

Updates the current position.

Parameters:
pPositionA position representing a provided location

Implements VgMyLocationListener.

void VgMyBasicApplicationController::viewDidChange ( VgMyLayerAndCameraHandler pSender,
const bool  pDoesChangeFromGlobalToDetailed 
) [virtual]

Notification that the view has changed its 'mode' (global or detailed)

Parameters:
pSender
pDoesChangeFromGlobalToDetailedTrue if the view switch to global view, False if it switches to the detailed view.

Implements VgMyLayerAndCameraListener.

void VgMyBasicApplicationController::viewWillChange ( VgMyLayerAndCameraHandler pSender,
const bool  pDoesChangeFromGlobalToDetailed 
) [virtual]

Notification that the view will change its 'mode' (global or detailed)

Parameters:
pSender
pDoesChangeFromGlobalToDetailedTrue if the view switch to global view, False if it switches to the detailed view.

Implements VgMyLayerAndCameraListener.


Member Data Documentation

VgEngine::VgRefPtr< VgNavigationModule::VgINavigation > VgMyBasicApplicationController::mNavigation [protected]

Current Navigation of NULL if no route request succeed.

Remarks:
Only this controller delete this object
VgEngine::VgRefPtr< VgRoutingModule::VgIRoute > VgMyBasicApplicationController::mRoute [protected]

Current Route of NULL if no route request succeed.

Remarks:
Only this controller delete this object
VgApplication::VgIApplication& VgMyBasicApplicationController::mVgApplication [protected]

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