• 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
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 GeoDataCamera::~GeoDataCamera()
41 {
42  if( !d->ref.deref() ) {
43  delete d;
44  }
45 }
46 
47 GeoDataAbstractView *GeoDataCamera::copy() const
48 {
49  return new GeoDataCamera( *this );
50 }
51 
52 void GeoDataCamera::setCoordinates( const GeoDataCoordinates& coordinates )
53 {
54  detach();
55  d->m_coordinates = coordinates;
56 }
57 
58 const char* GeoDataCamera::nodeType() const
59 {
60  return GeoDataTypes::GeoDataCameraType;
61 }
62 
63 void GeoDataCamera::setAltitude( qreal altitude )
64 {
65  detach();
66  d->m_coordinates.setAltitude( altitude );
67 }
68 
69 qreal GeoDataCamera::altitude() const
70 {
71  return d->m_coordinates.altitude();
72 }
73 
74 void GeoDataCamera::setLatitude( qreal latitude, GeoDataCoordinates::Unit unit )
75 {
76  detach();
77  d->m_coordinates.setLatitude( latitude, unit );
78 }
79 
80 qreal GeoDataCamera::latitude( GeoDataCoordinates::Unit unit ) const
81 {
82  return d->m_coordinates.latitude( unit );
83 }
84 
85 void GeoDataCamera::setLongitude( qreal longitude, GeoDataCoordinates::Unit unit )
86 {
87  detach();
88  d->m_coordinates.setLongitude( longitude, unit );
89 }
90 
91 qreal GeoDataCamera::longitude( GeoDataCoordinates::Unit unit ) const
92 {
93  return d->m_coordinates.longitude( unit );
94 }
95 
96 GeoDataCoordinates GeoDataCamera::coordinates() const
97 {
98  return d->m_coordinates;
99 }
100 
101 void GeoDataCamera::setRoll(qreal roll)
102 {
103  detach();
104  d->m_roll = roll;
105 }
106 
107 qreal GeoDataCamera::roll() const
108 {
109  return d->m_roll;
110 }
111 
112 qreal GeoDataCamera::heading() const
113 {
114  return d->m_heading;
115 }
116 
117 void GeoDataCamera::setHeading(qreal heading)
118 {
119  detach();
120  d->m_heading = heading;
121 }
122 
123 qreal GeoDataCamera::tilt() const
124 {
125  return d->m_tilt;
126 }
127 
128 void GeoDataCamera::setTilt(qreal tilt)
129 {
130  detach();
131  d->m_tilt = tilt;
132 }
133 
134 AltitudeMode GeoDataCamera::altitudeMode() const
135 {
136  return d->m_altitudeMode;
137 }
138 
139 void GeoDataCamera::setAltitudeMode(const AltitudeMode altitudeMode)
140 {
141  detach();
142  d->m_altitudeMode = altitudeMode;
143 }
144 
145 void GeoDataCamera::detach()
146 {
147  qAtomicDetach( d );
148 }
149 
150 }
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:80
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataAbstractView
Definition: GeoDataAbstractView.h:28
Marble::GeoDataCoordinates::setAltitude
void setAltitude(const qreal altitude)
set the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1191
Marble::GeoDataCamera::coordinates
GeoDataCoordinates coordinates() const
retrieve the lat/lon/alt triple as a GeoDataCoordinates object
Definition: GeoDataCamera.cpp:96
Marble::GeoDataCamera::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataCamera.cpp:58
Marble::GeoDataCamera::setLatitude
void setLatitude(qreal latitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the latitude in a GeoDataCamera object
Definition: GeoDataCamera.cpp:74
Marble::GeoDataCamera::setHeading
void setHeading(qreal heading)
Definition: GeoDataCamera.cpp:117
Marble::GeoDataCamera::setAltitude
void setAltitude(qreal altitude)
set the altitude in a GeoDataCamera object
Definition: GeoDataCamera.cpp:63
Marble::GeoDataCamera
Definition: GeoDataCamera.h:22
Marble::GeoDataCameraPrivate::m_altitudeMode
AltitudeMode m_altitudeMode
Definition: GeoDataCamera_p.h:40
Marble::GeoDataCamera::setAltitudeMode
void setAltitudeMode(const AltitudeMode altitudeMode)
Definition: GeoDataCamera.cpp:139
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:47
GeoDataCamera.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:41
Marble::GeoDataCamera::tilt
qreal tilt() const
Definition: GeoDataCamera.cpp:123
Marble::GeoDataCamera::setCoordinates
void setCoordinates(const GeoDataCoordinates &coordinates)
Definition: GeoDataCamera.cpp:52
Marble::AltitudeMode
AltitudeMode
Definition: MarbleGlobal.h:145
Marble::GeoDataCamera::~GeoDataCamera
~GeoDataCamera()
Definition: GeoDataCamera.cpp:40
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:91
Marble::GeoDataCameraPrivate
Definition: GeoDataCamera_p.h:23
Marble::GeoDataCameraPrivate::m_coordinates
GeoDataCoordinates m_coordinates
Definition: GeoDataCamera_p.h:36
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:145
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:128
Marble::GeoDataCameraPrivate::m_tilt
qreal m_tilt
Definition: GeoDataCamera_p.h:39
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:30
Marble::GeoDataCameraPrivate::m_heading
qreal m_heading
Definition: GeoDataCamera_p.h:38
GeoDataCamera_p.h
Marble::GeoDataCamera::altitudeMode
AltitudeMode altitudeMode() const
Definition: GeoDataCamera.cpp:134
Marble::GeoDataCamera::setLongitude
void setLongitude(qreal longitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the longitude in a GeoDataCamera object
Definition: GeoDataCamera.cpp:85
Marble::GeoDataCameraPrivate::m_roll
qreal m_roll
Definition: GeoDataCamera_p.h:37
Marble::GeoDataCamera::heading
qreal heading() const
Definition: GeoDataCamera.cpp:112
Marble::GeoDataCamera::roll
qreal roll() const
Definition: GeoDataCamera.cpp:107
Marble::GeoDataCamera::setRoll
void setRoll(qreal roll)
Definition: GeoDataCamera.cpp:101
Marble::GeoDataCameraPrivate::ref
QAtomicInt ref
Definition: GeoDataCamera_p.h:42
Marble::GeoDataCamera::altitude
qreal altitude() const
retrieves the altitude of the GeoDataCamera object
Definition: GeoDataCamera.cpp:69
Marble::GeoDataCamera::GeoDataCamera
GeoDataCamera()
Definition: GeoDataCamera.cpp:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 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