QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgsmeshdataprovidertemporalcapabilities.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshdataprovidertemporalcapabilities.h
3 -----------------------
4 begin : March 2020
5 copyright : (C) 2020 by Vincent Cloarec
6 email : vcloarec at gmail 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
18#ifndef QGSMESHDATAPROVIDERTEMPORALCAPABILITIES_H
19#define QGSMESHDATAPROVIDERTEMPORALCAPABILITIES_H
20
22#include "qgsrange.h"
23#include "qgsmeshdataset.h"
24#include "qgis.h"
25
26#define INVALID_MESHLAYER_TIME -99999
27
36{
37 public:
38
43 {
45 FindClosestDatasetFromStartRangeTime
46 };
47
52
60 QgsMeshDatasetIndex datasetIndexClosestBeforeRelativeTime( int group, qint64 timeSinceGlobalReference ) const;
61
69 QgsMeshDatasetIndex datasetIndexClosestFromRelativeTime( int group, qint64 timeSinceGlobalReference ) const;
70
76 void addGroupReferenceDateTime( int group, const QDateTime &reference ) SIP_SKIP;
77
84 void addDatasetTimeInMilliseconds( int group, qint64 time ) SIP_SKIP;
85
92 void addDatasetTime( int group, double time ) SIP_SKIP;
93
97 bool hasReferenceTime() const;
98
102 QDateTime referenceTime() const;
103
108 QgsDateTimeRange timeExtent() const;
109
114 QgsDateTimeRange timeExtent( const QDateTime &reference ) const;
115
121 void setTemporalUnit( Qgis::TemporalUnit temporalUnit );
122
126 Qgis::TemporalUnit temporalUnit() const;
127
131 qint64 datasetTime( const QgsMeshDatasetIndex &index ) const;
132
136 void clear();
137
143 qint64 firstTimeStepDuration( int group ) const;
144
145 private:
146
148 QDateTime mGlobalReferenceDateTime;
149
151 QHash<int, QDateTime> mGroupsReferenceDateTime;
152
159 QHash<int, QList<qint64>> mDatasetTimeSinceGroupReference;
160
162};
163
164#endif // QGSMESHDATAPROVIDERTEMPORALCAPABILITIES_H
TemporalUnit
Temporal units.
Definition: qgis.h:4231
Base class for handling properties relating to a data provider's temporal capabilities.
Class for handling properties relating to a mesh data provider's temporal capabilities.
MatchingTemporalDatasetMethod
Method for selection of temporal mesh dataset from a range time.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
#define SIP_SKIP
Definition: qgis_sip.h:126