diff --git a/src/Mod/Fem/Gui/TaskFemConstraint.cpp b/src/Mod/Fem/Gui/TaskFemConstraint.cpp index eb4d82e0c0..7c6df2430f 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraint.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraint.cpp @@ -28,7 +28,6 @@ #include #include #include -#include // OvG conversion between string and int etc. #include #endif @@ -82,13 +81,11 @@ const std::string TaskFemConstraint::getReferences(const std::vector(ConstraintView->getObject()); - result = boost::lexical_cast(pcConstraint->Scale.getValue()); - return result; + + return std::to_string(pcConstraint->Scale.getValue()); } void TaskFemConstraint::setSelection(QListWidgetItem* item) @@ -195,12 +192,11 @@ bool TaskFemConstraint::KeyEvent(QEvent* e) void TaskDlgFemConstraint::open() { - ConstraintView->setVisible(true); - Gui::Command::runCommand( - Gui::Command::Doc, - ViewProviderFemConstraint::gethideMeshShowPartStr( - (static_cast(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() @@ -223,6 +219,11 @@ bool TaskDlgFemConstraint::accept() return false; } + std::string scale = parameter->getScale(); + Gui::Command::doCommand(Gui::Command::Doc, + "App.ActiveDocument.%s.Scale = %s", + name.c_str(), + scale.c_str()); Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()"); if (!ConstraintView->getObject()->isValid()) { throw Base::RuntimeError(ConstraintView->getObject()->getStatusString()); @@ -243,9 +244,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintContact.cpp b/src/Mod/Fem/Gui/TaskFemConstraintContact.cpp index d515c44438..8a78fd21a9 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintContact.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintContact.cpp @@ -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(msg.toUtf8())); - ConstraintView->setVisible(true); - Gui::Command::runCommand( - Gui::Command::Doc, - ViewProviderFemConstraint::gethideMeshShowPartStr( - (static_cast(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintContact::accept() { /* Note: */ @@ -563,11 +548,6 @@ bool TaskDlgFemConstraintContact::accept() "App.ActiveDocument.%s.StickSlope = \"%s\"", name.c_str(), parameterContact->getStickSlope().c_str()); - std::string scale = parameterContact->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -577,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintContact.h b/src/Mod/Fem/Gui/TaskFemConstraintContact.h index b5f78a6ec2..98d86ae79a 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintContact.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintContact.h @@ -75,9 +75,7 @@ class TaskDlgFemConstraintContact: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintContact(ViewProviderFemConstraintContact* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp index 7dc9a18368..0f408da3ac 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintDisplacement::accept() { std::string name = ConstraintView->getObject()->getNameInDocument(); @@ -748,12 +734,6 @@ bool TaskDlgFemConstraintDisplacement::accept() name.c_str(), parameterDisplacement->get_useFlowSurfaceForce() ? "True" : "False"); - - std::string scale = parameterDisplacement->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -763,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.h b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.h index d5b07a09cc..f90285a8b2 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintDisplacement.h @@ -113,9 +113,7 @@ class TaskDlgFemConstraintDisplacement: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintDisplacement( ViewProviderFemConstraintDisplacement* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp index 76c0bb1f76..1bcb45f9b6 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include "TaskFemConstraintFixed.h" #include "ui_TaskFemConstraintFixed.h" @@ -279,41 +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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintFixed::accept() { - std::string name = ConstraintView->getObject()->getNameInDocument(); - const TaskFemConstraintFixed* parameters = - static_cast(parameter); - std::string scale = parameters->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale 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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFixed.h b/src/Mod/Fem/Gui/TaskFemConstraintFixed.h index 80b939e0c5..e7efbe4c98 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFixed.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintFixed.h @@ -66,9 +66,7 @@ class TaskDlgFemConstraintFixed: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintFixed(ViewProviderFemConstraintFixed* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp index 3410a64839..e7cac57583 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #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(); @@ -1048,12 +1040,6 @@ bool TaskDlgFemConstraintFluidBoundary::accept() // Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Reversed = %s", // name.c_str(), boundary->getReverse() ? "True" : "False"); - std::string scale = boundary->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale - // solver specific setting, physical model selection const Fem::FemSolverObject* pcSolver = boundary->getFemSolver(); @@ -1115,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h index 66141fb441..3dc484dac8 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.h @@ -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 diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp index 324fc7800d..fafe7e5fa2 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintForce::accept() { std::string name = ConstraintView->getObject()->getNameInDocument(); @@ -476,12 +462,6 @@ bool TaskDlgFemConstraintForce::accept() "App.ActiveDocument.%s.Reversed = %s", name.c_str(), parameterForce->getReverse() ? "True" : "False"); - - scale = parameterForce->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -491,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintForce.h b/src/Mod/Fem/Gui/TaskFemConstraintForce.h index 2563d2de6e..f166e75c53 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintForce.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintForce.h @@ -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 diff --git a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp index 0044718932..df5b2cca8b 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintHeatflux::accept() { std::string name = ConstraintView->getObject()->getNameInDocument(); @@ -531,23 +517,14 @@ 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(), parameterHeatflux->getEmissivity()); - - scale = parameterHeatflux->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -557,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h index a6cdda7235..50bf357deb 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintHeatflux.h @@ -81,9 +81,7 @@ class TaskDlgFemConstraintHeatflux: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintHeatflux(ViewProviderFemConstraintHeatflux* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp b/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp index 640b86cd32..6b83844caa 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.cpp @@ -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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} bool TaskDlgFemConstraintInitialTemperature::accept() { @@ -118,19 +104,6 @@ bool TaskDlgFemConstraintInitialTemperature::accept() "App.ActiveDocument.%s.initialTemperature = \"%s\"", name.c_str(), parameterTemperature->get_temperature().c_str()); - - std::string scale = parameterTemperature->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale - } - 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()); @@ -146,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.h b/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.h index ce5b554021..e71f5ea8e2 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintInitialTemperature.h @@ -62,9 +62,7 @@ class TaskDlgFemConstraintInitialTemperature: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintInitialTemperature( ViewProviderFemConstraintInitialTemperature* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.cpp index a5419a4049..b260d91144 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.cpp @@ -305,41 +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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintPlaneRotation::accept() { - std::string name = ConstraintView->getObject()->getNameInDocument(); - const TaskFemConstraintPlaneRotation* parameters = - static_cast(parameter); - std::string scale = parameters->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale 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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.h b/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.h index 1a55a0e27e..ee1092ce32 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintPlaneRotation.h @@ -68,9 +68,7 @@ class TaskDlgFemConstraintPlaneRotation: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintPlaneRotation( ViewProviderFemConstraintPlaneRotation* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp index 7cfe607d7f..acb0487626 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPressure.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintPressure::accept() { /* Note: */ @@ -326,11 +312,6 @@ bool TaskDlgFemConstraintPressure::accept() "App.ActiveDocument.%s.Reversed = %s", name.c_str(), parameterPressure->getReverse() ? "True" : "False"); - std::string scale = parameterPressure->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -340,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPressure.h b/src/Mod/Fem/Gui/TaskFemConstraintPressure.h index c312290534..a9a35ba8c4 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPressure.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintPressure.h @@ -71,9 +71,7 @@ class TaskDlgFemConstraintPressure: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintPressure(ViewProviderFemConstraintPressure* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp b/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp index a15cf6b11d..63469fb883 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintPulley.cpp @@ -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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintPulley::accept() { std::string name = ConstraintView->getObject()->getNameInDocument(); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintPulley.h b/src/Mod/Fem/Gui/TaskFemConstraintPulley.h index c7ac7b0685..4dfde5d8ab 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintPulley.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintPulley.h @@ -64,7 +64,6 @@ public: /// is called by the framework if the dialog is accepted (Ok) bool accept() override; - void open() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.cpp b/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.cpp index 313c53d75b..9f08c67df5 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintRigidBody::accept() { std::string name = ConstraintView->getObject()->getNameInDocument(); @@ -757,11 +743,6 @@ bool TaskDlgFemConstraintRigidBody::accept() "App.ActiveDocument.%s.RotationalModeZ = \"%s\"", name.c_str(), rotModes[2].c_str()); - - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - parameters->getScale().c_str()); } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -770,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.h b/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.h index dde1cad77a..1ce5745c52 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.h @@ -81,9 +81,7 @@ class TaskDlgFemConstraintRigidBody: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintRigidBody(ViewProviderFemConstraintRigidBody* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp b/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp index 85eee0271a..638a7e4e35 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintSpring.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintSpring::accept() { /* Note: */ @@ -340,11 +326,6 @@ bool TaskDlgFemConstraintSpring::accept() "App.ActiveDocument.%s.ElmerStiffness = '%s'", name.c_str(), parameterStiffness->getElmerStiffness().c_str()); - std::string scale = parameterStiffness->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -354,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintSpring.h b/src/Mod/Fem/Gui/TaskFemConstraintSpring.h index 9802c10d66..c4fed681b6 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintSpring.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintSpring.h @@ -69,9 +69,7 @@ class TaskDlgFemConstraintSpring: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintSpring(ViewProviderFemConstraintSpring* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp index 3ed30091e7..5ebcb4ecbb 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintTemperature::accept() { std::string name = ConstraintView->getObject()->getNameInDocument(); @@ -399,11 +385,6 @@ bool TaskDlgFemConstraintTemperature::accept() name.c_str(), parameterTemperature->get_cflux().c_str()); } - std::string scale = parameterTemperature->getScale(); // OvG: determine modified scale - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); // OvG: implement modified scale } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -413,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h index 889676b93c..2ff5e6df2c 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintTemperature.h @@ -77,9 +77,7 @@ class TaskDlgFemConstraintTemperature: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintTemperature(ViewProviderFemConstraintTemperature* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp b/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp index b669dee265..d7dd055f28 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintTransform.cpp @@ -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(ConstraintView->getObject()))->getNameInDocument()) - .c_str()); // OvG: Hide meshes and show parts - } -} - bool TaskDlgFemConstraintTransform::accept() { /* Note: */ @@ -619,12 +604,6 @@ bool TaskDlgFemConstraintTransform::accept() "App.ActiveDocument.%s.TransformType = %s", name.c_str(), parameters->get_transform_type().c_str()); - - std::string scale = parameters->getScale(); - Gui::Command::doCommand(Gui::Command::Doc, - "App.ActiveDocument.%s.Scale = %s", - name.c_str(), - scale.c_str()); } catch (const Base::Exception& e) { QMessageBox::warning(parameter, tr("Input error"), QString::fromLatin1(e.what())); @@ -634,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" diff --git a/src/Mod/Fem/Gui/TaskFemConstraintTransform.h b/src/Mod/Fem/Gui/TaskFemConstraintTransform.h index d6e087c5a5..4219e3313e 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintTransform.h +++ b/src/Mod/Fem/Gui/TaskFemConstraintTransform.h @@ -78,9 +78,7 @@ class TaskDlgFemConstraintTransform: public TaskDlgFemConstraint public: explicit TaskDlgFemConstraintTransform(ViewProviderFemConstraintTransform* ConstraintView); - void open() override; bool accept() override; - bool reject() override; }; } // namespace FemGui diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintOnBoundary.cpp b/src/Mod/Fem/Gui/ViewProviderFemConstraintOnBoundary.cpp index 18d168b5a3..ed5772129b 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintOnBoundary.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintOnBoundary.cpp @@ -23,8 +23,9 @@ #include "PreCompiled.h" -#include "Mod/Fem/App/FemConstraint.h" #include +#include "Mod/Fem/App/FemConstraint.h" +#include #include #include diff --git a/src/Mod/Fem/Gui/ViewProviderFemConstraintOnBoundary.h b/src/Mod/Fem/Gui/ViewProviderFemConstraintOnBoundary.h index 004e0e81ad..bca7164b1c 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemConstraintOnBoundary.h +++ b/src/Mod/Fem/Gui/ViewProviderFemConstraintOnBoundary.h @@ -24,10 +24,14 @@ #ifndef GUI_VIEWPROVIDERFEMCONSTRAINTONBOUNDARY_H #define GUI_VIEWPROVIDERFEMCONSTRAINTONBOUNDARY_H -#include - #include "ViewProviderFemConstraint.h" + +namespace Part +{ +class Feature; +} + namespace FemGui {