[FEM] spread the fixes from commit ef370e6d to the other dialogs

This commit is contained in:
donovaly
2020-02-28 01:58:42 +01:00
committed by wwmayer
parent 318e5603c3
commit 10cfdceb7a
10 changed files with 383 additions and 497 deletions

View File

@@ -738,7 +738,6 @@ void TaskFemConstraintFluidBoundary::addToSelection()
QMessageBox::warning(this, tr("Selection error"), tr("Nothing selected!"));
return;
}
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
@@ -748,7 +747,6 @@ void TaskFemConstraintFluidBoundary::addToSelection()
QMessageBox::warning(this, tr("Selection error"), tr("Selected object is not a part!"));
return;
}
const std::vector<std::string>& subNames = it->getSubNames();
App::DocumentObject* obj = it->getObject();
for (size_t subIt = 0; subIt < subNames.size(); ++subIt) {// for every selected sub element
@@ -761,7 +759,6 @@ void TaskFemConstraintFluidBoundary::addToSelection()
addMe = false;
}
}
// limit constraint such that only vertexes or faces or edges can be used depending on what was selected first
std::string searchStr;
if (subNames[subIt].find("Vertex") != std::string::npos)
@@ -787,7 +784,6 @@ void TaskFemConstraintFluidBoundary::addToSelection()
}
}
}
//Update UI
pcConstraint->References.setValues(Objects, SubElements);
updateUI();
@@ -800,7 +796,6 @@ void TaskFemConstraintFluidBoundary::removeFromSelection()
QMessageBox::warning(this, tr("Selection error"), tr("Nothing selected!"));
return;
}
Fem::ConstraintFluidBoundary* pcConstraint = static_cast<Fem::ConstraintFluidBoundary*>(ConstraintView->getObject());
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
@@ -810,7 +805,6 @@ void TaskFemConstraintFluidBoundary::removeFromSelection()
QMessageBox::warning(this, tr("Selection error"), tr("Selected object is not a part!"));
return;
}
const std::vector<std::string>& subNames = it->getSubNames();
App::DocumentObject* obj = it->getObject();
@@ -825,14 +819,12 @@ void TaskFemConstraintFluidBoundary::removeFromSelection()
}
}
}
std::sort(itemsToDel.begin(), itemsToDel.end());
while (itemsToDel.size() > 0) {
Objects.erase(Objects.begin() + itemsToDel.back());
SubElements.erase(SubElements.begin() + itemsToDel.back());
itemsToDel.pop_back();
}
//Update UI
{
QSignalBlocker block(ui->listReferences);
@@ -841,7 +833,6 @@ void TaskFemConstraintFluidBoundary::removeFromSelection()
ui->listReferences->addItem(makeRefText(Objects[j], SubElements[j]));
}
}
pcConstraint->References.setValues(Objects, SubElements);
updateUI();
}