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

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • data
GeoDataPoint.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 2004-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 // Copyright 2008 Patrick Spendrin <ps_ml@gmx.de>
11 //
12 
13 
14 #include "GeoDataPoint.h"
15 #include "GeoDataPoint_p.h"
16 #include "GeoDataCoordinates.h"
17 
18 #include <cmath>
19 
20 #include <QCoreApplication>
21 
22 #include "MarbleDebug.h"
23 #include "MarbleGlobal.h"
24 
25 #include "GeoDataTypes.h"
26 #include "GeoDataLatLonAltBox.h"
27 
28 
29 namespace Marble
30 {
31 
32 GeoDataPoint::GeoDataPoint( qreal lon, qreal lat, qreal alt,
33  GeoDataCoordinates::Unit unit )
34  : GeoDataGeometry( new GeoDataPointPrivate )
35 {
36  p()->m_coordinates = GeoDataCoordinates( lon, lat, alt, unit );
37  p()->m_latLonAltBox = GeoDataLatLonAltBox( p()->m_coordinates );
38 }
39 
40 GeoDataPoint::GeoDataPoint( const GeoDataPoint& other )
41  : GeoDataGeometry( other )
42 
43 {
44  p()->m_coordinates = other.p()->m_coordinates;
45  p()->m_latLonAltBox = other.p()->m_latLonAltBox;
46 }
47 
48 GeoDataPoint::GeoDataPoint( const GeoDataCoordinates& other )
49  : GeoDataGeometry ( new GeoDataPointPrivate )
50 {
51  p()->m_coordinates = other;
52  p()->m_latLonAltBox = GeoDataLatLonAltBox( p()->m_coordinates );
53 }
54 
55 GeoDataPoint::GeoDataPoint( const GeoDataGeometry& other )
56  : GeoDataGeometry( other )
57 {
58 }
59 
60 GeoDataPoint::GeoDataPoint()
61  : GeoDataGeometry( new GeoDataPointPrivate )
62 {
63 }
64 
65 GeoDataPoint::~GeoDataPoint()
66 {
67 }
68 
69 void GeoDataPoint::setCoordinates( const GeoDataCoordinates &coordinates )
70 {
71  p()->m_coordinates = coordinates;
72  p()->m_latLonAltBox = GeoDataLatLonAltBox( p()->m_coordinates );
73 }
74 
75 const GeoDataCoordinates &GeoDataPoint::coordinates() const
76 {
77  return p()->m_coordinates;
78 }
79 
80 GeoDataPointPrivate* GeoDataPoint::p() const
81 {
82  return static_cast<GeoDataPointPrivate*>(GeoDataGeometry::d);
83 }
84 
85 const char* GeoDataPoint::nodeType() const
86 {
87  return GeoDataTypes::GeoDataPointType;
88 }
89 
90 void GeoDataPoint::detach()
91 {
92  GeoDataGeometry::detach();
93 }
94 
95 void GeoDataPoint::pack( QDataStream& stream ) const
96 {
97  p()->m_coordinates.pack( stream );
98 }
99 
100 void GeoDataPoint::unpack( QDataStream& stream )
101 {
102  p()->m_coordinates.unpack( stream );
103 }
104 
105 }
Marble::GeoDataPointPrivate::m_coordinates
GeoDataCoordinates m_coordinates
Definition: GeoDataPoint_p.h:23
Marble::GeoDataCoordinates::Unit
Unit
enum used constructor to specify the units used
Definition: GeoDataCoordinates.h:64
Marble::GeoDataPoint
A Geometry object representing a 3d point.
Definition: GeoDataPoint.h:47
GeoDataCoordinates.h
Marble::GeoDataCoordinates::unpack
virtual void unpack(QDataStream &stream)
Unserialize the contents of the feature from stream.
Definition: GeoDataCoordinates.cpp:1300
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataTypes::GeoDataPointType
const char * GeoDataPointType
Definition: GeoDataTypes.cpp:64
Marble::GeoDataGeometry
A base class for all geodata features.
Definition: GeoDataGeometry.h:47
Marble::GeoDataGeometry::detach
void detach()
Definition: GeoDataGeometry.cpp:54
MarbleDebug.h
Marble::GeoDataPoint::pack
virtual void pack(QDataStream &stream) const
Serialize the contents of the feature to stream.
Definition: GeoDataPoint.cpp:95
Marble::GeoDataPoint::unpack
virtual void unpack(QDataStream &stream)
Unserialize the contents of the feature from stream.
Definition: GeoDataPoint.cpp:100
Marble::GeoDataPointPrivate
Definition: GeoDataPoint_p.h:20
GeoDataPoint_p.h
MarbleGlobal.h
Marble::GeoDataPoint::~GeoDataPoint
~GeoDataPoint()
Definition: GeoDataPoint.cpp:65
GeoDataPoint.h
Marble::GeoDataPoint::GeoDataPoint
GeoDataPoint()
Definition: GeoDataPoint.cpp:60
GeoDataLatLonAltBox.h
Marble::GeoDataPoint::detach
virtual void detach()
Definition: GeoDataPoint.cpp:90
Marble::GeoDataPoint::coordinates
const GeoDataCoordinates & coordinates() const
Definition: GeoDataPoint.cpp:75
Marble::GeoDataGeometryPrivate::m_latLonAltBox
GeoDataLatLonAltBox m_latLonAltBox
Definition: GeoDataGeometry_p.h:71
GeoDataTypes.h
Marble::GeoDataPoint::setCoordinates
void setCoordinates(const GeoDataCoordinates &coordinates)
Definition: GeoDataPoint.cpp:69
Marble::GeoDataLatLonAltBox
A class that defines a 3D bounding box for geographic data.
Definition: GeoDataLatLonAltBox.h:49
Marble::GeoDataCoordinates::pack
virtual void pack(QDataStream &stream) const
Serialize the contents of the feature to stream.
Definition: GeoDataCoordinates.cpp:1293
Marble::GeoDataPoint::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataPoint.cpp:85
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:50 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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