[FEM] implement further object addition mode

- for e.g. the solver objects it is important that the added equations are visible in the TreeView
- also improve activation of analyses for documents with multiple analyses: one activates one and can then subsequently add an object to it because the activation will also select
This commit is contained in:
Uwe
2023-03-24 06:48:14 +01:00
parent 26bb8b1666
commit 7e3d37a5fe
4 changed files with 52 additions and 19 deletions

View File

@@ -109,13 +109,6 @@ void ViewProviderFemAnalysis::attach(App::DocumentObject *obj)
auto *workbench = Gui::WorkbenchManager::instance()->active();
if (workbench->name() == "FemWorkbench") {
doubleClicked();
// indicate the activated analysis by selecting it
// especially useful for files with 2 or more analyses but also
// necessary for the workflow with new files to add a solver as next object
std::vector<App::DocumentObject*> selVector {};
selVector.push_back(this->getObject());
auto docName = this->getObject()->getDocument()->getName();
Gui::Selection().setSelection(docName, selVector);
}
}
@@ -134,6 +127,13 @@ bool ViewProviderFemAnalysis::doubleClicked(void)
// After activation of the analysis the allowed FEM toolbar buttons should become active.
// To achieve this we must clear the object selection to trigger the selection observer.
Gui::Command::doCommand(Gui::Command::Gui, "Gui.Selection.clearSelection()");
// indicate the activated analysis by selecting it
// especially useful for files with 2 or more analyses but also
// necessary for the workflow with new files to add a solver as next object
std::vector<App::DocumentObject*> selVector {};
selVector.push_back(this->getObject());
auto *docName = this->getObject()->getDocument()->getName();
Gui::Selection().setSelection(docName, selVector);
return true;
}