Marble

GeoDataOverlay.cpp
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012 Dennis Nienhüser <[email protected]>
4 //
5 
6 #include "GeoDataOverlay.h"
7 #include "GeoDataOverlay_p.h"
8 
9 namespace Marble {
10 
11 GeoDataOverlay::GeoDataOverlay()
12  : GeoDataFeature(new GeoDataOverlayPrivate)
13 {
14  // nothing to do
15 }
16 
17 GeoDataOverlay::GeoDataOverlay(const GeoDataOverlay &other)
18  : GeoDataFeature(other, new GeoDataOverlayPrivate(*other.d_func()))
19 {
20  // nothing to do
21 }
22 
23 GeoDataOverlay::GeoDataOverlay(GeoDataOverlayPrivate *priv)
24  : GeoDataFeature(priv)
25 {
26 }
27 
28 GeoDataOverlay::GeoDataOverlay(const GeoDataOverlay& other, GeoDataOverlayPrivate *priv)
29  : GeoDataFeature(other, priv)
30 {
31 }
32 
33 GeoDataOverlay::~GeoDataOverlay()
34 {
35 }
36 
37 GeoDataOverlay &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 
47 QColor GeoDataOverlay::color() const
48 {
49  Q_D(const GeoDataOverlay);
50  return d->m_color;
51 }
52 
53 void GeoDataOverlay::setColor( const QColor &color )
54 {
55  Q_D(GeoDataOverlay);
56  d->m_color = color;
57 }
58 
59 int GeoDataOverlay::drawOrder() const
60 {
61  Q_D(const GeoDataOverlay);
62  return d->m_drawOrder;
63 }
64 
65 void GeoDataOverlay::setDrawOrder( int order )
66 {
67  Q_D(GeoDataOverlay);
68  d->m_drawOrder = order;
69 }
70 
71 QImage 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 
80 void GeoDataOverlay::setIcon( const QImage &icon )
81 {
82  Q_D(GeoDataOverlay);
83  d->m_image = icon;
84 }
85 
86 void GeoDataOverlay::setIconFile( const QString &path )
87 {
88  Q_D(GeoDataOverlay);
89  d->m_iconPath = path;
90  d->m_image = QImage( path );
91 }
92 
93 QString GeoDataOverlay::iconFile() const
94 {
95  Q_D(const GeoDataOverlay);
96  return d->m_iconPath;
97 }
98 
99 QString GeoDataOverlay::absoluteIconFile() const
100 {
101  Q_D(const GeoDataOverlay);
102  return resolvePath( d->m_iconPath );
103 }
104 
105 bool 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 }
Binds a QML item to a specific geodetic location in screen coordinates.
QString path(const QString &relativePath)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Oct 4 2023 04:09:41 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.