QGIS API Documentation  3.20.0-Odense (decaadbb31)
qgsrasterdataprovidertemporalcapabilities.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterdataprovidertemporalcapabilities.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 
18 #ifndef QGSRASTERDATAPROVIDERTEMPORALCAPABILITIES_H
19 #define QGSRASTERDATAPROVIDERTEMPORALCAPABILITIES_H
20 
21 #include "qgis_core.h"
22 #include "qgis_sip.h"
23 #include "qgsrange.h"
24 #include "qgsinterval.h"
26 
39 {
40  public:
41 
47  QgsRasterDataProviderTemporalCapabilities( bool enabled = false );
48 
53  {
58  FindClosestMatchToEndOfRange
59  };
60  // TODO -- add other methods
61 
68  IntervalHandlingMethod intervalHandlingMethod() const;
69 
76  void setIntervalHandlingMethod( IntervalHandlingMethod method );
77 
83  void setAvailableTemporalRange( const QgsDateTimeRange &range );
84 
90  const QgsDateTimeRange &availableTemporalRange() const;
91 
102  void setAllAvailableTemporalRanges( const QList< QgsDateTimeRange > &ranges );
103 
114  QList< QgsDateTimeRange > allAvailableTemporalRanges() const;
115 
122  void setAvailableReferenceTemporalRange( const QgsDateTimeRange &range );
123 
130  const QgsDateTimeRange &availableReferenceTemporalRange() const;
131 
136  const QgsDateTimeRange &requestedTemporalRange() const;
137 
145  QgsInterval defaultInterval() const;
146 
154  void setDefaultInterval( const QgsInterval &interval );
155 
166  void setRequestedTemporalRange( const QgsDateTimeRange &range ) SIP_SKIP;
167 
168  private:
169 
178  QgsDateTimeRange mAvailableTemporalRange;
179 
184  QList< QgsDateTimeRange > mAllAvailableTemporalRanges;
185 
187  QgsDateTimeRange mRequestedRange;
188 
192  QgsDateTimeRange mAvailableReferenceRange;
193 
194  QgsInterval mDefaultInterval;
195 
197  IntervalHandlingMethod mIntervalMatchMethod = MatchUsingWholeRange;
198 
200  friend class TestQgsRasterDataProviderTemporalCapabilities;
201 
202 };
203 
204 #endif // QGSRASTERDATAPROVIDERTEMPORALCAPABILITIES_H
Base class for handling properties relating to a data provider's temporal capabilities.
A representation of the interval between two datetime values.
Definition: qgsinterval.h:42
Implementation of data provider temporal properties for QgsRasterDataProviders.
IntervalHandlingMethod
Method to use when resolving a temporal range to a data provider layer or band.
@ MatchExactUsingStartOfRange
Match the start of the temporal range to a corresponding layer or band, and only use exact matching r...
@ MatchExactUsingEndOfRange
Match the end of the temporal range to a corresponding layer or band, and only use exact matching res...
@ MatchUsingWholeRange
Use an exact match to the whole temporal range.
@ FindClosestMatchToStartOfRange
Match the start of the temporal range to the least previous closest datetime.
Implementation of threaded rendering for raster layers.
#define SIP_SKIP
Definition: qgis_sip.h:126