VisioMove-Sample  2.1.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
VgMyRoutingHelper Class Reference

Provides common operation on routes. More...

Inheritance diagram for VgMyRoutingHelper:
Inheritance graph

Classes

struct  LineObject
 Holds information on Lines to ease show/hide. More...
 
struct  PointObject
 Holds information on Points to ease show/hide. More...
 

Public Member Functions

 VgMyRoutingHelper (VgApplication::VgIApplication *pVgApplication, VgMyTextureLoader *pTextureLoader, VgEngine::VgRefPtr< VgRoutingModule::VgIRouteCallback >const &pCallback, VgMyLayerAndCameraHandler *pLayerAndCamerHandler)
 Constructor. More...
 
virtual ~VgMyRoutingHelper ()
 
virtual bool setRoutePoint (VgMyRouteCreator::RoutePoint pPoint, const std::string &pPlaceID)
 Implementation of interface : VgMyRouteCreator. More...
 
virtual bool setRoutePoint (RoutePoint pPoint, const VgEngine::VgPosition &pPosition)
 Sets a RoutePoint to a position within the map. More...
 
virtual void resetRoutePoint (VgMyRouteCreator::RoutePoint pPoint)
 Resets the place ID associated with a point. More...
 
virtual bool isRoutePointSet (VgMyRouteCreator::RoutePoint pPoint)
 
virtual void computeRoute ()
 Computes a route. More...
 
virtual
VgRoutingModule::VgIRouteRequestParameters * 
editRoutingRequestParameters ()
 Returns a reference to the routing request parameters that computeRoute uses. More...
 
virtual void resetRoutingRequestParameters ()
 Resets the routing request parameters to their initial state. More...
 
virtual
VgRoutingModule::VgIRoutingNodeParameters * 
editRoutingNodeParameters ()
 Returns a reference to the routing node parameters that getRoutingNode for a position uses. More...
 
virtual void resetRoutingNodeParameters ()
 Resets the routing node parameters to their initial state. More...
 
virtual void setAvoidStairs (bool pDisabledFriendly)
 Sets up the routing request parameters to include/exclude non disabled-friendly attributes. More...
 
VgEngine::VgRefPtr
< VgEngine::VgAnimationDescriptor > 
getRoutePointHighlightAnimationDescriptor ()
 Returns the descriptor of an animation intended to emphasize routing points. More...
 
void setRouteStyle (VgMyRouteStyler::RouteStyle pRouteStyle, bool pRecomputeRoute=true)
 Change the routing style of lines generated by the routing helper. More...
 
VgMyRouteStyler::RouteStyle getRouteStyle () const
 get the current route style More...
 
void setRouteWidth (float pWidth)
 Determines the width of the created route. More...
 
float getRouteWidth ()
 Returns the current width of the created route. More...
 
void setRouteMarkerHeight (float pHeight)
 Set route marker height. More...
 
bool createRouteObjects (VgEngine::VgConstRefPtr< VgRoutingModule::VgIRoute > const &pRoute)
 Implementation of interface : VgMyRouteDisplay. More...
 
void clear ()
 Clears the object. More...
 
void show ()
 Declaration from interface : VgMyDisplayable. More...
 
void hide ()
 Hides this Object. More...
 
bool isVisible ()
 
void setPoiCallback (const std::string &pIdentifier, VgEngine::VgRefPtr< Vg3DModule::VgIGeometryCallback >const &pCallback)
 Implementation of interface : VgMyPoiConfigurationSetter. More...
 
bool setRoutePoint (RoutePoint pPoint, const VgEngine::VgPosition &pPosition, const std::string &pLayerName)
 Sets a RoutePoint to a position and layer within the map. More...
 

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)
 
bool isPositionRoutable (const VgEngine::VgPosition &pPosition)
 
void requestRoute (const VgEngine::VgRefPtr< VgRoutingModule::VgIRoutingNode > pOrigin, const std::vector< VgEngine::VgRefPtr< VgRoutingModule::VgIRoutingNode > > &pDestinations)
 Requests a route from the routing module given some routing nodes. More...
 
void createAndAddRouteMarker (VgMyRouteCreator::RoutePoint pPoint, const VgEngine::VgPosition &pPosition, const std::string &pLayerName)
 Add a route marker to the map. More...
 
void removeRouteMarkers ()
 
std::string getLayerNameForPosition (const VgEngine::VgPosition &pPosition)
 
VgEngine::VgPosition getPositionOfPlace (const std::string &pPlaceId)
 
std::string getLayerNameOfPlace (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::VgIRoutingNodeParameters mRoutingNodeParameters
 
VgRoutingModule::VgIRoutingModule * mRoutingModule
 
VgRoutingModule::VgIRoutingSolver * mRouteSolver
 
VgRoutingModule::VgIRouteConverter * mRouteConverter2D
 
VgMapModule::VgIMapModule * mMapModule
 
std::map
< VgMyRouteCreator::RoutePoint,
VgEngine::VgRefPtr
< Vg3DModule::VgPoint > > 
mHighlightedRoutePoints
 
bool mIsRouteVisible
 
VgMyRouteStyler::RouteStyle mRouteStyle
 
std::vector< PointObjectmPoints
 
std::list< VgEngine::VgRefPtr
< Vg3DModule::VgLink > > 
mLinks
 
std::vector< LineObjectmLines
 
POICallbackMap mRoutePoiCallbacks
 
float mObjectHeightOffset
 
float mRouteWidth
 
VgMyLayerAndCameraHandlermLayerAndCameraHandler
 
VgEngine::VgRefPtr
< VgEngine::VgAnimationDescriptor > 
mHighlightedRoutePointsAnimationDescr
 
VgMyRouteStyler mRouteStyler
 

Additional Inherited Members

- Public Types inherited from VgMyRouteCreator
enum  RoutePoint {
  eStart, eStop0, eStop1, eStop2,
  eStop3, eStop4, eStop5, eStopMax = 7,
  eEnd
}
 The points that a route may have. More...
 

Detailed Description

Provides common operation on routes.

This helper simplifies the task of managing a route and showing/hiding it when changing floors (layers).

IMPLEMENTATION TIPS: In this class, you can configure :

  • The image used for the route.
  • The starting&ending POIs (images, callback etc etc)

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 
)

Constructor.

You can customize the textures here.

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.
Calling this method often will result in poor performance of the map.

Implements VgMyRouteCreator.

void VgMyRoutingHelper::createAndAddRouteMarker ( VgMyRouteCreator::RoutePoint  pPoint,
const VgEngine::VgPosition &  pPosition,
const std::string &  pLayerName 
)
protected

Add a route marker to the map.

Uses a RoutePoint to determine if it is start or end. Uses the position to place the point. Uses the pLayerName to determine which layer to put point, if the pLayerName is empty it will use the altitude of the pPosition to determine the layer. Use the pLayerName to reduce the computation or to select the right layer on maps that have multiple layers at the same height (e.g. multibuilding scenarios)

Parameters
pPointrouting node either start or end
pPositionto place point
pLayerNameoptional layername of point if known.
Version
2.1.2
bool VgMyRoutingHelper::createRouteObjects ( VgEngine::VgConstRefPtr< VgRoutingModule::VgIRoute > const &  pRoute)
virtual

Implementation of interface : VgMyRouteDisplay.

Creates the routes and its associated POIs

You can customize the route display as well as its starting&ending points.

Implements VgMyRouteDisplay.

virtual VgRoutingModule::VgIRoutingNodeParameters* VgMyRoutingHelper::editRoutingNodeParameters ( )
virtual

Returns a reference to the routing node parameters that getRoutingNode for a position uses.

Used for special configurations, for example you may want to use eRoutingNodeOptionsOnEdge and exclude the modality "shuttle" on edges.

Returns
a reference to the routing node parameters to be used on the next getRoutingNode for a position.

Implements VgMyRouteCreator.

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 ( const VgEngine::VgPosition &  pPosition)
protected
std::string VgMyRoutingHelper::getLayerNameOfPlace ( const std::string &  pPlaceId)
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.

VgMyRouteStyler::RouteStyle VgMyRoutingHelper::getRouteStyle ( ) const
virtual

get the current route style

Returns
current route style.

Implements VgMyRouteCreator.

float VgMyRoutingHelper::getRouteWidth ( )
virtual

Returns the current width of the created route.

Returns
The current width in meters

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
bool VgMyRoutingHelper::isPositionRoutable ( const VgEngine::VgPosition &  pPosition)
protected
Returns
true if the pPosition is routable, uses its altitude to figure out floor.
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 std::vector< VgEngine::VgRefPtr< VgRoutingModule::VgIRoutingNode > > &  pDestinations 
)
protected

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

Parameters
pOriginrouting node to start from
pDestinationsarray of at least size 1 of routing nodes.
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::resetRoutingNodeParameters ( )
virtual

Resets the routing node parameters to their initial state.

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

Implementation of interface : VgMyPoiConfigurationSetter.

Implements VgMyPoiConfigurationSetter.

void VgMyRoutingHelper::setRouteMarkerHeight ( float  pHeight)
virtual

Set route marker height.

Adjust so that the marker appears to be anchored to the top of desired surface.

Parameters
pHeightThe height of the route markers in meters.

Implements VgMyRouteCreator.

virtual bool VgMyRoutingHelper::setRoutePoint ( VgMyRouteCreator::RoutePoint  pPoint,
const std::string &  pPlaceID 
)
virtual

Implementation of interface : VgMyRouteCreator.

Implements VgMyRouteCreator.

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

bool VgMyRoutingHelper::setRoutePoint ( RoutePoint  pPoint,
const VgEngine::VgPosition &  pPosition,
const std::string &  pLayerName 
)

Sets a RoutePoint to a position and layer within the map.

Used when the layername for a given position cannot be deduced from its altitude, for example multiple building's.

Parameters
pPointRoutePoint to set
pPositionPosition to associates with pPoint.
pLayerNamewhere the position is, pPosition.mZOrAltitude should be within the minimum and maximum heights for the layer
Version
2.1.2
Returns
False if the pPosition is not routable.
void VgMyRoutingHelper::setRouteStyle ( VgMyRouteStyler::RouteStyle  pRouteStyle,
bool  pRecomputeRoute = true 
)
virtual

Change the routing style of lines generated by the routing helper.

Parameters
pRouteStyleroute style
pRecomputeRoute

Implements VgMyRouteCreator.

void VgMyRoutingHelper::setRouteWidth ( float  pWidth)
virtual

Determines the width of the created route.

Parameters
pWidthThe width of the route in meters

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
bool VgMyRoutingHelper::mIsRouteVisible
protected
VgMyLayerAndCameraHandler* VgMyRoutingHelper::mLayerAndCameraHandler
protected
std::vector< LineObject > VgMyRoutingHelper::mLines
protected
std::list< VgEngine::VgRefPtr< Vg3DModule::VgLink > > VgMyRoutingHelper::mLinks
protected
VgMapModule::VgIMapModule* VgMyRoutingHelper::mMapModule
protected
float VgMyRoutingHelper::mObjectHeightOffset
protected
std::vector< PointObject > VgMyRoutingHelper::mPoints
protected
VgRoutingModule::VgIRouteConverter* VgMyRoutingHelper::mRouteConverter2D
protected
POICallbackMap VgMyRoutingHelper::mRoutePoiCallbacks
protected
std::map<VgMyRouteCreator::RoutePoint, VgEngine::VgRefPtr<VgRoutingModule::VgIRoutingNode> > VgMyRoutingHelper::mRoutePoints
protected
VgRoutingModule::VgIRoutingSolver* VgMyRoutingHelper::mRouteSolver
protected
VgMyRouteStyler::RouteStyle VgMyRoutingHelper::mRouteStyle
protected
VgMyRouteStyler VgMyRoutingHelper::mRouteStyler
protected
float VgMyRoutingHelper::mRouteWidth
protected
VgRoutingModule::VgIRoutingModule* VgMyRoutingHelper::mRoutingModule
protected
VgRoutingModule::VgIRoutingNodeParameters VgMyRoutingHelper::mRoutingNodeParameters
protected
VgRoutingModule::VgIRouteRequestParameters VgMyRoutingHelper::mRoutingRequestParameters
protected
VgMyTextureLoader* VgMyRoutingHelper::mTextureLoader
protected
VgApplication::VgIApplication* VgMyRoutingHelper::mVgApplication
protected

The documentation for this class was generated from the following file:
VisioMove 2.1.5, Visioglobe® 2015