QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsrasterlayertemporalproperties.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterlayertemporalproperties.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 
19 #ifndef QGSRASTERLAYERTEMPORALPROPERTIES_H
20 #define QGSRASTERLAYERTEMPORALPROPERTIES_H
21 
22 #include "qgis_core.h"
23 #include "qgis_sip.h"
24 #include "qgsrange.h"
27 
36 {
37  Q_OBJECT
38 
39  public:
40 
46  QgsRasterLayerTemporalProperties( QObject *parent SIP_TRANSFERTHIS = nullptr, bool enabled = false );
47 
48  bool isVisibleInTemporalRange( const QgsDateTimeRange &range ) const override;
49  QgsDateTimeRange calculateTemporalExtent( QgsMapLayer *layer ) const override SIP_SKIP;
50 
55  {
56  ModeFixedTemporalRange = 0,
57  ModeTemporalRangeFromDataProvider = 1,
58  };
59 
65  TemporalMode mode() const;
66 
72  void setMode( TemporalMode mode );
73 
77  QgsTemporalProperty::Flags flags() const override;
78 
86 
93  void setIntervalHandlingMethod( QgsRasterDataProviderTemporalCapabilities::IntervalHandlingMethod method );
94 
105  void setFixedTemporalRange( const QgsDateTimeRange &range );
106 
115  const QgsDateTimeRange &fixedTemporalRange() const;
116 
117  QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
118 
119  bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
120 
122 
123  private:
124 
126  TemporalMode mMode = ModeFixedTemporalRange;
127 
130 
132  QgsDateTimeRange mFixedRange;
133 };
134 
135 #endif // QGSRASTERLAYERTEMPORALPROPERTIES_H
QgsTemporalProperty::flags
virtual QgsTemporalProperty::Flags flags() const
Returns flags associated to the temporal property.
Definition: qgstemporalproperty.h:74
QgsMapLayerTemporalProperties::writeXml
virtual QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
Writes the properties to a DOM element, to be used later with readXml().
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:35
QgsRasterLayerTemporalProperties::TemporalMode
TemporalMode
Mode of the raster temporal properties.
Definition: qgsrasterlayertemporalproperties.h:55
QgsRasterDataProviderTemporalCapabilities::IntervalHandlingMethod
IntervalHandlingMethod
Method to use when resolving a temporal range to a data provider layer or band.
Definition: qgsrasterdataprovidertemporalcapabilities.h:52
QgsMapLayerTemporalProperties::calculateTemporalExtent
virtual QgsDateTimeRange calculateTemporalExtent(QgsMapLayer *layer) const
Attempts to calculate the overall temporal extent for the specified layer, using the settings defined...
Definition: qgsmaplayertemporalproperties.cpp:30
qgsrange.h
QgsRasterDataProviderTemporalCapabilities::MatchUsingWholeRange
@ MatchUsingWholeRange
Use an exact match to the whole temporal range.
Definition: qgsrasterdataprovidertemporalcapabilities.h:53
qgsrasterdataprovidertemporalcapabilities.h
QgsRasterLayerTemporalProperties
Implementation of map layer temporal properties for raster layers.
Definition: qgsrasterlayertemporalproperties.h:36
QgsMapLayerTemporalProperties::readXml
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads temporal properties from a DOM element previously written by writeXml().
QgsDataProviderTemporalCapabilities
Base class for handling properties relating to a data provider's temporal capabilities.
Definition: qgsdataprovidertemporalcapabilities.h:34
qgsmaplayertemporalproperties.h
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
qgis_sip.h
QgsMapLayerTemporalProperties::isVisibleInTemporalRange
virtual bool isVisibleInTemporalRange(const QgsDateTimeRange &range) const
Returns true if the layer should be visible and rendered for the specified time range.
Definition: qgsmaplayertemporalproperties.cpp:25
QgsMapLayerTemporalProperties
Base class for storage of map layer temporal properties.
Definition: qgsmaplayertemporalproperties.h:43
QgsMapLayer
Base class for all map layer types.
Definition: qgsmaplayer.h:83
QgsMapLayerTemporalProperties::setDefaultsFromDataProviderTemporalCapabilities
virtual void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities)=0
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53