6#include "PlaybackFlyToItem.h"
8#include "GeoDataCamera.h"
9#include "GeoDataFlyTo.h"
10#include "GeoDataLookAt.h"
11#include "Quaternion.h"
17PlaybackFlyToItem::PlaybackFlyToItem(
const GeoDataFlyTo *flyTo)
27const GeoDataFlyTo *PlaybackFlyToItem::flyTo()
const
32double PlaybackFlyToItem::duration()
const
35 return m_isFirst ? 0 : m_flyTo->duration();
38void PlaybackFlyToItem::play()
44 if (!(m_start.isValid())) {
46 Q_ASSERT(m_start.isValid());
54void PlaybackFlyToItem::playNext()
56 if (!m_start.isValid()) {
60 Q_ASSERT(progress >= 0.0);
61 double const t = progress / duration();
65 Q_EMIT progressChanged(progress);
75void PlaybackFlyToItem::pause()
81void PlaybackFlyToItem::seek(
double t)
88void PlaybackFlyToItem::stop()
95void PlaybackFlyToItem::center(
double t)
97 Q_ASSERT(t >= 0.0 && t <= 1.0);
99 if (m_flyTo->flyToMode() == GeoDataFlyTo::Bounce || !m_before->m_before || !m_next) {
100 GeoDataCoordinates
const a = m_before->m_flyTo->view()->coordinates();
101 GeoDataCoordinates
const b = m_flyTo->view()->coordinates();
102 Q_EMIT centerOn(a.interpolate(b, t));
104 Q_ASSERT(m_flyTo->flyToMode() == GeoDataFlyTo::Smooth);
105 GeoDataCoordinates
const a = m_before->m_before->m_flyTo->view()->coordinates();
106 GeoDataCoordinates
const b = m_before->m_flyTo->view()->coordinates();
107 GeoDataCoordinates
const c = m_flyTo->view()->coordinates();
108 GeoDataCoordinates
const d = m_next->m_flyTo->view()->coordinates();
109 Q_EMIT centerOn(b.interpolate(a, c, d, t));
113void PlaybackFlyToItem::setBefore(PlaybackFlyToItem *before)
118void PlaybackFlyToItem::setNext(PlaybackFlyToItem *next)
123void PlaybackFlyToItem::setFirst(
bool isFirst)
130#include "moc_PlaybackFlyToItem.cpp"
void stop(Ekos::AlignState mode)
QAction * next(const QObject *recvr, const char *slot, QObject *parent)
Binds a QML item to a specific geodetic location in screen coordinates.
QDateTime addMSecs(qint64 msecs) const const
QDateTime currentDateTime()
QTextStream & center(QTextStream &stream)