Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
simple static queue for indexing
- Loading branch information
|
@@ -35,6 +35,8 @@ |
|
|
#define PROVIDER_KEY QStringLiteral( "pdal" ) |
|
|
#define PROVIDER_DESCRIPTION QStringLiteral( "PDAL point cloud data provider" ) |
|
|
|
|
|
QQueue<QgsPdalProvider *> QgsPdalProvider::mIndexingQueue; |
|
|
|
|
|
QgsPdalProvider::QgsPdalProvider( |
|
|
const QString &uri, |
|
|
const QgsDataProvider::ProviderOptions &options, |
|
@@ -93,6 +95,7 @@ void QgsPdalProvider::generateIndex() |
|
|
if ( anyIndexingTaskExists() ) |
|
|
{ |
|
|
QgsMessageLog::logMessage( tr( "EPT generation task is already running" ), QObject::tr( "Point clouds" ), Qgis::Info ); |
|
|
mIndexingQueue.push_back( this ); |
|
|
return; |
|
|
} |
|
|
|
|
@@ -146,6 +149,8 @@ void QgsPdalProvider::onGenerateIndexFinished() |
|
|
mRunningIndexingTask = nullptr; |
|
|
emit indexGenerationStateChanged( PointCloudIndexGenerationState::Indexed ); |
|
|
} |
|
|
if ( !mIndexingQueue.empty() ) |
|
|
mIndexingQueue.takeFirst()->generateIndex(); |
|
|
} |
|
|
|
|
|
void QgsPdalProvider::onGenerateIndexFailed() |
|
@@ -157,6 +162,8 @@ void QgsPdalProvider::onGenerateIndexFailed() |
|
|
mRunningIndexingTask = nullptr; |
|
|
emit indexGenerationStateChanged( PointCloudIndexGenerationState::NotIndexed ); |
|
|
} |
|
|
if ( !mIndexingQueue.empty() ) |
|
|
mIndexingQueue.takeFirst()->generateIndex(); |
|
|
} |
|
|
|
|
|
bool QgsPdalProvider::anyIndexingTaskExists() |
|
|
|
@@ -66,6 +66,7 @@ class QgsPdalProvider: public QgsPointCloudDataProvider |
|
|
QVariantMap mOriginalMetadata; |
|
|
std::unique_ptr<QgsEptPointCloudIndex> mIndex; |
|
|
QgsPdalEptGenerationTask *mRunningIndexingTask = nullptr; |
|
|
static QQueue<QgsPdalProvider *> mIndexingQueue; |
|
|
}; |
|
|
|
|
|
class QgsPdalProviderMetadata : public QgsProviderMetadata |
|
|