7 #include "GeoDataAbstractView.h"
9 #include "GeoDataCamera.h"
10 #include "GeoDataLookAt.h"
11 #include "GeoDataTypes.h"
12 #include "GeoDataTimeSpan.h"
13 #include "GeoDataTimeStamp.h"
17 class GeoDataAbstractViewPrivate
20 GeoDataAbstractViewPrivate();
22 GeoDataTimeSpan m_timeSpan;
23 GeoDataTimeStamp m_timeStamp;
27 GeoDataAbstractViewPrivate::GeoDataAbstractViewPrivate() :
35 GeoDataAbstractView::GeoDataAbstractView() :
36 d( new GeoDataAbstractViewPrivate() )
41 GeoDataAbstractView::~GeoDataAbstractView()
46 GeoDataAbstractView::GeoDataAbstractView(
const GeoDataAbstractView &other ) :
47 GeoDataObject( other ),
48 d( new GeoDataAbstractViewPrivate( *other.d ) )
53 GeoDataAbstractView &GeoDataAbstractView::operator =(
const GeoDataAbstractView &other )
55 GeoDataObject::operator=( other );
60 bool GeoDataAbstractView::operator==(
const GeoDataAbstractView &other)
const
62 if (
nodeType() != other.nodeType()) {
66 if (
nodeType() == GeoDataTypes::GeoDataCameraType) {
67 const GeoDataCamera &thisCam =
static_cast<const GeoDataCamera &
>(*this);
68 const GeoDataCamera &otherCam =
static_cast<const GeoDataCamera &
>(other);
70 return thisCam == otherCam;
71 }
else if (
nodeType() == GeoDataTypes::GeoDataLookAtType) {
72 const GeoDataLookAt &thisLookAt =
static_cast<const GeoDataLookAt &
>(*this);
73 const GeoDataLookAt &otherLookAt =
static_cast<const GeoDataLookAt &
>(other);
75 return thisLookAt == otherLookAt;
81 GeoDataCoordinates GeoDataAbstractView::coordinates()
const
83 if (
nodeType() == GeoDataTypes::GeoDataLookAtType) {
84 const GeoDataLookAt *lookAt =
static_cast<const GeoDataLookAt*
>( this );
86 return lookAt->coordinates();
89 else if(
nodeType() == GeoDataTypes::GeoDataCameraType ){
90 const GeoDataCamera *
camera =
static_cast<const GeoDataCamera*
>( this );
92 return camera->coordinates();
95 return GeoDataCoordinates();
99 bool GeoDataAbstractView::equals(
const GeoDataAbstractView &other)
const
102 d->m_timeSpan == other.d->m_timeSpan &&
103 d->m_timeStamp == other.d->m_timeStamp &&
104 d->m_altitudeMode == other.d->m_altitudeMode;
107 const GeoDataTimeSpan &GeoDataAbstractView::timeSpan()
const
109 return d->m_timeSpan;
112 GeoDataTimeSpan &GeoDataAbstractView::timeSpan()
114 return d->m_timeSpan;
117 void GeoDataAbstractView::setTimeSpan(
const GeoDataTimeSpan &timeSpan )
119 d->m_timeSpan = timeSpan;
122 GeoDataTimeStamp &GeoDataAbstractView::timeStamp()
124 return d->m_timeStamp;
127 const GeoDataTimeStamp &GeoDataAbstractView::timeStamp()
const
129 return d->m_timeStamp;
132 void GeoDataAbstractView::setTimeStamp(
const GeoDataTimeStamp &timeStamp )
134 d->m_timeStamp = timeStamp;
139 return d->m_altitudeMode;
142 void GeoDataAbstractView::setAltitudeMode(
const AltitudeMode altitudeMode)
144 d->m_altitudeMode = altitudeMode;