[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:
@@ -59,8 +59,8 @@ using namespace Gui;
|
||||
/* TRANSLATOR FemGui::TaskFemConstraintSpring */
|
||||
|
||||
TaskFemConstraintSpring::TaskFemConstraintSpring(ViewProviderFemConstraintSpring *ConstraintView, QWidget *parent)
|
||||
: TaskFemConstraint(ConstraintView, parent, "FEM_ConstraintSpring")
|
||||
{
|
||||
: TaskFemConstraintOnBoundary(ConstraintView, parent, "FEM_ConstraintSpring")
|
||||
{
|
||||
proxy = new QWidget(this);
|
||||
ui = new Ui_TaskFemConstraintSpring();
|
||||
ui->setupUi(proxy);
|
||||
@@ -95,7 +95,7 @@ TaskFemConstraintSpring::TaskFemConstraintSpring(ViewProviderFemConstraintSpring
|
||||
ui->if_tan->setMaximum(FLOAT_MAX);
|
||||
Base::Quantity ts = Base::Quantity((pcConstraint->tangentialStiffness.getValue()), Base::Unit::Stiffness);
|
||||
ui->if_tan->setValue(ts);
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
ui->lw_references->clear();
|
||||
@@ -107,8 +107,10 @@ TaskFemConstraintSpring::TaskFemConstraintSpring(ViewProviderFemConstraintSpring
|
||||
}
|
||||
|
||||
//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 TaskFemConstraintSpring::changeEvent(QEvent *)
|
||||
{
|
||||
}
|
||||
|
||||
void TaskFemConstraintSpring::clearButtons(const SelectionChangeModes notThis)
|
||||
{
|
||||
if (notThis != refAdd) ui->btnAdd->setChecked(false);
|
||||
if (notThis != refRemove) ui->btnRemove->setChecked(false);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// TaskDialog
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
Reference in New Issue
Block a user