Class QAccelPlot::TransitionRunner¶
ClassList > QAccelPlot > TransitionRunner
Runs the DataTransition assigned to one item, such as a custom series.More...
#include <TransitionRunner.hpp>
Inherits the following classes: QObject
Inheritance diagram¶
flowchart TB
classQAccelPlot_1_1TransitionRunner["QAccelPlot::TransitionRunner"]
external_base_classQAccelPlot_1_1TransitionRunner_1["QObject"]
external_base_classQAccelPlot_1_1TransitionRunner_1 --> classQAccelPlot_1_1TransitionRunner
Public Signals¶
| Type | Name |
|---|---|
| signal void | frameDue Emitted once per rendered frame while the run is active. |
| signal void | interrupted Emitted when the run stopped before its end: the transition was replaced, cancelled, or destroyed. |
| signal void | transitionDestroyed Emitted after the assigned transition was destroyed, when transition() is alreadynullptr . |
Public Functions¶
| Type | Name |
|---|---|
| TransitionRunner (QQuickItem * item) Constructs the runner for item , which must outlive it. |
|
| bool | active () const Returns true while the transition advances the run. |
| bool | advance (std::vector< double > & outData, int & outPointCount) Writes the frame of the run into outData and__outPointCount , or the target data when the run ends. |
| void | cancel () Ends the run and discards its data. |
| bool | enabled () const Returns true when a transition is assigned and enabled, so new data should start a run. |
| bool | finish (std::vector< double > & outData, int & outPointCount) Ends the run and moves its target data into outData and__outPointCount . |
| bool | pending () const Returns true while the run holds target data thatfinish() has not taken. |
| bool | setTransition (DataTransition * transition) Assigns transition , interrupting a pending run first. The runner does not own it. |
| void | start (const std::vector< double > & currentData, int currentPointCount, std::vector< double > && newData, int newPointCount, int stride=2) Starts the run on the assigned transition and requests a frame. Requires an assigned transition. |
| const std::vector< double > & | targetData () const Returns the target data. Valid while pending() istrue . |
| int | targetPointCount () const Returns the number of points in targetData() . |
| DataTransition * | transition () const Returns the assigned transition, or nullptr . |
| ~TransitionRunner () override Ends the run without emitting interrupted() . |
Detailed Description¶
Holds the item's DataTransition::Run and asks for a frame once per rendered frame while it is active. The request comes on the GUI thread from QQuickWindow::afterAnimating, before the scene graph syncs, so DataTransition::runningChanged reaches QML there and the frame renders the new step. LineCurve, BarSeries, and PointCloud animate through it.
** **
- Forward the item's
transitionproperty totransition()andsetTransition(). - When data arrives and
enabled()istrue, callstart(); otherwise callcancel()and show the data. - On
frameDue(), calladvance()and show the frame. - On
interrupted(), callfinish()and show the target data.
Use it on the item's thread only.
See also: DataTransition
Public Signals Documentation¶
signal frameDue¶
Emitted once per rendered frame while the run is active.
signal interrupted¶
Emitted when the run stopped before its end: the transition was replaced, cancelled, or destroyed.
The run still holds the target data. A run still pending after the signal is cancelled.
signal transitionDestroyed¶
Emitted after the assigned transition was destroyed, when transition() is alreadynullptr .
Public Functions Documentation¶
function TransitionRunner¶
Constructs the runner for item , which must outlive it.
function active¶
Returns true while the transition advances the run.
function advance¶
Writes the frame of the run into outData and__outPointCount , or the target data when the run ends.
Call it from a frameDue() handler.
Returns:
true if the run is still active after this call.
function cancel¶
Ends the run and discards its data.
function enabled¶
Returns true when a transition is assigned and enabled, so new data should start a run.
function finish¶
Ends the run and moves its target data into outData and__outPointCount .
Returns:
false, leaving the outputs unchanged, when the run is not pending.
function pending¶
Returns true while the run holds target data thatfinish() has not taken.
function setTransition¶
Assigns transition , interrupting a pending run first. The runner does not own it.
Returns:
false when transition is already assigned.
function start¶
Starts the run on the assigned transition and requests a frame. Requires an assigned transition.
void QAccelPlot::TransitionRunner::start (
const std::vector< double > & currentData,
int currentPointCount,
std::vector< double > && newData,
int newPointCount,
int stride=2
)
Parameters:
currentDataCurrent double buffer (copied as the from state).currentPointCountNumber of points in currentData.newDataTarget double buffer (moved as the to state).newPointCountNumber of points in newData.strideNumber of values per point in both buffers. Default: 2, XY points.
function targetData¶
Returns the target data. Valid while pending() istrue .
function targetPointCount¶
Returns the number of points in targetData() .
function transition¶
Returns the assigned transition, or nullptr .
function ~TransitionRunner¶
Ends the run without emitting interrupted() .
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/transitions/TransitionRunner.hpp