QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Types | Public Member Functions | List of all members
QgsMeshDataProviderTemporalCapabilities Class Reference

Class for handling properties relating to a mesh data provider's temporal capabilities. More...

#include <qgsmeshdataprovidertemporalcapabilities.h>

Inheritance diagram for QgsMeshDataProviderTemporalCapabilities:
Inheritance graph
[legend]

Public Types

enum  MatchingTemporalDatasetMethod { FindClosestDatasetBeforeStartRangeTime , FindClosestDatasetFromStartRangeTime }
 Method for selection of temporal mesh dataset from a range time. More...
 

Public Member Functions

 QgsMeshDataProviderTemporalCapabilities ()
 Constructor for QgsMeshDataProviderTemporalCapabilities. More...
 
void addDatasetTime (int group, double time)
 Adds a time (in provider unit) from a dataset contained in group. More...
 
void addDatasetTimeInMilliseconds (int group, qint64 time)
 Adds a time (in milliseconds) from a dataset contained in group. More...
 
void addGroupReferenceDateTime (int group, const QDateTime &reference)
 Adds a reference date/time from a dataset group. More...
 
void clear ()
 Clears alls stored reference times and dataset times. More...
 
QgsMeshDatasetIndex datasetIndexClosestBeforeRelativeTime (int group, qint64 timeSinceGlobalReference) const
 Returns the last dataset with time less than or equal to timeSinceGlobalReference. More...
 
QgsMeshDatasetIndex datasetIndexClosestFromRelativeTime (int group, qint64 timeSinceGlobalReference) const
 Returns the closest dataset index from the timeSinceGlobalReference. More...
 
qint64 datasetTime (const QgsMeshDatasetIndex &index) const
 Returns the relative time in milliseconds of the dataset. More...
 
qint64 firstTimeStepDuration (int group) const
 Returns the duration of the first time step of the dataset group with index group. More...
 
bool hasReferenceTime () const
 Returns whether the reference time is set. More...
 
QDateTime referenceTime () const
 Returns the reference time. More...
 
void setTemporalUnit (QgsUnitTypes::TemporalUnit temporalUnit)
 Sets the temporal unit (temporalUnit) used to read data by the data provider. More...
 
QgsUnitTypes::TemporalUnit temporalUnit () const
 Returns the temporal unit used to read data by the data provider. More...
 
QgsDateTimeRange timeExtent () const
 Returns the time extent using the internal reference time and the first and last times available from the all the dataset. More...
 
QgsDateTimeRange timeExtent (const QDateTime &reference) const
 Returns the time extent using an external reference date time and the first and last times available from the all the dataset. More...
 
- Public Member Functions inherited from QgsDataProviderTemporalCapabilities
 QgsDataProviderTemporalCapabilities (bool available=false)
 Constructor for QgsDataProviderTemporalCapabilities. More...
 
virtual ~QgsDataProviderTemporalCapabilities ()=default
 
bool hasTemporalCapabilities () const
 Returns true if the provider has temporal capabilities available. More...
 
void setHasTemporalCapabilities (bool available)
 Sets whether the provider has temporal capabilities available. More...
 

Detailed Description

Class for handling properties relating to a mesh data provider's temporal capabilities.

Since
QGIS 3.14

Definition at line 34 of file qgsmeshdataprovidertemporalcapabilities.h.

Member Enumeration Documentation

◆ MatchingTemporalDatasetMethod

Method for selection of temporal mesh dataset from a range time.

Enumerator
FindClosestDatasetBeforeStartRangeTime 
FindClosestDatasetFromStartRangeTime 

Finds the closest dataset which have its time before the requested start range time.

Finds the closest dataset before or after the requested start range time

Definition at line 41 of file qgsmeshdataprovidertemporalcapabilities.h.

Constructor & Destructor Documentation

◆ QgsMeshDataProviderTemporalCapabilities()

QgsMeshDataProviderTemporalCapabilities::QgsMeshDataProviderTemporalCapabilities ( )

Member Function Documentation

◆ addDatasetTime()

void QgsMeshDataProviderTemporalCapabilities::addDatasetTime ( int  group,
double  time 
)

Adds a time (in provider unit) from a dataset contained in group.

Note
must be used only by the mesh data provider, all dataset need to be added one after one

Definition at line 93 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ addDatasetTimeInMilliseconds()

void QgsMeshDataProviderTemporalCapabilities::addDatasetTimeInMilliseconds ( int  group,
qint64  time 
)

Adds a time (in milliseconds) from a dataset contained in group.

Note
must be used only by the mesh data provider, all dataset need to be added one after one

Definition at line 87 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ addGroupReferenceDateTime()

void QgsMeshDataProviderTemporalCapabilities::addGroupReferenceDateTime ( int  group,
const QDateTime &  reference 
)

Adds a reference date/time from a dataset group.

Note
must be used only by the mesh data provider

Definition at line 78 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ clear()

void QgsMeshDataProviderTemporalCapabilities::clear ( )

Clears alls stored reference times and dataset times.

Definition at line 170 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ datasetIndexClosestBeforeRelativeTime()

QgsMeshDatasetIndex QgsMeshDataProviderTemporalCapabilities::datasetIndexClosestBeforeRelativeTime ( int  group,
qint64  timeSinceGlobalReference 
) const

Returns the last dataset with time less than or equal to timeSinceGlobalReference.

Returns invalid dataset index if timeSinceGlobalReference is outside the time extent of the dataset group

Note
for non temporal dataset group, timeSinceGlobalReference is not used and the unique dataset is returned

Definition at line 54 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ datasetIndexClosestFromRelativeTime()

QgsMeshDatasetIndex QgsMeshDataProviderTemporalCapabilities::datasetIndexClosestFromRelativeTime ( int  group,
qint64  timeSinceGlobalReference 
) const

Returns the closest dataset index from the timeSinceGlobalReference.

Returns invalid dataset index if timeSinceGlobalReference is outside the time extent of the dataset group

Note
for non temporal dataset group, timeSinceGlobalReference is not used and the unique dataset is returned

Definition at line 24 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ datasetTime()

qint64 QgsMeshDataProviderTemporalCapabilities::datasetTime ( const QgsMeshDatasetIndex index) const

Returns the relative time in milliseconds of the dataset.

Definition at line 158 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ firstTimeStepDuration()

qint64 QgsMeshDataProviderTemporalCapabilities::firstTimeStepDuration ( int  group) const

Returns the duration of the first time step of the dataset group with index group.

The value is -1 if the dataset group is not present or if it contains only one dataset (non temporal dataset)

Definition at line 177 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ hasReferenceTime()

bool QgsMeshDataProviderTemporalCapabilities::hasReferenceTime ( ) const

Returns whether the reference time is set.

Definition at line 99 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ referenceTime()

QDateTime QgsMeshDataProviderTemporalCapabilities::referenceTime ( ) const

Returns the reference time.

Definition at line 104 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ setTemporalUnit()

void QgsMeshDataProviderTemporalCapabilities::setTemporalUnit ( QgsUnitTypes::TemporalUnit  temporalUnit)

Sets the temporal unit (temporalUnit) used to read data by the data provider.

Temporal units supported are milliseconds, seconds, minutes, hors, days and weeks

Definition at line 148 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ temporalUnit()

QgsUnitTypes::TemporalUnit QgsMeshDataProviderTemporalCapabilities::temporalUnit ( ) const

Returns the temporal unit used to read data by the data provider.

Definition at line 153 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ timeExtent() [1/2]

QgsDateTimeRange QgsMeshDataProviderTemporalCapabilities::timeExtent ( ) const

Returns the time extent using the internal reference time and the first and last times available from the all the dataset.

Definition at line 109 of file qgsmeshdataprovidertemporalcapabilities.cpp.

◆ timeExtent() [2/2]

QgsDateTimeRange QgsMeshDataProviderTemporalCapabilities::timeExtent ( const QDateTime &  reference) const

Returns the time extent using an external reference date time and the first and last times available from the all the dataset.

Definition at line 115 of file qgsmeshdataprovidertemporalcapabilities.cpp.


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