File: qgstemporalutils.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (163 lines) | stat: -rw-r--r-- 5,743 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgstemporalutils.h                                          *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/







class QgsTemporalUtils
{
%Docstring(signature="appended")
Contains utility methods for working with temporal layers and projects.

.. versionadded:: 3.14
%End

%TypeHeaderCode
#include "qgstemporalutils.h"
%End
  public:

    static QgsDateTimeRange calculateTemporalRangeForProject( QgsProject *project );
%Docstring
Calculates the temporal range for a ``project``.

This method considers the temporal range available from layers contained
within the project and returns the maximal combined temporal extent of
these layers.
%End

    static QList< QgsDateTimeRange > usedTemporalRangesForProject( QgsProject *project );
%Docstring
Calculates all temporal ranges which are in use for a ``project``.

This method considers the temporal range available from layers contained
within the project and returns a list of ranges which cover only the
temporal ranges which are actually in use by layers in the project.

The returned list may be non-contiguous and have gaps in the ranges. The
ranges are sorted in ascending order.

.. versionadded:: 3.20
%End

    struct AnimationExportSettings
    {
      QgsDateTimeRange animationRange;

      QgsInterval frameDuration;

      QString outputDirectory;

      QString fileNameTemplate;

      QList<QgsMapDecoration *> decorations;

      QList<QgsDateTimeRange> availableTemporalRanges;

      double frameRate;

    };

    static bool exportAnimation( const QgsMapSettings &mapSettings, const AnimationExportSettings &settings, QString &error /Out/, QgsFeedback *feedback = 0 );
%Docstring
Exports animation frames by rendering the map to multiple destination
images.

The ``mapSettings`` argument dictates the overall map settings such as
extent and size, while animation and export specific settings are
specified via the ``settings`` argument.

An optional ``feedback`` argument can be used to provide progress
reports and cancellation support.

:param mapSettings: settings controlling the map render
:param settings: animation and export settings
:param feedback: optional feedback object for progress reports and
                 cancellation checks

:return: - ``True`` if the export was successful.
         - error: a descriptive error message if the export fails
%End

    static QDateTime calculateFrameTime( const QDateTime &start, const long long frame, const QgsInterval &interval );
%Docstring
Calculates the frame time for an animation.

If the interval original duration is fractional or interval original
unit is unknown
(:py:class:`QgsUnitTypes`.TemporalUnit.TemporalUnknownUnit), then
:py:class:`QgsInterval` is used to determine the duration of the frame.
This uses average durations for months and years.

Otherwise, we use QDateTime to advance by the exact duration of the
current month or year. So a time step of 1.5 months will result in a
duration of 45 days, but a time step of 1 month will result in a
duration that depends upon the number of days in the current month.

:param start: time of the animation
:param frame: number
:param interval: duration of the animation

:return: The calculated datetime for the frame.

.. versionadded:: 3.18
%End

    static QList< QDateTime > calculateDateTimesUsingDuration( const QDateTime &start, const QDateTime &end, const QString &duration, bool &ok /Out/, bool &maxValuesExceeded /Out/, int maxValues = -1 );
%Docstring
Calculates a complete list of datetimes between ``start`` and ``end``,
using the specified ISO8601 ``duration`` string (eg "PT12H").

:param start: start date time
:param end: end date time
:param duration: ISO8601 duration string
:param maxValues: maximum number of values to return, or -1 to return
                  all values

:return: - calculated list of date times
         - ok: ``True`` if ``duration`` was successfully parsed and date
           times could be calculated
         - maxValuesExceeded: ``True`` if the maximum number of values
           to return was exceeded

.. versionadded:: 3.20
%End


    static QList< QDateTime > calculateDateTimesFromISO8601( const QString &string, bool &ok /Out/, bool &maxValuesExceeded /Out/, int maxValues = -1 );
%Docstring
Calculates a complete list of datetimes from a ISO8601 ``string``
containing a duration (eg
"2021-03-23T00:00:00Z/2021-03-24T12:00:00Z/PT12H").

:param string: ISO8601 compatible string
:param maxValues: maximum number of values to return, or -1 to return
                  all values

:return: - calculated list of date times
         - ok: ``True`` if ``string`` was successfully parsed and date
           times could be calculated
         - maxValuesExceeded: ``True`` if the maximum number of values
           to return was exceeded

.. versionadded:: 3.20
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgstemporalutils.h                                          *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/