[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

@@ -59,7 +59,7 @@ using namespace Gui;
/* TRANSLATOR FemGui::TaskFemConstraintPressure */
TaskFemConstraintPressure::TaskFemConstraintPressure(ViewProviderFemConstraintPressure *ConstraintView,QWidget *parent)
: TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintPressure")
: TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintPressure")
{ //Note change "pressure" in line above to new constraint name
proxy = new QWidget(this);
ui = new Ui_TaskFemConstraintPressure();
@@ -105,8 +105,10 @@ TaskFemConstraintPressure::TaskFemConstraintPressure(ViewProviderFemConstraintPr
}
//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();
}
@@ -261,6 +263,12 @@ void TaskFemConstraintPressure::changeEvent(QEvent *)
{
}
void TaskFemConstraintPressure::clearButtons(const SelectionChangeModes notThis)
{
if (notThis != refAdd) ui->btnAdd->setChecked(false);
if (notThis != refRemove) ui->btnRemove->setChecked(false);
}
//**************************************************************************
// TaskDialog
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++