QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsMeshLayerTemporalProperties Class Reference

Implementation of map layer temporal properties for mesh layers. More...

#include <qgsmeshlayertemporalproperties.h>

Inheritance diagram for QgsMeshLayerTemporalProperties:
Inheritance graph
[legend]

Public Member Functions

 QgsMeshLayerTemporalProperties (QObject *parent=nullptr, bool enabled=true)
 Constructor for QgsMeshLayerTemporalProperties. More...
 
bool alwaysLoadReferenceTimeFromSource () const
 Returns whether the time proporties are automatically reloaded from provider when project is opened or layer is reloaded. More...
 
QgsDateTimeRange calculateTemporalExtent (QgsMapLayer *layer) const override
 Attempts to calculate the overall temporal extent for the specified layer, using the settings defined by the temporal properties object. More...
 
bool isValid () const
 Returns whether the instance is valid. More...
 
QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod matchingMethod () const
 Returns the method used to match dataset from temporal capabilities. More...
 
bool readXml (const QDomElement &element, const QgsReadWriteContext &context) override
 Reads temporal properties from a DOM element previously written by writeXml(). More...
 
QDateTime referenceTime () const
 Returns the reference time. More...
 
void setAlwaysLoadReferenceTimeFromSource (bool autoReloadFromProvider)
 Sets whether the time proporties are automatically reloaded from provider when project is opened or layer is reloaded. More...
 
void setDefaultsFromDataProviderTemporalCapabilities (const QgsDataProviderTemporalCapabilities *capabilities) override
 Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities. More...
 
void setIsValid (bool isValid)
 Sets whether the instance is valid. More...
 
void setMatchingMethod (const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod &matchingMethod)
 Sets the method used to match dataset from temporal capabilities. More...
 
void setReferenceTime (const QDateTime &referenceTime, const QgsDataProviderTemporalCapabilities *capabilities)
 Sets the reference time and update the time extent from the temporal capabilities, if the temporal capabilities is null, set a void time extent (reference time to reference time) More...
 
QgsDateTimeRange timeExtent () const
 Returns the time extent. More...
 
QDomElement writeXml (QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context) override
 Writes the properties to a DOM element, to be used later with readXml(). More...
 
- Public Member Functions inherited from QgsMapLayerTemporalProperties
 QgsMapLayerTemporalProperties (QObject *parent, bool enabled=false)
 Constructor for QgsMapLayerTemporalProperties, with the specified parent object. More...
 
virtual QList< QgsDateTimeRangeallTemporalRanges (QgsMapLayer *layer) const
 Attempts to calculate the overall list of all temporal extents which are contained in the specified layer, using the settings defined by the temporal properties object. More...
 
virtual QgsDateTimeRange calculateTemporalExtent (QgsMapLayer *layer) const
 Attempts to calculate the overall temporal extent for the specified layer, using the settings defined by the temporal properties object. More...
 
virtual bool isVisibleInTemporalRange (const QgsDateTimeRange &range) const
 Returns true if the layer should be visible and rendered for the specified time range. More...
 
virtual bool readXml (const QDomElement &element, const QgsReadWriteContext &context)=0
 Reads temporal properties from a DOM element previously written by writeXml(). More...
 
virtual void setDefaultsFromDataProviderTemporalCapabilities (const QgsDataProviderTemporalCapabilities *capabilities)=0
 Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities. More...
 
virtual QDomElement writeXml (QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context)=0
 Writes the properties to a DOM element, to be used later with readXml(). More...
 
- Public Member Functions inherited from QgsTemporalProperty
 QgsTemporalProperty (QObject *parent=nullptr, bool enabled=false)
 Constructor for QgsTemporalProperty, with the specified parent object. More...
 
virtual QgsTemporalProperty::Flags flags () const
 Returns flags associated to the temporal property. More...
 
bool isActive () const
 Returns true if the temporal property is active. More...
 
void setIsActive (bool active)
 Sets whether the temporal property is active. More...
 

Additional Inherited Members

- Public Types inherited from QgsTemporalProperty
enum  Flag { FlagDontInvalidateCachedRendersWhenRangeChanges = 1 }
 Flags attached to the temporal property. More...
 
typedef QFlags< FlagFlags
 
- Signals inherited from QgsTemporalProperty
void changed ()
 Emitted when the temporal properties have changed. More...
 

Detailed Description

Implementation of map layer temporal properties for mesh layers.

The time in a mesh layer is defined by :

Reference time : AT
Dataset 1 time o-----RT------RT-----RT-----------RT
Dataset 2 time o---------RT------RT--------RT
Dataset 3 time o------------------------------RT-------RT----------RT
Time extent of layer o-----<--------------------------------------------->
AT : absolute time (QDateTime)
RT : relative time (qint64)
Since
QGIS 3.14

Definition at line 51 of file qgsmeshlayertemporalproperties.h.

Constructor & Destructor Documentation

◆ QgsMeshLayerTemporalProperties()

QgsMeshLayerTemporalProperties::QgsMeshLayerTemporalProperties ( QObject *  parent = nullptr,
bool  enabled = true 
)

Constructor for QgsMeshLayerTemporalProperties.

Parameters
parentpointer to the parent object
enabledargument specifies whether the temporal properties are initially enabled or not (see isActive()).

Definition at line 23 of file qgsmeshlayertemporalproperties.cpp.

Member Function Documentation

◆ alwaysLoadReferenceTimeFromSource()

bool QgsMeshLayerTemporalProperties::alwaysLoadReferenceTimeFromSource ( ) const

Returns whether the time proporties are automatically reloaded from provider when project is opened or layer is reloaded.

Since
QGIS 3.28

Definition at line 131 of file qgsmeshlayertemporalproperties.cpp.

◆ calculateTemporalExtent()

QgsDateTimeRange QgsMeshLayerTemporalProperties::calculateTemporalExtent ( QgsMapLayer layer) const
overridevirtual

Attempts to calculate the overall temporal extent for the specified layer, using the settings defined by the temporal properties object.

May return an infinite range if the extent could not be calculated.

Note
Not available in Python bindings

Reimplemented from QgsMapLayerTemporalProperties.

Definition at line 84 of file qgsmeshlayertemporalproperties.cpp.

◆ isValid()

bool QgsMeshLayerTemporalProperties::isValid ( ) const

Returns whether the instance is valid.

Since
QGIS 3.22

Definition at line 121 of file qgsmeshlayertemporalproperties.cpp.

◆ matchingMethod()

QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod QgsMeshLayerTemporalProperties::matchingMethod ( ) const

Returns the method used to match dataset from temporal capabilities.

Definition at line 111 of file qgsmeshlayertemporalproperties.cpp.

◆ readXml()

bool QgsMeshLayerTemporalProperties::readXml ( const QDomElement &  element,
const QgsReadWriteContext context 
)
overridevirtual

Reads temporal properties from a DOM element previously written by writeXml().

See also
writeXml()

Implements QgsMapLayerTemporalProperties.

Definition at line 43 of file qgsmeshlayertemporalproperties.cpp.

◆ referenceTime()

QDateTime QgsMeshLayerTemporalProperties::referenceTime ( ) const

Returns the reference time.

Definition at line 94 of file qgsmeshlayertemporalproperties.cpp.

◆ setAlwaysLoadReferenceTimeFromSource()

void QgsMeshLayerTemporalProperties::setAlwaysLoadReferenceTimeFromSource ( bool  autoReloadFromProvider)

Sets whether the time proporties are automatically reloaded from provider when project is opened or layer is reloaded.

Parameters
autoReloadFromProviderwhether the time proporties is automatically reloaded
Since
QGIS 3.28

Definition at line 136 of file qgsmeshlayertemporalproperties.cpp.

◆ setDefaultsFromDataProviderTemporalCapabilities()

void QgsMeshLayerTemporalProperties::setDefaultsFromDataProviderTemporalCapabilities ( const QgsDataProviderTemporalCapabilities capabilities)
overridevirtual

Sets the layers temporal settings to appropriate defaults based on a provider's temporal capabilities.

Implements QgsMapLayerTemporalProperties.

Definition at line 70 of file qgsmeshlayertemporalproperties.cpp.

◆ setIsValid()

void QgsMeshLayerTemporalProperties::setIsValid ( bool  isValid)

Sets whether the instance is valid.

Parameters
isValidwhether the instance is valid
Since
QGIS 3.22

Definition at line 126 of file qgsmeshlayertemporalproperties.cpp.

◆ setMatchingMethod()

void QgsMeshLayerTemporalProperties::setMatchingMethod ( const QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod matchingMethod)

Sets the method used to match dataset from temporal capabilities.

Parameters
matchingMethodthe matching method

Definition at line 116 of file qgsmeshlayertemporalproperties.cpp.

◆ setReferenceTime()

void QgsMeshLayerTemporalProperties::setReferenceTime ( const QDateTime &  referenceTime,
const QgsDataProviderTemporalCapabilities capabilities 
)

Sets the reference time and update the time extent from the temporal capabilities, if the temporal capabilities is null, set a void time extent (reference time to reference time)

Parameters
referenceTimethe reference time
capabilitiesthe temporal capabilities of the data provider

Definition at line 99 of file qgsmeshlayertemporalproperties.cpp.

◆ timeExtent()

QgsDateTimeRange QgsMeshLayerTemporalProperties::timeExtent ( ) const

Returns the time extent.

Definition at line 89 of file qgsmeshlayertemporalproperties.cpp.

◆ writeXml()

QDomElement QgsMeshLayerTemporalProperties::writeXml ( QDomElement &  element,
QDomDocument &  doc,
const QgsReadWriteContext context 
)
overridevirtual

Writes the properties to a DOM element, to be used later with readXml().

See also
readXml()

Implements QgsMapLayerTemporalProperties.

Definition at line 27 of file qgsmeshlayertemporalproperties.cpp.


The documentation for this class was generated from the following files: