Class: QgsTemporalNavigationObject¶
- class qgis.core.QgsTemporalNavigationObject¶
Bases:
QgsTemporalController
,QgsExpressionContextScopeGenerator
Implements a temporal controller based on a frame by frame navigation and animation.
New in version 3.14.
QgsTemporalNavigationObject(parent: QObject = None) Constructor for
QgsTemporalNavigationObject
, with the specifiedparent
object.Methods
Returns the current animation state.
Returns the list of all available temporal ranges which have data available.
- rtype:
QgsExpressionContextScope
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
True
if the animation should loop after hitting the end or start frame.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
animationState()
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.
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.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
Attributes
- Animated = 1¶
- class AnimationState¶
Bases:
int
- FixedRange = 2¶
- Forward = 0¶
- Idle = 2¶
- class NavigationMode¶
Bases:
int
- NavigationOff = 0¶
- Reverse = 1¶
- animationState(self) → QgsTemporalNavigationObject.AnimationState¶
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
New in version 3.20.
- Return type:
List[QgsDateTimeRange]
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- createExpressionContextScope(self) → QgsExpressionContextScope¶
- Return type:
- currentFrameNumber(self) → int¶
Returns the current frame number.
See also
- Return type:
int
- customEvent(self, QEvent)¶
- dateTimeRangeForFrameNumber(self, frame: int) → QgsDateTimeRange¶
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:
- disconnectNotify(self, QMetaMethod)¶
- 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) –
- Return type:
int
- frameDuration(self) → QgsInterval¶
Returns the current set frame duration, which dictates the temporal length of each frame in the animation.
See also
- Return type:
- framesPerSecond(self) → float¶
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¶
Returns
True
if the animation should loop after hitting the end or start frame.See also
- Return type:
bool
- isSignalConnected(self, QMetaMethod) → bool¶
- navigationMode(self) → QgsTemporalNavigationObject.NavigationMode¶
Returns the current temporal navigation mode.
See also
- Return type:
- navigationModeChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- next(self)¶
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)¶
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)¶
Starts playing the temporal navigation from its current frame, using the direction specified by
animationState()
- playBackward(self)¶
Starts the animation playing in a reverse direction until the beginning of the time range.
- playForward(self)¶
Starts the animation playing in a forward direction up till the end of all frames.
- previous(self)¶
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.
- receivers(self, PYQT_SIGNAL) → int¶
- rewindToStart(self)¶
Rewinds the temporal navigation to start of the temporal extent.
- sender(self) → QObject¶
- senderSignalIndex(self) → int¶
- setAnimationState(self, state: QgsTemporalNavigationObject.AnimationState)¶
Sets the current animation
state
.See also
- Parameters:
- setAvailableTemporalRanges(self, ranges: Iterable[QgsDateTimeRange])¶
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
New in version 3.20.
- Parameters:
ranges (Iterable[QgsDateTimeRange]) –
- setCurrentFrameNumber(self, frame: int)¶
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)¶
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)¶
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)¶
Sets whether the animation should
loop
after hitting the end or start frame.See also
- Parameters:
loop (bool) –
- setNavigationMode(self, mode: QgsTemporalNavigationObject.NavigationMode)¶
Sets the temporal navigation
mode
.See also
- Parameters:
- setTemporalExtents(self, extents: QgsDateTimeRange)¶
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)¶
Sets the animation temporal range as cumulative.
See also
- Parameters:
state (bool) –
- skipToEnd(self)¶
Skips the temporal navigation to end of the temporal extent.
- stateChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- temporalExtents(self) → QgsDateTimeRange¶
Returns the navigation temporal extents, which dictate the earliest and latest date time possible in the animation.
See also
- Return type:
- temporalExtentsChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- temporalFrameDurationChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- temporalRangeCumulative(self) → bool¶
Returns the animation temporal range cumulative settings.
See also
- Return type:
bool
- timerEvent(self, QTimerEvent)¶
- totalFrameCount(self) → int¶
Returns the total number of frames for the navigation.
- Return type:
int