24 QgsDataProvider::ReadFlags flags )
49 if ( oldUnit != unit )
61 const QDateTime &referenceTime,
62 int groupIndex, qint64 time,
65 const QDateTime requestDateTime = referenceTime.addMSecs( time );
68 if ( providerReferenceTime.isValid() )
69 providerTime = providerReferenceTime.msecsTo( requestDateTime );
88 const QDateTime requestDateTime = referenceTime.addMSecs( time1 );
94 providerTime1 = providerReferenceTime.msecsTo( requestDateTime );
95 providerTime2 = providerTime1 - time1 + time2;
99 providerTime1 = time1;
100 providerTime2 = time2;
103 QList<QgsMeshDatasetIndex> ret;
108 if ( time >= providerTime1 && time <= providerTime2 )
109 ret.append( datasetIndex );
131 const QVector<QgsMeshDataBlock> &datasetValues,
132 const QVector<QgsMeshDataBlock> &datasetActive,
133 const QVector<double> × )
136 QString filename = path;
138 QString driverName = QStringLiteral(
"DAT" );
139 QStringList parts = path.split(
':' );
140 if ( parts.size() > 1 )
142 driverName = parts[0];
144 filename = parts.join( QString() );
151 if ( index <
vertices.size() && index >= 0 )
158 if ( index <
faces.size() && index >= 0 )
165 if ( index <
edges.size() && index >= 0 )
179 if ( face1.count() != face2.count() )
183 for (
int i = 0; i < face2.count(); ++i )
184 if ( face2.at( i ) == face1.at( 0 ) )
190 for (
int i = 0; i < face1.count(); ++i )
191 if ( face1.at( i ) != face2.at( ( i + startFace2 ) % ( face2.count() ) ) )
204 return !
edges.isEmpty();
206 return !
faces.isEmpty();
TemporalUnit
Temporal units.
Abstract base class for spatial data provider implementations.
virtual void reloadData()
Reloads the data from the source for providers with data caches to synchronize, changes in the data s...
Class for handling properties relating to a mesh data provider's temporal capabilities.
Qgis::TemporalUnit temporalUnit() const
Returns the temporal unit used to read data by the data provider.
MatchingTemporalDatasetMethod
Method for selection of temporal mesh dataset from a range time.
@ FindClosestDatasetBeforeStartRangeTime
@ FindClosestDatasetFromStartRangeTime
Finds the closest dataset which have its time before the requested start range time.
virtual QgsMeshDriverMetadata driverMetadata() const
Returns the mesh driver metadata of the provider.
void setTemporalUnit(Qgis::TemporalUnit unit)
Sets the temporal unit of the provider and reload data if it changes.
QgsMeshDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
QgsMeshDataProvider(const QString &uri, const QgsDataProvider::ProviderOptions &providerOptions, QgsDataProvider::ReadFlags flags=QgsDataProvider::ReadFlags())
Ctor.
virtual int vertexCount() const =0
Returns number of vertices in the native mesh.
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
virtual int edgeCount() const =0
Returns number of edges in the native mesh.
virtual int faceCount() const =0
Returns number of faces in the native mesh.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
int group() const
Returns a group index.
virtual QgsMeshDataBlock datasetValues(QgsMeshDatasetIndex index, int valueIndex, int count) const =0
Returns N vector/scalar values from the index from the dataset.
virtual int datasetCount(int groupIndex) const =0
Returns number of datasets loaded in the group.
virtual Q_DECL_DEPRECATED bool persistDatasetGroup(const QString &path, const QgsMeshDatasetGroupMetadata &meta, const QVector< QgsMeshDataBlock > &datasetValues, const QVector< QgsMeshDataBlock > &datasetActive, const QVector< double > ×)
Creates a new dataset group from a data and persists it into a destination path.
virtual QgsMeshDatasetGroupMetadata datasetGroupMetadata(int groupIndex) const =0
Returns dataset group metadata.
QgsMeshDatasetSourceInterface()
std::unique_ptr< QgsMeshDataProviderTemporalCapabilities > mTemporalCapabilities
QgsMeshDatasetIndex datasetIndexAtTime(const QDateTime &referenceTime, int groupIndex, qint64 time, QgsMeshDataProviderTemporalCapabilities::MatchingTemporalDatasetMethod method) const
Returns the dataset index of the dataset in a specific dataset group at time from the reference time.
QList< QgsMeshDatasetIndex > datasetIndexInTimeInterval(const QDateTime &referenceTime, int groupIndex, qint64 time1, qint64 time2) const
Returns a list of dataset indexes of the dataset in a specific dataset group that are between time1 a...
Point geometry type, with support for z-dimension and m-values.
QVector< int > QgsMeshFace
List of vertex indexes.
QPair< int, int > QgsMeshEdge
Edge is a straight line seqment between 2 points.
QgsPoint QgsMeshVertex
xyz coords of vertex
#define QGIS_PROTECT_QOBJECT_THREAD_ACCESS
Setting options for creating vector data providers.
int vertexCount() const
Returns number of vertices.
QVector< QgsMeshVertex > vertices
QgsMeshFace face(int index) const
Returns a face at the index.
bool contains(const ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
QVector< QgsMeshFace > faces
static bool compareFaces(const QgsMeshFace &face1, const QgsMeshFace &face2)
Compare two faces, return true if they are equivalent : same indexes and same clock wise.
void clear()
Remove all vertices, edges and faces.
int faceCount() const
Returns number of faces.
ElementType
Defines type of mesh elements.
QgsMeshEdge edge(int index) const
Returns an edge at the index.
QgsMeshVertex vertex(int index) const
Returns a vertex at the index.
int edgeCount() const
Returns number of edge.
QVector< QgsMeshEdge > edges