QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 
25 #define INVALID_MESHLAYER_TIME -99999
26 
35 {
36  public:
37 
42  {
44  FindClosestDatasetFromStartRangeTime
45  };
46 
51 
59  QgsMeshDatasetIndex datasetIndexClosestBeforeRelativeTime( int group, qint64 timeSinceGlobalReference ) const;
60 
68  QgsMeshDatasetIndex datasetIndexClosestFromRelativeTime( int group, qint64 timeSinceGlobalReference ) const;
69 
75  void addGroupReferenceDateTime( int group, const QDateTime &reference ) SIP_SKIP;
76 
83  void addDatasetTimeInMilliseconds( int group, qint64 time ) SIP_SKIP;
84 
91  void addDatasetTime( int group, double time ) SIP_SKIP;
92 
96  bool hasReferenceTime() const;
97 
101  QDateTime referenceTime() const;
102 
107  QgsDateTimeRange timeExtent() const;
108 
113  QgsDateTimeRange timeExtent( const QDateTime &reference ) const;
114 
120  void setTemporalUnit( QgsUnitTypes::TemporalUnit temporalUnit );
121 
125  QgsUnitTypes::TemporalUnit temporalUnit() const;
126 
130  qint64 datasetTime( const QgsMeshDatasetIndex &index ) const;
131 
135  void clear();
136 
142  qint64 firstTimeStepDuration( int group ) const;
143 
144  private:
145 
147  QDateTime mGlobalReferenceDateTime;
148 
150  QHash<int, QDateTime> mGroupsReferenceDateTime;
151 
158  QHash<int, QList<qint64>> mDatasetTimeSinceGroupReference;
159 
161 };
162 
163 #endif // QGSMESHDATAPROVIDERTEMPORALCAPABILITIES_H
qgsdataprovidertemporalcapabilities.h
QgsMeshDataProviderTemporalCapabilities
Class for handling properties relating to a mesh data provider's temporal capabilities.
Definition: qgsmeshdataprovidertemporalcapabilities.h:35
qgsrange.h
QgsUnitTypes::TemporalUnit
TemporalUnit
Temporal units.
Definition: qgsunittypes.h:150
QgsDataProviderTemporalCapabilities
Base class for handling properties relating to a data provider's temporal capabilities.
Definition: qgsdataprovidertemporalcapabilities.h:34
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsMeshDatasetIndex
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
Definition: qgsmeshdataset.h:47
QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod
MatchingTemporalDatasetMethod
Method for selection of temporal mesh dataset from a range time.
Definition: qgsmeshdataprovidertemporalcapabilities.h:42
QgsUnitTypes::TemporalHours
@ TemporalHours
Hours.
Definition: qgsunittypes.h:154
QgsMeshDataProviderTemporalCapabilities::FindClosestDatasetBeforeStartRangeTime
@ FindClosestDatasetBeforeStartRangeTime
Definition: qgsmeshdataprovidertemporalcapabilities.h:43
qgsmeshdataset.h