mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
Try to remember/set last timeframe (upon timestep- or timeframe-changes). Setting the stepsize to a different size, did reset the slider to start (aka timeframe 0). Same when you changed the range (data time) extent. This commit tries to set the slider to the same position as before the step change, if possible). Else it will take the position of the timeframe in which the start of the old timeframe fits. fixes #39994
290 lines
7.7 KiB
Plaintext
290 lines
7.7 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgstemporalnavigationobject.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsTemporalNavigationObject : QgsTemporalController, QgsExpressionContextScopeGenerator
|
|
{
|
|
%Docstring
|
|
Implements a temporal controller based on a frame by frame navigation and animation.
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgstemporalnavigationobject.h"
|
|
%End
|
|
public:
|
|
|
|
QgsTemporalNavigationObject( QObject *parent /TransferThis/ = 0 );
|
|
%Docstring
|
|
Constructor for QgsTemporalNavigationObject, with the specified ``parent`` object.
|
|
%End
|
|
|
|
enum NavigationMode
|
|
{
|
|
NavigationOff,
|
|
Animated,
|
|
FixedRange,
|
|
};
|
|
|
|
enum AnimationState
|
|
{
|
|
Forward,
|
|
Reverse,
|
|
Idle,
|
|
};
|
|
|
|
void setAnimationState( AnimationState state );
|
|
%Docstring
|
|
Sets the current animation ``state``.
|
|
|
|
.. seealso:: :py:func:`animationState`
|
|
%End
|
|
|
|
AnimationState animationState() const;
|
|
%Docstring
|
|
Returns the current animation state.
|
|
|
|
.. seealso:: :py:func:`setAnimationState`
|
|
%End
|
|
|
|
void setNavigationMode( const NavigationMode mode );
|
|
%Docstring
|
|
Sets the temporal navigation ``mode``.
|
|
|
|
.. seealso:: :py:func:`navigationMode`
|
|
%End
|
|
|
|
NavigationMode navigationMode() const;
|
|
%Docstring
|
|
Returns the currenttemporal navigation mode.
|
|
|
|
.. seealso:: :py:func:`setNavigationMode`
|
|
%End
|
|
|
|
void setTemporalExtents( const QgsDateTimeRange &extents );
|
|
%Docstring
|
|
Sets the navigation temporal ``extents``, which dictate the earliest
|
|
and latest date time possible in the animation.
|
|
|
|
.. note::
|
|
|
|
Calling this will reset the :py:func:`~QgsTemporalNavigationObject.currentFrameNumber` to the first frame.
|
|
|
|
.. seealso:: :py:func:`temporalExtents`
|
|
%End
|
|
|
|
QgsDateTimeRange temporalExtents() const;
|
|
%Docstring
|
|
Returns the navigation temporal extents, which dictate the earliest
|
|
and latest date time possible in the animation.
|
|
|
|
.. seealso:: :py:func:`setTemporalExtents`
|
|
%End
|
|
|
|
void setCurrentFrameNumber( long long frame );
|
|
%Docstring
|
|
Sets the current animation ``frame`` number.
|
|
|
|
Caling this method will change the controllers current datetime range to match, based on the
|
|
:py:func:`~QgsTemporalNavigationObject.temporalExtents` and :py:func:`~QgsTemporalNavigationObject.frameDuration` values.
|
|
|
|
.. seealso:: :py:func:`currentFrameNumber`
|
|
%End
|
|
|
|
long long currentFrameNumber() const;
|
|
%Docstring
|
|
Returns the current frame number.
|
|
|
|
.. seealso:: :py:func:`setCurrentFrameNumber`
|
|
%End
|
|
|
|
void setFrameDuration( QgsInterval duration );
|
|
%Docstring
|
|
Sets the frame ``duration``, which dictates the temporal length of each frame in the animation.
|
|
|
|
.. note::
|
|
|
|
Calling this will reset the :py:func:`~QgsTemporalNavigationObject.currentFrameNumber` to the closest temporal match for the previous temporal range.
|
|
|
|
.. seealso:: :py:func:`frameDuration`
|
|
%End
|
|
|
|
QgsInterval frameDuration() const;
|
|
%Docstring
|
|
Returns the current set frame duration, which dictates the temporal length of each frame in the animation.
|
|
|
|
.. seealso:: :py:func:`setFrameDuration`
|
|
%End
|
|
|
|
QgsDateTimeRange dateTimeRangeForFrameNumber( long long frame ) const;
|
|
%Docstring
|
|
Calculates the temporal range associated with a particular animation ``frame``.
|
|
|
|
This is calculated from the navigation start time (taken from :py:func:`~QgsTemporalNavigationObject.temporalExtents`),
|
|
the specified ``frame`` number, and the frame duration (see :py:func:`~QgsTemporalNavigationObject.frameDuration`).
|
|
%End
|
|
|
|
void setFramesPerSecond( double rate );
|
|
%Docstring
|
|
Sets the animation frame ``rate``, in frames per second.
|
|
|
|
This setting controls the overall playback speed of the animation, i.e. how quickly
|
|
a playing animation will advance to the next frame.
|
|
|
|
.. seealso:: :py:func:`framesPerSecond`
|
|
%End
|
|
|
|
double framesPerSecond() const;
|
|
%Docstring
|
|
Returns the animation frame rate, in frames per second.
|
|
|
|
This setting controls the overall playback speed of the animation, i.e. how quickly
|
|
a playing animation will advance to the next frame.
|
|
|
|
.. seealso:: :py:func:`setFramesPerSecond`
|
|
%End
|
|
|
|
void setTemporalRangeCumulative( bool state );
|
|
%Docstring
|
|
Sets the animation temporal range as cumulative.
|
|
|
|
.. seealso:: :py:func:`temporalRangeCumulative`
|
|
%End
|
|
|
|
bool temporalRangeCumulative() const;
|
|
%Docstring
|
|
Returns the animation temporal range cumulative settings.
|
|
|
|
.. seealso:: :py:func:`setTemporalRangeCumulative`
|
|
%End
|
|
|
|
long long totalFrameCount() const;
|
|
%Docstring
|
|
Returns the total number of frames for the navigation.
|
|
%End
|
|
|
|
bool isLooping() const;
|
|
%Docstring
|
|
Returns ``True`` if the animation should loop after hitting the end or start frame.
|
|
|
|
.. seealso:: :py:func:`setLooping`
|
|
%End
|
|
|
|
void setLooping( bool loop );
|
|
%Docstring
|
|
Sets whether the animation should ``loop`` after hitting the end or start frame.
|
|
|
|
.. seealso:: :py:func:`isLooping`
|
|
%End
|
|
|
|
long findBestFrameNumberForFrameStart( const QDateTime &frameStart ) const;
|
|
%Docstring
|
|
Returns the best suited frame number for the specified datetime, based on the start of the corresponding temporal range.
|
|
%End
|
|
|
|
virtual QgsExpressionContextScope *createExpressionContextScope() const /Factory/;
|
|
|
|
|
|
signals:
|
|
|
|
void stateChanged( AnimationState state );
|
|
%Docstring
|
|
Emitted whenever the animation ``state`` changes.
|
|
%End
|
|
|
|
void navigationModeChanged( NavigationMode mode );
|
|
%Docstring
|
|
Emitted whenever the navigation ``mode`` changes.
|
|
%End
|
|
|
|
void temporalExtentsChanged( const QgsDateTimeRange &extent );
|
|
%Docstring
|
|
Emitted whenever the temporalExtent ``extent`` changes.
|
|
%End
|
|
|
|
void temporalFrameDurationChanged( const QgsInterval &interval );
|
|
%Docstring
|
|
Emitted whenever the frameDuration ``interval`` of the controller changes.
|
|
%End
|
|
|
|
|
|
public slots:
|
|
|
|
void play();
|
|
%Docstring
|
|
Starts playing the temporal navigation from its current frame,
|
|
using the direction specified by :py:func:`~QgsTemporalNavigationObject.animationState`
|
|
%End
|
|
|
|
void pause();
|
|
%Docstring
|
|
Pauses the temporal navigation.
|
|
|
|
Calling this slot changes the animation state to idle, preventing
|
|
automatic advancement of frames.
|
|
|
|
It does not affect the current animation frame number or the current
|
|
temporal range of the controller.
|
|
%End
|
|
|
|
void playForward();
|
|
%Docstring
|
|
Starts the animation playing in a forward direction up till the end of all frames.
|
|
%End
|
|
|
|
void playBackward();
|
|
%Docstring
|
|
Starts the animation playing in a reverse direction until the beginning of the time range.
|
|
%End
|
|
|
|
void next();
|
|
%Docstring
|
|
Advances to the next frame.
|
|
|
|
.. note::
|
|
|
|
Calling this slot does not change the current animation state, i.e. a paused animation
|
|
will remain paused.
|
|
%End
|
|
|
|
void previous();
|
|
%Docstring
|
|
Jumps back to the previous frame.
|
|
|
|
.. note::
|
|
|
|
Calling this slot does not change the current animation state, i.e. a paused animation
|
|
will remain paused.
|
|
%End
|
|
|
|
void rewindToStart();
|
|
%Docstring
|
|
Rewinds the temporal navigation to start of the temporal extent.
|
|
%End
|
|
|
|
void skipToEnd();
|
|
%Docstring
|
|
Skips the temporal navigation to end of the temporal extent.
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgstemporalnavigationobject.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|