Skip to content

Commit

Permalink
updates on map layers temporal properties classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Samweli committed Feb 8, 2020
1 parent 930f7a5 commit c4355ab
Show file tree
Hide file tree
Showing 22 changed files with 337 additions and 249 deletions.
6 changes: 2 additions & 4 deletions python/core/auto_generated/qgsmaplayer.sip.in
Expand Up @@ -1297,15 +1297,13 @@ should be canceled.
.. versionadded:: 3.10
%End

QgsMapLayerTemporalProperties *temporalProperties();
virtual QgsMapLayerTemporalProperties *temporalProperties();
%Docstring
Returns map layer temporal properties
Returns map layer temporal properties. This may be ``None``, depending on the layer type.

.. versionadded:: 3.14
%End



public slots:

void setMinimumScale( double scale );
Expand Down
59 changes: 59 additions & 0 deletions python/core/auto_generated/qgsmaplayertemporalproperties.sip.in
@@ -0,0 +1,59 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayertemporalproperties.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/







class QgsMapLayerTemporalProperties : QgsTemporalProperty
{
%Docstring
Class for handling map layer temporal properties.

Subclasses will provide full implementation.

.. versionadded:: 3.14
%End

%TypeHeaderCode
#include "qgsmaplayertemporalproperties.h"
%End
public:

QgsMapLayerTemporalProperties( bool enabled = false );
%Docstring
Constructor for QgsMapLayerTemporalProperties.
%End

virtual ~QgsMapLayerTemporalProperties();

virtual QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) = 0;
%Docstring
Writes map layer temporal properties to a DOM element, to be used later with readXml()

.. seealso:: :py:func:`readXml`
%End

virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;
%Docstring
Reads temporal properties from a DOM element previously written by writeXml()

.. seealso:: :py:func:`writeXml`
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayertemporalproperties.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
57 changes: 57 additions & 0 deletions python/core/auto_generated/qgstemporalproperty.sip.in
@@ -0,0 +1,57 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgstemporalproperty.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/







class QgsTemporalProperty
{
%Docstring
Base class for temporal property.

.. versionadded:: 3.14
%End

%TypeHeaderCode
#include "qgstemporalproperty.h"
%End
public:

QgsTemporalProperty( bool enabled = false );
%Docstring
Constructor for QgsTemporalProperty.
%End

virtual ~QgsTemporalProperty();

void setIsActive( bool enabled );
%Docstring
Sets temporal property status.

.. seealso:: :py:func:`isActive`
%End

bool isActive() const;
%Docstring
Returns true temporal property status.

.. seealso:: :py:func:`setIsActive`
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgstemporalproperty.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
5 changes: 5 additions & 0 deletions python/core/auto_generated/raster/qgsrasterlayer.sip.in
Expand Up @@ -430,6 +430,11 @@ To be used for example for WMS layers with labels or symbology that happens
to be drawn outside the data extent.

.. versionadded:: 3.10
%End

virtual QgsRasterLayerTemporalProperties *temporalProperties();
%Docstring
Returns temporal properties associated with the raster layer.
%End

public slots:
Expand Down
@@ -0,0 +1,109 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrasterlayertemporalproperties.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/






class QgsRasterLayerTemporalProperties : QgsMapLayerTemporalProperties
{
%Docstring
Implementation of map layer temporal properties for raster layers.

.. versionadded:: 3.14
%End

%TypeHeaderCode
#include "qgsrasterlayertemporalproperties.h"
%End
public:

QgsRasterLayerTemporalProperties( bool enabled = false );
%Docstring
Constructor for QgsRasterLayerTemporalProperties.
%End

virtual ~QgsRasterLayerTemporalProperties();

enum TemporalMode
{
ModeFixedTemporalRange,
ModeTemporalRangeFromDataProvider,
ModeTemporalRangesList
};

TemporalMode mode() const;
%Docstring
Return the temporal properties mode

.. seealso:: :py:func:`setMode`
%End

void setMode( TemporalMode mode );
%Docstring
Set the temporal properties mode

.. seealso:: :py:func:`mode`
%End

void setFixedTemporalRange( const QgsDateTimeRange &range );
%Docstring
Sets the temporal ``range`` to apply to the whole layer. All bands from
the raster layer will be rendered whenever the current datetime range of
a render context intersects the specified ``range``.

For the case of WMS-T layers, new layers with the current datetime range
of the render context will be fetched.

.. warning::

This setting is only effective when mode() is
QgsRasterLayerTemporalProperties.ModeFixedTemporalRange

.. seealso:: :py:func:`fixedTemporalRange`
%End

const QgsDateTimeRange &fixedTemporalRange() const;
%Docstring
Return fixed temporal range for these properties

.. warning::

To be used only when mode() is
QgsRasterLayerTemporalProperties.ModeFixedTemporalRange

.. seealso:: :py:func:`setFixedTemporalRange`
%End

void setWmstRelatedSettings( const QString &dimension );
%Docstring
Set this raster layer properties with WMS-T temporal settings.

.. warning::

This is to be used to support WMS-T layers only. Applicable when
TemporalMode is QgsRasterLayerTemporalProperties.ModeFixedTemporalRange or
QgsRasterLayerTemporalProperties.ModeTemporalRangesList
%End

virtual QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context );


virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context );


};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrasterlayertemporalproperties.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
3 changes: 3 additions & 0 deletions python/core/core_auto.sip
Expand Up @@ -104,6 +104,7 @@
%Include auto_generated/qgsmaplayerstore.sip
%Include auto_generated/qgsmaplayerstyle.sip
%Include auto_generated/qgsmaplayerstylemanager.sip
%Include auto_generated/qgsmaplayertemporalproperties.sip
%Include auto_generated/qgsmaprenderercache.sip
%Include auto_generated/qgsmaprenderercustompainterjob.sip
%Include auto_generated/qgsmaprendererjob.sip
Expand Down Expand Up @@ -189,6 +190,7 @@
%Include auto_generated/qgsstringutils.sip
%Include auto_generated/qgstablecell.sip
%Include auto_generated/qgstaskmanager.sip
%Include auto_generated/qgstemporalproperty.sip
%Include auto_generated/qgstemporalrangeobject.sip
%Include auto_generated/qgstessellator.sip
%Include auto_generated/qgstestutils.sip
Expand Down Expand Up @@ -453,6 +455,7 @@
%Include auto_generated/raster/qgsrasterinterface.sip
%Include auto_generated/raster/qgsrasteriterator.sip
%Include auto_generated/raster/qgsrasterlayer.sip
%Include auto_generated/raster/qgsrasterlayertemporalproperties.sip
%Include auto_generated/raster/qgsrasterminmaxorigin.sip
%Include auto_generated/raster/qgsrasternuller.sip
%Include auto_generated/raster/qgsrasterpipe.sip
Expand Down
2 changes: 0 additions & 2 deletions src/core/CMakeLists.txt
Expand Up @@ -407,7 +407,6 @@ SET(QGIS_CORE_SRCS
qgsvectorlayerjoinbuffer.cpp
qgsvectorlayerjoininfo.cpp
qgsvectorlayerrenderer.cpp
qgsvectorlayertemporalproperties.cpp
qgsvectorlayertools.cpp
qgsvectorlayerundocommand.cpp
qgsvectorlayerundopassthroughcommand.cpp
Expand Down Expand Up @@ -926,7 +925,6 @@ SET(QGIS_CORE_HDRS
qgsvectorlayerjoininfo.h
qgsvectorlayerrenderer.h
qgsvectorlayerserverproperties.h
qgsvectorlayertemporalproperties.h
qgsvectorlayertools.h
qgsvectorlayerundocommand.h
qgsvectorlayerundopassthroughcommand.h
Expand Down
8 changes: 0 additions & 8 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -90,7 +90,6 @@ QgsMapLayer::~QgsMapLayer()
delete m3DRenderer;
delete mLegend;
delete mStyleManager;
delete mTemporalProperties;
}

void QgsMapLayer::clone( QgsMapLayer *layer ) const
Expand Down Expand Up @@ -1873,13 +1872,6 @@ bool QgsMapLayer::accept( QgsStyleEntityVisitorInterface * ) const
return true;
}

QgsMapLayerTemporalProperties *QgsMapLayer::temporalProperties()
{
if ( type() == QgsMapLayerType::RasterLayer )
return dynamic_cast<QgsRasterLayerTemporalProperties *>( mTemporalProperties );
return mTemporalProperties;
}

void QgsMapLayer::setProviderType( const QString &providerType )
{
mProviderKey = providerType;
Expand Down
15 changes: 2 additions & 13 deletions src/core/qgsmaplayer.h
Expand Up @@ -1175,19 +1175,11 @@ class CORE_EXPORT QgsMapLayer : public QObject
virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;

/**
* Returns map layer temporal properties
* Returns map layer temporal properties. This may be NULLPTR, depending on the layer type.
*
* \since QGIS 3.14
*/
QgsMapLayerTemporalProperties *temporalProperties();

// /**
// * Sets map layer temporal properties
// *
// * \since QGIS 3.14
// */
// virtual void setTemporalProperties( QgsMapLayerTemporalProperties *temporalProperties );

virtual QgsMapLayerTemporalProperties *temporalProperties() { return nullptr; }

public slots:

Expand Down Expand Up @@ -1648,9 +1640,6 @@ class CORE_EXPORT QgsMapLayer : public QObject

//! To avoid firing multiple time repaintRequested signal on circular layer circular dependencies
bool mRepaintRequestedFired = false;

//! Temporal properties
QgsMapLayerTemporalProperties *mTemporalProperties = nullptr;
};

Q_DECLARE_METATYPE( QgsMapLayer * )
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsmaplayertemporalproperties.cpp
Expand Up @@ -21,3 +21,4 @@ QgsMapLayerTemporalProperties::QgsMapLayerTemporalProperties( bool enabled )
: QgsTemporalProperty( enabled )
{
}

6 changes: 3 additions & 3 deletions src/core/qgsmaplayertemporalproperties.h
Expand Up @@ -22,10 +22,10 @@
#include "qgis_core.h"
#include "qgis_sip.h"
#include "qgstemporalproperty.h"
#include "qgsreadwritecontext.h"

#include <QDomElement>


/**
* \class QgsMapLayerTemporalProperties
* \ingroup core
Expand All @@ -52,14 +52,14 @@ class CORE_EXPORT QgsMapLayerTemporalProperties : public QgsTemporalProperty
*
* \see readXml()
*/
virtual QDomElement writeXml( ... ) = 0;
virtual QDomElement writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) = 0;

/**
* Reads temporal properties from a DOM element previously written by writeXml()
*
* \see writeXml()
*/
virtual bool readXml( QDomElement ... ) = 0;
virtual bool readXml( const QDomElement &element, const QgsReadWriteContext &context ) = 0;

};

Expand Down
5 changes: 0 additions & 5 deletions src/core/qgstemporalproperty.h
Expand Up @@ -40,11 +40,6 @@ class CORE_EXPORT QgsTemporalProperty
*/
QgsTemporalProperty( bool enabled = false );

/**
* Copy constructor
*/
QgsTemporalProperty( const QgsTemporalProperty &temporalProperty );

virtual ~QgsTemporalProperty() = default;

/**
Expand Down

0 comments on commit c4355ab

Please sign in to comment.