VisioMove SDK (Android)  2.1.22
 All Classes Functions Variables Pages
VgINavigationConstRefPtr Class Reference

Public Member Functions

 VgINavigationConstRefPtr ()
 
 VgINavigationConstRefPtr (VgINavigation pPointer)
 
 VgINavigationConstRefPtr (VgINavigationConstRefPtr pConstRefPtr)
 
VgINavigationConstRefPtr set (VgINavigation pPointer)
 
VgINavigation __ref__ ()
 
VgINavigation __deref__ ()
 
VgINavigation get ()
 
boolean isValid ()
 
VgINavigationInstructionConstRefPtr getInstruction (long pIndex)
 
long getNumInstructions ()
 
VgPosition getCurrentPosition ()
 
long getCurrentInstructionIndex ()
 
VgPosition getClosestPositionOnRoute ()
 
double getDistanceFromRoute ()
 
long getCurrentInstructionClosestPositionNextSubIndex ()
 
double getInstructionGeofenceDistance ()
 
VgINavigationRequestParameters getRequestParameters ()
 
void ref ()
 
int unref ()
 
int getNbReferences ()
 

Static Public Member Functions

static VgINavigationConstRefPtr getNull ()
 

Detailed Description

VgINavigation represents a Navigation object

Constructor & Destructor Documentation

VgINavigationConstRefPtr.VgINavigationConstRefPtr ( )
VgINavigationConstRefPtr.VgINavigationConstRefPtr ( VgINavigation  pPointer)
VgINavigationConstRefPtr.VgINavigationConstRefPtr ( VgINavigationConstRefPtr  pConstRefPtr)

Member Function Documentation

VgINavigation VgINavigationConstRefPtr.__deref__ ( )
VgINavigation VgINavigationConstRefPtr.__ref__ ( )
VgINavigation VgINavigationConstRefPtr.get ( )
VgPosition VgINavigationConstRefPtr.getClosestPositionOnRoute ( )

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.
See also
VgRoutingModule::VgIRoutingSolver::getRoutingNode
VgRoutingModule::VgIRoutingNode::getPosition
Returns
Position on route, if no position has been injected, it will return the first position of the navigation.
long VgINavigationConstRefPtr.getCurrentInstructionClosestPositionNextSubIndex ( )

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();
VgEngine::VgConstRefPtr< VgNavigationModule::VgINavigationInstruction > mInstruction;
mInstruction = pNavigation->getInstruction(lCurrentInstructnionIndex);
VgEngine::VgPosition lClosestPosition = pNavigation->getClosestPositionOnRoute();
const std::vector<VgEngine::VgPosition>& lInstructionPositions = mInstruction->getInstructionPositions();
VgEngine::VgRefPtr< Vg3DModule::VgLineDescriptor > lCurrentLD = Vg3DModule::VgLineDescriptor::create();
// 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)
}
Version
2.1.3
Returns
the index of the next position in VgINavigationInstruction::getInstructionPositions after the getClosestPositionOnRoute(). Initial value is 1, maximum value is currentInstruction getPositions().size()
long VgINavigationConstRefPtr.getCurrentInstructionIndex ( )

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.
VgPosition VgINavigationConstRefPtr.getCurrentPosition ( )

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

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

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

Since
2.1.3 Updated default value when it has not been initialized.
Returns
Distance in meters from route. If no position has been injected, it will return 0.
VgINavigationInstructionConstRefPtr VgINavigationConstRefPtr.getInstruction ( long  pIndex)

Gets a navigation instruction

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

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

Returns
the radius distance in meters. Default value is 2.5 meters
int VgINavigationConstRefPtr.getNbReferences ( )
static VgINavigationConstRefPtr VgINavigationConstRefPtr.getNull ( )
static
long VgINavigationConstRefPtr.getNumInstructions ( )

Gets the number of navigation instructions

Returns
Number of instructions
VgINavigationRequestParameters VgINavigationConstRefPtr.getRequestParameters ( )
Version
2.1.8 cleared mCallback to avoid possible circular dependencies.
Returns
the NavigationRequest parameters with which the request was made, without the callback.
boolean VgINavigationConstRefPtr.isValid ( )
void VgINavigationConstRefPtr.ref ( )
VgINavigationConstRefPtr VgINavigationConstRefPtr.set ( VgINavigation  pPointer)
int VgINavigationConstRefPtr.unref ( )

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