QGIS API Documentation 3.41.0-Master (af5edcb665c)
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 //SIP_TYPEHEADER_INCLUDE( "qgsrasterlayertemporalproperties.h" );
46 //SIP_TYPEHEADER_INCLUDE( "qgsmeshlayertemporalproperties.h" );
47 //SIP_TYPEHEADER_INCLUDE( "qgsvectorlayertemporalproperties.h" );
48
49 Q_OBJECT
50
51#ifdef SIP_RUN
53 if ( qobject_cast<QgsRasterLayerTemporalProperties *>( sipCpp ) )
54 {
55 sipType = sipType_QgsRasterLayerTemporalProperties;
56 }
57 else if ( qobject_cast<QgsMeshLayerTemporalProperties *>( sipCpp ) )
58 {
59 sipType = sipType_QgsMeshLayerTemporalProperties;
60 }
61 else if ( qobject_cast<QgsVectorLayerTemporalProperties *>( sipCpp ) )
62 {
63 sipType = sipType_QgsVectorLayerTemporalProperties;
64 }
65 else
66 {
67 sipType = 0;
68 }
70#endif
71
72 public:
73
79 QgsMapLayerTemporalProperties( QObject *parent SIP_TRANSFERTHIS, bool enabled = false );
80
86 virtual QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) = 0;
87
93 virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;
94
98 virtual bool isVisibleInTemporalRange( const QgsDateTimeRange &range ) const;
99
105
106#ifndef SIP_RUN
107// sip gets confused with this, refuses to compile
108
117 virtual QgsDateTimeRange calculateTemporalExtent( QgsMapLayer *layer ) const;
118#endif
119
128 virtual QList< QgsDateTimeRange > allTemporalRanges( QgsMapLayer *layer ) const;
129
130};
131
132#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