QGIS API Documentation 4.1.0-Master (60fea48833c)
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:
45 QgsProjectTimeSettings( QObject *parent SIP_TRANSFERTHIS = nullptr );
46
50 void reset();
51
64
76 void setTemporalRange( const QgsDateTimeRange &range );
77
82 bool readXml( const QDomElement &element, const QgsReadWriteContext &context );
83
88 QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const;
89
98
107
117 double timeStep() const;
118
128 void setTimeStep( double step );
129
135 void setFramesPerSecond( double rate );
136
142 double framesPerSecond() const;
143
149 void setIsTemporalRangeCumulative( bool state );
150
156 bool isTemporalRangeCumulative() const;
157
167 long long totalMovieFrames() const;
168
178 void setTotalMovieFrames( long long frames );
179
180 signals:
181
189
190 private:
191 QgsDateTimeRange mRange;
193 double mTimeStep = 1;
194 double mFrameRate = 1;
195 bool mCumulativeTemporalRange = false;
196 long long mTotalMovieFrames = 100;
197};
198
199
200#endif // QGSPROJECTTIMESETTINGS_H
TemporalUnit
Temporal units.
Definition qgis.h:5316
@ Hours
Hours.
Definition qgis.h:5320
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:52
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
Definition qgsrange.h:705