Skip to content

Commit

Permalink
added temporal source for temporal layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Samweli authored and nyalldawson committed Mar 10, 2020
1 parent 1b53cbc commit 54d608c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/qgsmaplayertemporalproperties.cpp
Expand Up @@ -22,3 +22,13 @@ QgsMapLayerTemporalProperties::QgsMapLayerTemporalProperties( bool enabled )
{
}

void QgsMapLayerTemporalProperties::setTemporalSource( QgsMapLayerTemporalProperties::TemporalSource source )
{
mSource = source;
}

QgsMapLayerTemporalProperties::TemporalSource QgsMapLayerTemporalProperties::temporalSource() const
{
return mSource;
}

26 changes: 26 additions & 0 deletions src/core/qgsmaplayertemporalproperties.h
Expand Up @@ -63,6 +63,32 @@ class CORE_EXPORT QgsMapLayerTemporalProperties : public QgsTemporalProperty
*/
virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;

/**
* Source of the temporal range of these properties.
*/
enum TemporalSource
{
Layer, //! Defined from layer .
Project//! Defined from project time settings;
};

/**
* Returns the temporal properties temporal range source, can be layer or project.
*
*\see setTemporalSource()
**/
TemporalSource temporalSource() const;

/**
* Sets the temporal properties temporal range \a source.
*
*\see temporalSource()
**/
void setTemporalSource( TemporalSource source );
private:

TemporalSource mSource = TemporalSource::Layer;

};

#endif // QGSMAPLAYERTEMPORALPROPERTIES_H

0 comments on commit 54d608c

Please sign in to comment.