• 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
GeoDataModel.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 2013 Mayank Madan <maddiemadan@gmail.com>
9 // Copyright 2013 Sanjiban Bairagya <sanjiban22393@gmail.com>
10 //
11 
12 #include "GeoDataModel.h"
13 #include "GeoDataTypes.h"
14 
15 #include "stdio.h"
16 
17 namespace Marble {
18 
19 class GeoDataModelPrivate
20 {
21 public:
22  GeoDataModelPrivate();
23 
24  GeoDataCoordinates m_coordinates;
25 
26  GeoDataScale m_scale;
27  GeoDataOrientation m_orientation;
28  GeoDataLocation m_location;
29  GeoDataLink m_link;
30  GeoDataResourceMap m_map;
31  QString m_targetHref;
32  QString m_sourceHref;
33 };
34 
35 GeoDataModelPrivate::GeoDataModelPrivate() :
36  m_coordinates(),
37  m_scale(),
38  m_orientation(),
39  m_location(),
40  m_link(),
41  m_map(),
42  m_targetHref(),
43  m_sourceHref()
44 {
45 }
46 
47 GeoDataModel::GeoDataModel() :
48  GeoDataGeometry(),
49  d( new GeoDataModelPrivate )
50 {
51  setAltitudeMode( ClampToGround );
52 }
53 
54 GeoDataModel::GeoDataModel( const GeoDataModel &other ) :
55  GeoDataGeometry( other ),
56  d( new GeoDataModelPrivate( *other.d ) )
57 {
58  // nothing to do
59 }
60 
61 GeoDataModel &GeoDataModel::operator=( const GeoDataModel &other )
62 {
63  GeoDataGeometry::operator=( other );
64  *d = *other.d;
65  return *this;
66 }
67 
68 
69 bool GeoDataModel::operator==( const GeoDataModel &other ) const
70 {
71  return equals(other) &&
72  d->m_coordinates == other.d->m_coordinates &&
73  d->m_scale == other.d->m_scale &&
74  d->m_orientation == other.d->m_orientation &&
75  d->m_location == other.d->m_location &&
76  d->m_link == other.d->m_link &&
77  d->m_map == other.d->m_map &&
78  d->m_targetHref == other.d->m_targetHref &&
79  d->m_sourceHref == other.d->m_sourceHref;
80 }
81 
82 bool GeoDataModel::operator!=( const GeoDataModel &other ) const
83 {
84  return !this->operator==( other );
85 }
86 
87 GeoDataModel::~GeoDataModel()
88 {
89  delete d;
90 }
91 
92 const char *GeoDataModel::nodeType() const
93 {
94  return GeoDataTypes::GeoDataModelType;
95 }
96 
97 const GeoDataCoordinates &GeoDataModel::coordinates() const
98 {
99  return d->m_coordinates;
100 }
101 
102 GeoDataCoordinates &GeoDataModel::coordinates()
103 {
104  return d->m_coordinates;
105 }
106 
107 const GeoDataLocation &GeoDataModel::location() const
108 {
109  return d->m_location;
110 }
111 
112 GeoDataLocation &GeoDataModel::location()
113 {
114  return d->m_location;
115 }
116 
117 void GeoDataModel::setCoordinates(const GeoDataCoordinates &coordinates)
118 {
119  d->m_coordinates = coordinates;
120 }
121 
122 void GeoDataModel::setLocation(const GeoDataLocation &location)
123 {
124  d->m_location = location;
125 }
126 
127 const GeoDataLink &GeoDataModel::link() const
128 {
129  return d->m_link;
130 }
131 
132 GeoDataLink &GeoDataModel::link()
133 {
134  return d->m_link;
135 }
136 
137 void GeoDataModel::setLink( const GeoDataLink &link )
138 {
139  d->m_link = link;
140 }
141 
142 const GeoDataScale &GeoDataModel::scale() const
143 {
144  return d->m_scale;
145 }
146 
147 GeoDataScale &GeoDataModel::scale()
148 {
149  return d->m_scale;
150 }
151 
152 void GeoDataModel::setScale(const GeoDataScale &scale)
153 {
154  d->m_scale=scale;
155 }
156 
157 const GeoDataOrientation &GeoDataModel::orientation() const
158 {
159  return d->m_orientation;
160 }
161 
162 GeoDataOrientation &GeoDataModel::orientation()
163 {
164  return d->m_orientation;
165 }
166 
167 void GeoDataModel::setOrientation(const GeoDataOrientation &orientation)
168 {
169  d->m_orientation=orientation;
170 }
171 
172 const GeoDataResourceMap &GeoDataModel::resourceMap() const
173 {
174  return d->m_map;
175 }
176 
177 GeoDataResourceMap &GeoDataModel::resourceMap()
178 {
179  return d->m_map;
180 }
181 
182 void GeoDataModel::setResourceMap(const GeoDataResourceMap &map)
183 {
184  d->m_map=map;
185 }
186 
187 QString GeoDataModel::targetHref() const
188 {
189  return d->m_map.targetHref();
190 }
191 
192 void GeoDataModel::setTargetHref(const QString &targetHref)
193 {
194  d->m_map.setTargetHref( targetHref );
195 }
196 
197 QString GeoDataModel::sourceHref() const
198 {
199  return d->m_map.sourceHref();
200 }
201 
202 void GeoDataModel::setSourceHref(const QString &sourceHref)
203 {
204  d->m_map.setSourceHref( sourceHref );
205 }
206 
207 }
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataModel::setTargetHref
void setTargetHref(const QString &targetHref)
Definition: GeoDataModel.cpp:192
Marble::GeoDataModel::location
const GeoDataLocation & location() const
Definition: GeoDataModel.cpp:107
Marble::GeoDataGeometry
A base class for all geodata features.
Definition: GeoDataGeometry.h:47
Marble::GeoDataModel::orientation
const GeoDataOrientation & orientation() const
Definition: GeoDataModel.cpp:157
Marble::GeoDataLink
Definition: GeoDataLink.h:22
Marble::GeoDataModel::setLocation
void setLocation(const GeoDataLocation &location)
Definition: GeoDataModel.cpp:122
Marble::GeoDataModel::operator=
GeoDataModel & operator=(const GeoDataModel &other)
Definition: GeoDataModel.cpp:61
GeoDataModel.h
Marble::GeoDataModel::setLink
void setLink(const GeoDataLink &link)
Definition: GeoDataModel.cpp:137
Marble::GeoDataModel
Definition: GeoDataModel.h:29
Marble::GeoDataModel::resourceMap
const GeoDataResourceMap & resourceMap() const
Definition: GeoDataModel.cpp:172
Marble::GeoDataModel::setScale
void setScale(const GeoDataScale &scale)
Definition: GeoDataModel.cpp:152
Marble::GeoDataModel::setCoordinates
void setCoordinates(const GeoDataCoordinates &coordinates)
Definition: GeoDataModel.cpp:117
Marble::GeoDataModel::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataModel.cpp:92
Marble::GeoDataModel::operator==
bool operator==(const GeoDataModel &other) const
Definition: GeoDataModel.cpp:69
Marble::GeoDataModel::sourceHref
QString sourceHref() const
Definition: GeoDataModel.cpp:197
Marble::GeoDataModel::scale
const GeoDataScale & scale() const
Definition: GeoDataModel.cpp:142
QString
Marble::GeoDataModel::~GeoDataModel
~GeoDataModel()
Definition: GeoDataModel.cpp:87
Marble::GeoDataModel::link
const GeoDataLink & link() const
Definition: GeoDataModel.cpp:127
Marble::GeoDataGeometry::operator=
GeoDataGeometry & operator=(const GeoDataGeometry &other)
Definition: GeoDataGeometry.cpp:87
Marble::GeoDataScale
Definition: GeoDataScale.h:22
Marble::GeoDataModel::targetHref
QString targetHref() const
Definition: GeoDataModel.cpp:187
Marble::GeoDataModel::operator!=
bool operator!=(const GeoDataModel &other) const
Definition: GeoDataModel.cpp:82
Marble::GeoDataResourceMap
Definition: GeoDataResourceMap.h:22
Marble::GeoDataModel::setOrientation
void setOrientation(const GeoDataOrientation &orientation)
Definition: GeoDataModel.cpp:167
Marble::ClampToGround
Altitude always sticks to ground level.
Definition: MarbleGlobal.h:148
Marble::GeoDataLocation
Definition: GeoDataLocation.h:23
Marble::GeoDataModel::GeoDataModel
GeoDataModel()
Definition: GeoDataModel.cpp:47
Marble::GeoDataGeometry::setAltitudeMode
void setAltitudeMode(const AltitudeMode altitudeMode)
Definition: GeoDataGeometry.cpp:116
Marble::GeoDataTypes::GeoDataModelType
const char * GeoDataModelType
Definition: GeoDataTypes.cpp:59
Marble::GeoDataOrientation
Definition: GeoDataOrientation.h:21
GeoDataTypes.h
Marble::GeoDataGeometry::equals
bool equals(const GeoDataGeometry &other) const
Definition: GeoDataGeometry.cpp:146
Marble::GeoDataModel::coordinates
const GeoDataCoordinates & coordinates() const
Definition: GeoDataModel.cpp:97
Marble::GeoDataModel::setResourceMap
void setResourceMap(const GeoDataResourceMap &map)
Definition: GeoDataModel.cpp:182
Marble::GeoDataModel::setSourceHref
void setSourceHref(const QString &sourceHref)
Definition: GeoDataModel.cpp:202
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