Fem: Use base class open and reject methods in constraint task panels

This commit is contained in:
marioalexis
2024-06-21 14:11:42 -03:00
parent 5548ba1c59
commit 6002a73fd7
31 changed files with 23 additions and 367 deletions

View File

@@ -195,12 +195,11 @@ bool TaskFemConstraint::KeyEvent(QEvent* e)
void TaskDlgFemConstraint::open()
{
ConstraintView->setVisible(true);
Gui::Command::runCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
if (!Gui::Command::hasPendingCommand()) {
const char* typeName = ConstraintView->getObject()->getTypeId().getName();
Gui::Command::openCommand(typeName);
ConstraintView->setVisible(true);
}
}
bool TaskDlgFemConstraint::accept()
@@ -248,9 +247,9 @@ bool TaskDlgFemConstraint::reject()
// roll back the changes
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraint.cpp"

View File

@@ -520,21 +520,6 @@ TaskDlgFemConstraintContact::TaskDlgFemConstraintContact(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintContact::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Contact constraint");
Gui::Command::openCommand(static_cast<const char*>(msg.toUtf8()));
ConstraintView->setVisible(true);
Gui::Command::runCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintContact::accept()
{
/* Note: */
@@ -572,12 +557,4 @@ bool TaskDlgFemConstraintContact::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintContact::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintContact.cpp"

View File

@@ -75,9 +75,7 @@ class TaskDlgFemConstraintContact: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintContact(ViewProviderFemConstraintContact* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -34,6 +34,7 @@
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Mod/Fem/App/FemConstraintDisplacement.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintDisplacement.h"
#include "ui_TaskFemConstraintDisplacement.h"
@@ -625,21 +626,6 @@ TaskDlgFemConstraintDisplacement::TaskDlgFemConstraintDisplacement(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintDisplacement::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Displacement boundary condition");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintDisplacement::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();
@@ -757,13 +743,4 @@ bool TaskDlgFemConstraintDisplacement::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintDisplacement::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintDisplacement.cpp"

View File

@@ -113,9 +113,7 @@ class TaskDlgFemConstraintDisplacement: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintDisplacement(
ViewProviderFemConstraintDisplacement* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -33,6 +33,7 @@
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Mod/Fem/App/FemConstraintFixed.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintFixed.h"
#include "ui_TaskFemConstraintFixed.h"
@@ -279,33 +280,9 @@ TaskDlgFemConstraintFixed::TaskDlgFemConstraintFixed(ViewProviderFemConstraintFi
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintFixed::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Fixed boundary condition");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintFixed::accept()
{
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintFixed::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintFixed.cpp"

View File

@@ -66,9 +66,7 @@ class TaskDlgFemConstraintFixed: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintFixed(ViewProviderFemConstraintFixed* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -44,6 +44,7 @@
#include <Mod/Fem/App/FemMeshObject.h>
#include <Mod/Fem/App/FemSolverObject.h>
#include <Mod/Fem/App/FemTools.h>
#include <Mod/Part/App/PartFeature.h>
#include "ActiveAnalysisObserver.h"
#include "TaskFemConstraintFluidBoundary.h"
@@ -994,15 +995,6 @@ TaskDlgFemConstraintFluidBoundary::TaskDlgFemConstraintFluidBoundary(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintFluidBoundary::open()
{
// a transaction is already open when creating this panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Fluid boundary condition");
Gui::Command::openCommand((const char*)msg.toUtf8());
}
}
bool TaskDlgFemConstraintFluidBoundary::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();
@@ -1109,13 +1101,4 @@ bool TaskDlgFemConstraintFluidBoundary::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintFluidBoundary::reject()
{
Gui::Command::abortCommand(); // recover properties content
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintFluidBoundary.cpp"

View File

@@ -120,9 +120,7 @@ public:
ViewProviderFemConstraintFluidBoundary* ConstraintView);
/// is called by the framework if the dialog is accepted (Ok)
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -37,6 +37,7 @@
#include <Gui/ViewProvider.h>
#include <Mod/Fem/App/FemConstraintForce.h>
#include <Mod/Fem/App/FemTools.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintForce.h"
#include "ui_TaskFemConstraintForce.h"
@@ -426,21 +427,6 @@ TaskDlgFemConstraintForce::TaskDlgFemConstraintForce(ViewProviderFemConstraintFo
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintForce::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Force load");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintForce::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();
@@ -485,14 +471,4 @@ bool TaskDlgFemConstraintForce::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintForce::reject()
{
// roll back the changes
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintForce.cpp"

View File

@@ -91,9 +91,7 @@ public:
explicit TaskDlgFemConstraintForce(ViewProviderFemConstraintForce* ConstraintView);
/// is called by the framework if the dialog is accepted (Ok)
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -34,6 +34,7 @@
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Mod/Fem/App/FemConstraintHeatflux.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintHeatflux.h"
#include "ui_TaskFemConstraintHeatflux.h"
@@ -504,21 +505,6 @@ TaskDlgFemConstraintHeatflux::TaskDlgFemConstraintHeatflux(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintHeatflux::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Heat flux load");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintHeatflux::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();
@@ -531,13 +517,10 @@ bool TaskDlgFemConstraintHeatflux::accept()
"App.ActiveDocument.%s.AmbientTemp = %f",
name.c_str(),
parameterHeatflux->getAmbientTemp());
/*Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.FaceTemp = %f",
name.c_str(), parameterHeatflux->getFaceTemp());*/
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.FilmCoef = %f",
name.c_str(),
parameterHeatflux->getFilmCoef());
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.Emissivity = %f",
name.c_str(),
@@ -551,13 +534,4 @@ bool TaskDlgFemConstraintHeatflux::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintHeatflux::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintHeatflux.cpp"

View File

@@ -81,9 +81,7 @@ class TaskDlgFemConstraintHeatflux: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintHeatflux(ViewProviderFemConstraintHeatflux* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -92,20 +92,6 @@ TaskDlgFemConstraintInitialTemperature::TaskDlgFemConstraintInitialTemperature(
}
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintInitialTemperature::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Constraint initial temperature");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintInitialTemperature::accept()
{
@@ -118,13 +104,6 @@ bool TaskDlgFemConstraintInitialTemperature::accept()
"App.ActiveDocument.%s.initialTemperature = \"%s\"",
name.c_str(),
parameterTemperature->get_temperature().c_str());
}
catch (const Base::Exception& e) {
QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what()));
return false;
}
try {
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
if (!ConstraintView->getObject()->isValid()) {
throw Base::RuntimeError(ConstraintView->getObject()->getStatusString());
@@ -140,13 +119,4 @@ bool TaskDlgFemConstraintInitialTemperature::accept()
return true;
}
bool TaskDlgFemConstraintInitialTemperature::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintInitialTemperature.cpp"

View File

@@ -62,9 +62,7 @@ class TaskDlgFemConstraintInitialTemperature: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintInitialTemperature(
ViewProviderFemConstraintInitialTemperature* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -305,33 +305,9 @@ TaskDlgFemConstraintPlaneRotation::TaskDlgFemConstraintPlaneRotation(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintPlaneRotation::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Plane multi-point constraint");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintPlaneRotation::accept()
{
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintPlaneRotation::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintPlaneRotation.cpp"

View File

@@ -68,9 +68,7 @@ class TaskDlgFemConstraintPlaneRotation: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintPlaneRotation(
ViewProviderFemConstraintPlaneRotation* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -32,6 +32,7 @@
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Mod/Fem/App/FemConstraintPressure.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintPressure.h"
#include "ui_TaskFemConstraintPressure.h"
@@ -295,21 +296,6 @@ TaskDlgFemConstraintPressure::TaskDlgFemConstraintPressure(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintPressure::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Pressure load");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintPressure::accept()
{
/* Note: */
@@ -335,13 +321,4 @@ bool TaskDlgFemConstraintPressure::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintPressure::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintPressure.cpp"

View File

@@ -71,9 +71,7 @@ class TaskDlgFemConstraintPressure: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintPressure(ViewProviderFemConstraintPressure* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -194,21 +194,6 @@ TaskDlgFemConstraintPulley::TaskDlgFemConstraintPulley(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintPulley::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Constraint pulley");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintPulley::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();

View File

@@ -64,7 +64,6 @@ public:
/// is called by the framework if the dialog is accepted (Ok)
bool accept() override;
void open() override;
};
} // namespace FemGui

View File

@@ -32,6 +32,7 @@
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Mod/Fem/App/FemConstraintRigidBody.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintRigidBody.h"
#include "ui_TaskFemConstraintRigidBody.h"
@@ -652,21 +653,6 @@ TaskDlgFemConstraintRigidBody::TaskDlgFemConstraintRigidBody(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintRigidBody::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Constraint RigidBody");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintRigidBody::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();
@@ -765,13 +751,4 @@ bool TaskDlgFemConstraintRigidBody::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintRigidBody::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintRigidBody.cpp"

View File

@@ -81,9 +81,7 @@ class TaskDlgFemConstraintRigidBody: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintRigidBody(ViewProviderFemConstraintRigidBody* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -33,6 +33,7 @@
#include <Gui/Command.h>
#include <Gui/SelectionObject.h>
#include <Mod/Fem/App/FemConstraintSpring.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintSpring.h"
#include "ui_TaskFemConstraintSpring.h"
@@ -303,21 +304,6 @@ TaskDlgFemConstraintSpring::TaskDlgFemConstraintSpring(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintSpring::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Constraint spring");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintSpring::accept()
{
/* Note: */
@@ -349,13 +335,4 @@ bool TaskDlgFemConstraintSpring::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintSpring::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintSpring.cpp"

View File

@@ -69,9 +69,7 @@ class TaskDlgFemConstraintSpring: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintSpring(ViewProviderFemConstraintSpring* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -36,6 +36,7 @@
#include <Gui/QuantitySpinBox.h>
#include <Gui/SelectionObject.h>
#include <Mod/Fem/App/FemConstraintTemperature.h>
#include <Mod/Part/App/PartFeature.h>
#include "TaskFemConstraintTemperature.h"
#include "ui_TaskFemConstraintTemperature.h"
@@ -359,21 +360,6 @@ TaskDlgFemConstraintTemperature::TaskDlgFemConstraintTemperature(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintTemperature::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Temperature boundary condition");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintTemperature::accept()
{
std::string name = ConstraintView->getObject()->getNameInDocument();
@@ -408,13 +394,4 @@ bool TaskDlgFemConstraintTemperature::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintTemperature::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintTemperature.cpp"

View File

@@ -77,9 +77,7 @@ class TaskDlgFemConstraintTemperature: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintTemperature(ViewProviderFemConstraintTemperature* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -579,21 +579,6 @@ TaskDlgFemConstraintTransform::TaskDlgFemConstraintTransform(
//==== calls from the TaskView ===============================================================
void TaskDlgFemConstraintTransform::open()
{
// a transaction is already open at creation time of the panel
if (!Gui::Command::hasPendingCommand()) {
QString msg = QObject::tr("Local coordinate system");
Gui::Command::openCommand((const char*)msg.toUtf8());
ConstraintView->setVisible(true);
Gui::Command::doCommand(
Gui::Command::Doc,
ViewProviderFemConstraint::gethideMeshShowPartStr(
(static_cast<Fem::Constraint*>(ConstraintView->getObject()))->getNameInDocument())
.c_str()); // OvG: Hide meshes and show parts
}
}
bool TaskDlgFemConstraintTransform::accept()
{
/* Note: */
@@ -628,13 +613,4 @@ bool TaskDlgFemConstraintTransform::accept()
return TaskDlgFemConstraint::accept();
}
bool TaskDlgFemConstraintTransform::reject()
{
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
Gui::Command::updateActive();
return true;
}
#include "moc_TaskFemConstraintTransform.cpp"

View File

@@ -78,9 +78,7 @@ class TaskDlgFemConstraintTransform: public TaskDlgFemConstraint
public:
explicit TaskDlgFemConstraintTransform(ViewProviderFemConstraintTransform* ConstraintView);
void open() override;
bool accept() override;
bool reject() override;
};
} // namespace FemGui

View File

@@ -23,8 +23,9 @@
#include "PreCompiled.h"
#include "Mod/Fem/App/FemConstraint.h"
#include <Gui/Application.h>
#include "Mod/Fem/App/FemConstraint.h"
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Part/Gui/ReferenceHighlighter.h>
#include <Mod/Part/Gui/ViewProvider.h>

View File

@@ -24,10 +24,14 @@
#ifndef GUI_VIEWPROVIDERFEMCONSTRAINTONBOUNDARY_H
#define GUI_VIEWPROVIDERFEMCONSTRAINTONBOUNDARY_H
#include <Mod/Part/App/PartFeature.h>
#include "ViewProviderFemConstraint.h"
namespace Part
{
class Feature;
}
namespace FemGui
{