• 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
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  qAtomicAssign( d, other.d );
39  return *this;
40 }
41 
42 GeoDataLookAt::~GeoDataLookAt()
43 {
44  if( !d->ref.deref() )
45  delete d;
46 }
47 
48 GeoDataAbstractView *GeoDataLookAt::copy() const
49 {
50  return new GeoDataLookAt( *this );
51 }
52 
53 void GeoDataLookAt::setCoordinates( const GeoDataCoordinates& coordinates )
54 {
55  d->m_coordinates = coordinates;
56 }
57 
58 const char* GeoDataLookAt::nodeType() const
59 {
60  return GeoDataTypes::GeoDataLookAtType;
61 }
62 
63 void GeoDataLookAt::setAltitude( qreal altitude )
64 {
65  detach();
66  d->m_coordinates.setAltitude( altitude );
67 }
68 
69 qreal GeoDataLookAt::altitude() const
70 {
71  return d->m_coordinates.altitude();
72 }
73 
74 void GeoDataLookAt::setLatitude( qreal latitude, GeoDataCoordinates::Unit unit )
75 {
76  detach();
77  d->m_coordinates.setLatitude( latitude,unit );
78 }
79 
80 qreal GeoDataLookAt::latitude( GeoDataCoordinates::Unit unit ) const
81 {
82  return d->m_coordinates.latitude( unit );
83 }
84 
85 void GeoDataLookAt::setLongitude( qreal longitude, GeoDataCoordinates::Unit unit )
86 {
87  detach();
88  d->m_coordinates.setLongitude( longitude, unit );
89 }
90 
91 qreal GeoDataLookAt::longitude( GeoDataCoordinates::Unit unit ) const
92 {
93  return d->m_coordinates.longitude( unit );
94 }
95 
96 GeoDataCoordinates GeoDataLookAt::coordinates() const
97 {
98  return d->m_coordinates;
99 }
100 
101 void GeoDataLookAt::setRange( qreal range )
102 {
103  detach();
104  d->m_range = range;
105 }
106 
107 qreal GeoDataLookAt::range() const
108 {
109  return d->m_range;
110 }
111 
112 void GeoDataLookAt::detach()
113 {
114  qAtomicDetach( d );
115 }
116 
117 }
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:28
Marble::GeoDataLookAtPrivate::ref
QAtomicInt ref
Definition: GeoDataLookAt_p.h:38
Marble::GeoDataTypes::GeoDataLookAtType
const char * GeoDataLookAtType
Definition: GeoDataTypes.cpp:54
Marble::GeoDataCoordinates::setAltitude
void setAltitude(const qreal altitude)
set the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1191
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:91
Marble::GeoDataLookAtPrivate::m_range
qreal m_range
Definition: GeoDataLookAt_p.h:36
Marble::GeoDataLookAtPrivate::m_coordinates
GeoDataCoordinates m_coordinates
Definition: GeoDataLookAt_p.h:35
Marble::GeoDataLookAt::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataLookAt.cpp:58
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:85
MarbleDebug.h
Marble::GeoDataLookAt::range
qreal range() const
Retrieve the distance (in meters) between the camera and the object looked at.
Definition: GeoDataLookAt.cpp:107
GeoDataLookAt_p.h
Marble::GeoDataCoordinates::altitude
qreal altitude() const
return the altitude of the Point in meters
Definition: GeoDataCoordinates.cpp:1197
GeoDataLookAt.h
Marble::GeoDataLookAt::setRange
void setRange(qreal range)
Change the distance (in meters) between the camera and the object looked at.
Definition: GeoDataLookAt.cpp:101
Marble::GeoDataLookAt::GeoDataLookAt
GeoDataLookAt()
Definition: GeoDataLookAt.cpp:23
Marble::GeoDataLookAt::altitude
qreal altitude() const
retrieves the altitude of the GeoDataLookAt object
Definition: GeoDataLookAt.cpp:69
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:80
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
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:48
Marble::GeoDataLookAt::detach
void detach()
Definition: GeoDataLookAt.cpp:112
Marble::GeoDataLookAt::coordinates
GeoDataCoordinates coordinates() const
retrieve the lat/lon/alt triple as a GeoDataCoordinates object
Definition: GeoDataLookAt.cpp:96
Marble::GeoDataLookAt::setAltitude
void setAltitude(qreal altitude)
set the altitude in a GeoDataLookAt object
Definition: GeoDataLookAt.cpp:63
Marble::GeoDataLookAt::~GeoDataLookAt
~GeoDataLookAt()
Definition: GeoDataLookAt.cpp:42
Marble::GeoDataLookAt::setLatitude
void setLatitude(qreal latitude, GeoDataCoordinates::Unit unit=GeoDataCoordinates::Radian)
set the latitude in a GeoDataLookAt object
Definition: GeoDataLookAt.cpp:74
Marble::GeoDataLookAt::setCoordinates
void setCoordinates(const GeoDataCoordinates &coordinates)
set the GeoDataCoordinates object
Definition: GeoDataLookAt.cpp:53
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