Fem: Update ReferenceNode property from task dialog - fixes #14172

This commit is contained in:
marioalexis
2024-05-20 23:43:44 -03:00
committed by Chris Hennes
parent f7c2512188
commit 6714af1bc8
2 changed files with 38 additions and 0 deletions

View File

@@ -91,6 +91,18 @@ TaskFemConstraintRigidBody::TaskFemConstraintRigidBody(
qOverload<int>(&QComboBox::activated),
this,
&TaskFemConstraintRigidBody::onRotModeZChanged);
connect(ui->qsb_ref_node_x,
qOverload<double>(&Gui::QuantitySpinBox::valueChanged),
this,
&TaskFemConstraintRigidBody::onRefNodeXChanged);
connect(ui->qsb_ref_node_y,
qOverload<double>(&Gui::QuantitySpinBox::valueChanged),
this,
&TaskFemConstraintRigidBody::onRefNodeYChanged);
connect(ui->qsb_ref_node_z,
qOverload<double>(&Gui::QuantitySpinBox::valueChanged),
this,
&TaskFemConstraintRigidBody::onRefNodeZChanged);
this->groupLayout()->addWidget(proxy);
@@ -506,6 +518,29 @@ void TaskFemConstraintRigidBody::onTransModeZChanged(int item)
}
}
void TaskFemConstraintRigidBody::onRefNodeXChanged(double value)
{
auto obj = static_cast<Fem::ConstraintRigidBody*>(ConstraintView->getObject());
Base::Vector3d refNode = obj->ReferenceNode.getValue();
refNode.x = value;
obj->ReferenceNode.setValue(refNode);
}
void TaskFemConstraintRigidBody::onRefNodeYChanged(double value)
{
auto obj = static_cast<Fem::ConstraintRigidBody*>(ConstraintView->getObject());
Base::Vector3d refNode = obj->ReferenceNode.getValue();
refNode.y = value;
obj->ReferenceNode.setValue(refNode);
}
void TaskFemConstraintRigidBody::onRefNodeZChanged(double value)
{
auto obj = static_cast<Fem::ConstraintRigidBody*>(ConstraintView->getObject());
Base::Vector3d refNode = obj->ReferenceNode.getValue();
refNode.z = value;
obj->ReferenceNode.setValue(refNode);
}
const std::string TaskFemConstraintRigidBody::getReferences() const
{

View File

@@ -61,6 +61,9 @@ private Q_SLOTS:
void onRotModeXChanged(int);
void onRotModeYChanged(int);
void onRotModeZChanged(int);
void onRefNodeXChanged(double);
void onRefNodeYChanged(double);
void onRefNodeZChanged(double);
protected:
bool event(QEvent* e) override;