mirror of
https://github.com/dgirardeau/q3DMASC.git
synced 2026-08-30 00:50:49 +08:00
Compute features at various scales in a smarter way (finished)
This commit is contained in:
@@ -120,7 +120,7 @@ bool Classifier::classify(const Feature::Set& features, ccPointCloud* cloud, QSt
|
||||
//look for the classification field
|
||||
CCLib::ScalarField* classificationSF = nullptr;
|
||||
int classifSFIdx = cloud->getScalarFieldIndexByName(LAS_FIELD_NAMES[LAS_CLASSIFICATION]); //LAS_FIELD_NAMES[LAS_CLASSIFICATION] = "Classification"
|
||||
if (!classifSFIdx)
|
||||
if (classifSFIdx < 0)
|
||||
{
|
||||
//create it if necessary
|
||||
ccScalarField* _classificationSF = new ccScalarField(LAS_FIELD_NAMES[LAS_CLASSIFICATION]);
|
||||
|
||||
+21
-10
@@ -894,7 +894,8 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
unsigned pointCount = corePoints.size();
|
||||
if (progressCb)
|
||||
{
|
||||
progressCb->setInfo(qPrintable(QString("Computing fields for cloud %1\n(core points: %2)").arg(sourceCloud->getName()).arg(pointCount)));
|
||||
progressCb->setMethodTitle("Point features");
|
||||
progressCb->setInfo(qPrintable(QString("Computing %1 featrues on cloud %2\n(core points: %3)").arg(fas.features.size()).arg(sourceCloud->getName()).arg(pointCount)));
|
||||
}
|
||||
ccLog::Print(QString("Computing fields for cloud %1 (core points: %2)").arg(sourceCloud->getName()).arg(pointCount));
|
||||
CCLib::NormalizedProgress nProgress(progressCb, pointCount);
|
||||
@@ -980,21 +981,31 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
break;
|
||||
}
|
||||
|
||||
if (progressCb && !nProgress.oneStep())
|
||||
{
|
||||
//process cancelled by the user
|
||||
ccLog::Warning("Process cancelled");
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
} //for each scale
|
||||
|
||||
if (progressCb && !nProgress.oneStep())
|
||||
{
|
||||
//process cancelled by the user
|
||||
ccLog::Warning("Process cancelled");
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
} //for each point
|
||||
|
||||
} //for each cloud
|
||||
}
|
||||
|
||||
//now we can end
|
||||
for (const Feature::Shared& feature : features)
|
||||
{
|
||||
//we have to 'finish' the process for Point features
|
||||
if (feature->getType() == Feature::Type::PointFeature && feature->scaled())
|
||||
{
|
||||
if (!qSharedPointerCast<PointFeature>(feature)->finish(corePoints, error))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user