• 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
GeoDataCamera.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 //
10 
11 
12 #include "GeoDataCamera.h"
13 #include "GeoDataCamera_p.h"
14 
15 #include <QDataStream>
16 
17 namespace Marble
18 {
19 
20 GeoDataCamera::GeoDataCamera() :
21  GeoDataAbstractView(),
22  d( new GeoDataCameraPrivate )
23 {
24 }
25 
26 GeoDataCamera::GeoDataCamera( const GeoDataCamera& other ) :
27  GeoDataAbstractView(),
28  d( other.d )
29 {
30  d->ref.ref();
31 }
32 
33 GeoDataCamera& GeoDataCamera::operator=( const GeoDataCamera &other )
34 {
35  GeoDataAbstractView::operator=( other );
36  qAtomicAssign( d, other.d );
37  return *this;
38 }
39 
40 bool GeoDataCamera::operator==( const GeoDataCamera &other ) const
41 {
42  return equals(other) &&
43  d->m_coordinates == other.d->m_coordinates &&
44  d->m_roll == other.d->m_roll &&
45  d->m_heading == other.d->m_heading &&
46  d->m_tilt == other.d->m_tilt &&
47  altitudeMode() == other.altitudeMode();
48 }
49 
50 bool GeoDataCamera::operator!=( const GeoDataCamera &other ) const
51 {
52  return !this->operator==(other);
53 }
54 
55 GeoDataCamera::~GeoDataCamera()
56 {
57  if( !d->ref.deref() ) {
58  delete d;
59  }
60 }
61 
62 GeoDataAbstractView *GeoDataCamera::copy() const
63 {
64  return new GeoDataCamera( *this );
65 }
66 
67 void GeoDataCamera::setCoordinates( const GeoDataCoordinates& coordinates )
68 {
69  detach();
70  d->m_coordinates = coordinates;
71 }
72 
73 const char* GeoDataCamera::nodeType() const
74 {
75  return GeoDataTypes::GeoDataCameraType;
76 }
77 
78 void GeoDataCamera::setAltitude( qreal altitude )
79 {
80  detach();
81  d->m_coordinates.setAltitude( altitude );
82 }
83 
84 qreal GeoDataCamera::altitude() const
85 {
86  return d->m_coordinates.altitude();
87 }
88 
89 void GeoDataCamera::setLatitude( qreal latitude, GeoDataCoordinates::Unit unit )
90 {
91  detach();
92  d->m_coordinates.setLatitude( latitude, unit );
93 }
94 
95 qreal GeoDataCamera::latitude( GeoDataCoordinates::Unit unit ) const
96 {
97  return d->m_coordinates.latitude( unit );
98 }
99 
100 void GeoDataCamera::setLongitude( qreal longitude, GeoDataCoordinates::Unit unit )
101 {
102  detach();
103  d->m_coordinates.setLongitude( longitude, unit );
104 }
105 
106 qreal GeoDataCamera::longitude( GeoDataCoordinates::Unit unit ) const
107 {
108  return d->m_coordinates.longitude( unit );
109 }
110 
111 GeoDataCoordinates GeoDataCamera::coordinates() const
112 {
113  return d->m_coordinates;
114 }
115 
116 void GeoDataCamera::setRoll(qreal roll)
117 {
118  detach();
119  d->m_roll = roll;
120 }
121 
122 qreal GeoDataCamera::roll() const
123 {
124  return d->m_roll;
125 }
126 
127 qreal GeoDataCamera::heading() const
128 {
129  return d->m_heading;
130 }
131 
132 void GeoDataCamera::setHeading(qreal heading)
133 {
134  detach();
135  d->m_heading = heading;
136 }
137 
138 qreal GeoDataCamera::tilt() const
139 {
140  return d->m_tilt;
141 }
142 
143 void GeoDataCamera::setTilt(qreal tilt)
144 {
145  detach();
146  d->m_tilt = tilt;
147 }
148 
149 void GeoDataCamera::detach()
150 {
151  qAtomicDetach( d );
152 }
153 
154 }
Marble::GeoDataCoordinates::Unit
Unit
enum used constructor to specify the units used
Definition: GeoDataCoordinates.h:64
Marble::GeoDataCamera::latitude
qreal latitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the latitude of the GeoDataCamera object use the unit parameter to switch between Radian an...
Definition: GeoDataCamera.cpp:95
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataAbstractView
Definition: GeoDataAbstractView.h:30
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::GeoDataCamera::coordinates
GeoDataCoordinates coordinates() const
retrieve the lat/lon/alt triple as a GeoDataCoordinates object
Definition: GeoDataCamera.cpp:111
Marble::GeoDataCamera::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataCamera.cpp:73
Marble::GeoDataCamera::setLatitude
void setLatitude(qreal latitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the latitude in a GeoDataCamera object
Definition: GeoDataCamera.cpp:89
Marble::GeoDataCamera::setHeading
void setHeading(qreal heading)
Definition: GeoDataCamera.cpp:132
Marble::GeoDataCamera::setAltitude
void setAltitude(qreal altitude)
set the altitude in a GeoDataCamera object
Definition: GeoDataCamera.cpp:78
QAtomicInt::ref
bool ref()
Marble::GeoDataCamera
Definition: GeoDataCamera.h:22
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::GeoDataCamera::operator=
GeoDataCamera & operator=(const GeoDataCamera &other)
Definition: GeoDataCamera.cpp:33
Marble::GeoDataCamera::copy
GeoDataAbstractView * copy() const
Definition: GeoDataCamera.cpp:62
GeoDataCamera.h
Marble::GeoDataCoordinates::altitude
qreal altitude() const
return the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1197
Marble::GeoDataCamera::operator!=
bool operator!=(const GeoDataCamera &other) const
Definition: GeoDataCamera.cpp:50
Marble::GeoDataAbstractView::operator=
GeoDataAbstractView & operator=(const GeoDataAbstractView &other)
Definition: GeoDataAbstractView.cpp:56
Marble::GeoDataCamera::tilt
qreal tilt() const
Definition: GeoDataCamera.cpp:138
Marble::GeoDataCamera::setCoordinates
void setCoordinates(const GeoDataCoordinates &coordinates)
Definition: GeoDataCamera.cpp:67
Marble::GeoDataCamera::~GeoDataCamera
~GeoDataCamera()
Definition: GeoDataCamera.cpp:55
Marble::GeoDataCamera::longitude
qreal longitude(GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian) const
retrieves the longitude of the GeoDataCamera object use the unit parameter to switch between Radian a...
Definition: GeoDataCamera.cpp:106
Marble::GeoDataCameraPrivate
Definition: GeoDataCamera_p.h:23
QAtomicInt::deref
bool deref()
Marble::GeoDataCameraPrivate::m_coordinates
GeoDataCoordinates m_coordinates
Definition: GeoDataCamera_p.h:35
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::GeoDataCamera::detach
void detach()
Definition: GeoDataCamera.cpp:149
Marble::GeoDataCoordinates::setLatitude
void setLatitude(qreal lat, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the longitude in a GeoDataCoordinates object
Definition: GeoDataCoordinates.cpp:699
Marble::GeoDataCamera::setTilt
void setTilt(qreal tilt)
Definition: GeoDataCamera.cpp:143
Marble::GeoDataCameraPrivate::m_tilt
qreal m_tilt
Definition: GeoDataCamera_p.h:38
Marble::GeoDataCamera::operator==
bool operator==(const GeoDataCamera &other) const
Definition: GeoDataCamera.cpp:40
Marble::GeoDataCoordinates::setLongitude
void setLongitude(qreal lon, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the longitude in a GeoDataCoordinates object
Definition: GeoDataCoordinates.cpp:679
Marble::GeoDataTypes::GeoDataCameraType
const char * GeoDataCameraType
Definition: GeoDataTypes.cpp:31
Marble::GeoDataCameraPrivate::m_heading
qreal m_heading
Definition: GeoDataCamera_p.h:37
GeoDataCamera_p.h
Marble::GeoDataAbstractView::altitudeMode
AltitudeMode altitudeMode() const
Definition: GeoDataAbstractView.cpp:119
Marble::GeoDataCamera::setLongitude
void setLongitude(qreal longitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the longitude in a GeoDataCamera object
Definition: GeoDataCamera.cpp:100
Marble::GeoDataCameraPrivate::m_roll
qreal m_roll
Definition: GeoDataCamera_p.h:36
Marble::GeoDataCamera::heading
qreal heading() const
Definition: GeoDataCamera.cpp:127
Marble::GeoDataCamera::roll
qreal roll() const
Definition: GeoDataCamera.cpp:122
Marble::GeoDataCamera::setRoll
void setRoll(qreal roll)
Definition: GeoDataCamera.cpp:116
Marble::GeoDataCameraPrivate::ref
QAtomicInt ref
Definition: GeoDataCamera_p.h:40
Marble::GeoDataCamera::altitude
qreal altitude() const
retrieves the altitude of the GeoDataCamera object
Definition: GeoDataCamera.cpp:84
Marble::GeoDataCamera::GeoDataCamera
GeoDataCamera()
Definition: GeoDataCamera.cpp:20
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