marble
Routing.cpp
Go to the documentation of this file.
65 connect(d->m_routeRequestModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(updateWaypointItems()));
66 connect(d->m_routeRequestModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(updateWaypointItems()));
67 connect(d->m_routeRequestModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(updateWaypointItems()));
83 Marble::GeoPainter geoPainter(&paintDevice, d->m_marbleMap->viewport(), d->m_marbleMap->mapQuality());
115 QSGGeometry * lineNodeGeo = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), segmentCount*4);
183 for (int i = d->m_waypointItems.keys().size()-1; i >= d->m_routeRequestModel->rowCount(); i--) {
194 const qreal lon = d->m_routeRequestModel->data(d->m_routeRequestModel->index( iter.key() ), RouteRequestModel::LongitudeRole).toFloat();
195 const qreal lat = d->m_routeRequestModel->data(d->m_routeRequestModel->index( iter.key() ), RouteRequestModel::LatitudeRole).toFloat();
196 const bool visible = d->m_marbleMap->viewport()->screenCoordinates(lon * DEG2RAD, lat * DEG2RAD, x, y);
227 if (d->m_searchResultPlacemarks[i]->placemark().coordinate() == placemark->placemark().coordinate()) {
255 for (int i = d->m_searchResultItems.keys().size(); i < d->m_searchResultPlacemarks.size(); i++ ) {
270 for (int i = d->m_searchResultItems.keys().size()-1; i >= d->m_searchResultPlacemarks.size(); i--) {
277 for (int i = 0; i < d->m_searchResultItems.keys().size() && i < d->m_searchResultPlacemarks.size(); i++) {
358 d->m_marbleMap->model()->routingManager()->routeRequest()->setRoutingProfile( d->m_profiles[profile] );
366 return d->m_marbleMap && !d->m_marbleMap->model()->routingManager()->routingModel()->route().path().isEmpty();
371 return d->m_marbleMap && d->m_marbleMap->model()->routingManager()->routingModel()->rowCount() > 0;
376 return d->m_marbleMap == nullptr ? nullptr : d->m_marbleMap->model()->routingManager()->routingModel();
398 request->addVia( Marble::GeoDataCoordinates( lon, lat, 0.0, Marble::GeoDataCoordinates::Degree ) );
407 request->insert(index, Marble::GeoDataCoordinates( lon, lat, 0.0, Marble::GeoDataCoordinates::Degree) );
439 request->setPosition( index, Marble::GeoDataCoordinates( lon, lat, 0.0, Marble::GeoDataCoordinates::Degree ) );
444 request->append( Marble::GeoDataCoordinates( lon, lat, 0.0, Marble::GeoDataCoordinates::Degree ) );
503 QString target = fileName.startsWith( QLatin1String( "file://" ) ) ? fileName.mid( 7 ) : fileName;
505 const Marble::GeoDataDocument *route = routingManager->alternativeRoutesModel()->currentRoute();
507 const Marble::GeoDataLineString* waypoints = Marble::AlternativeRoutesModel::waypoints( route );
521 QString target = fileName.startsWith( QLatin1String( "file://" ) ) ? fileName.mid( 7 ) : fileName;
void routingModelChanged()
void routeRequestModelChanged(RouteRequestModel *routeRequestModel)
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:63
QQmlComponent * waypointDelegate() const
QList< RoutingProfile > profiles() const
Definition: RoutingProfilesModel.cpp:60
void setWaypointDelegate(QQmlComponent *waypointDelegate)
Definition: Routing.cpp:157
void setRoutingProfile(const QString &profile)
Definition: Routing.cpp:353
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:93
This file contains the headers for MarbleModel.
const T & at(int i) const
void insert(int index, const GeoDataCoordinates &coordinates, const QString &name=QString())
Add the given element at the given position.
Definition: RouteRequest.cpp:211
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: RoutingProfilesModel.cpp:35
MarbleMap * marbleMap()
void append(const GeoDataCoordinates &coordinates, const QString &name=QString())
Add the given element to the end.
Definition: RouteRequest.cpp:237
const GeoDataLatLonAltBox & latLonAltBox() const override
Returns the smallest latLonAltBox that contains the LineString.
Definition: GeoDataLineString.cpp:806
void clearSearchResultPlacemarks()
Definition: Routing.cpp:240
int size() const
RoutingProfilesModel * profilesModel()
Provides access to the model which contains all possible routing profiles.
Definition: RoutingManager.cpp:282
bool hasWaypoints() const
Definition: RouteRequestModel.h:21
This file contains the headers for MarbleMap.
void addViaByPlacemarkAtIndex(int index, Placemark *placemark)
Definition: Routing.cpp:421
void hasRouteChanged()
GeoDataCoordinates center() const override
returns the center of this box
Definition: GeoDataLatLonAltBox.cpp:148
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
int addSearchResultPlacemark(Placemark *placemark)
Definition: Routing.cpp:223
void readSettings()
Restores a previously saved route request and route from disk, if any.
Definition: RoutingManager.cpp:501
void hasWaypointsChanged()
void routingProfileChanged()
void deleteLater()
void setGeoDataPlacemark(const Marble::GeoDataPlacemark &placemark)
Definition: Placemark.cpp:31
A LineString that allows to store a contiguous set of line segments.
Definition: GeoDataLineString.h:72
bool hasRoute() const
void loadDefaultProfiles()
Definition: RoutingProfilesModel.cpp:126
Delegates data retrieval and model updates to the appropriate routing provider.
Definition: RoutingManager.h:32
void reserve(int size)
void addViaAtIndex(int index, qreal lon, qreal lat)
Definition: Routing.cpp:403
This file contains the headers for ViewportParams.
QVariant fromValue(const T &value)
void marbleMapChanged()
GeoDataCoordinates coordinate(const QDateTime &dateTime=QDateTime(), bool *iconAtCoordinates=nullptr) const
Return the coordinates of the placemark at time dateTime as a GeoDataCoordinates. ...
Definition: GeoDataPlacemark.cpp:220
const Key key(const T &value) const
QString mid(int position, int n) const
RoutingModel * routingModel()
bool isEmpty() const
Returns whether the LineString has no nodes at all.
Definition: GeoDataLineString.cpp:258
bool isEmpty() const
void swap(int index1, int index2)
Swaps the given elements at the given positions.
Definition: RouteRequest.cpp:225
RouteRequestModel * routeRequestModel()
void loadRoute(const QString &filename)
Opens the given filename (kml format) and loads the route contained in it.
Definition: RoutingManager.cpp:465
void addViaByPlacemark(Placemark *placemark)
Definition: Routing.cpp:412
QSGNode * updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override
Definition: Routing.cpp:77
void waypointDelegateChanged(QQmlComponent *waypointDelegate)
QVector2D normalized() const
qreal longitude(GeoDataCoordinates::Unit unit) const
retrieves the longitude of the GeoDataCoordinates object use the unit parameter to switch between Rad...
Definition: GeoDataCoordinates.cpp:204
void setPosition(int index, const GeoDataCoordinates &position, const QString &name=QString())
Change the value of the element at the given position.
Definition: RouteRequest.cpp:273
qreal latitude(GeoDataCoordinates::Unit unit) const
retrieves the latitude of the GeoDataCoordinates object use the unit parameter to switch between Radi...
Definition: GeoDataCoordinates.cpp:221
int size() const
QString routingProfile() const
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:47
AlternativeRoutesModel * alternativeRoutesModel()
Provides access to the model which contains a list of alternative routes.
Definition: RoutingManager.cpp:450
const T value(const Key &key) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 01:47:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2019 The KDE developers.
Generated on Thu Dec 12 2019 01:47:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.