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

VgMyRoutingHelper Class Reference

Creates a VgMyRoutingHelper which simplifies the task of managing a route and showing/hiding it when changing floors (layers). More...

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

List of all members.

Classes

struct  LineObject
struct  PointObject

Public Member Functions

 VgMyRoutingHelper (VgApplication::VgIApplication *pVgApplication, VgMyTextureLoader *pTextureLoader, VgEngine::VgRefPtr< VgRoutingModule::VgIRouteCallback >const &pCallback, VgMyLayerAndCameraHandler *pLayerAndCamerHandler)
virtual ~VgMyRoutingHelper ()
virtual bool setRoutePoint (VgMyRouteCreator::RoutePoint pPoint, const std::string &pPlaceID)
 Sets a RoutePoint to a specific place.
virtual bool setRoutePoint (RoutePoint pPoint, VgEngine::VgPosition pPosition)
 Sets a RoutePoint to a position within the map.
virtual void resetRoutePoint (VgMyRouteCreator::RoutePoint pPoint)
 Resets the place ID associated with a point.
virtual bool isRoutePointSet (VgMyRouteCreator::RoutePoint pPoint)
virtual void computeRoute ()
 Computes a route.
virtual
VgRoutingModule::VgIRouteRequestParameters * 
editRoutingRequestParameters ()
 Returns a reference to the routing request parameters that computeRoute uses.
virtual void resetRoutingRequestParameters ()
 Resets the routing request parameters to their initial state.
virtual void setAvoidStairs (bool pDisabledFriendly)
 Sets up the routing request parameters to include/exclude non disabled-friendly attributes.
VgEngine::VgRefPtr
< VgEngine::VgAnimationDescriptor > 
getRoutePointHighlightAnimationDescriptor ()
 Returns the descriptor of an animation intended to emphasize routing points.
bool createRouteObjects (VgEngine::VgConstRefPtr< VgRoutingModule::VgIRoute > const &pRoute)
 Creates the geometry objects to be added to the view to represent the route.
void clear ()
 Clears the object.
void show ()
 Declaration from interface : VgMyDisplayable.
void hide ()
 Hides this Object.
bool isVisible ()
void setPoiCallback (const std::string &pIdentifier, VgEngine::VgRefPtr< Vg3DModule::VgIGeometryCallback >const &pCallback)
 Sets a callback for a specific POI identifier.

Static Public Attributes

static const std::string kStartPointStrID
static const std::string kEndPointStrID

Protected Types

typedef std::map< std::string,
VgEngine::VgRefPtr
< Vg3DModule::VgIGeometryCallback > > 
POICallbackMap

Protected Member Functions

double computeFloorHeightFromLayer (const std::string &pLayer) const
bool isPlaceRoutable (const std::string &pID)
void requestRoute (const VgEngine::VgRefPtr< VgRoutingModule::VgIRoutingNode > pOrigin, const VgEngine::VgRefPtr< VgRoutingModule::VgIRoutingNode > pDestination)
 Requests a route from the routing module given some routing nodes.
void createAndAddRouteMarker (VgMyRouteCreator::RoutePoint pPoint, const VgEngine::VgPosition &pPosition)
void removeRouteMarkers ()
std::string getLayerNameForPosition (VgEngine::VgPosition pPosition)
VgEngine::VgPosition getPositionOfPlace (const std::string &pPlaceId)

Protected Attributes

VgApplication::VgIApplication * mVgApplication
VgEngine::VgInstanceFactory * mInstanceFactory
VgMyTextureLoadermTextureLoader
VgEngine::VgRefPtr
< VgRoutingModule::VgIRouteCallback > 
mCallback
std::map
< VgMyRouteCreator::RoutePoint,
VgEngine::VgRefPtr
< VgRoutingModule::VgIRoutingNode > > 
mRoutePoints
VgRoutingModule::VgIRouteRequestParameters mRoutingRequestParameters
VgRoutingModule::VgIRoutingModule * mRoutingModule
VgRoutingModule::VgIRoutingSolver * mRouteSolver
VgRoutingModule::VgIRouteConverter * mRouteConverter2D
VgMapModule::VgIMapModule * mMapModule
std::map
< VgMyRouteCreator::RoutePoint,
VgEngine::VgRefPtr
< Vg3DModule::VgPoint > > 
mHighlightedRoutePoints
bool mIsRouteVisible
bool mShowAnimatedTrack
std::vector< PointObjectmPoints
std::list< VgEngine::VgRefPtr
< Vg3DModule::VgLink > > 
mLinks
std::vector< LineObjectmLines
POICallbackMap mRoutePoiCallbacks
float mObjectHeightOffset
VgMyLayerAndCameraHandlermLayerAndCameraHandler
VgEngine::VgRefPtr
< VgEngine::VgAnimationDescriptor > 
mHighlightedRoutePointsAnimationDescr

Detailed Description

Creates a VgMyRoutingHelper which simplifies the task of managing a route and showing/hiding it when changing floors (layers).

It can configure the images used for the route.


Member Typedef Documentation

typedef std::map<std::string, VgEngine::VgRefPtr< Vg3DModule::VgIGeometryCallback > > VgMyRoutingHelper::POICallbackMap [protected]

Constructor & Destructor Documentation

VgMyRoutingHelper::VgMyRoutingHelper ( VgApplication::VgIApplication *  pVgApplication,
VgMyTextureLoader pTextureLoader,
VgEngine::VgRefPtr< VgRoutingModule::VgIRouteCallback >const &  pCallback,
VgMyLayerAndCameraHandler pLayerAndCamerHandler 
)
virtual VgMyRoutingHelper::~VgMyRoutingHelper (  ) [virtual]

Member Function Documentation

void VgMyRoutingHelper::clear (  ) [virtual]

Clears the object.

Implements VgMyRouteDisplay.

double VgMyRoutingHelper::computeFloorHeightFromLayer ( const std::string &  pLayer ) const [protected]
virtual void VgMyRoutingHelper::computeRoute (  ) [virtual]

Computes a route.

Remarks:
Works only if both end points are set.

Implements VgMyRouteCreator.

void VgMyRoutingHelper::createAndAddRouteMarker ( VgMyRouteCreator::RoutePoint  pPoint,
const VgEngine::VgPosition &  pPosition 
) [protected]
bool VgMyRoutingHelper::createRouteObjects ( VgEngine::VgConstRefPtr< VgRoutingModule::VgIRoute > const &  pRoute ) [virtual]

Creates the geometry objects to be added to the view to represent the route.

Parameters:
pRouteThe object containing the route data to represent.
Returns:
true if route objects where created successfully, otherwise false.

Implements VgMyRouteDisplay.

virtual VgRoutingModule::VgIRouteRequestParameters* VgMyRoutingHelper::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.

std::string VgMyRoutingHelper::getLayerNameForPosition ( VgEngine::VgPosition  pPosition ) [protected]
VgEngine::VgPosition VgMyRoutingHelper::getPositionOfPlace ( const std::string &  pPlaceId ) [protected]
VgEngine::VgRefPtr< VgEngine::VgAnimationDescriptor > VgMyRoutingHelper::getRoutePointHighlightAnimationDescriptor (  ) [virtual]

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

Implements VgMyRouteCreator.

void VgMyRoutingHelper::hide (  ) [virtual]

Hides this Object.

No effect if it is already hidden.

Implements VgMyRouteDisplay.

bool VgMyRoutingHelper::isPlaceRoutable ( const std::string &  pID ) [protected]
Returns:
true if the pID is routable
virtual bool VgMyRoutingHelper::isRoutePointSet ( VgMyRouteCreator::RoutePoint  pPoint ) [virtual]
Parameters:
pPointRoutePoint to test.
Returns:
True if the specified point is already set.

Implements VgMyRouteCreator.

bool VgMyRoutingHelper::isVisible (  ) [virtual]
Returns:
TRUE if this Object is visible (i.e. shown). FALSE otherwise.

Implements VgMyRouteDisplay.

void VgMyRoutingHelper::removeRouteMarkers (  ) [protected]
void VgMyRoutingHelper::requestRoute ( const VgEngine::VgRefPtr< VgRoutingModule::VgIRoutingNode >  pOrigin,
const VgEngine::VgRefPtr< VgRoutingModule::VgIRoutingNode >  pDestination 
) [protected]

Requests a route from the routing module given some routing nodes.

Parameters:
pOriginrouting node to start from
pDestinationrouting node to finish at
virtual void VgMyRoutingHelper::resetRoutePoint ( VgMyRouteCreator::RoutePoint  pPoint ) [virtual]

Resets the place ID associated with a point.

Parameters:
pPointRoutePoint to reset.

Implements VgMyRouteCreator.

virtual void VgMyRoutingHelper::resetRoutingRequestParameters (  ) [virtual]

Resets the routing request parameters to their initial state.

Implements VgMyRouteCreator.

virtual void VgMyRoutingHelper::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 VgMyRoutingHelper::setPoiCallback ( const std::string &  pIdentifier,
VgEngine::VgRefPtr< Vg3DModule::VgIGeometryCallback >const &  pCallback 
) [virtual]

Sets a callback for a specific POI identifier.

Implements VgMyPoiConfigurationSetter.

virtual bool VgMyRoutingHelper::setRoutePoint ( RoutePoint  pPoint,
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.

virtual bool VgMyRoutingHelper::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.

void VgMyRoutingHelper::show (  ) [virtual]

Declaration from interface : VgMyDisplayable.

Implements VgMyRouteDisplay.


Member Data Documentation

const std::string VgMyRoutingHelper::kEndPointStrID [static]
const std::string VgMyRoutingHelper::kStartPointStrID [static]
VgEngine::VgRefPtr< VgRoutingModule::VgIRouteCallback > VgMyRoutingHelper::mCallback [protected]
std::map<VgMyRouteCreator::RoutePoint, VgEngine::VgRefPtr< Vg3DModule::VgPoint > > VgMyRoutingHelper::mHighlightedRoutePoints [protected]
VgEngine::VgRefPtr< VgEngine::VgAnimationDescriptor > VgMyRoutingHelper::mHighlightedRoutePointsAnimationDescr [protected]
VgEngine::VgInstanceFactory* VgMyRoutingHelper::mInstanceFactory [protected]
std::vector< LineObject > VgMyRoutingHelper::mLines [protected]
std::list< VgEngine::VgRefPtr< Vg3DModule::VgLink > > VgMyRoutingHelper::mLinks [protected]
VgMapModule::VgIMapModule* VgMyRoutingHelper::mMapModule [protected]
std::vector< PointObject > VgMyRoutingHelper::mPoints [protected]
VgRoutingModule::VgIRouteConverter* VgMyRoutingHelper::mRouteConverter2D [protected]
std::map<VgMyRouteCreator::RoutePoint, VgEngine::VgRefPtr<VgRoutingModule::VgIRoutingNode> > VgMyRoutingHelper::mRoutePoints [protected]
VgRoutingModule::VgIRoutingSolver* VgMyRoutingHelper::mRouteSolver [protected]
VgRoutingModule::VgIRoutingModule* VgMyRoutingHelper::mRoutingModule [protected]
VgRoutingModule::VgIRouteRequestParameters VgMyRoutingHelper::mRoutingRequestParameters [protected]
VgApplication::VgIApplication* VgMyRoutingHelper::mVgApplication [protected]

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