QGIS API Documentation 3.39.0-Master (f549811d78c)
|
Implements a temporal controller based on a frame by frame navigation and animation. More...
#include <qgstemporalnavigationobject.h>
Public Slots | |
void | next () |
Advances to the next frame. | |
void | pause () |
Pauses the temporal navigation. | |
void | play () |
Starts playing the temporal navigation from its current frame, using the direction specified by animationState() | |
void | playBackward () |
Starts the animation playing in a reverse direction until the beginning of the time range. | |
void | playForward () |
Starts the animation playing in a forward direction up till the end of all frames. | |
void | previous () |
Jumps back to the previous frame. | |
void | rewindToStart () |
Rewinds the temporal navigation to start of the temporal extent. | |
void | skipToEnd () |
Skips the temporal navigation to end of the temporal extent. | |
Signals | |
void | navigationModeChanged (Qgis::TemporalNavigationMode mode) |
Emitted whenever the navigation mode changes. | |
void | stateChanged (Qgis::AnimationState state) |
Emitted whenever the animation state changes. | |
void | temporalExtentsChanged (const QgsDateTimeRange &extent) |
Emitted whenever the temporalExtent extent changes. | |
void | temporalFrameDurationChanged (const QgsInterval &interval) |
Emitted whenever the frameDuration interval of the controller changes. | |
void | totalMovieFramesChanged (long long frames) |
Emitted whenever the total number of frames in the movie is changed. | |
Signals inherited from QgsTemporalController | |
void | updateTemporalRange (const QgsDateTimeRange &range) |
Signals that a temporal range has changed and needs to be updated in all connected objects. | |
Public Member Functions | |
QgsTemporalNavigationObject (QObject *parent=nullptr) | |
Constructor for QgsTemporalNavigationObject, with the specified parent object. | |
Qgis::AnimationState | animationState () const |
Returns the current animation state. | |
QList< QgsDateTimeRange > | availableTemporalRanges () const |
Returns the list of all available temporal ranges which have data available. | |
QgsExpressionContextScope * | createExpressionContextScope () const override |
This method needs to be reimplemented in all classes which implement this interface and return an expression context scope. | |
long long | currentFrameNumber () const |
Returns the current frame number. | |
QgsDateTimeRange | dateTimeRangeForFrameNumber (long long frame) const |
Calculates the temporal range associated with a particular animation frame. | |
long long | findBestFrameNumberForFrameStart (const QDateTime &frameStart) const |
Returns the best suited frame number for the specified datetime, based on the start of the corresponding temporal range. | |
QgsInterval | frameDuration () const |
Returns the current set frame duration, which dictates the temporal length of each frame in the animation. | |
double | framesPerSecond () const |
Returns the animation frame rate, in frames per second. | |
bool | isLooping () const |
Returns true if the animation should loop after hitting the end or start frame. | |
Qgis::TemporalNavigationMode | navigationMode () const |
Returns the current temporal navigation mode. | |
void | setAnimationState (Qgis::AnimationState state) |
Sets the current animation state. | |
void | setAvailableTemporalRanges (const QList< QgsDateTimeRange > &ranges) |
Sets the list of all available temporal ranges which have data available. | |
void | setCurrentFrameNumber (long long frame) |
Sets the current animation frame number. | |
void | setFrameDuration (const QgsInterval &duration) |
Sets the frame duration, which dictates the temporal length of each frame in the animation. | |
void | setFramesPerSecond (double rate) |
Sets the animation frame rate, in frames per second. | |
void | setLooping (bool loop) |
Sets whether the animation should loop after hitting the end or start frame. | |
void | setNavigationMode (const Qgis::TemporalNavigationMode mode) |
Sets the temporal navigation mode. | |
void | setTemporalExtents (const QgsDateTimeRange &extents) |
Sets the navigation temporal extents, which dictate the earliest and latest date time possible in the animation. | |
void | setTemporalRangeCumulative (bool state) |
Sets the animation temporal range as cumulative. | |
void | setTotalMovieFrames (long long frames) |
Sets the total number of frames for the movie. | |
QgsDateTimeRange | temporalExtents () const |
Returns the navigation temporal extents, which dictate the earliest and latest date time possible in the animation. | |
bool | temporalRangeCumulative () const |
Returns the animation temporal range cumulative settings. | |
long long | totalFrameCount () const |
Returns the total number of frames for the navigation. | |
long long | totalMovieFrames () const |
Returns the total number of frames for the movie. | |
Public Member Functions inherited from QgsTemporalController | |
QgsTemporalController (QObject *parent=nullptr) | |
Constructor for QgsTemporalController, with the specified parent object. | |
Public Member Functions inherited from QgsExpressionContextScopeGenerator | |
virtual | ~QgsExpressionContextScopeGenerator ()=default |
Implements a temporal controller based on a frame by frame navigation and animation.
Definition at line 39 of file qgstemporalnavigationobject.h.
QgsTemporalNavigationObject::QgsTemporalNavigationObject | ( | QObject * | parent = nullptr | ) |
Constructor for QgsTemporalNavigationObject, with the specified parent object.
Definition at line 23 of file qgstemporalnavigationobject.cpp.
Qgis::AnimationState QgsTemporalNavigationObject::animationState | ( | ) | const |
Returns the current animation state.
Definition at line 370 of file qgstemporalnavigationobject.cpp.
QList< QgsDateTimeRange > QgsTemporalNavigationObject::availableTemporalRanges | ( | ) | const |
Returns the list of all available temporal ranges which have data available.
The ranges list can be a list of non-contiguous ranges (i.e. containing gaps) which together describe the complete range of times which contain data.
Definition at line 210 of file qgstemporalnavigationobject.cpp.
|
overridevirtual |
This method needs to be reimplemented in all classes which implement this interface and return an expression context scope.
Implements QgsExpressionContextScopeGenerator.
Definition at line 90 of file qgstemporalnavigationobject.cpp.
long long QgsTemporalNavigationObject::currentFrameNumber | ( | ) | const |
Returns the current frame number.
Definition at line 227 of file qgstemporalnavigationobject.cpp.
QgsDateTimeRange QgsTemporalNavigationObject::dateTimeRangeForFrameNumber | ( | long long | frame | ) | const |
Calculates the temporal range associated with a particular animation frame.
This is calculated from the navigation start time (taken from temporalExtents()), the specified frame number, and the frame duration (see frameDuration()).
Definition at line 109 of file qgstemporalnavigationobject.cpp.
long long QgsTemporalNavigationObject::findBestFrameNumberForFrameStart | ( | const QDateTime & | frameStart | ) | const |
Returns the best suited frame number for the specified datetime, based on the start of the corresponding temporal range.
Definition at line 375 of file qgstemporalnavigationobject.cpp.
QgsInterval QgsTemporalNavigationObject::frameDuration | ( | ) | const |
Returns the current set frame duration, which dictates the temporal length of each frame in the animation.
Definition at line 252 of file qgstemporalnavigationobject.cpp.
double QgsTemporalNavigationObject::framesPerSecond | ( | ) | const |
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.
Definition at line 266 of file qgstemporalnavigationobject.cpp.
bool QgsTemporalNavigationObject::isLooping | ( | ) | const |
Returns true
if the animation should loop after hitting the end or start frame.
Definition at line 80 of file qgstemporalnavigationobject.cpp.
|
inline |
Returns the current temporal navigation mode.
Definition at line 76 of file qgstemporalnavigationobject.h.
|
signal |
Emitted whenever the navigation mode changes.
|
slot |
Advances to the next frame.
Definition at line 324 of file qgstemporalnavigationobject.cpp.
|
slot |
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.
Definition at line 294 of file qgstemporalnavigationobject.cpp.
|
slot |
Starts playing the temporal navigation from its current frame, using the direction specified by animationState()
Definition at line 289 of file qgstemporalnavigationobject.cpp.
|
slot |
Starts the animation playing in a reverse direction until the beginning of the time range.
Definition at line 312 of file qgstemporalnavigationobject.cpp.
|
slot |
Starts the animation playing in a forward direction up till the end of all frames.
Definition at line 300 of file qgstemporalnavigationobject.cpp.
|
slot |
Jumps back to the previous frame.
Definition at line 329 of file qgstemporalnavigationobject.cpp.
|
slot |
Rewinds the temporal navigation to start of the temporal extent.
Definition at line 334 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setAnimationState | ( | Qgis::AnimationState | state | ) |
Sets the current animation state.
Definition at line 361 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setAvailableTemporalRanges | ( | const QList< QgsDateTimeRange > & | ranges | ) |
Sets the list of all available temporal ranges which have data available.
The ranges list can be a list of non-contiguous ranges (i.e. containing gaps) which together describe the complete range of times which contain data.
Definition at line 205 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setCurrentFrameNumber | ( | long long | frame | ) |
Sets the current animation frame number.
Calling this method will change the controllers current datetime range to match, based on the temporalExtents() and frameDuration() values.
Definition at line 215 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setFrameDuration | ( | const QgsInterval & | duration | ) |
Sets the frame duration, which dictates the temporal length of each frame in the animation.
Definition at line 232 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setFramesPerSecond | ( | double | rate | ) |
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.
Definition at line 257 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setLooping | ( | bool | loop | ) |
Sets whether the animation should loop after hitting the end or start frame.
Definition at line 85 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setNavigationMode | ( | const Qgis::TemporalNavigationMode | mode | ) |
Sets the temporal navigation mode.
Definition at line 141 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setTemporalExtents | ( | const QgsDateTimeRange & | extents | ) |
Sets the navigation temporal extents, which dictate the earliest and latest date time possible in the animation.
Definition at line 167 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setTemporalRangeCumulative | ( | bool | state | ) |
Sets the animation temporal range as cumulative.
Definition at line 271 of file qgstemporalnavigationobject.cpp.
void QgsTemporalNavigationObject::setTotalMovieFrames | ( | long long | frames | ) |
Sets the total number of frames for the movie.
Definition at line 69 of file qgstemporalnavigationobject.cpp.
|
slot |
Skips the temporal navigation to end of the temporal extent.
Definition at line 339 of file qgstemporalnavigationobject.cpp.
|
signal |
Emitted whenever the animation state changes.
QgsDateTimeRange QgsTemporalNavigationObject::temporalExtents | ( | ) | const |
Returns the navigation temporal extents, which dictate the earliest and latest date time possible in the animation.
Definition at line 200 of file qgstemporalnavigationobject.cpp.
|
signal |
Emitted whenever the temporalExtent extent changes.
|
signal |
Emitted whenever the frameDuration interval of the controller changes.
bool QgsTemporalNavigationObject::temporalRangeCumulative | ( | ) | const |
Returns the animation temporal range cumulative settings.
Definition at line 284 of file qgstemporalnavigationobject.cpp.
long long QgsTemporalNavigationObject::totalFrameCount | ( | ) | const |
Returns the total number of frames for the navigation.
Definition at line 345 of file qgstemporalnavigationobject.cpp.
long long QgsTemporalNavigationObject::totalMovieFrames | ( | ) | const |
Returns the total number of frames for the movie.
Definition at line 64 of file qgstemporalnavigationobject.cpp.
|
signal |
Emitted whenever the total number of frames in the movie is changed.