7#include "GeoDataAbstractView.h"
9#include "GeoDataCamera.h"
10#include "GeoDataLookAt.h"
11#include "GeoDataTimeSpan.h"
12#include "GeoDataTimeStamp.h"
13#include "GeoDataTypes.h"
18class GeoDataAbstractViewPrivate
21 GeoDataAbstractViewPrivate();
23 GeoDataTimeSpan m_timeSpan;
24 GeoDataTimeStamp m_timeStamp;
25 AltitudeMode m_altitudeMode;
28GeoDataAbstractViewPrivate::GeoDataAbstractViewPrivate()
36GeoDataAbstractView::GeoDataAbstractView()
37 : d(new GeoDataAbstractViewPrivate())
42GeoDataAbstractView::~GeoDataAbstractView()
47GeoDataAbstractView::GeoDataAbstractView(
const GeoDataAbstractView &other)
48 : GeoDataObject(other)
49 , d(new GeoDataAbstractViewPrivate(*other.d))
54GeoDataAbstractView &GeoDataAbstractView::operator=(
const GeoDataAbstractView &other)
56 GeoDataObject::operator=(other);
61bool GeoDataAbstractView::operator==(
const GeoDataAbstractView &other)
const
63 if (nodeType() != other.nodeType()) {
67 if (nodeType() == GeoDataTypes::GeoDataCameraType) {
68 const auto &thisCam =
static_cast<const GeoDataCamera &
>(*this);
69 const auto &otherCam =
static_cast<const GeoDataCamera &
>(other);
71 return thisCam == otherCam;
72 }
else if (nodeType() == GeoDataTypes::GeoDataLookAtType) {
73 const auto &thisLookAt =
static_cast<const GeoDataLookAt &
>(*this);
74 const auto &otherLookAt =
static_cast<const GeoDataLookAt &
>(other);
76 return thisLookAt == otherLookAt;
82GeoDataCoordinates GeoDataAbstractView::coordinates()
const
84 if (nodeType() == GeoDataTypes::GeoDataLookAtType) {
85 const auto lookAt =
static_cast<const GeoDataLookAt *
>(
this);
87 return lookAt->coordinates();
89 }
else if (nodeType() == GeoDataTypes::GeoDataCameraType) {
90 const auto camera =
static_cast<const GeoDataCamera *
>(
this);
92 return camera->coordinates();
98bool GeoDataAbstractView::equals(
const GeoDataAbstractView &other)
const
100 return GeoDataObject::equals(other) && d->m_timeSpan == other.d->m_timeSpan && d->m_timeStamp == other.d->m_timeStamp
101 && d->m_altitudeMode == other.d->m_altitudeMode;
104const GeoDataTimeSpan &GeoDataAbstractView::timeSpan()
const
106 return d->m_timeSpan;
109GeoDataTimeSpan &GeoDataAbstractView::timeSpan()
111 return d->m_timeSpan;
114void GeoDataAbstractView::setTimeSpan(
const GeoDataTimeSpan &timeSpan)
116 d->m_timeSpan = timeSpan;
119GeoDataTimeStamp &GeoDataAbstractView::timeStamp()
121 return d->m_timeStamp;
124const GeoDataTimeStamp &GeoDataAbstractView::timeStamp()
const
126 return d->m_timeStamp;
129void GeoDataAbstractView::setTimeStamp(
const GeoDataTimeStamp &timeStamp)
131 d->m_timeStamp = timeStamp;
134AltitudeMode GeoDataAbstractView::altitudeMode()
const
136 return d->m_altitudeMode;
139void GeoDataAbstractView::setAltitudeMode(
const AltitudeMode altitudeMode)
141 d->m_altitudeMode = altitudeMode;
Q_SCRIPTABLE QString camera()
Binds a QML item to a specific geodetic location in screen coordinates.
@ ClampToGround
Altitude always sticks to ground level.