QGIS API Documentation 3.41.0-Master (25ec5511245)
Loading...
Searching...
No Matches
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
30class QgsMapLayer;
32
44{
45#ifdef SIP_RUN
49#endif
50
51 Q_OBJECT
52
53#ifdef SIP_RUN
55 if ( qobject_cast<QgsRasterLayerTemporalProperties *>( sipCpp ) )
56 {
57 sipType = sipType_QgsRasterLayerTemporalProperties;
58 }
59 else if ( qobject_cast<QgsMeshLayerTemporalProperties *>( sipCpp ) )
60 {
61 sipType = sipType_QgsMeshLayerTemporalProperties;
62 }
63 else if ( qobject_cast<QgsVectorLayerTemporalProperties *>( sipCpp ) )
64 {
65 sipType = sipType_QgsVectorLayerTemporalProperties;
66 }
67 else
68 {
69 sipType = 0;
70 }
72#endif
73
74 public:
75
81 QgsMapLayerTemporalProperties( QObject *parent SIP_TRANSFERTHIS, bool enabled = false );
82
88 virtual QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) = 0;
89
95 virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;
96
100 virtual bool isVisibleInTemporalRange( const QgsDateTimeRange &range ) const;
101
107
108#ifndef SIP_RUN
109// sip gets confused with this, refuses to compile
110
119 virtual QgsDateTimeRange calculateTemporalExtent( QgsMapLayer *layer ) const;
120#endif
121
130 virtual QList< QgsDateTimeRange > allTemporalRanges( QgsMapLayer *layer ) const;
131
132};
133
134#endif // QGSMAPLAYERTEMPORALPROPERTIES_H
Base class for handling properties relating to a data provider's temporal capabilities.
Base class for storage of map layer temporal properties.
virtual QDomElement writeXml(QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
Writes the properties to a DOM element, to be used later with readXml().
virtual void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities)=0
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads temporal properties from a DOM element previously written by writeXml().
Base class for all map layer types.
Definition qgsmaplayer.h:76
The class is used as a container of context for various read/write operations on other objects.
Base class for temporal property.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:191
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_END
Definition qgis_sip.h:208