QGIS API Documentation 3.99.0-Master (21b3aa880ba)
Loading...
Searching...
No Matches
qgsmeshlayertemporalproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshlayertemporalproperties.h
3 -----------------------
4 begin : March 2020
5 copyright : (C) 2020 by Vincent Cloarec
6 email : vcloarec at gmail 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#ifndef QGSMESHLAYERTEMPORALPROPERTIES_H
19#define QGSMESHLAYERTEMPORALPROPERTIES_H
20
23
49
51{
52 Q_OBJECT
53
54 public:
55
62 QgsMeshLayerTemporalProperties( QObject *parent SIP_TRANSFERTHIS = nullptr, bool enabled = true );
63
64 public:
65
66 QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) override;
67 bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) override;
70
75
79 QDateTime referenceTime() const;
80
88 void setReferenceTime( const QDateTime &referenceTime, const QgsDataProviderTemporalCapabilities *capabilities );
89
94
101
107 bool isValid() const;
108
116 void setIsValid( bool isValid );
117
124
132 void setAlwaysLoadReferenceTimeFromSource( bool autoReloadFromProvider );
133
134 private:
135 QDateTime mReferenceTime;
136 QgsDateTimeRange mTimeExtent;
139 bool mIsValid = false;
140 bool mAlwaysLoadReferenceTimeFromSource = false;
141};
142
143#endif // QGSMESHLAYERTEMPORALPROPERTIES_H
Base class for handling properties relating to a data provider's temporal capabilities.
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 QgsDateTimeRange calculateTemporalExtent(QgsMapLayer *layer) const
Attempts to calculate the overall temporal extent for the specified layer, using the settings defined...
virtual void setDefaultsFromDataProviderTemporalCapabilities(const QgsDataProviderTemporalCapabilities *capabilities)=0
Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities...
QgsMapLayerTemporalProperties(QObject *parent, bool enabled=false)
Constructor for QgsMapLayerTemporalProperties, with the specified parent object.
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:80
MatchingTemporalDatasetMethod
Method for selection of temporal mesh dataset from a range time.
QDateTime referenceTime() const
Returns the reference time.
void setAlwaysLoadReferenceTimeFromSource(bool autoReloadFromProvider)
Sets whether the time proporties are automatically reloaded from provider when project is opened or l...
bool isValid() const
Returns whether the instance is valid.
void setMatchingMethod(const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod)
Sets the method used to match dataset from temporal capabilities.
QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod matchingMethod() const
Returns the method used to match dataset from temporal capabilities.
void setReferenceTime(const QDateTime &referenceTime, const QgsDataProviderTemporalCapabilities *capabilities)
Sets the reference time and update the time extent from the temporal capabilities,...
bool alwaysLoadReferenceTimeFromSource() const
Returns whether the time proporties are automatically reloaded from provider when project is opened o...
void setIsValid(bool isValid)
Sets whether the instance is valid.
QgsDateTimeRange timeExtent() const
Returns the time extent.
QgsMeshLayerTemporalProperties(QObject *parent=nullptr, bool enabled=true)
Constructor for QgsMeshLayerTemporalProperties.
A container for the context for various read/write operations on objects.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_SKIP
Definition qgis_sip.h:134
QgsTemporalRange< QDateTime > QgsDateTimeRange
QgsRange which stores a range of date times.
Definition qgsrange.h:761