Marble

GeoTrackGraphicsItem.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2011 Guillaume Martres <[email protected]>
4 //
5 
6 #include "GeoTrackGraphicsItem.h"
7 
8 #include "GeoDataLineString.h"
9 #include "GeoDataPlacemark.h"
10 #include "GeoDataTrack.h"
11 #include "MarbleDebug.h"
12 #include "StyleBuilder.h"
13 
14 using namespace Marble;
15 
16 GeoTrackGraphicsItem::GeoTrackGraphicsItem(const GeoDataPlacemark *placemark, const GeoDataTrack *track) :
17  GeoLineStringGraphicsItem(placemark, track->lineString())
18 {
19  setTrack( track );
20  if (placemark) {
21  QString const paintLayer = QLatin1String("Track/") + StyleBuilder::visualCategoryName(placemark->visualCategory());
22  setPaintLayers(QStringList() << paintLayer);
23  }
24 }
25 
26 void GeoTrackGraphicsItem::setTrack( const GeoDataTrack* track )
27 {
28  m_track = track;
29  update();
30 }
31 
32 void GeoTrackGraphicsItem::paint(GeoPainter *painter, const ViewportParams *viewport , const QString &layer, int tileZoomLevel)
33 {
34  Q_UNUSED(layer);
35  Q_UNUSED(tileZoomLevel);
36  update();
37  GeoLineStringGraphicsItem::paint(painter, viewport, layer, tileZoomLevel);
38 }
39 
40 void GeoTrackGraphicsItem::update()
41 {
42  setLineString( m_track->lineString() );
43 }
A public class that controls what is visible in the viewport of a Marble map.
GeoDataVisualCategory visualCategory() const
Return the symbol index of the placemark.
Binds a QML item to a specific geodetic location in screen coordinates.
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:88
A geometry for tracking objects made of (time, coordinates) pairs.
Definition: GeoDataTrack.h:50
a class representing a point of interest on the map
void update(Part *part, const QByteArray &data, qint64 dataSize)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.