QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
24 QgsDataProvider::ReadFlags flags )
43 if ( oldUnit != unit )
50 const QDateTime &referenceTime,
51 int groupIndex, qint64 time,
54 const QDateTime requestDateTime = referenceTime.addMSecs( time );
57 if ( providerReferenceTime.isValid() )
58 providerTime = providerReferenceTime.msecsTo( requestDateTime );
77 const QDateTime requestDateTime = referenceTime.addMSecs( time1 );
83 providerTime1 = providerReferenceTime.msecsTo( requestDateTime );
84 providerTime2 = providerTime1 - time1 + time2;
88 providerTime1 = time1;
89 providerTime2 = time2;
92 QList<QgsMeshDatasetIndex> ret;
97 if ( time >= providerTime1 && time <= providerTime2 )
98 ret.append( datasetIndex );
120 const QVector<QgsMeshDataBlock> &datasetValues,
121 const QVector<QgsMeshDataBlock> &datasetActive,
122 const QVector<double> × )
125 QString filename = path;
127 QString driverName = QStringLiteral(
"DAT" );
128 QStringList parts = path.split(
':' );
129 if ( parts.size() > 1 )
131 driverName = parts[0];
133 filename = parts.join( QString() );
140 if ( index <
vertices.size() && index >= 0 )
147 if ( index <
faces.size() && index >= 0 )
154 if ( index <
edges.size() && index >= 0 )
168 if ( face1.count() != face2.count() )
172 for (
int i = 0; i < face2.count(); ++i )
173 if ( face2.at( i ) == face1.at( 0 ) )
179 for (
int i = 0; i < face1.count(); ++i )
180 if ( face1.at( i ) != face2.at( ( i + startFace2 ) % ( face2.count() ) ) )
190 case ElementType::Vertex:
192 case ElementType::Edge:
193 return !
edges.isEmpty();
194 case ElementType::Face:
195 return !
faces.isEmpty();
219 case QgsMesh::ElementType::Vertex:
221 case QgsMesh::ElementType::Edge:
223 case QgsMesh::ElementType::Face:
virtual int datasetCount(int groupIndex) const =0
Returns number of datasets loaded in the group.
Setting options for creating vector data providers.
Abstract base class for spatial data provider implementations.
Point geometry type, with support for z-dimension and m-values.
QgsPoint QgsMeshVertex
xyz coords of vertex
Class for handling properties relating to a mesh data provider's temporal capabilities.
bool contains(const QgsMesh::ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
TemporalUnit
Temporal units.
QVector< QgsMeshEdge > edges
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...
@ FindClosestDatasetFromStartRangeTime
Finds the closest dataset which have its time before the requested start range time.
QgsMeshDataProviderTemporalCapabilities * temporalCapabilities() override
Returns the provider's temporal capabilities.
virtual QgsMeshDataBlock datasetValues(QgsMeshDatasetIndex index, int valueIndex, int count) const =0
Returns N vector/scalar values from the index from the dataset.
virtual void reloadData()
Reloads the data from the source for providers with data caches to synchronize, changes in the data s...
int faceCount() const
Returns number of faces.
int group() const
Returns a group index.
int vertexCount() const
Returns number of vertices.
ElementType
Defines type of mesh elements.
QVector< QgsMeshFace > faces
int edgeCount() const
Returns number of edge.
QgsMeshEdge edge(int index) const
Returns an edge at the index.
QgsMeshDatasetSourceInterface()
QgsMeshDatasetIndex is index that identifies the dataset group (e.g. wind speed) and a dataset in thi...
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.
void setTemporalUnit(QgsUnitTypes::TemporalUnit unit)
Sets the temporal unit of the provider and reload data if it changes.
QgsMeshFace face(int index) const
Returns a face at the index.
MatchingTemporalDatasetMethod
Method for selection of temporal mesh dataset from a range time.
virtual int edgeCount() const =0
Returns number of edges in the native mesh.
virtual int vertexCount() const =0
Returns number of vertices in the native mesh.
QVector< int > QgsMeshFace
List of vertex indexes.
void clear()
Remove all vertices, edges and faces.
QgsMeshDataProvider(const QString &uri, const QgsDataProvider::ProviderOptions &providerOptions, QgsDataProvider::ReadFlags flags=QgsDataProvider::ReadFlags())
Ctor.
virtual int faceCount() const =0
Returns number of faces in the native mesh.
bool contains(const ElementType &type) const
Returns whether the mesh contains at mesh elements of given type.
virtual QgsMeshDriverMetadata driverMetadata() const
Returns the mesh driver metadata of the provider.
@ FindClosestDatasetBeforeStartRangeTime
QPair< int, int > QgsMeshEdge
Edge is a straight line seqment between 2 points.
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.
QVector< QgsMeshVertex > vertices
static bool compareFaces(const QgsMeshFace &face1, const QgsMeshFace &face2)
Compare two faces, return true if they are equivalent : same indexes and same clock wise.
QgsMeshVertex vertex(int index) const
Returns a vertex at the index.
virtual QgsMeshDatasetGroupMetadata datasetGroupMetadata(int groupIndex) const =0
Returns dataset group metadata.
std::unique_ptr< QgsMeshDataProviderTemporalCapabilities > mTemporalCapabilities