QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsmaplayertemporalproperties.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaplayertemporalproperties.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 QGSMAPLAYERTEMPORALPROPERTIES_H
20 #define QGSMAPLAYERTEMPORALPROPERTIES_H
21 
22 #include "qgis_core.h"
23 #include "qgis_sip.h"
24 #include "qgstemporalproperty.h"
25 #include "qgsreadwritecontext.h"
26 #include "qgsrange.h"
27 
28 #include <QDomElement>
29 
31 
43 {
44 #ifdef SIP_RUN
48 #endif
49 
50  Q_OBJECT
51 
52 #ifdef SIP_RUN
54  if ( qobject_cast<QgsRasterLayerTemporalProperties *>( sipCpp ) )
55  {
56  sipType = sipType_QgsRasterLayerTemporalProperties;
57  }
58  else if ( qobject_cast<QgsMeshLayerTemporalProperties *>( sipCpp ) )
59  {
60  sipType = sipType_QgsMeshLayerTemporalProperties;
61  }
62  else if ( qobject_cast<QgsVectorLayerTemporalProperties *>( sipCpp ) )
63  {
64  sipType = sipType_QgsVectorLayerTemporalProperties;
65  }
66  else
67  {
68  sipType = 0;
69  }
70  SIP_END
71 #endif
72 
73  public:
74 
80  QgsMapLayerTemporalProperties( QObject *parent SIP_TRANSFERTHIS, bool enabled = false );
81 
87  virtual QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) = 0;
88 
94  virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;
95 
99  virtual bool isVisibleInTemporalRange( const QgsDateTimeRange &range ) const;
100 
106 
107 #ifndef SIP_RUN
108 // sip gets confused with this, refuses to compile
109 
118  virtual QgsDateTimeRange calculateTemporalExtent( QgsMapLayer *layer ) const;
119 #endif
120 };
121 
122 #endif // QGSMAPLAYERTEMPORALPROPERTIES_H
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().
qgstemporalproperty.h
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:35
qgsreadwritecontext.h
qgsrange.h
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
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
qgsvectorlayertemporalproperties.h
qgis_sip.h
QgsMapLayerTemporalProperties
Base class for storage of map layer temporal properties.
Definition: qgsmaplayertemporalproperties.h:43
QgsTemporalProperty
Base class for temporal property.
Definition: qgstemporalproperty.h:36
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...
qgsrasterlayertemporalproperties.h
SIP_END
#define SIP_END
Definition: qgis_sip.h:194
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
qgsmeshlayertemporalproperties.h