-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgspdalprovider.h
86 lines (75 loc) · 3.64 KB
/
qgspdalprovider.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/***************************************************************************
qgspdaldataprovider.h
---------------------
Date : November 2020
Copyright : (C) 2020 by Peter Petrik
Email : zilolv at gmail dot com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSPDALPROVIDER_H
#define QGSPDALPROVIDER_H
#include "qgis_core.h"
#include "qgspointclouddataprovider.h"
#include "qgsprovidermetadata.h"
#include <memory>
class QgsEptPointCloudIndex;
class QgsPdalEptGenerationTask;
class QgsPdalProvider: public QgsPointCloudDataProvider
{
Q_OBJECT
public:
QgsPdalProvider( const QString &uri,
const QgsDataProvider::ProviderOptions &providerOptions,
QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
~QgsPdalProvider();
QgsCoordinateReferenceSystem crs() const override;
QgsRectangle extent() const override;
QgsPointCloudAttributeCollection attributes() const override;
int pointCount() const override;
QVariantMap originalMetadata() const override;
bool isValid() const override;
QString name() const override;
QString description() const override;
QgsPointCloudIndex *index() const override;
QVariant metadataStatistic( const QString &attribute, QgsStatisticalSummary::Statistic statistic ) const override;
QVariantList metadataClasses( const QString &attribute ) const override;
QVariant metadataClassStatistic( const QString &attribute, const QVariant &value, QgsStatisticalSummary::Statistic statistic ) const override;
void loadIndex( ) override;
void generateIndex( ) override;
PointCloudIndexGenerationState indexingState( ) override;
private slots:
void onGenerateIndexFinished();
void onGenerateIndexFailed();
private:
bool anyIndexingTaskExists();
bool load( const QString &uri );
QgsCoordinateReferenceSystem mCrs;
QgsRectangle mExtent;
bool mIsValid = false;
int mPointCount = 0;
QVariantMap mOriginalMetadata;
std::unique_ptr<QgsEptPointCloudIndex> mIndex;
QgsPdalEptGenerationTask *mRunningIndexingTask = nullptr;
static QQueue<QgsPdalProvider *> sIndexingQueue;
};
class QgsPdalProviderMetadata : public QgsProviderMetadata
{
public:
QgsPdalProviderMetadata();
QgsPdalProvider *createProvider( const QString &uri, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() ) override;
QgsProviderMetadata::ProviderMetadataCapabilities capabilities() const override;
QList< QgsDataItemProvider * > dataItemProviders() const override;
QString encodeUri( const QVariantMap &parts ) const override;
QVariantMap decodeUri( const QString &uri ) const override;
int priorityForUri( const QString &uri ) const override;
QList< QgsMapLayerType > validLayerTypesForUri( const QString &uri ) const override;
QString filters( FilterType type ) override;
};
#endif // QGSPDALPROVIDER_H