THe GUI version can now handle 4 clouds

This commit is contained in:
Daniel Girardeau-Montaut
2019-03-29 13:40:57 +01:00
parent 568ed7e292
commit 4dfc90d967
3 changed files with 75 additions and 43 deletions
+22
View File
@@ -84,6 +84,7 @@ Classify3DMASCDialog::Classify3DMASCDialog(ccMainAppInterface* app, bool trainMo
cloud1ComboBox->addItem(name, uniqueID);
cloud2ComboBox->addItem(name, uniqueID);
cloud3ComboBox->addItem(name, uniqueID);
cloud4ComboBox->addItem(name, uniqueID);
testCloudComboBox->addItem(name, uniqueID);
++cloudCount;
}
@@ -96,6 +97,8 @@ Classify3DMASCDialog::Classify3DMASCDialog(ccMainAppInterface* app, bool trainMo
connect(cloud2ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onCloudChanged(int)));
cloud3ComboBox->setCurrentIndex(/*cloudCount > 2 ? 0 : */-1);
connect(cloud3ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onCloudChanged(int)));
cloud4ComboBox->setCurrentIndex(/*cloudCount > 3 ? 0 : */-1);
connect(cloud4ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onCloudChanged(int)));
testCloudComboBox->setCurrentIndex(-1);
if (cloudCount == 0 && app)
@@ -135,6 +138,11 @@ void Classify3DMASCDialog::setCloudRoles(const QList<QString>& roles, QString co
if (corePointsLabel == role)
cloud3RadioButton->setChecked(true);
break;
case 3:
cloud4RadioButton->setText(role);
if (corePointsLabel == role)
cloud4RadioButton->setChecked(true);
break;
default:
//this dialog can't handle more than 3 roles!
break;
@@ -159,6 +167,12 @@ void Classify3DMASCDialog::setCloudRoles(const QList<QString>& roles, QString co
cloud3RadioButton->setVisible(false);
cloud3ComboBox->setVisible(false);
}
if (index < 4)
{
cloud4RadioButton->setEnabled(false);
cloud4RadioButton->setVisible(false);
cloud4ComboBox->setVisible(false);
}
}
void Classify3DMASCDialog::getClouds(QMap<QString, ccPointCloud*>& clouds, QString& mainCloud) const
@@ -193,6 +207,14 @@ void Classify3DMASCDialog::getClouds(QMap<QString, ccPointCloud*>& clouds, QStri
mainCloud = cloud3RadioButton->text();
}
}
if (cloud4RadioButton->isEnabled())
{
clouds.insert(cloud4RadioButton->text(), GetCloudFromCombo(cloud3ComboBox, m_app->dbRootObject()));
if (cloud4RadioButton->isChecked())
{
mainCloud = cloud4RadioButton->text();
}
}
if (testCloudComboBox->currentIndex() >= 0)
{
clouds.insert("TEST", GetCloudFromCombo(testCloudComboBox, m_app->dbRootObject()));