QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgs3danimationsettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgs3danimationsettings.h
3 --------------------------------------
4 Date : July 2018
5 Copyright : (C) 2018 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGS3DANIMATIONSETTINGS_H
17#define QGS3DANIMATIONSETTINGS_H
18
19#include "qgsvector3d.h"
20#include "qgis_3d.h"
21
22#include <QEasingCurve>
23#include <QVector>
24
25class QDomDocument;
26class QDomElement;
28
29#define SIP_NO_FILE
30
38class _3D_EXPORT Qgs3DAnimationSettings
39{
40 public:
42
44 struct Keyframe
45 {
46 float time = 0;
48 float dist = 0;
49 float pitch = 0;
50 float yaw = 0;
51 };
52
53 typedef QVector<Keyframe> Keyframes;
54
56 void setKeyframes( const Keyframes &keyframes ) { mKeyframes = keyframes; }
58 Keyframes keyFrames() const { return mKeyframes; }
59
61 void setEasingCurve( const QEasingCurve &curve ) { mEasingCurve = curve; }
63 QEasingCurve easingCurve() const { return mEasingCurve; }
64
66 float duration() const;
67
69 Keyframe interpolate( float time ) const;
70
72 void readXml( const QDomElement &elem );
74 QDomElement writeXml( QDomDocument &doc ) const;
75
76 private:
77 Keyframes mKeyframes;
78 QEasingCurve mEasingCurve;
79};
80
82
83#endif // QGS3DANIMATIONSETTINGS_H
void setEasingCurve(const QEasingCurve &curve)
Sets the interpolation method for transitions of the camera.
QEasingCurve easingCurve() const
Returns the interpolation method for transitions of the camera.
Keyframes keyFrames() const
Returns keyframes of the animation.
void setKeyframes(const Keyframes &keyframes)
Configures keyframes of the animation. It is expected that the keyframes are ordered according to the...
QVector< Keyframe > Keyframes
The class is used as a container of context for various read/write operations on other objects.
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...
Definition qgsvector3d.h:31
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
QgsVector3D point
Point towards which the camera is looking in 3D world coords.