iVS3D v2.0.0
Loading...
Searching...
No Matches
MapHandler Class Reference

The MapHandler is used to handel the qml map. More...

#include <maphandler.h>

Inheritance diagram for MapHandler:

Signals

void circleSignal (const QGeoCoordinate &coordinate, QString name, bool used)
 circleSignal Used to create points on the map at the given coordinate
 
void adjustMap (const QGeoCoordinate &coordinate)
 adjustMap Used to center the map at the given coordinate
 
void createPolyline (const QGeoCoordinate &coordinate)
 emitCreatePolyline Used to add points to the static polyline on the map (And will set the polyline visible)
 
void setMapSelect (const QGeoPath &path)
 emitSetMapSelect Used to updated the current user selected polygon on the map
 
void setPoint (const int index, bool used)
 emitSetPoint Used to update a points oppacity
 
void getMapItems ()
 getMapItems Used to signal that the map needs to return the current map items
 
void gpsClicked (QPointF gpsPoint, bool used)
 gpsClicked Signal emitted when a gps points has been clicked
 
void gpsSelected (QPolygonF polyF)
 gpsSelected Signal emitted when a new polygon has been selected
 

Public Member Functions

void addPoints (const QList< QPair< QPointF, bool > > &m_gpsData)
 addPoints Adds all given gps values as points on the map
 
void emitCircleSignal (const QGeoCoordinate &coordinate, QString name, bool used)
 emitCircleSignal Method to emit the corresponding signal
 
void emitAdjustMapCenter (const QGeoCoordinate &coordinate)
 emitAdjustMapCenter Method to emit the corresponding signal
 
void emitCreatePolyline (const QGeoCoordinate &coordinate)
 emitCreatePolyline method to emit the corresponding signal
 
void emitSetMapSelect (const QGeoPath &path)
 emitSetMapSelect Method to emit the corresponding signal
 
void emitSetPoint (const int index, bool used)
 emitSetPoint Method to emit the corresponding signal
 
void emitGetMapItems ()
 emitGetMapItems Method to emit the corresponding signal
 
void drawGpsDataOnMap ()
 draw GPS data onto map.
 

Private Member Functions

void newMapItems ()
 
QPolygonF geoPolyToPolyF ()
 Converts the current QGeoPolygon to QPolygonF.
 
QList< QLineF > geoPolyToLineList ()
 
QPointF pointAtGeo (int index)
 Return the QPointF of the current QGeoPolygon at the given index.
 
QPointF minDistance (QPointF A, QPointF B, QPointF newPoint)
 

Private Attributes

QMap< QPointF, bool > mGpsMap
 GPS points used or not.
 
QList< QPointF > mOrderedGpsList
 List of GPS data in the order of acquisition.
 
QGeoPolygon mPolygon
 The current polygon.
 
QSet< QPointF > mChangedPoints
 Save points that have been change with a new polygon.
 
QMap< QPointF, int > mMapItems
 Used to save the item list from the qml map.
 

Detailed Description

The MapHandler is used to handel the qml map.

Author
Daniel Brommer
Boitumelo Ruf

Member Function Documentation

◆ adjustMap

void MapHandler::adjustMap ( const QGeoCoordinate &  coordinate)
signal

adjustMap Used to center the map at the given coordinate

Parameters
coordinateCenter coordinate

◆ circleSignal

void MapHandler::circleSignal ( const QGeoCoordinate &  coordinate,
QString  name,
bool  used 
)
signal

circleSignal Used to create points on the map at the given coordinate

Parameters
coordinateWhere to place the point
nameObjectName of the point
usedtrue if the point is used false otherwise

◆ createPolyline

void MapHandler::createPolyline ( const QGeoCoordinate &  coordinate)
signal

emitCreatePolyline Used to add points to the static polyline on the map (And will set the polyline visible)

Parameters
coordinateNew coordinate added to the polyline

◆ emitAdjustMapCenter()

void MapHandler::emitAdjustMapCenter ( const QGeoCoordinate &  coordinate)
inline

emitAdjustMapCenter Method to emit the corresponding signal

Parameters
coordinateCenter coordinate

◆ emitCircleSignal()

void MapHandler::emitCircleSignal ( const QGeoCoordinate &  coordinate,
QString  name,
bool  used 
)
inline

emitCircleSignal Method to emit the corresponding signal

Parameters
coordinateWhere to place the point
nameObjectName of the point
usedtrue if the point is used false otherwise

◆ emitCreatePolyline()

void MapHandler::emitCreatePolyline ( const QGeoCoordinate &  coordinate)
inline

emitCreatePolyline method to emit the corresponding signal

Parameters
coordinateNew coordinate added to the polyline

◆ emitSetMapSelect()

void MapHandler::emitSetMapSelect ( const QGeoPath &  path)
inline

emitSetMapSelect Method to emit the corresponding signal

Parameters
pathQGeoPath with the perimeter of the current polygon

◆ emitSetPoint()

void MapHandler::emitSetPoint ( const int  index,
bool  used 
)
inline

emitSetPoint Method to emit the corresponding signal

Parameters
indexIndex of the point based on the list of map items from the qml map
usedtrue if the point is used false otherwise

◆ geoPolyToLineList()

QList< QLineF > MapHandler::geoPolyToLineList ( )
private

Disassembles the GeoPolygon to a List of lines (excluding the automatic last line to the start)

◆ gpsClicked

void MapHandler::gpsClicked ( QPointF  gpsPoint,
bool  used 
)
signal

gpsClicked Signal emitted when a gps points has been clicked

Parameters
gpsPointPosition of the point
usedtrue if the point is used AFTER the click false otherwise

◆ gpsSelected

void MapHandler::gpsSelected ( QPolygonF  polyF)
signal

gpsSelected Signal emitted when a new polygon has been selected

Parameters
polyFThe perimeter of the current polygon

◆ minDistance()

QPointF MapHandler::minDistance ( QPointF  A,
QPointF  B,
QPointF  newPoint 
)
private

returns QPoint with x = min distance from line segment (a,b) to newPoint; y = t with nearest point to newPoint at A+t*(B-A)

◆ newMapItems()

void MapHandler::newMapItems ( )
private

Used to update the polygon on the map, signal the gps class the new polygon and change opacity of changed points on the map

◆ setMapSelect

void MapHandler::setMapSelect ( const QGeoPath &  path)
signal

emitSetMapSelect Used to updated the current user selected polygon on the map

Parameters
pathQGeoPath with the perimeter of the current polygon

◆ setPoint

void MapHandler::setPoint ( const int  index,
bool  used 
)
signal

emitSetPoint Used to update a points oppacity

Parameters
indexIndex of the point based on the list of map items from the qml map
usedtrue if the point is used false otherwise

The documentation for this class was generated from the following files: