Class: QgsTemporalNavigationObject¶
Implements a temporal controller based on a frame by frame navigation and animation.
Added in version 3.14.
Class Hierarchy¶
Base classes¶
A controller base class for temporal objects, contains a signal for notifying updates of the objects temporal range. |
|
Abstract interface for generating an expression context scope. |
Enums
Animation states. |
|
alias of |
Methods
Returns the current animation state. |
|
Returns the list of all available temporal ranges which have data available. |
|
Returns the current frame number. |
|
Calculates the temporal range associated with a particular animation frame. |
|
Returns the best suited frame number for the specified datetime, based on the start of the corresponding temporal range. |
|
Returns the current set frame duration, which dictates the temporal length of each frame in the animation. |
|
Returns the animation frame rate, in frames per second. |
|
Returns |
|
Returns the current temporal navigation mode. |
|
Advances to the next frame. |
|
Pauses the temporal navigation. |
|
Starts playing the temporal navigation from its current frame, using the direction specified by |
|
Starts the animation playing in a reverse direction until the beginning of the time range. |
|
Starts the animation playing in a forward direction up till the end of all frames. |
|
Jumps back to the previous frame. |
|
Rewinds the temporal navigation to start of the temporal extent. |
|
Sets the current animation state. |
|
Sets the list of all available temporal ranges which have data available. |
|
Sets the current animation frame number. |
|
Sets the frame duration, which dictates the temporal length of each frame in the animation. |
|
Sets the animation frame rate, in frames per second. |
|
Sets whether the animation should loop after hitting the end or start frame. |
|
Sets the temporal navigation mode. |
|
Sets the navigation temporal extents, which dictate the earliest and latest date time possible in the animation. |
|
Sets the animation temporal range as cumulative. |
|
Sets the total number of frames for the movie. |
|
Skips the temporal navigation to end of the temporal extent. |
|
Returns the navigation temporal extents, which dictate the earliest and latest date time possible in the animation. |
|
Returns the animation temporal range cumulative settings. |
|
Returns the total number of frames for the navigation. |
|
Returns the total number of frames for the movie. |
Signals
Emitted whenever the navigation mode changes. |
|
Emitted whenever the animation state changes. |
|
Emitted whenever the temporalExtent extent changes. |
|
Emitted whenever the frameDuration interval of the controller changes. |
|
Emitted whenever the total number of frames in the movie is changed. |
- class qgis.core.QgsTemporalNavigationObject[source]¶
Bases:
QgsTemporalController
,QgsExpressionContextScopeGenerator
- __init__(parent: QObject | None = None)
Constructor for QgsTemporalNavigationObject, with the specified
parent
object.- Parameters:
parent (Optional[QObject] = None)
- class AnimationState(*values)¶
Bases:
IntEnum
Animation states.
Note
Prior to QGIS 3.36 this was available as
QgsTemporalNavigationObject
.AnimationStateAdded in version 3.36.
Forward
: Animation is playing forward.Reverse
: Animation is playing in reverse.Idle
: Animation is paused.
- NavigationMode¶
alias of
TemporalNavigationMode
- animationState(self) → Qgis.AnimationState[source]¶
Returns the current animation state.
See also
- Return type:
- availableTemporalRanges(self) → List[QgsDateTimeRange]¶
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.
See also
Added in version 3.20.
- Return type:
List[QgsDateTimeRange]
- currentFrameNumber(self) → int¶
Returns the current frame number.
See also
- Return type:
int
- dateTimeRangeForFrameNumber(self, frame: int) → QgsDateTimeRange[source]¶
Calculates the temporal range associated with a particular animation
frame
.This is calculated from the navigation start time (taken from
temporalExtents()
), the specifiedframe
number, and the frame duration (seeframeDuration()
).- Parameters:
frame (int)
- Return type:
- findBestFrameNumberForFrameStart(self, frameStart: QDateTime | datetime.datetime) → int¶
Returns the best suited frame number for the specified datetime, based on the start of the corresponding temporal range.
- Parameters:
frameStart (Union[QDateTime, datetime.datetime])
- Return type:
int
- frameDuration(self) → QgsInterval[source]¶
Returns the current set frame duration, which dictates the temporal length of each frame in the animation.
See also
- Return type:
- framesPerSecond(self) → float[source]¶
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.
See also
- Return type:
float
- isLooping(self) → bool[source]¶
Returns
True
if the animation should loop after hitting the end or start frame.See also
- Return type:
bool
- navigationMode(self) → Qgis.TemporalNavigationMode[source]¶
Returns the current temporal navigation mode.
See also
- Return type:
- signal navigationModeChanged(mode: Qgis.TemporalNavigationMode)[source]¶
Emitted whenever the navigation
mode
changes.- Parameters:
mode (Qgis.TemporalNavigationMode)
- next(self)[source]¶
Advances to the next frame.
Note
Calling this slot does not change the current animation state, i.e. a paused animation will remain paused.
- pause(self)[source]¶
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.
- play(self)[source]¶
Starts playing the temporal navigation from its current frame, using the direction specified by
animationState()
- playBackward(self)[source]¶
Starts the animation playing in a reverse direction until the beginning of the time range.
- playForward(self)[source]¶
Starts the animation playing in a forward direction up till the end of all frames.
- previous(self)[source]¶
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.
- setAnimationState(self, state: Qgis.AnimationState)[source]¶
Sets the current animation
state
.See also
- Parameters:
state (Qgis.AnimationState)
- setAvailableTemporalRanges(self, ranges: Iterable[QgsDateTimeRange])[source]¶
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.See also
Added in version 3.20.
- Parameters:
ranges (Iterable[QgsDateTimeRange])
- setCurrentFrameNumber(self, frame: int)[source]¶
Sets the current animation
frame
number.Calling this method will change the controllers current datetime range to match, based on the
temporalExtents()
andframeDuration()
values.See also
- Parameters:
frame (int)
- setFrameDuration(self, duration: QgsInterval)[source]¶
Sets the frame
duration
, which dictates the temporal length of each frame in the animation.Note
Calling this will reset the
currentFrameNumber()
to the closest temporal match for the previous temporal range.See also
- Parameters:
duration (QgsInterval)
- setFramesPerSecond(self, rate: float)[source]¶
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.
See also
- Parameters:
rate (float)
- setLooping(self, loop: bool)[source]¶
Sets whether the animation should
loop
after hitting the end or start frame.See also
- Parameters:
loop (bool)
- setNavigationMode(self, mode: Qgis.TemporalNavigationMode)[source]¶
Sets the temporal navigation
mode
.See also
- Parameters:
mode (Qgis.TemporalNavigationMode)
- setTemporalExtents(self, extents: QgsDateTimeRange)[source]¶
Sets the navigation temporal
extents
, which dictate the earliest and latest date time possible in the animation.Note
Calling this will reset the
currentFrameNumber()
to the first frame.See also
- Parameters:
extents (QgsDateTimeRange)
- setTemporalRangeCumulative(self, state: bool)[source]¶
Sets the animation temporal range as cumulative.
See also
- Parameters:
state (bool)
- setTotalMovieFrames(self, frames: int)[source]¶
Sets the total number of
frames
for the movie.Note
This is only used when the
navigationMode()
is set toQgis
.TemporalNavigationMode.Movie.See also
See also
Added in version 3.36.
- Parameters:
frames (int)
- signal stateChanged(state: Qgis.AnimationState)[source]¶
Emitted whenever the animation
state
changes.- Parameters:
state (Qgis.AnimationState)
- temporalExtents(self) → QgsDateTimeRange[source]¶
Returns the navigation temporal extents, which dictate the earliest and latest date time possible in the animation.
See also
- Return type:
- signal temporalExtentsChanged(extent: QgsDateTimeRange)[source]¶
Emitted whenever the temporalExtent
extent
changes.- Parameters:
extent (QgsDateTimeRange)
- signal temporalFrameDurationChanged(interval: QgsInterval)[source]¶
Emitted whenever the frameDuration
interval
of the controller changes.- Parameters:
interval (QgsInterval)
- temporalRangeCumulative(self) → bool[source]¶
Returns the animation temporal range cumulative settings.
See also
- Return type:
bool
- totalFrameCount(self) → int¶
Returns the total number of frames for the navigation.
- Return type:
int
- totalMovieFrames(self) → int¶
Returns the total number of frames for the movie.
Note
This is only used when the
navigationMode()
is set toQgis
.TemporalNavigationMode.Movie.See also
See also
Added in version 3.36.
- Return type:
int
- signal totalMovieFramesChanged(frames: int)[source]¶
Emitted whenever the total number of
frames
in the movie is changed.Note
This is only used when the
navigationMode()
is set toQgis
.TemporalNavigationMode.Movie.See also
See also
Added in version 3.36.
- Parameters:
frames (int)