Marble
6 #include "PlaybackFlyToItem.h"
8 #include "GeoDataLookAt.h"
9 #include "GeoDataCamera.h"
10 #include "GeoDataFlyTo.h"
11 #include "Quaternion.h"
17 PlaybackFlyToItem::PlaybackFlyToItem(
const GeoDataFlyTo* flyTo ):
27 const GeoDataFlyTo* PlaybackFlyToItem::flyTo()
const
32 double PlaybackFlyToItem::duration()
const
35 return m_isFirst ? 0 : m_flyTo->duration();
38 void PlaybackFlyToItem::play()
44 if ( !( m_start.isValid() ) ){
46 Q_ASSERT( m_start.isValid() );
54 void PlaybackFlyToItem::playNext()
56 if( !m_start.isValid() ){
60 Q_ASSERT( progress >= 0.0 );
61 double const t = progress / duration();
65 emit progressChanged( progress );
81 void PlaybackFlyToItem::seek(
double t )
95 void 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 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 emit centerOn( b.interpolate( a, c, d, t ) );
113 void PlaybackFlyToItem::setBefore( PlaybackFlyToItem *before )
118 void PlaybackFlyToItem::setNext( PlaybackFlyToItem *next )
123 void PlaybackFlyToItem::setFirst(
bool isFirst)
130 #include "moc_PlaybackFlyToItem.cpp"
QDateTime addMSecs(qint64 msecs) const const
void stop(Ekos::AlignState mode)
QDateTime currentDateTime()
Q_SCRIPTABLE Q_NOREPLY void pause()
Binds a QML item to a specific geodetic location in screen coordinates.
QTextStream & center(QTextStream &stream)
QAction * next(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:27 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.