VisioMove-Sample  2.1.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
VgMyPositionTracker Class Reference

Receives location provider events and when position tracking is enabled, will animate the camera to that location. More...

Inheritance diagram for VgMyPositionTracker:
Inheritance graph

Public Types

enum  { ePositionTrackerPosition = 1 << 0, ePositionTrackerHeading = 1 << 1, ePositionTrackerAltitude = 1 << 2, ePositionTrackerPitch = 1 << 3 }
 Flags used to determine the behavior of the tracking camera. More...
 

Public Member Functions

 VgMyPositionTracker (VgApplication::VgIApplication *pVgApplication, VgMyLayerAndCameraHandler *pLayerAndCameraHandler, int pTrackerFlags)
 Constructor. More...
 
 ~VgMyPositionTracker ()
 
void enable ()
 Enable the Position Tracker. More...
 
void disable ()
 Disable the Position Tracker. More...
 
bool isEnabled ()
 
void addPositionTrackerListener (VgMyPositionTrackerListener *pPositionTrackerListener)
 Add a listener to this position tracker. More...
 
void removePositionTrackerListener (VgMyPositionTrackerListener *pPositionTrackerListener)
 Remove a listener to this position tracker. More...
 
double getAltitude ()
 
void setAltitude (double pAltitude)
 Sets the camera's altitude that's used when tracking. More...
 
double getPitch ()
 
void setPitch (double pPitch)
 Sets the camera's pitch that's used when tracking. More...
 
void setPositionOnMap (const double pX, const double pY)
 Sets the screen location where the current position will appear. More...
 
void notifyPositionDidChange (const std::string &pProvider, const VgEngine::VgPosition &pPosition)
 Called when the location has changed. More...
 
void notifyFloorDidChange (const std::string &pProvider, const std::string &pFloor)
 Called when the floor has changed. More...
 
void notifyAccuracyDidChange (const std::string &pProvider, double pAccuracy)
 Called when the accuracy has changed. More...
 
void notifyContextDidChange (const std::string &pProvider, int pContext)
 Called when the context has changed. More...
 
void notifyHeadingDidChange (const std::string &pProvider, double pHeading)
 Called when the heading has changed. More...
 
void notifyStatusDidChange (const std::string &pProvider, int pStatus)
 Called when the status has changed. More...
 
void notifyLocationProviderEnabled (const std::string &pProvider)
 Called when the provider is enabled. More...
 
void notifyLocationProviderDisabled (const std::string &pProvider)
 Called when the provider is disabled. More...
 

Protected Attributes

VgApplication::VgIApplication * mVgApplication
 
VgMyLayerAndCameraHandlermLayerAndCameraHandler
 
VgEngine::VgPosition mCurrentPosition
 
VgEngine::VgPosition mPreviousPosition
 
std::string mCurrentLayer
 
double mCurrentHeading
 
bool mIsEnabled
 
int mTrackerFlags
 
double mOriginalPitch
 The camera's original pitch is recorded in order so that it can be reset when tracking is disabled. More...
 
double mPitch
 The pitch to use when in tracking mode. More...
 
double mAltitude
 The altitude to use when in tracking mode. More...
 
double mXPositionOnMap
 
double mYPositionOnMap
 
VgMyPositionTrackerListenermPositionTrackerListener
 

Additional Inherited Members

- Protected Member Functions inherited from VgMyLocationListener
virtual ~VgMyLocationListener ()
 

Detailed Description

Receives location provider events and when position tracking is enabled, will animate the camera to that location.

Must be registered with VgMyLocationManager before it will receive location notification.

Member Enumeration Documentation

anonymous enum

Flags used to determine the behavior of the tracking camera.

Enumerator
ePositionTrackerPosition 

The camera tracks the location's position.

To determine where the position appears on the screen see VgMyPositionTracker::setPositionOnMap()

ePositionTrackerHeading 

The camera tracks the location's heading.

ePositionTrackerAltitude 

The camera is set to a specified altitude.

To determine the altitude see VgMyPositionTracker::setAltitude

ePositionTrackerPitch 

The camera is set to a specified pitch.

To determine the altitude see VgMyPositionTracker::setPitch IMPORTANT: This feature will not function correctly when used in conjunction with global view.

Constructor & Destructor Documentation

VgMyPositionTracker::VgMyPositionTracker ( VgApplication::VgIApplication *  pVgApplication,
VgMyLayerAndCameraHandler pLayerAndCameraHandler,
int  pTrackerFlags 
)

Constructor.

Parameters
pVgApplicationVgIApplication to use. Can't be NULL
pLayerAndCameraHandlerThe interface which allows this class to manipulate the camera.
pTrackerFlagsDetermines how the camera should behave when a new location is received.
VgMyPositionTracker::~VgMyPositionTracker ( )

Member Function Documentation

void VgMyPositionTracker::addPositionTrackerListener ( VgMyPositionTrackerListener pPositionTrackerListener)

Add a listener to this position tracker.

Parameters
pPositionTrackerListenerThe position tracker listener to add. Currently, only one listener supported. If there is already a position tracking listener, this will override an existing one.
void VgMyPositionTracker::disable ( )

Disable the Position Tracker.

void VgMyPositionTracker::enable ( )

Enable the Position Tracker.

double VgMyPositionTracker::getAltitude ( )
Returns
Retrieves the camera's altitude used when tracking.
double VgMyPositionTracker::getPitch ( )
Returns
Retrieves the camera's pitch used when tracking.
bool VgMyPositionTracker::isEnabled ( )
Returns
The current enabled/disabled state of the position tracker.
void VgMyPositionTracker::notifyAccuracyDidChange ( const std::string &  pProvider,
double  pAccuracy 
)
virtual

Called when the accuracy has changed.

Parameters
pProviderThe location provider responsible for sending the notification.
pAccuracyThe new accuracy

Implements VgMyLocationListener.

void VgMyPositionTracker::notifyContextDidChange ( const std::string &  pProvider,
int  pContext 
)
virtual

Called when the context has changed.

Parameters
pProviderThe location provider responsible for sending the notification.
pContextThe new context

Implements VgMyLocationListener.

void VgMyPositionTracker::notifyFloorDidChange ( const std::string &  pProvider,
const std::string &  pFloor 
)
virtual

Called when the floor has changed.

Parameters
pProviderThe location provider responsible for sending the notification.
pFloorThe new floor

Implements VgMyLocationListener.

void VgMyPositionTracker::notifyHeadingDidChange ( const std::string &  pProvider,
double  pHeading 
)
virtual

Called when the heading has changed.

Heading is the horizontal direction of travel of this device, and is not related to the device orientation.

Parameters
pProviderThe location provider responsible for sending the notification.
pHeadingThe new heading. The valid range for the heading is [0.0, 360.0]. Where 0.0 is North, and increasing values starts towards the East.

Implements VgMyLocationListener.

void VgMyPositionTracker::notifyLocationProviderDisabled ( const std::string &  pProvider)
virtual

Called when the provider is disabled.

Parameters
pProviderThe location provider responsible for sending the notification.

Implements VgMyLocationListener.

void VgMyPositionTracker::notifyLocationProviderEnabled ( const std::string &  pProvider)
virtual

Called when the provider is enabled.

Parameters
pProviderThe location provider responsible for sending the notification.

Implements VgMyLocationListener.

void VgMyPositionTracker::notifyPositionDidChange ( const std::string &  pProvider,
const VgEngine::VgPosition &  pPosition 
)
virtual

Called when the location has changed.

Parameters
pProviderThe location provider responsible for sending the notification
pPositionThe new position

Implements VgMyLocationListener.

void VgMyPositionTracker::notifyStatusDidChange ( const std::string &  pProvider,
int  pStatus 
)
virtual

Called when the status has changed.

Parameters
pProviderThe location provider responsible for sending the notification.
pStatusThe new status. See for available values.

Implements VgMyLocationListener.

void VgMyPositionTracker::removePositionTrackerListener ( VgMyPositionTrackerListener pPositionTrackerListener)

Remove a listener to this position tracker.

Parameters
pPositionTrackerListenerThe position tracker listener to remove.
void VgMyPositionTracker::setAltitude ( double  pAltitude)

Sets the camera's altitude that's used when tracking.

This value is only used if the ePositionTrackerAltitude flag is active.

Parameters
pAltitudeThe altitude to set. If pAltitude falls outside of the manipulator limits, then the limit value will be used.
void VgMyPositionTracker::setPitch ( double  pPitch)

Sets the camera's pitch that's used when tracking.

This value is only used if the ePositionTrackerPitch flag is active. pPitch The pitch value to use when tracking a position. Accepted values are [0.0 to -90.0].

void VgMyPositionTracker::setPositionOnMap ( const double  pX,
const double  pY 
)

Sets the screen location where the current position will appear.

These values are only used when the ePositionTrackerPosition flag is active.

Parameters
pXthe normalized X screen coordinate (0 is on the left of the screen, 1 on the right).
pYthe normalized Y screen coordinate (0 is on the bottom of the screen, 1 on the top).

Member Data Documentation

double VgMyPositionTracker::mAltitude
protected

The altitude to use when in tracking mode.

double VgMyPositionTracker::mCurrentHeading
protected
std::string VgMyPositionTracker::mCurrentLayer
protected
VgEngine::VgPosition VgMyPositionTracker::mCurrentPosition
protected
bool VgMyPositionTracker::mIsEnabled
protected
VgMyLayerAndCameraHandler* VgMyPositionTracker::mLayerAndCameraHandler
protected
double VgMyPositionTracker::mOriginalPitch
protected

The camera's original pitch is recorded in order so that it can be reset when tracking is disabled.

double VgMyPositionTracker::mPitch
protected

The pitch to use when in tracking mode.

VgMyPositionTrackerListener* VgMyPositionTracker::mPositionTrackerListener
protected
VgEngine::VgPosition VgMyPositionTracker::mPreviousPosition
protected
int VgMyPositionTracker::mTrackerFlags
protected
VgApplication::VgIApplication* VgMyPositionTracker::mVgApplication
protected
double VgMyPositionTracker::mXPositionOnMap
protected
double VgMyPositionTracker::mYPositionOnMap
protected

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