com.visioglobe.libVisioDevKit
Class VgINavigation

java.lang.Object
  extended by com.visioglobe.libVisioDevKit.VgReferenced
      extended by com.visioglobe.libVisioDevKit.VgINavigation

public class VgINavigation
extends VgReferenced

VgINavigation represents a Navigation object


Field Summary
 
Fields inherited from class com.visioglobe.libVisioDevKit.VgReferenced
swigCMemOwn, swigRefPtr
 
Constructor Summary
VgINavigation(long cPtr, boolean cMemoryOwn)
          Constructor.
 
Method Summary
 void addListener(VgINavigationListenerRefPtr pListener)
          Adds a listener to the navgiation object.
 void delete()
           
protected  void finalize()
           
 VgPosition getClosestPositionOnRoute()
          Calculates the closest position on the route, given the current position (VgINavigation::getCurrentPosition()).
static long getCPtr(VgINavigation obj)
           
 long getCurrentInstructionIndex()
          Gets the index of the active instruction.
 VgPosition getCurrentPosition()
          Gets the last position that was notified.
 double getDistanceFromRoute()
          Gets the distance between current position (VgINavigation::getCurrentPosition()) and closest position on route
 VgINavigationInstructionConstRefPtr getInstruction(long pIndex)
          Gets a navigation instruction
 double getInstructionGeofenceDistance()
          Gets the distance in meters of the threshold when to switch instructions.
 long getNumInstructions()
          Gets the number of navigation instructions
 VgINavigationRequestParameters getRequestParameters()
           
 void removeListener(VgINavigationListenerRefPtr pListener)
          Removes a listener from the navigation object.
 void setInstructionGeofenceDistance(double pDistanceInMeters)
          Sets the distance in meters of the threshold when to switch instructions.
 void updateCurrentPosition(VgPosition pPosition, double pTime)
          Injects new position.
 
Methods inherited from class com.visioglobe.libVisioDevKit.VgReferenced
getCPtr, getNbReferences, ref, unref
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VgINavigation

public VgINavigation(long cPtr,
                     boolean cMemoryOwn)
Constructor.

Method Detail

getCPtr

public static long getCPtr(VgINavigation obj)

finalize

protected void finalize()
Overrides:
finalize in class VgReferenced

delete

public void delete()
Overrides:
delete in class VgReferenced

addListener

public void addListener(VgINavigationListenerRefPtr pListener)
Adds a listener to the navgiation object.

Parameters:
pListener - The navigation listener to be added.

removeListener

public void removeListener(VgINavigationListenerRefPtr pListener)
Removes a listener from the navigation object.

Parameters:
pListener - The navigation listener to be removed.

getInstruction

public VgINavigationInstructionConstRefPtr getInstruction(long pIndex)
Gets a navigation instruction

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

getNumInstructions

public long getNumInstructions()
Gets the number of navigation instructions

Returns:
Number of instructions

updateCurrentPosition

public void updateCurrentPosition(VgPosition pPosition,
                                  double pTime)
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:
pPosition - The new current position.
pTime - Time of the position capture. If unknown, use 0.
Remark:
this called should be done on the main thread as the SDK is not thread-safe and the VgINavigationListener::notifyPositionUpdated() might interact with the engine as well. see FAQ.

getCurrentPosition

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

getCurrentInstructionIndex

public long 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

getClosestPositionOnRoute

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

Returns:
Position on route.

getDistanceFromRoute

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

Returns:
Distance in meters from route.

setInstructionGeofenceDistance

public void setInstructionGeofenceDistance(double pDistanceInMeters)
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.

Parameters:
pDistanceInMeters - Radius distance in meters.
Note:
This function should be called at the moment the application is notified of the result of a navigation computation.

getInstructionGeofenceDistance

public double getInstructionGeofenceDistance()
Gets the distance in meters of the threshold when to switch instructions.

Returns:
the radius distance in meters.

getRequestParameters

public VgINavigationRequestParameters getRequestParameters()
Returns:
the NavigationRequest parameters with which the request was made.

VisioDevKit 2.0, Visioglobe® 2013