From 80a6be6b2a6451e162111cdf9c9b4933e8862cc1 Mon Sep 17 00:00:00 2001 From: Daniel Girardeau-Montaut Date: Sat, 24 Nov 2018 18:41:14 +0100 Subject: [PATCH] Automatically display the classification field when classification is finished --- q3DMASCClassifier.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/q3DMASCClassifier.cpp b/q3DMASCClassifier.cpp index 3a50662..3fc7ff8 100644 --- a/q3DMASCClassifier.cpp +++ b/q3DMASCClassifier.cpp @@ -193,6 +193,7 @@ bool Classifier::classify(const Feature::Set& features, ccPointCloud* cloud, QSt } CCLib::NormalizedProgress nProgress(pDlg.data(), cloud->size()); + bool success = true; for (unsigned i = 0; i < cloud->size(); ++i) { for (int fIndex = 0; fIndex < attributesPerSample; ++fIndex) @@ -207,13 +208,21 @@ bool Classifier::classify(const Feature::Set& features, ccPointCloud* cloud, QSt if (pDlg && !nProgress.oneStep()) { //process cancelled by the user - classificationSF->computeMinAndMax(); - return false; + success = false; + break; } } classificationSF->computeMinAndMax(); - return true; + cloud->setCurrentDisplayedScalarField(classifSFIdx); + cloud->showSF(true); + if (parentWidget && cloud->getDisplay()) + { + cloud->getDisplay()->redraw(); + QCoreApplication::processEvents(); + } + + return success; } bool Classifier::evaluate(const Feature::Set& features, CCLib::ReferenceCloud* testSubset, AccuracyMetrics& metrics, QString& errorMessage, QWidget* parentWidget/*=nullptr*/)