QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsprojecttimesettings.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprojecttimesettings.h
3 ---------------
4 begin : February 2020
5 copyright : (C) 2020 by Samweli Mwakisambwe
6 email : samweli at kartoza dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17#ifndef QGSPROJECTTIMESETTINGS_H
18#define QGSPROJECTTIMESETTINGS_H
19
20#include "qgis.h"
21#include "qgis_core.h"
22#include "qgsrange.h"
23
24#include <QObject>
25
26class QDomElement;
28class QDomDocument;
29
37class CORE_EXPORT QgsProjectTimeSettings : public QObject
38{
39 Q_OBJECT
40
41 public:
42
46 QgsProjectTimeSettings( QObject *parent SIP_TRANSFERTHIS = nullptr );
47
51 void reset();
52
65
77 void setTemporalRange( const QgsDateTimeRange &range );
78
83 bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
84
89 QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;
90
99
108
118 double timeStep() const;
119
129 void setTimeStep( double step );
130
136 void setFramesPerSecond( double rate );
137
143 double framesPerSecond() const;
144
150 void setIsTemporalRangeCumulative( bool state );
151
157 bool isTemporalRangeCumulative() const;
158
168 long long totalMovieFrames() const;
169
179 void setTotalMovieFrames( long long frames );
180
181 signals:
182
190
191 private:
192
193 QgsDateTimeRange mRange;
195 double mTimeStep = 1;
196 double mFrameRate = 1;
197 bool mCumulativeTemporalRange = false;
198 long long mTotalMovieFrames = 100;
199};
200
201
202#endif // QGSPROJECTTIMESETTINGS_H
TemporalUnit
Temporal units.
Definition qgis.h:5159
@ Hours
Hours.
Definition qgis.h:5163
long long totalMovieFrames() const
Returns the total number of frames for the project's movie.
QgsDateTimeRange temporalRange() const
Returns the project's temporal range, which indicates the earliest and latest datetime ranges associa...
void setTotalMovieFrames(long long frames)
Sets the total number of frames for the movie.
void setTemporalRange(const QgsDateTimeRange &range)
Sets the project's temporal range, which indicates the earliest and latest datetime ranges associated...
double timeStep() const
Returns the project's time step (length of one animation frame), which is used as the default value w...
void setFramesPerSecond(double rate)
Sets the project's default animation frame rate, in frames per second.
bool readXml(const QDomElement &element, const QgsReadWriteContext &context)
Reads the settings's state from a DOM element.
void temporalRangeChanged()
Emitted when the temporal range changes.
Qgis::TemporalUnit timeStepUnit() const
Returns the project's time step (length of one animation frame) unit, which is used as the default va...
QgsProjectTimeSettings(QObject *parent=nullptr)
Constructor for QgsProjectTimeSettings with the specified parent object.
bool isTemporalRangeCumulative() const
Returns the value of cumulative temporal range in animation settings.
void setTimeStepUnit(Qgis::TemporalUnit unit)
Sets the project's time step (length of one animation frame) unit, which is used as the default value...
void setIsTemporalRangeCumulative(bool state)
Sets the project's temporal range as cumulative in animation settings.
void reset()
Resets the settings to a default state.
QDomElement writeXml(QDomDocument &document, const QgsReadWriteContext &context) const
Returns a DOM element representing the settings.
void setTimeStep(double step)
Sets the project's time step (length of one animation frame), which is used as the default value when...
double framesPerSecond() const
Returns the project's default animation frame rate, in frames per second.
A container for the context for various read/write operations on objects.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
Definition qgsrange.h:761