• 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
GeoDataAbstractView.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 2013 Dennis Nienhüser <earthwings@gentoo.org>
10 //
11 
12 #include "GeoDataAbstractView.h"
13 
14 #include "GeoDataCamera.h"
15 #include "GeoDataLookAt.h"
16 #include "GeoDataTypes.h"
17 
18 namespace Marble {
19 
20 class GeoDataAbstractViewPrivate
21 {
22 public:
23  GeoDataAbstractViewPrivate();
24 
25  GeoDataTimeSpan m_timeSpan;
26  GeoDataTimeStamp m_timeStamp;
27  AltitudeMode m_altitudeMode;
28 };
29 
30 GeoDataAbstractViewPrivate::GeoDataAbstractViewPrivate() :
31  m_timeSpan(),
32  m_timeStamp(),
33  m_altitudeMode( ClampToGround )
34 {
35  // do nothing
36 }
37 
38 GeoDataAbstractView::GeoDataAbstractView() :
39  d( new GeoDataAbstractViewPrivate() )
40 {
41  // do nothing
42 }
43 
44 GeoDataAbstractView::~GeoDataAbstractView()
45 {
46  delete d;
47 }
48 
49 GeoDataAbstractView::GeoDataAbstractView( const GeoDataAbstractView &other ) :
50  GeoDataObject( other ),
51  d( new GeoDataAbstractViewPrivate( *other.d ) )
52 {
53  // nothing to do
54 }
55 
56 GeoDataAbstractView &GeoDataAbstractView::operator =( const GeoDataAbstractView &other )
57 {
58  GeoDataObject::operator=( other );
59  *d = *other.d;
60  return *this;
61 }
62 
63 GeoDataCoordinates GeoDataAbstractView::coordinates() const
64 {
65  if ( nodeType() == GeoDataTypes::GeoDataLookAtType) {
66  const GeoDataLookAt *lookAt = static_cast<const GeoDataLookAt*>( this );
67  if( lookAt ){
68  return lookAt->coordinates();
69  }
70  }
71  else if( nodeType() == GeoDataTypes::GeoDataCameraType ){
72  const GeoDataCamera *camera = static_cast<const GeoDataCamera*>( this );
73  if ( camera ){
74  return camera->coordinates();
75  }
76  }
77  return GeoDataCoordinates();
78 }
79 
80 
81 bool GeoDataAbstractView::equals(const GeoDataAbstractView &other) const
82 {
83  return GeoDataObject::equals(other) &&
84  d->m_timeSpan == other.d->m_timeSpan &&
85  d->m_timeStamp == other.d->m_timeStamp &&
86  d->m_altitudeMode == other.d->m_altitudeMode;
87 }
88 
89 const GeoDataTimeSpan &GeoDataAbstractView::timeSpan() const
90 {
91  return d->m_timeSpan;
92 }
93 
94 GeoDataTimeSpan &GeoDataAbstractView::timeSpan()
95 {
96  return d->m_timeSpan;
97 }
98 
99 void GeoDataAbstractView::setTimeSpan( const GeoDataTimeSpan &timeSpan )
100 {
101  d->m_timeSpan = timeSpan;
102 }
103 
104 GeoDataTimeStamp &GeoDataAbstractView::timeStamp()
105 {
106  return d->m_timeStamp;
107 }
108 
109 const GeoDataTimeStamp &GeoDataAbstractView::timeStamp() const
110 {
111  return d->m_timeStamp;
112 }
113 
114 void GeoDataAbstractView::setTimeStamp( const GeoDataTimeStamp &timeStamp )
115 {
116  d->m_timeStamp = timeStamp;
117 }
118 
119 AltitudeMode GeoDataAbstractView::altitudeMode() const
120 {
121  return d->m_altitudeMode;
122 }
123 
124 void GeoDataAbstractView::setAltitudeMode(const AltitudeMode altitudeMode)
125 {
126  d->m_altitudeMode = altitudeMode;
127 }
128 
129 }
Marble::GeoDataAbstractView::coordinates
GeoDataCoordinates coordinates() const
Definition: GeoDataAbstractView.cpp:63
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoDataAbstractView
Definition: GeoDataAbstractView.h:30
GeoDataAbstractView.h
Marble::GeoDataTimeStamp
Definition: GeoDataTimeStamp.h:27
Marble::GeoDataTypes::GeoDataLookAtType
const char * GeoDataLookAtType
Definition: GeoDataTypes.cpp:58
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::GeoDataObject
A base class for all geodata objects.
Definition: GeoDataObject.h:48
Marble::GeoDataObject::equals
virtual bool equals(const GeoDataObject &other) const
Compares the value of id and targetId of the two objects.
Definition: GeoDataObject.cpp:126
Marble::GeoDataCamera
Definition: GeoDataCamera.h:22
Marble::GeoDataAbstractView::timeStamp
GeoDataTimeStamp & timeStamp()
Definition: GeoDataAbstractView.cpp:104
Marble::GeoDataAbstractView::setAltitudeMode
void setAltitudeMode(const AltitudeMode altitudeMode)
Definition: GeoDataAbstractView.cpp:124
Marble::GeoDataObject::nodeType
virtual const char * nodeType() const =0
Provides type information for downcasting a GeoNode.
GeoDataCamera.h
Marble::GeoDataAbstractView::~GeoDataAbstractView
~GeoDataAbstractView()
Definition: GeoDataAbstractView.cpp:44
Marble::GeoDataAbstractView::operator=
GeoDataAbstractView & operator=(const GeoDataAbstractView &other)
Definition: GeoDataAbstractView.cpp:56
Marble::GeoDataAbstractView::timeSpan
const GeoDataTimeSpan & timeSpan() const
Definition: GeoDataAbstractView.cpp:89
GeoDataLookAt.h
Marble::GeoDataAbstractView::GeoDataAbstractView
GeoDataAbstractView()
Definition: GeoDataAbstractView.cpp:38
Marble::AltitudeMode
AltitudeMode
Definition: MarbleGlobal.h:147
Marble::GeoDataAbstractView::setTimeStamp
void setTimeStamp(const GeoDataTimeStamp &timeStamp)
Definition: GeoDataAbstractView.cpp:114
Marble::GeoDataLookAt
Definition: GeoDataLookAt.h:23
Marble::GeoDataTypes::GeoDataCameraType
const char * GeoDataCameraType
Definition: GeoDataTypes.cpp:31
Marble::GeoDataTimeSpan
Definition: GeoDataTimeSpan.h:28
Marble::GeoDataAbstractView::altitudeMode
AltitudeMode altitudeMode() const
Definition: GeoDataAbstractView.cpp:119
Marble::ClampToGround
Altitude always sticks to ground level.
Definition: MarbleGlobal.h:148
Marble::GeoDataObject::operator=
GeoDataObject & operator=(const GeoDataObject &)
Definition: GeoDataObject.cpp:54
GeoDataTypes.h
Marble::GeoDataLookAt::coordinates
GeoDataCoordinates coordinates() const
retrieve the lat/lon/alt triple as a GeoDataCoordinates object
Definition: GeoDataLookAt.cpp:109
Marble::GeoDataAbstractView::setTimeSpan
void setTimeSpan(const GeoDataTimeSpan &timeSpan)
Definition: GeoDataAbstractView.cpp:99
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