|
QGIS API Documentation 4.3.0-Master (16649ce5cc6)
|
Renders animated particle traces over a vector field. More...
#include <qgsvectorfieldtraceanimationgenerator.h>

Public Member Functions | |
| QgsVectorFieldTraceAnimationGenerator (const QgsVectorFieldTraceAnimationGenerator &other) | |
| QgsVectorFieldTraceAnimationGenerator (std::unique_ptr< QgsVectorFieldValueSource > source, const QgsRenderContext &rendererContext, const QgsVectorFieldSettings &vectorSettings, bool minimizeFieldSize=true) | |
| Constructs a generator sampling the vector field from source, which is taken ownership of. | |
| ~QgsVectorFieldTraceAnimationGenerator () | |
| QImage | imageRendered () |
| Moves all the particles using frame per second (fps) to calculate the displacement and return the rendered frame. | |
| QgsVectorFieldTraceAnimationGenerator & | operator= (const QgsVectorFieldTraceAnimationGenerator &other) |
| void | seedRandomParticles (int count) |
| Seeds particles in the vector field. | |
| void | setFramesPerSecond (int frames) |
| Sets the number of frames per seconds that will be rendered. | |
| void | setMaximumSpeedPixel (int pixels) |
| Sets the max number of pixels that can be go through by the particles in 1 second. | |
| void | setMinimumTailLength (int l) |
| Sets the minimum tail length. | |
| void | setParticlesColor (const QColor &c) |
| Sets colors of particle. | |
| void | setParticlesLifeTime (double particleLifeTime) |
| Sets maximum life time of particles in seconds. | |
| void | setParticlesSize (double width) |
| Sets particle size in px. | |
| void | setTailFactor (double fct) |
| Sets the tail factor, used to adjust the length of the tail. 0 : minimum length, >1 increase the tail. | |
| void | setTailPersitence (double p) |
| Sets the visual persistence of the tail. | |
Static Public Member Functions | |
| static QgsVectorFieldTraceAnimationGenerator * | fromMeshLayer (QgsMeshLayer *layer, const QgsRenderContext &rendererContext) |
Returns a generator for the active vector dataset of layer, or nullptr if the layer has no vector dataset to animate. | |
Protected Member Functions | |
| QgsVectorFieldTraceAnimationGenerator (QgsMeshLayer *layer, const QgsRenderContext &rendererContext) | |
| Constructs a generator for the active vector dataset of layer. | |
Renders animated particle traces over a vector field.
Unlike the trace symbology of a layer renderer, which draws a single static frame, this class keeps the particles alive between calls so that successive imageRendered() calls produce the frames of an animation.
The vector field can come from any source, so the same generator serves mesh layers and any other layer type able to expose a vector field.
Definition at line 48 of file qgsvectorfieldtraceanimationgenerator.h.
| QgsVectorFieldTraceAnimationGenerator::QgsVectorFieldTraceAnimationGenerator | ( | std::unique_ptr< QgsVectorFieldValueSource > | source, |
| const QgsRenderContext & | rendererContext, | ||
| const QgsVectorFieldSettings & | vectorSettings, | ||
| bool | minimizeFieldSize = true ) |
Constructs a generator sampling the vector field from source, which is taken ownership of.
If minimizeFieldSize is true the animated field only covers the part of the data which is currently on the device, otherwise it covers the whole rendered extent.
Definition at line 28 of file qgsvectorfieldtraceanimationgenerator.cpp.
| QgsVectorFieldTraceAnimationGenerator::QgsVectorFieldTraceAnimationGenerator | ( | const QgsVectorFieldTraceAnimationGenerator & | other | ) |
Definition at line 111 of file qgsvectorfieldtraceanimationgenerator.cpp.
|
default |
|
protected |
Constructs a generator for the active vector dataset of layer.
Only call this when QgsVectorFieldTraceAnimationGenerator::fromMeshLayer() would return a generator for layer, that is when the layer actually has a vector dataset to animate.
Definition at line 51 of file qgsvectorfieldtraceanimationgenerator.cpp.
|
static |
Returns a generator for the active vector dataset of layer, or nullptr if the layer has no vector dataset to animate.
The caller takes ownership of the returned generator.
Definition at line 38 of file qgsvectorfieldtraceanimationgenerator.cpp.
| QImage QgsVectorFieldTraceAnimationGenerator::imageRendered | ( | ) |
Moves all the particles using frame per second (fps) to calculate the displacement and return the rendered frame.
Definition at line 127 of file qgsvectorfieldtraceanimationgenerator.cpp.
| QgsVectorFieldTraceAnimationGenerator & QgsVectorFieldTraceAnimationGenerator::operator= | ( | const QgsVectorFieldTraceAnimationGenerator & | other | ) |
Definition at line 184 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::seedRandomParticles | ( | int | count | ) |
Seeds particles in the vector field.
Definition at line 121 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::setFramesPerSecond | ( | int | frames | ) |
Sets the number of frames per seconds that will be rendered.
Definition at line 133 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::setMaximumSpeedPixel | ( | int | pixels | ) |
Sets the max number of pixels that can be go through by the particles in 1 second.
Definition at line 143 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::setMinimumTailLength | ( | int | l | ) |
Sets the minimum tail length.
Definition at line 170 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::setParticlesColor | ( | const QColor & | c | ) |
Sets colors of particle.
Definition at line 155 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::setParticlesLifeTime | ( | double | particleLifeTime | ) |
Sets maximum life time of particles in seconds.
Definition at line 149 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::setParticlesSize | ( | double | width | ) |
Sets particle size in px.
Definition at line 160 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::setTailFactor | ( | double | fct | ) |
Sets the tail factor, used to adjust the length of the tail. 0 : minimum length, >1 increase the tail.
Definition at line 165 of file qgsvectorfieldtraceanimationgenerator.cpp.
| void QgsVectorFieldTraceAnimationGenerator::setTailPersitence | ( | double | p | ) |
Sets the visual persistence of the tail.
Definition at line 175 of file qgsvectorfieldtraceanimationgenerator.cpp.