QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
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 "
qgsrange.h
"
25
#include "
qgsreadwritecontext.h
"
26
#include "
qgstemporalproperty.h
"
27
28
#include <QDomElement>
29
30
class
QgsMapLayer
;
31
class
QgsDataProviderTemporalCapabilities
;
32
43
class
CORE_EXPORT
QgsMapLayerTemporalProperties
:
public
QgsTemporalProperty
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
52
SIP_CONVERT_TO_SUBCLASS_CODE
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
}
69
SIP_END
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
104
virtual
void
setDefaultsFromDataProviderTemporalCapabilities
(
const
QgsDataProviderTemporalCapabilities
*capabilities ) = 0;
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
#endif
// QGSMAPLAYERTEMPORALPROPERTIES_H
QgsDataProviderTemporalCapabilities
Base class for handling properties relating to a data provider's temporal capabilities.
Definition
qgsdataprovidertemporalcapabilities.h:34
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().
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:31
QgsMapLayerTemporalProperties::setDefaultsFromDataProviderTemporalCapabilities
virtual void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities)=0
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
QgsMapLayerTemporalProperties::allTemporalRanges
virtual QList< QgsDateTimeRange > allTemporalRanges(QgsMapLayer *layer) const
Attempts to calculate the overall list of all temporal extents which are contained in the specified l...
Definition
qgsmaplayertemporalproperties.cpp:36
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:26
QgsMapLayerTemporalProperties::QgsMapLayerTemporalProperties
QgsMapLayerTemporalProperties(QObject *parent, bool enabled=false)
Constructor for QgsMapLayerTemporalProperties, with the specified parent object.
Definition
qgsmaplayertemporalproperties.cpp:22
QgsMapLayerTemporalProperties::readXml
virtual bool readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads temporal properties from a DOM element previously written by writeXml().
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
QgsReadWriteContext
A container for the context for various read/write operations on objects.
Definition
qgsreadwritecontext.h:38
QgsTemporalProperty::QgsTemporalProperty
QgsTemporalProperty(QObject *parent=nullptr, bool enabled=false)
Constructor for QgsTemporalProperty, with the specified parent object.
Definition
qgstemporalproperty.cpp:23
qgis_sip.h
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition
qgis_sip.h:203
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_END
#define SIP_END
Definition
qgis_sip.h:220
qgsrange.h
QgsDateTimeRange
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
Definition
qgsrange.h:764
qgsreadwritecontext.h
qgstemporalproperty.h
Generated on
for QGIS API Documentation by
1.17.0