scale selection

It is possible to select/deselect all features related to a scale in the interface
This commit is contained in:
Paul Leroy
2022-10-28 17:05:36 +02:00
parent 0b0fc3e8d7
commit 9ddb986351
4 changed files with 28 additions and 20 deletions
+18
View File
@@ -75,6 +75,24 @@ int Train3DMASCDialog::addScale(double scale, bool isChecked/*=true*/)
return index;
}
void Train3DMASCDialog::scaleStateChanged(QTableWidgetItem* item)
{
// if the scale is not checked, remove automatically features based on this scale
QString scale = "_SC" + item->text() + "_";
for (int row = 0; row < tableWidget->rowCount(); row++)
{
QTableWidgetItem* nameItem = tableWidget->item(row, 0);
QString name = nameItem->text();
if (name.contains(scale))
nameItem->setCheckState(item->checkState());
}
}
void Train3DMASCDialog::connectScaleSelectionToFeatureSelection()
{
connect(tableWidgetScales, &QTableWidget::itemChanged, this, &Train3DMASCDialog::scaleStateChanged);
}
void Train3DMASCDialog::setResultText(QString text)
{
resultLabel->setText(text);