Marble

GeoDataOverlay.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#include "GeoDataOverlay.h"
7#include "GeoDataOverlay_p.h"
8
9namespace Marble {
10
11GeoDataOverlay::GeoDataOverlay()
12 : GeoDataFeature(new GeoDataOverlayPrivate)
13{
14 // nothing to do
15}
16
17GeoDataOverlay::GeoDataOverlay(const GeoDataOverlay &other)
18 : GeoDataFeature(other, new GeoDataOverlayPrivate(*other.d_func()))
19{
20 // nothing to do
21}
22
23GeoDataOverlay::GeoDataOverlay(GeoDataOverlayPrivate *priv)
24 : GeoDataFeature(priv)
25{
26}
27
28GeoDataOverlay::GeoDataOverlay(const GeoDataOverlay& other, GeoDataOverlayPrivate *priv)
29 : GeoDataFeature(other, priv)
30{
31}
32
33GeoDataOverlay::~GeoDataOverlay()
34{
35}
36
37GeoDataOverlay &GeoDataOverlay::operator=( const GeoDataOverlay &other )
38{
39 if (this != &other) {
40 Q_D(GeoDataOverlay);
41 *d = *other.d_func();
42 }
43
44 return *this;
45}
46
47QColor GeoDataOverlay::color() const
48{
49 Q_D(const GeoDataOverlay);
50 return d->m_color;
51}
52
53void GeoDataOverlay::setColor( const QColor &color )
54{
55 Q_D(GeoDataOverlay);
56 d->m_color = color;
57}
58
59int GeoDataOverlay::drawOrder() const
60{
61 Q_D(const GeoDataOverlay);
62 return d->m_drawOrder;
63}
64
65void GeoDataOverlay::setDrawOrder( int order )
66{
67 Q_D(GeoDataOverlay);
68 d->m_drawOrder = order;
69}
70
71QImage GeoDataOverlay::icon() const
72{
73 Q_D(const GeoDataOverlay);
74 if ( d->m_image.isNull() && !d->m_iconPath.isEmpty() ) {
75 d->m_image = QImage( absoluteIconFile() );
76 }
77 return d->m_image;
78}
79
80void GeoDataOverlay::setIcon( const QImage &icon )
81{
82 Q_D(GeoDataOverlay);
83 d->m_image = icon;
84}
85
86void GeoDataOverlay::setIconFile( const QString &path )
87{
88 Q_D(GeoDataOverlay);
89 d->m_iconPath = path;
90 d->m_image = QImage( path );
91}
92
93QString GeoDataOverlay::iconFile() const
94{
95 Q_D(const GeoDataOverlay);
96 return d->m_iconPath;
97}
98
99QString GeoDataOverlay::absoluteIconFile() const
100{
101 Q_D(const GeoDataOverlay);
102 return resolvePath( d->m_iconPath );
103}
104
105bool GeoDataOverlay::equals(const GeoDataOverlay& other) const
106{
107 Q_D(const GeoDataOverlay);
108 const GeoDataOverlayPrivate* const other_d = other.d_func();
109
110 return GeoDataFeature::equals(other) &&
111 d->m_drawOrder == other_d->m_drawOrder &&
112 d->m_color == other_d->m_color &&
113 d->m_iconPath == other_d->m_iconPath &&
114 d->m_image == other_d->m_image;
115}
116
117}
QString path(const QString &relativePath)
Binds a QML item to a specific geodetic location in screen coordinates.
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:54:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.