VisioMove  2.1.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends Pages
VgNavigationModule::VgINavigation Class Referenceabstract

VgINavigation represents a Navigation object. More...

Inheritance diagram for VgNavigationModule::VgINavigation:
Inheritance graph

Public Member Functions

virtual ~VgINavigation ()
 Destructor. More...
 
virtual void addListener (VgEngine::VgRefPtr< VgINavigationListener >const &pListener)=0
 Adds a listener to the navgiation object. More...
 
virtual void removeListener (VgEngine::VgRefPtr< VgINavigationListener >const &pListener)=0
 Removes a listener from the navigation object. More...
 
virtual
VgEngine::VgConstRefPtr
< VgNavigationModule::VgINavigationInstruction
getInstruction (unsigned int pIndex) const =0
 Gets a navigation instruction. More...
 
virtual const unsigned int getNumInstructions () const =0
 Gets the number of navigation instructions. More...
 
virtual void updateCurrentPosition (const VgEngine::VgPosition &pPosition, double pTime)=0
 Injects new position. More...
 
virtual const
VgEngine::VgPosition
getCurrentPosition () const =0
 Gets the last position that was notified. More...
 
virtual unsigned int getCurrentInstructionIndex () const =0
 Gets the index of the active instruction. More...
 
virtual const
VgEngine::VgPosition
getClosestPositionOnRoute () const =0
 Calculates the closest position on the route, given the current position (VgINavigation::getCurrentPosition()). More...
 
virtual double getDistanceFromRoute () const =0
 Gets the distance between current position (VgINavigation::getCurrentPosition()) and closest position on route. More...
 
virtual unsigned int getCurrentInstructionClosestPositionNextSubIndex () const =0
 Used to determine where on the current instruction the closest position on route is. More...
 
virtual void setInstructionGeofenceDistance (double pDistanceInMeters)=0
 Sets the distance in meters of the threshold when to switch instructions. More...
 
virtual double getInstructionGeofenceDistance () const =0
 Gets the distance in meters of the threshold when to switch instructions. More...
 
virtual const
VgINavigationRequestParameters
getRequestParameters () const =0
 
- Public Member Functions inherited from VgEngine::VgReferenced
 VgReferenced ()
 Constructor. More...
 
 VgReferenced (const VgReferenced &pThis)
 Copy constructor. More...
 
virtual ~VgReferenced ()
 Destructor. More...
 
VgReferencedoperator= (const VgReferenced &pThis)
 Assignment operator. More...
 
void ref () const
 This method is used to add a reference to this object. More...
 
int unref () const
 This method is used to remove a reference to this object. More...
 
int getNbReferences () const
 Retrieves the number of references to this object. More...
 

Protected Member Functions

 VgINavigation ()
 Constructor. More...
 

Additional Inherited Members

- Protected Attributes inherited from VgEngine::VgReferenced
int mNbReferences
 The number of references to this object. More...
 

Detailed Description

VgINavigation represents a Navigation object.

Constructor & Destructor Documentation

VgNavigationModule::VgINavigation::VgINavigation ( )
inlineprotected

Constructor.

virtual VgNavigationModule::VgINavigation::~VgINavigation ( )
inlinevirtual

Destructor.

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.
virtual const VgEngine::VgPosition& VgNavigationModule::VgINavigation::getClosestPositionOnRoute ( ) const
pure virtual

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

Returns
Position on route, if no position has been injected, it will return the first position of the navigation.
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
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.
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.
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.
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 ()
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
virtual const unsigned int VgNavigationModule::VgINavigation::getNumInstructions ( ) const
pure virtual

Gets the number of navigation instructions.

Returns
Number of instructions
virtual const VgINavigationRequestParameters& VgNavigationModule::VgINavigation::getRequestParameters ( ) const
pure virtual
Returns
the NavigationRequest parameters with which the request was made.
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.
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.
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.

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