• 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
GeoDataLookAt.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 2009 Gaurav Gupta <1989.gaurav@googlemail.com>
9 // Copyright 2010 Bastian Holst <bastianholst@gmx.de>
10 //
11 
12 //own
13 #include "GeoDataLookAt.h"
14 #include "GeoDataLookAt_p.h"
15 #include "MarbleDebug.h"
16 
17 //Qt
18 #include <QDataStream>
19 
20 namespace Marble
21 {
22 
23 GeoDataLookAt::GeoDataLookAt() :
24  GeoDataAbstractView(),
25  d( new GeoDataLookAtPrivate )
26 {
27 }
28 
29 GeoDataLookAt::GeoDataLookAt( const GeoDataLookAt& other ) :
30  GeoDataAbstractView(),
31  d( other.d )
32 {
33  d->ref.ref();
34 }
35 
36 GeoDataLookAt& GeoDataLookAt::operator=( const GeoDataLookAt &other )
37 {
38  GeoDataAbstractView::operator=( other );
39  qAtomicAssign( d, other.d );
40  return *this;
41 }
42 
43 bool GeoDataLookAt::operator==(const GeoDataLookAt &other) const
44 {
45  return equals(other) &&
46  d->m_coordinates == other.d->m_coordinates &&
47  d->m_range == other.d->m_range;
48 }
49 
50 bool GeoDataLookAt::operator!=(const GeoDataLookAt &other) const
51 {
52  return !this->operator==( other );
53 }
54 
55 GeoDataLookAt::~GeoDataLookAt()
56 {
57  if( !d->ref.deref() )
58  delete d;
59 }
60 
61 GeoDataAbstractView *GeoDataLookAt::copy() const
62 {
63  return new GeoDataLookAt( *this );
64 }
65 
66 void GeoDataLookAt::setCoordinates( const GeoDataCoordinates& coordinates )
67 {
68  d->m_coordinates = coordinates;
69 }
70 
71 const char* GeoDataLookAt::nodeType() const
72 {
73  return GeoDataTypes::GeoDataLookAtType;
74 }
75 
76 void GeoDataLookAt::setAltitude( qreal altitude )
77 {
78  detach();
79  d->m_coordinates.setAltitude( altitude );
80 }
81 
82 qreal GeoDataLookAt::altitude() const
83 {
84  return d->m_coordinates.altitude();
85 }
86 
87 void GeoDataLookAt::setLatitude( qreal latitude, GeoDataCoordinates::Unit unit )
88 {
89  detach();
90  d->m_coordinates.setLatitude( latitude,unit );
91 }
92 
93 qreal GeoDataLookAt::latitude( GeoDataCoordinates::Unit unit ) const
94 {
95  return d->m_coordinates.latitude( unit );
96 }
97 
98 void GeoDataLookAt::setLongitude( qreal longitude, GeoDataCoordinates::Unit unit )
99 {
100  detach();
101  d->m_coordinates.setLongitude( longitude, unit );
102 }
103 
104 qreal GeoDataLookAt::longitude( GeoDataCoordinates::Unit unit ) const
105 {
106  return d->m_coordinates.longitude( unit );
107 }
108 
109 GeoDataCoordinates GeoDataLookAt::coordinates() const
110 {
111  return d->m_coordinates;
112 }
113 
114 void GeoDataLookAt::setRange( qreal range )
115 {
116  detach();
117  d->m_range = range;
118 }
119 
120 qreal GeoDataLookAt::range() const
121 {
122  return d->m_range;
123 }
124 
125 void GeoDataLookAt::detach()
126 {
127  qAtomicDetach( d );
128 }
129 
130 }
Marble::GeoDataCoordinates::Unit
Unit
enum used constructor to specify the units used
Definition: GeoDataCoordinates.h:64
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataAbstractView
Definition: GeoDataAbstractView.h:30
Marble::GeoDataLookAtPrivate::ref
QAtomicInt ref
Definition: GeoDataLookAt_p.h:38
Marble::GeoDataTypes::GeoDataLookAtType
const char * GeoDataLookAtType
Definition: GeoDataTypes.cpp:58
Marble::GeoDataCoordinates::setAltitude
void setAltitude(const qreal altitude)
set the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1191
Marble::GeoDataAbstractView::equals
bool equals(const GeoDataAbstractView &other) const
Definition: GeoDataAbstractView.cpp:81
Marble::GeoDataLookAt::longitude
qreal longitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the longitude of the GeoDataLookAt object use the unit parameter to switch between Radian a...
Definition: GeoDataLookAt.cpp:104
Marble::GeoDataLookAtPrivate::m_range
qreal m_range
Definition: GeoDataLookAt_p.h:36
Marble::GeoDataLookAtPrivate::m_coordinates
GeoDataCoordinates m_coordinates
Definition: GeoDataLookAt_p.h:35
QAtomicInt::ref
bool ref()
Marble::GeoDataLookAt::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataLookAt.cpp:71
Marble::GeoDataCoordinates::latitude
qreal latitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the latitude of the GeoDataCoordinates object use the unit parameter to switch between Radi...
Definition: GeoDataCoordinates.cpp:751
Marble::GeoDataLookAt::setLongitude
void setLongitude(qreal longitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the longitude in a GeoDataLookAt object
Definition: GeoDataLookAt.cpp:98
MarbleDebug.h
Marble::GeoDataLookAt::range
qreal range() const
Retrieve the distance (in meters) between the camera and the object looked at.
Definition: GeoDataLookAt.cpp:120
GeoDataLookAt_p.h
Marble::GeoDataCoordinates::altitude
qreal altitude() const
return the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1197
Marble::GeoDataAbstractView::operator=
GeoDataAbstractView & operator=(const GeoDataAbstractView &other)
Definition: GeoDataAbstractView.cpp:56
GeoDataLookAt.h
Marble::GeoDataLookAt::operator==
bool operator==(const GeoDataLookAt &other) const
Definition: GeoDataLookAt.cpp:43
Marble::GeoDataLookAt::setRange
void setRange(qreal range)
Change the distance (in meters) between the camera and the object looked at.
Definition: GeoDataLookAt.cpp:114
Marble::GeoDataLookAt::GeoDataLookAt
GeoDataLookAt()
Definition: GeoDataLookAt.cpp:23
Marble::GeoDataLookAt::altitude
qreal altitude() const
retrieves the altitude of the GeoDataLookAt object
Definition: GeoDataLookAt.cpp:82
Marble::GeoDataLookAt::operator=
GeoDataLookAt & operator=(const GeoDataLookAt &other)
Definition: GeoDataLookAt.cpp:36
Marble::GeoDataLookAt::latitude
qreal latitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the latitude of the GeoDataLookAt object use the unit parameter to switch between Radian an...
Definition: GeoDataLookAt.cpp:93
QAtomicInt::deref
bool deref()
Marble::GeoDataCoordinates::longitude
qreal longitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the longitude of the GeoDataCoordinates object use the unit parameter to switch between Rad...
Definition: GeoDataCoordinates.cpp:739
Marble::GeoDataCoordinates::setLatitude
void setLatitude(qreal lat, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the longitude in a GeoDataCoordinates object
Definition: GeoDataCoordinates.cpp:699
Marble::GeoDataLookAt::operator!=
bool operator!=(const GeoDataLookAt &other) const
Definition: GeoDataLookAt.cpp:50
Marble::GeoDataLookAt
Definition: GeoDataLookAt.h:23
Marble::GeoDataCoordinates::setLongitude
void setLongitude(qreal lon, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the longitude in a GeoDataCoordinates object
Definition: GeoDataCoordinates.cpp:679
Marble::GeoDataLookAtPrivate
Definition: GeoDataLookAt_p.h:25
Marble::GeoDataLookAt::copy
GeoDataAbstractView * copy() const
Definition: GeoDataLookAt.cpp:61
Marble::GeoDataLookAt::detach
void detach()
Definition: GeoDataLookAt.cpp:125
Marble::GeoDataLookAt::coordinates
GeoDataCoordinates coordinates() const
retrieve the lat/lon/alt triple as a GeoDataCoordinates object
Definition: GeoDataLookAt.cpp:109
Marble::GeoDataLookAt::setAltitude
void setAltitude(qreal altitude)
set the altitude in a GeoDataLookAt object
Definition: GeoDataLookAt.cpp:76
Marble::GeoDataLookAt::~GeoDataLookAt
~GeoDataLookAt()
Definition: GeoDataLookAt.cpp:55
Marble::GeoDataLookAt::setLatitude
void setLatitude(qreal latitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the latitude in a GeoDataLookAt object
Definition: GeoDataLookAt.cpp:87
Marble::GeoDataLookAt::setCoordinates
void setCoordinates(const GeoDataCoordinates &coordinates)
set the GeoDataCoordinates object
Definition: GeoDataLookAt.cpp:66
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