Skip to content

Class QfNavigation

ClassList > QfNavigation

Inherits the following classes: QObject

Public Properties

Type Name
property double bearing
property QgsPoint destination
property int destinationFeatureCurrentVertex
property int destinationFeatureVertexCount
property QString destinationName
property double distance
property Qgis::DistanceUnit distanceUnits
property bool isActive
property modelChanged QgsPoint location
property QgsQuickMapSettings * mapSettings
property QfNavigationModel * model
property QgsGeometry path
property bool proximityAlarm
property double proximityAlarmThreshold
property double verticalDistance

Public Signals

Type Name
signal void destinationChanged
signal void destinationFeatureCurrentVertexChanged
signal void destinationFeatureVertexCountChanged
signal void destinationNameChanged
signal void detailsChanged
signal void isActiveChanged
signal void locationChanged
signal void mapSettingsChanged
signal void modelChanged
signal void proximityAlarmChanged
signal void proximityAlarmThresholdChanged

Public Functions

Type Name
QfNavigation ()
double bearing () const
Q_INVOKABLE void clear ()
Q_INVOKABLE void clearDestinationFeature ()
QgsPoint destination () const
int destinationFeatureCurrentVertex () const
int destinationFeatureVertexCount () const
QString destinationName () const
double distance () const
Qgis::DistanceUnit distanceUnits () const
bool isActive () const
QgsPoint location () const
QgsQuickMapSettings * mapSettings () const
QfNavigationModel * model () const
Q_INVOKABLE void nextDestinationVertex ()
QgsGeometry path () const
Q_INVOKABLE void previousDestinationVertex ()
bool proximityAlarm () const
double proximityAlarmThreshold () const
void setDestination (const QgsPoint & point)
Q_INVOKABLE void setDestinationFeature (const QgsFeature & feature, QgsVectorLayer * layer)
void setLocation (const QgsPoint & point)
void setMapSettings (QgsQuickMapSettings * mapSettings)
void setProximityAlarm (const bool enabled)
void setProximityAlarmThreshold (const double & threshold)
double verticalDistance () const
~QfNavigation ()

Public Properties Documentation

property bearing [1/2]

double QfNavigation::bearing;

property destination [1/2]

QgsPoint QfNavigation::destination;

property destinationFeatureCurrentVertex [1/2]

int QfNavigation::destinationFeatureCurrentVertex;

property destinationFeatureVertexCount [1/2]

int QfNavigation::destinationFeatureVertexCount;

property destinationName [1/2]

QString QfNavigation::destinationName;

property distance [1/2]

double QfNavigation::distance;

property distanceUnits [1/2]

Qgis::DistanceUnit QfNavigation::distanceUnits;

property isActive [1/2]

bool QfNavigation::isActive;

property location [1/2]

modelChanged QgsPoint QfNavigation::location;

property mapSettings [1/2]

QgsQuickMapSettings * QfNavigation::mapSettings;

property model [1/2]

QfNavigationModel * QfNavigation::model;

property path [1/2]

QgsGeometry QfNavigation::path;

property proximityAlarm [1/2]

bool QfNavigation::proximityAlarm;

property proximityAlarmThreshold [1/2]

double QfNavigation::proximityAlarmThreshold;

property verticalDistance [1/2]

double QfNavigation::verticalDistance;

Public Signals Documentation

signal destinationChanged

void QfNavigation::destinationChanged;

signal destinationFeatureCurrentVertexChanged

void QfNavigation::destinationFeatureCurrentVertexChanged;

signal destinationFeatureVertexCountChanged

void QfNavigation::destinationFeatureVertexCountChanged;

signal destinationNameChanged

void QfNavigation::destinationNameChanged;

signal detailsChanged

void QfNavigation::detailsChanged;

signal isActiveChanged

void QfNavigation::isActiveChanged;

signal locationChanged

void QfNavigation::locationChanged;

signal mapSettingsChanged

void QfNavigation::mapSettingsChanged;

signal modelChanged

void QfNavigation::modelChanged;

signal proximityAlarmChanged

void QfNavigation::proximityAlarmChanged;

signal proximityAlarmThresholdChanged

void QfNavigation::proximityAlarmThresholdChanged;

Public Functions Documentation

function QfNavigation

QfNavigation::QfNavigation () 

function bearing [2/2]

inline double QfNavigation::bearing () const

Returns the bearing between the current location and the destination points


function clear

Q_INVOKABLE void QfNavigation::clear () 

Clears any existing destination point and feature.


function clearDestinationFeature

Q_INVOKABLE void QfNavigation::clearDestinationFeature () 

Clears the current destination feature, as well as the current destination point.


function destination [2/2]

QgsPoint QfNavigation::destination () const

Returns the current destination point.


function destinationFeatureCurrentVertex [2/2]

int QfNavigation::destinationFeatureCurrentVertex () const

Returns the current focused vertex serving as destination point when a feature is used as destination.

Note:

for line and polygon geometries, vertex '0' represents the centroid of the geometry while it presents the first (or only) vertex in point geometries


function destinationFeatureVertexCount [2/2]

int QfNavigation::destinationFeatureVertexCount () const

Returns the vertex count available to cycle through as destination points when a feature is used as destination.


function destinationName [2/2]

QString QfNavigation::destinationName () const

Returns the current destination name.

See also: setDestinationFeature


function distance [2/2]

inline double QfNavigation::distance () const

Returns the 2D distance between the current location and the destination points


function distanceUnits [2/2]

inline Qgis::DistanceUnit QfNavigation::distanceUnits () const

Returns the distance unit used


function isActive [2/2]

bool QfNavigation::isActive () const

Returns TRUE when navigation is active.


function location [2/2]

QgsPoint QfNavigation::location () const

Returns the current location point.


function mapSettings [2/2]

inline QgsQuickMapSettings * QfNavigation::mapSettings () const

Returns the map settings object used to project points and calculate navigation details.


function model [2/2]

inline QfNavigationModel * QfNavigation::model () const

Returns the navigation model containing the destination point.

Note:

In the future, the model could contain intermediary stops


function nextDestinationVertex

Q_INVOKABLE void QfNavigation::nextDestinationVertex () 

Sets the destination point to the next vertex or centroid of the current destination feature.

Note:

if a destination feature has not been provided, calling this function does nothing


function path [2/2]

inline QgsGeometry QfNavigation::path () const

Returns the path between the current location and the destination points


function previousDestinationVertex

Q_INVOKABLE void QfNavigation::previousDestinationVertex () 

Sets the destination point to the previous vertex or centroid of the current destination feature.

Note:

if a destination feature has not been provided, calling this function does nothing


function proximityAlarm [2/2]

inline bool QfNavigation::proximityAlarm () const

Returns TRUE if the proximity alarm is enabled.


function proximityAlarmThreshold [2/2]

inline double QfNavigation::proximityAlarmThreshold () const

Returns the current distance threshold below which the proximity alarm will turn on when enabled.


function setDestination

void QfNavigation::setDestination (
    const QgsPoint & point
) 

Sets the current destination point.


function setDestinationFeature

Q_INVOKABLE void QfNavigation::setDestinationFeature (
    const QgsFeature & feature,
    QgsVectorLayer * layer
) 

Sets a provided feature as navigation destination, which allows for users to cycle through the feature centroid and its individual vertices as destination point.

Parameters:

  • feature the feature used as destination
  • layer the vector layer associated to the feature

function setLocation

void QfNavigation::setLocation (
    const QgsPoint & point
) 

Sets the current location point.

Note:

A null/empty geometry will be threated as a lack of available location information


function setMapSettings

void QfNavigation::setMapSettings (
    QgsQuickMapSettings * mapSettings
) 

Sets the map settings object used to project points and calculate navigation details.


function setProximityAlarm

void QfNavigation::setProximityAlarm (
    const bool enabled
) 

Sets whether the proximity alarm is enabled.


function setProximityAlarmThreshold

void QfNavigation::setProximityAlarmThreshold (
    const double & threshold
) 

Sets the distance threshold below which the proximity alarm will turn on when enabled. Once the distance threshold is met, the alarm sound will loop at a varying interval based on the distance between the device's current location and the destination. The closer to the destination, the shorter the interval.


function verticalDistance [2/2]

inline double QfNavigation::verticalDistance () const

Retuens the vertical distance between the current location and the destination points

Note:

if either points miss a Z value, the returned vertical distance value will be NaN


function ~QfNavigation

QfNavigation::~QfNavigation () 


The documentation for this class was generated from the following file src/core/qfnavigation.h