QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
pointcloud
qgspointcloudstatscalculationtask.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgspointcloudstatscalculationtask.cpp
3
--------------------
4
begin : April 2022
5
copyright : (C) 2022 by Belgacem Nedjima
6
email : belgacem dot nedjima at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#include "
qgspointcloudstatscalculationtask.h
"
19
20
#include "
qgsfeedback.h
"
21
#include "
qgspointcloudindex.h
"
22
23
#include "moc_qgspointcloudstatscalculationtask.cpp"
24
26
27
QgsPointCloudStatsCalculationTask::QgsPointCloudStatsCalculationTask(
QgsPointCloudIndex
index,
const
QVector<QgsPointCloudAttribute> &attributes, qint64 pointLimit )
28
:
QgsTask
( tr(
"Generating attributes statistics"
) )
29
, mCalculator( std::move( index ) )
30
, mAttributes( attributes )
31
, mPointLimit( pointLimit )
32
{
33
mFeedback =
new
QgsFeedback
(
this
);
34
}
35
36
bool
QgsPointCloudStatsCalculationTask::run()
37
{
38
connect( mFeedback, &
QgsFeedback::progressChanged
,
this
, &QgsPointCloudStatsCalculationTask::setProgress );
39
return
mCalculator.calculateStats( mFeedback, mAttributes, mPointLimit );
40
}
41
42
void
QgsPointCloudStatsCalculationTask::cancel()
43
{
44
mFeedback->cancel();
45
QgsTask::cancel
();
46
}
47
48
QgsPointCloudStatistics
QgsPointCloudStatsCalculationTask::calculationResults()
const
49
{
50
return
mCalculator.statistics();
51
}
52
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition
qgsfeedback.h:44
QgsFeedback::progressChanged
void progressChanged(double progress)
Emitted when the feedback object reports a progress change.
QgsPointCloudIndex
Smart pointer for QgsAbstractPointCloudIndex.
Definition
qgspointcloudindex.h:439
QgsPointCloudStatistics
Used to store statistics of a point cloud dataset.
Definition
qgspointcloudstatistics.h:76
QgsTask
Abstract base class for long running background tasks.
Definition
qgstaskmanager.h:55
QgsTask::cancel
virtual void cancel()
Notifies the task that it should terminate.
Definition
qgstaskmanager.cpp:98
qgsfeedback.h
qgspointcloudindex.h
qgspointcloudstatscalculationtask.h
Generated on
for QGIS API Documentation by
1.17.0