VisioMove SDK (iOS)  2.1.22
VgNavigationModule::VgINavigation Class Referenceabstract
Inheritance diagram for VgNavigationModule::VgINavigation:
Inheritance graph

Public Member Functions

virtual ~VgINavigation ()
 
virtual void addListener (VgEngine::VgRefPtr< VgINavigationListener >const &pListener)=0
 
virtual void removeListener (VgEngine::VgRefPtr< VgINavigationListener >const &pListener)=0
 
virtual VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstructiongetInstruction (unsigned int pIndex) const =0
 
virtual const unsigned int getNumInstructions () const =0
 
virtual void updateCurrentPosition (const VgEngine::VgPosition &pPosition, double pTime)=0
 
virtual const VgEngine::VgPositiongetCurrentPosition () const =0
 
virtual unsigned int getCurrentInstructionIndex () const =0
 
virtual const VgEngine::VgPositiongetClosestPositionOnRoute () const =0
 
virtual double getDistanceFromRoute () const =0
 
virtual unsigned int getCurrentInstructionClosestPositionNextSubIndex () const =0
 
virtual void setInstructionGeofenceDistance (double pDistanceInMeters)=0
 
virtual double getInstructionGeofenceDistance () const =0
 
virtual const VgINavigationRequestParametersgetRequestParameters () const =0
 
- Public Member Functions inherited from VgEngine::VgReferenced
 VgReferenced ()
 
 VgReferenced (const VgReferenced &pThis)
 
virtual ~VgReferenced ()
 
VgReferencedoperator= (const VgReferenced &pThis)
 
void ref () const
 
int unref () const
 
int getNbReferences () const
 

Protected Member Functions

 VgINavigation ()
 

Additional Inherited Members

- Protected Attributes inherited from VgEngine::VgReferenced
int mNbReferences
 

Detailed Description

VgINavigation represents a Navigation object

Constructor & Destructor Documentation

VgNavigationModule::VgINavigation::VgINavigation ( )
inlineprotected

Constructor.

Member Function Documentation

virtual void VgNavigationModule::VgINavigation::addListener ( VgEngine::VgRefPtr< VgINavigationListener >const &  pListener)
pure virtual

Adds a listener to the navgiation object. If the listener already exists, it does not add it.

Parameters
pListenerThe navigation listener to be added.

Referenced by ~VgINavigation().

virtual const VgEngine::VgPosition& VgNavigationModule::VgINavigation::getClosestPositionOnRoute ( ) const
pure virtual

Calculates the closest position on the route, given the current position (VgINavigation::getCurrentPosition()).

Note
you can use VgRoutingModule::VgIRoutingSolver::getRoutingNode and VgRoutingModule::VgIRoutingNode::getPosition to obtain the position on the routing network where there is no navigation.
Returns
Position on route, if no position has been injected, it will return the first position of the navigation.
See also
VgRoutingModule::VgIRoutingSolver::getRoutingNode
VgRoutingModule::VgIRoutingNode::getPosition

Referenced by ~VgINavigation().

virtual unsigned int VgNavigationModule::VgINavigation::getCurrentInstructionClosestPositionNextSubIndex ( ) const
pure virtual

Used to determine where on the current instruction the closest position on route is.

// Example how to draw a line while doing a Navigation from the closest position on the route to the end of the current instruction
//
void MyDrawNavigationListener::notifyPositionUpdated (VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigation >
const& pNavigation
const VgEngine::VgPosition &,double)
{
// hide previous line
...
unsigned int lNbInstructions = pNavigation->getNumInstructions();
unsigned int lCurrentInstructnionIndex = pNavigation->getCurrentInstructionIndex();
// This is the next index on the current instruction positions after the closest position.
unsigned int lPositionNextSubIndex = pNavigation->getCurrentInstructionClosestPositionNextSubIndex();
mInstruction = pNavigation->getInstruction(lCurrentInstructnionIndex);
VgEngine::VgPosition lClosestPosition = pNavigation->getClosestPositionOnRoute();
const std::vector<VgEngine::VgPosition>& lInstructionPositions = mInstruction->getInstructionPositions();
// Push closest position
lClosestPosition.mZOrAltitude = lLineAltitude;
lCurrentLD->mPositions.push_back(lClosestPosition);
// For each position, flatten height, and add it to line descriptor
std::vector<VgEngine::VgPosition>::const_iterator lPosIter;
for (lPosIter = (lInstructionPositions.begin() + lPositionNextSubIndex);
lPosIter != lInstructionPositions.end();
++lPosIter)
{
VgEngine::VgPosition lPosition = *lPosIter;
lPosition.mZOrAltitude = lLineAltitude;
lCurrentLD->mPositions.push_back(lPosition);
}
// Complete the line descriptor e.g. color and width information
// Instantiate the line descriptor, and show it (set its layer)
}
Returns
the index of the next position in VgINavigationInstruction::getInstructionPositions after the getClosestPositionOnRoute(). Initial value is 1, maximum value is currentInstruction getPositions().size()
Version
2.1.3

Referenced by ~VgINavigation().

virtual unsigned int VgNavigationModule::VgINavigation::getCurrentInstructionIndex ( ) const
pure virtual

Gets the index of the active instruction. The value will be the same as the last value given by VgINavigationListener::notifyNewInstruction().

Returns
The index of the active instruction, initial value is 0.

Referenced by ~VgINavigation().

virtual const VgEngine::VgPosition& VgNavigationModule::VgINavigation::getCurrentPosition ( ) const
pure virtual

Gets the last position that was notified. This value will be the same as the last value given by VgINavigationListener::notifyPositionUpdated().

Returns
Last injected position, if no position has been injected, it will return the first position of the navigation.
Since
2.1.3 Updated default value when it has not been initialized.

Referenced by ~VgINavigation().

virtual double VgNavigationModule::VgINavigation::getDistanceFromRoute ( ) const
pure virtual

Gets the distance between current position (VgINavigation::getCurrentPosition()) and closest position on route

Returns
Distance in meters from route. If no position has been injected, it will return 0.
Since
2.1.3 Updated default value when it has not been initialized.

Referenced by ~VgINavigation().

virtual VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > VgNavigationModule::VgINavigation::getInstruction ( unsigned int  pIndex) const
pure virtual

Gets a navigation instruction

Parameters
pIndexindex of instruction
Returns
Instruction with index pIndex, or NULL if pIndex >+ VgINavigation::getNumInstructions ()

Referenced by ~VgINavigation().

virtual double VgNavigationModule::VgINavigation::getInstructionGeofenceDistance ( ) const
pure virtual

Gets the distance in meters of the threshold when to switch instructions.

Returns
the radius distance in meters. Default value is 2.5 meters

Referenced by ~VgINavigation().

virtual const unsigned int VgNavigationModule::VgINavigation::getNumInstructions ( ) const
pure virtual

Gets the number of navigation instructions

Returns
Number of instructions

Referenced by ~VgINavigation().

virtual const VgINavigationRequestParameters& VgNavigationModule::VgINavigation::getRequestParameters ( ) const
pure virtual
Returns
the NavigationRequest parameters with which the request was made, without the callback.
Version
2.1.8 cleared mCallback to avoid possible circular dependencies.

Referenced by ~VgINavigation().

virtual void VgNavigationModule::VgINavigation::removeListener ( VgEngine::VgRefPtr< VgINavigationListener >const &  pListener)
pure virtual

Removes a listener from the navigation object.

Parameters
pListenerThe navigation listener to be removed.

Referenced by ~VgINavigation().

virtual void VgNavigationModule::VgINavigation::setInstructionGeofenceDistance ( double  pDistanceInMeters)
pure virtual

Sets the distance in meters of the threshold when to switch instructions. this number is a function of the accuracy of the position information. If too large, instructions will switch rapidly, if too small, instructions will not change.

Note
This function should be called at the moment the application is notified of the result of a navigation computation.
Parameters
pDistanceInMetersRadius distance in meters. Initial value is 2.5 meters.

Referenced by ~VgINavigation().

virtual void VgNavigationModule::VgINavigation::updateCurrentPosition ( const VgEngine::VgPosition pPosition,
double  pTime 
)
pure virtual

Injects new position. This will trigger a VgINavigationListener::notifyPositionUpdated() event. This method can be used to connect a location provider service to the navigation object.

Parameters
pPositionThe new current position. The attribute mZOrAltitude of this parameter will be used to determine the corresponding layer within the map. In order for pPosition to be valid it must fall within the boundary of the map (VgEngine::VgIDatabaseDatasetDescriptor) and the mZOrAltitude must fall within a layer range (VgMapModule::VgIMapModule::getHeightRangeForLayer)
pTimeTime of the position capture. Will be used when notifying any registered navigation listeners, (VgNavigationModule::VgINavigationListener::notifyPositionUpdated). If unknown, use 0.
Remarks
This method must be called within the GL Thread. The SDK is not thread-safe and the resulting call to VgINavigationListener::notifyPositionUpdated() might interact with the engine.

Referenced by ~VgINavigation().


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