• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • data
GeoDataOverlay.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2012 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 #include "GeoDataOverlay.h"
12 #include "GeoDataDocument.h"
13 
14 #include <QFileInfo>
15 #include <QDir>
16 
17 namespace Marble {
18 
19 class GeoDataOverlayPrivate
20 {
21 public:
22  QColor m_color;
23 
24  int m_drawOrder;
25 
26  QImage m_image;
27 
28  QString m_iconPath;
29 
30  GeoDataOverlayPrivate();
31 };
32 
33 GeoDataOverlayPrivate::GeoDataOverlayPrivate() : m_color( Qt::white ), m_drawOrder( 0 )
34 {
35  // nothing to do
36 }
37 
38 GeoDataOverlay::GeoDataOverlay() : d( new GeoDataOverlayPrivate )
39 {
40  // nothing to do
41 }
42 
43 GeoDataOverlay::~GeoDataOverlay()
44 {
45  delete d;
46 }
47 
48 GeoDataOverlay::GeoDataOverlay( const GeoDataOverlay &other ) :
49  GeoDataFeature( other ), d( new GeoDataOverlayPrivate( *other.d ) )
50 {
51  // nothing to do
52 }
53 
54 GeoDataOverlay &GeoDataOverlay::operator=( const GeoDataOverlay &other )
55 {
56  *d = *other.d;
57  return *this;
58 }
59 
60 QColor GeoDataOverlay::color() const
61 {
62  return d->m_color;
63 }
64 
65 void GeoDataOverlay::setColor( const QColor &color )
66 {
67  d->m_color = color;
68 }
69 
70 int GeoDataOverlay::drawOrder() const
71 {
72  return d->m_drawOrder;
73 }
74 
75 void GeoDataOverlay::setDrawOrder( int order )
76 {
77  d->m_drawOrder = order;
78 }
79 
80 QImage GeoDataOverlay::icon() const
81 {
82  if ( d->m_image.isNull() && !d->m_iconPath.isEmpty() ) {
83  d->m_image = QImage( absoluteIconFile() );
84  }
85  return d->m_image;
86 }
87 
88 void GeoDataOverlay::setIcon( const QImage &icon )
89 {
90  d->m_image = icon;
91 }
92 
93 void GeoDataOverlay::setIconFile( const QString &path )
94 {
95  d->m_iconPath = path;
96 }
97 
98 QString GeoDataOverlay::iconFile() const
99 {
100  return d->m_iconPath;
101 }
102 
103 QString GeoDataOverlay::absoluteIconFile() const
104 {
105  return resolvePath( d->m_iconPath );
106 }
107 
108 bool GeoDataOverlay::equals(const GeoDataOverlay& other) const
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 }
GeoDataDocument.h
Marble::GeoDataOverlay::equals
bool equals(const GeoDataOverlay &other) const
Definition: GeoDataOverlay.cpp:108
Marble::GeoDataOverlay::setIcon
void setIcon(const QImage &icon)
Definition: GeoDataOverlay.cpp:88
Marble::GeoDataFeature::equals
bool equals(const GeoDataFeature &other) const
Definition: GeoDataFeature.cpp:94
Marble::GeoDataOverlay::drawOrder
int drawOrder() const
Definition: GeoDataOverlay.cpp:70
Marble::GeoDataOverlay::color
QColor color() const
Definition: GeoDataOverlay.cpp:60
Marble::GeoDataOverlay::icon
QImage icon() const
Definition: GeoDataOverlay.cpp:80
Marble::GeoDataOverlay::setDrawOrder
void setDrawOrder(int order)
Definition: GeoDataOverlay.cpp:75
Marble::GeoDataOverlay::~GeoDataOverlay
~GeoDataOverlay()
Definition: GeoDataOverlay.cpp:43
QString
Marble::GeoDataObject::resolvePath
QString resolvePath(const QString &relativePath) const
Definition: GeoDataObject.cpp:95
QColor
Marble::GeoDataOverlay::setIconFile
void setIconFile(const QString &path)
Definition: GeoDataOverlay.cpp:93
Marble::GeoDataOverlay::operator=
GeoDataOverlay & operator=(const GeoDataOverlay &other)
Definition: GeoDataOverlay.cpp:54
QImage
Marble::GeoDataOverlay
Definition: GeoDataOverlay.h:27
GeoDataOverlay.h
Marble::GeoDataOverlay::setColor
void setColor(const QColor &color)
Definition: GeoDataOverlay.cpp:65
Marble::GeoDataFeature
A base class for all geodata features.
Definition: GeoDataFeature.h:57
Marble::GeoDataOverlay::GeoDataOverlay
GeoDataOverlay()
Constructor.
Definition: GeoDataOverlay.cpp:38
Marble::GeoDataOverlay::absoluteIconFile
QString absoluteIconFile() const
Returns the iconFile as an absolute filename.
Definition: GeoDataOverlay.cpp:103
Marble::GeoDataOverlay::iconFile
QString iconFile() const
Definition: GeoDataOverlay.cpp:98
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal