[FEM] Use modal add/remove for more constraints (8/??)

Use the previously added superclass `TaskConstraintOnBoundary` for more
constraints where it's usable.

Currently done:
TaskFemConstraintDisplacement
TaskFemConstraintForce
TaskFemConstraintSpring
TaskFemConstraintFluidBoundary
TaskFemConstraintHeatflux
TaskFemConstraintFixed
TaskFemConstraintTemperature
TaskFemConstraintPressure

Too different:
TaskFemConstraintTransform (single selection)
TaskFemConstraintContact (single selection, two fields)
TaskFemConstraintPlaneRotation (single selection)
(Other constraint tasks, which do not use `addToSelection`)
This commit is contained in:
Ajinkya Dahale
2021-10-22 20:51:39 -04:00
committed by Uwe
parent 0aeed0e53b
commit c558fc7195
21 changed files with 162 additions and 45 deletions

View File

@@ -60,7 +60,7 @@ using namespace Gui;
/* TRANSLATOR FemGui::TaskFemConstraintFixed */
TaskFemConstraintFixed::TaskFemConstraintFixed(ViewProviderFemConstraintFixed *ConstraintView,QWidget *parent)
: TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintFixed")
: TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintFixed")
{ //Note change "Fixed" in line above to new constraint name
proxy = new QWidget(this);
ui = new Ui_TaskFemConstraintFixed();
@@ -96,8 +96,10 @@ TaskFemConstraintFixed::TaskFemConstraintFixed(ViewProviderFemConstraintFixed *C
}
//Selection buttons
connect(ui->btnAdd, SIGNAL(clicked()), this, SLOT(addToSelection()));
connect(ui->btnRemove, SIGNAL(clicked()), this, SLOT(removeFromSelection()));
connect(ui->btnAdd, SIGNAL(toggled(bool)),
this, SLOT(_addToSelection(bool)));
connect(ui->btnRemove, SIGNAL(toggled(bool)),
this, SLOT(_removeFromSelection(bool)));
updateUI();
}
@@ -244,6 +246,12 @@ void TaskFemConstraintFixed::changeEvent(QEvent *)
{
}
void TaskFemConstraintFixed::clearButtons(const SelectionChangeModes notThis)
{
if (notThis != refAdd) ui->btnAdd->setChecked(false);
if (notThis != refRemove) ui->btnRemove->setChecked(false);
}
//**************************************************************************
// TaskDialog
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++