diff --git a/src/Mod/Fem/App/AppFem.cpp b/src/Mod/Fem/App/AppFem.cpp
index 54654aea34..81cf2e84b7 100644
--- a/src/Mod/Fem/App/AppFem.cpp
+++ b/src/Mod/Fem/App/AppFem.cpp
@@ -1,8 +1,5 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
- * additional statement(s) for element sets *
- * *
- * added to: AppFem.cpp *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
* This file is part of the FreeCAD CAx development system. *
diff --git a/src/Mod/Fem/App/FemSetElementNodesObject.cpp b/src/Mod/Fem/App/FemSetElementNodesObject.cpp
index 52f2925172..60a659d159 100644
--- a/src/Mod/Fem/App/FemSetElementNodesObject.cpp
+++ b/src/Mod/Fem/App/FemSetElementNodesObject.cpp
@@ -1,25 +1,23 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
* *
- * based on: FemSetNodesObject.cpp *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
- * This file is part of the FreeCAD CAx development system. *
+ * This file is part of FreeCAD. *
* *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
* *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
* *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
* *
***************************************************************************/
@@ -35,7 +33,6 @@ using namespace App;
PROPERTY_SOURCE(Fem::FemSetElementNodesObject, Fem::FemSetObject)
-
FemSetElementNodesObject::FemSetElementNodesObject()
{
ADD_PROPERTY_TYPE(Elements,
diff --git a/src/Mod/Fem/App/FemSetElementNodesObject.h b/src/Mod/Fem/App/FemSetElementNodesObject.h
index ed79ccbb99..c016d0eec0 100644
--- a/src/Mod/Fem/App/FemSetElementNodesObject.h
+++ b/src/Mod/Fem/App/FemSetElementNodesObject.h
@@ -1,25 +1,22 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
- * *
- * based on: FemSetNodesObject.h *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
- * This file is part of the FreeCAD CAx development system. *
+ * This file is part of FreeCAD. *
* *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
* *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
* *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
* *
***************************************************************************/
@@ -56,8 +53,10 @@ public:
}
short mustExecute() const override;
PyObject* getPyObject() override;
- static std::string elementsName; // = "ElementsSet";
- static std::string uniqueElementsName; // "ElementsSet" latest name
+ static std::string getElementName()
+ {
+ return "ElementsSet";
+ }
};
} // namespace Fem
diff --git a/src/Mod/Fem/Gui/AppFemGui.cpp b/src/Mod/Fem/Gui/AppFemGui.cpp
index 4acb5219c4..ffe08198d4 100644
--- a/src/Mod/Fem/Gui/AppFemGui.cpp
+++ b/src/Mod/Fem/Gui/AppFemGui.cpp
@@ -1,8 +1,5 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
- * additional statement(s) for element sets *
- * *
- * added to: AppFemGui.cpp *
* Copyright (c) 2008 Jürgen Riegel *
* *
* This file is part of the FreeCAD CAx development system. *
diff --git a/src/Mod/Fem/Gui/Command.cpp b/src/Mod/Fem/Gui/Command.cpp
index ad1557b81b..dde134d9dd 100644
--- a/src/Mod/Fem/Gui/Command.cpp
+++ b/src/Mod/Fem/Gui/Command.cpp
@@ -1,9 +1,5 @@
/***************************************************************************
* Copyright (c) 2022 Peter McB *
- * added erase elements function *
- * *
- * added to: Command.cpp *
- * *
* Copyright (c) 2008 Jürgen Riegel *
* *
* This file is part of the FreeCAD CAx development system. *
@@ -73,7 +69,7 @@ using namespace std;
//================================================================================================
//================================================================================================
// helpers
-bool getConstraintPrerequisits(Fem::FemAnalysis** Analysis)
+static bool getConstraintPrerequisits(Fem::FemAnalysis** Analysis)
{
if (!FemGui::ActiveAnalysisObserver::instance()->hasActiveObject()) {
QMessageBox::warning(Gui::getMainWindow(),
@@ -89,7 +85,7 @@ bool getConstraintPrerequisits(Fem::FemAnalysis** Analysis)
}
// OvG: Visibility automation show parts and hide meshes on activation of a constraint
-std::string gethideMeshShowPartStr(std::string showConstr = "")
+static std::string gethideMeshShowPartStr(std::string showConstr = "")
{
return "for amesh in App.activeDocument().Objects:\n\
if \""
@@ -103,6 +99,63 @@ std::string gethideMeshShowPartStr(std::string showConstr = "")
amesh.ViewObject.Visibility = False\n";
}
+static std::string getSelectedNodes(Gui::View3DInventorViewer* view)
+{
+ Gui::SelectionRole role;
+ std::vector clPoly = view->getGLPolygon(&role);
+ if (clPoly.size() < 3) {
+ return {};
+ }
+ if (clPoly.front() != clPoly.back()) {
+ clPoly.push_back(clPoly.front());
+ }
+
+ SoCamera* cam = view->getSoRenderManager()->getCamera();
+ SbViewVolume vv = cam->getViewVolume();
+ Gui::ViewVolumeProjection proj(vv);
+ Base::Polygon2d polygon;
+ for (auto it : clPoly) {
+ polygon.Add(Base::Vector2d(it[0], it[1]));
+ }
+
+ std::vector docObj =
+ Gui::Selection().getObjectsOfType(Fem::FemMeshObject::getClassTypeId());
+ if (docObj.size() != 1) {
+ return {};
+ }
+
+ const SMESHDS_Mesh* data =
+ static_cast(docObj[0])->FemMesh.getValue().getSMesh()->GetMeshDS();
+
+ SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator();
+ Base::Vector3f pt2d;
+ std::set IntSet;
+
+ while (aNodeIter->more()) {
+ const SMDS_MeshNode* aNode = aNodeIter->next();
+ Base::Vector3f vec(aNode->X(), aNode->Y(), aNode->Z());
+ pt2d = proj(vec);
+ if (polygon.Contains(Base::Vector2d(pt2d.x, pt2d.y))) {
+ IntSet.insert(aNode->GetID());
+ }
+ }
+
+ std::stringstream set;
+
+ set << "[";
+ for (auto it = IntSet.cbegin(); it != IntSet.cend(); ++it) {
+ if (it == IntSet.begin()) {
+ set << *it;
+ }
+ else {
+ set << "," << *it;
+ }
+ }
+ set << "]";
+
+ return set.str();
+}
+
//================================================================================================
//================================================================================================
@@ -1035,7 +1088,7 @@ bool CmdFemConstraintTransform::isActive()
//================================================================================================
DEF_STD_CMD_A(CmdFemDefineNodesSet)
-void DefineNodesCallback(void* ud, SoEventCallback* n)
+static void DefineNodesCallback(void* ud, SoEventCallback* n)
{
Fem::FemAnalysis* Analysis;
@@ -1052,88 +1105,20 @@ void DefineNodesCallback(void* ud, SoEventCallback* n)
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), DefineNodesCallback, ud);
n->setHandled();
- Gui::SelectionRole role;
- std::vector clPoly = view->getGLPolygon(&role);
- if (clPoly.size() < 3) {
- return;
+ std::string str = getSelectedNodes(view);
+ if (!str.empty()) {
+ Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Place robot"));
+ Gui::Command::doCommand(Gui::Command::Doc,
+ "App.ActiveDocument.addObject('Fem::FemSetNodesObject','NodeSet')");
+ Gui::Command::doCommand(Gui::Command::Doc,
+ "App.ActiveDocument.ActiveObject.Nodes = %s",
+ str.c_str());
+ Gui::Command::doCommand(Gui::Command::Doc,
+ "App.activeDocument().%s.addObject(App.activeDocument().NodeSet)",
+ Analysis->getNameInDocument());
+
+ Gui::Command::commitCommand();
}
- if (clPoly.front() != clPoly.back()) {
- clPoly.push_back(clPoly.front());
- }
-
- SoCamera* cam = view->getSoRenderManager()->getCamera();
- SbViewVolume vv = cam->getViewVolume();
- Gui::ViewVolumeProjection proj(vv);
- Base::Polygon2d polygon;
- for (auto it : clPoly) {
- polygon.Add(Base::Vector2d(it[0], it[1]));
- }
-
-
- std::vector docObj =
- Gui::Selection().getObjectsOfType(Fem::FemMeshObject::getClassTypeId());
- if (docObj.size() != 1) {
- return;
- }
-
- const SMESHDS_Mesh* data =
- static_cast(docObj[0])->FemMesh.getValue().getSMesh()->GetMeshDS();
-
- SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator();
- Base::Vector3f pt2d;
- std::set IntSet;
-
- while (aNodeIter->more()) {
- const SMDS_MeshNode* aNode = aNodeIter->next();
- Base::Vector3f vec(aNode->X(), aNode->Y(), aNode->Z());
- pt2d = proj(vec);
- if (polygon.Contains(Base::Vector2d(pt2d.x, pt2d.y))) {
- IntSet.insert(aNode->GetID());
- }
- }
-
- std::stringstream set;
-
- set << "[";
- for (std::set::const_iterator it = IntSet.begin(); it != IntSet.end(); ++it) {
- if (it == IntSet.begin()) {
- set << *it;
- }
- else {
- set << "," << *it;
- }
- }
- set << "]";
-
-
- Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Place robot"));
- Gui::Command::doCommand(Gui::Command::Doc,
- "App.ActiveDocument.addObject('Fem::FemSetNodesObject','NodeSet')");
- Gui::Command::doCommand(Gui::Command::Doc,
- "App.ActiveDocument.ActiveObject.Nodes = %s",
- set.str().c_str());
- Gui::Command::doCommand(Gui::Command::Doc,
- "App.activeDocument().%s.addObject(App.activeDocument().NodeSet)",
- Analysis->getNameInDocument());
- // Gui::Command::updateActive();
- Gui::Command::commitCommand();
-
- // std::vector views =
- // view->getViewProvidersOfType(ViewProviderMesh::getClassTypeId()); if (!views.empty()) {
- // Gui::Application::Instance->activeDocument()->openCommand(QT_TRANSLATE_NOOP("Command",
- // "Cut")); for (std::vector::iterator it = views.begin(); it !=
- // views.end(); ++it) {
- // ViewProviderMesh* that = static_cast(*it);
- // if (that->getEditingMode() > -1) {
- // that->finishEditing();
- // that->cutMesh(clPoly, *view, clip_inner);
- // }
- // }
-
- // Gui::Application::Instance->activeDocument()->commitCommand();
-
- // view->render();
- //}
}
@@ -1251,13 +1236,10 @@ bool CmdFemCreateNodesSet::isActive()
//===========================================================================
// start of Erase Elements code
//===========================================================================
-std::string Fem::FemSetElementNodesObject::elementsName;
-std::string Fem::FemSetElementNodesObject::uniqueElementsName;
-
DEF_STD_CMD_A(CmdFemDefineElementsSet);
-void DefineElementsCallback(void* ud, SoEventCallback* n)
+static void DefineElementsCallback(void* ud, SoEventCallback* n)
{
Fem::FemAnalysis* Analysis;
@@ -1274,70 +1256,22 @@ void DefineElementsCallback(void* ud, SoEventCallback* n)
view->removeEventCallback(SoMouseButtonEvent::getClassTypeId(), DefineElementsCallback, ud);
n->setHandled();
- Gui::SelectionRole role;
- std::vector clPoly = view->getGLPolygon(&role);
- if (clPoly.size() < 3) {
- return;
+ std::string str = getSelectedNodes(view);
+ if (!str.empty()) {
+ Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Place robot"));
+ Gui::Command::doCommand(
+ Gui::Command::Doc,
+ "App.ActiveDocument.addObject('Fem::FemSetElementNodesObject','ElementSet')");
+ Gui::Command::doCommand(Gui::Command::Doc,
+ "App.ActiveDocument.ActiveObject.Nodes = %s",
+ str.c_str());
+ Gui::Command::doCommand(
+ Gui::Command::Doc,
+ "App.activeDocument().%s.addObject(App.activeDocument().ElementSet)",
+ Analysis->getNameInDocument());
+
+ Gui::Command::commitCommand();
}
- if (clPoly.front() != clPoly.back()) {
- clPoly.push_back(clPoly.front());
- }
-
- SoCamera* cam = view->getSoRenderManager()->getCamera();
- SbViewVolume vv = cam->getViewVolume();
- Gui::ViewVolumeProjection proj(vv);
- Base::Polygon2d polygon;
- for (std::vector::const_iterator it = clPoly.begin(); it != clPoly.end(); ++it) {
- polygon.Add(Base::Vector2d((*it)[0], (*it)[1]));
- }
-
- std::vector docObj =
- Gui::Selection().getObjectsOfType(Fem::FemMeshObject::getClassTypeId());
- if (docObj.size() != 1) {
- return;
- }
-
- const SMESHDS_Mesh* data =
- static_cast(docObj[0])->FemMesh.getValue().getSMesh()->GetMeshDS();
-
- SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator();
- Base::Vector3f pt2d;
- std::set IntSet;
-
- while (aNodeIter->more()) {
- const SMDS_MeshNode* aNode = aNodeIter->next();
- Base::Vector3f vec(aNode->X(), aNode->Y(), aNode->Z());
- pt2d = proj(vec);
- if (polygon.Contains(Base::Vector2d(pt2d.x, pt2d.y))) {
- IntSet.insert(aNode->GetID());
- }
- }
-
- std::stringstream set;
-
- set << "[";
- for (std::set::const_iterator it = IntSet.begin(); it != IntSet.end(); ++it) {
- if (it == IntSet.begin()) {
- set << *it;
- }
- else {
- set << "," << *it;
- }
- }
- set << "]";
-
- Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Place robot"));
- Gui::Command::doCommand(
- Gui::Command::Doc,
- "App.ActiveDocument.addObject('Fem::FemSetElementNodesObject','ElementSet')");
- Gui::Command::doCommand(Gui::Command::Doc,
- "App.ActiveDocument.ActiveObject.Nodes = %s",
- set.str().c_str());
- Gui::Command::doCommand(Gui::Command::Doc,
- "App.activeDocument().%s.addObject(App.activeDocument().ElementSet)",
- Analysis->getNameInDocument());
-
- Gui::Command::commitCommand();
}
CmdFemDefineElementsSet::CmdFemDefineElementsSet()
@@ -1423,22 +1357,18 @@ void CmdFemCreateElementsSet::activated(int)
Fem::FemMeshObject* MeshObj =
static_cast(FemMeshFilter.Result[0][0].getObject());
- Fem::FemSetElementNodesObject::elementsName = "ElementsSet";
- Fem::FemSetElementNodesObject::uniqueElementsName =
- Command::getUniqueObjectName(Fem::FemSetElementNodesObject::elementsName.c_str());
-
+ std::string elementsName = Fem::FemSetElementNodesObject::getElementName();
+ std::string uniqueElementsName = Command::getUniqueObjectName(elementsName.c_str());
openCommand(QT_TRANSLATE_NOOP("Command", "Create Elements set"));
doCommand(Doc,
"App.activeDocument().addObject('Fem::FemSetElementNodesObject','%s')",
- Fem::FemSetElementNodesObject::uniqueElementsName.c_str());
+ uniqueElementsName.c_str());
doCommand(Gui,
"App.activeDocument().%s.FemMesh = App.activeDocument().%s",
- Fem::FemSetElementNodesObject::uniqueElementsName.c_str(),
+ uniqueElementsName.c_str(),
MeshObj->getNameInDocument());
- doCommand(Gui,
- "Gui.activeDocument().setEdit('%s')",
- Fem::FemSetElementNodesObject::uniqueElementsName.c_str());
+ doCommand(Gui, "Gui.activeDocument().setEdit('%s')", uniqueElementsName.c_str());
}
else {
QMessageBox::warning(
diff --git a/src/Mod/Fem/Gui/TaskCreateElementSet.cpp b/src/Mod/Fem/Gui/TaskCreateElementSet.cpp
index 566d58c77f..d41d40c029 100644
--- a/src/Mod/Fem/Gui/TaskCreateElementSet.cpp
+++ b/src/Mod/Fem/Gui/TaskCreateElementSet.cpp
@@ -1,26 +1,22 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
- * implementation of the erase elements function *
- * *
- * loosely based on: TaskCreateNodeSet.cpp *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
- * This file is part of the FreeCAD CAx development system. *
+ * This file is part of FreeCAD. *
* *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
* *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
* *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
* *
***************************************************************************/
@@ -545,7 +541,8 @@ void TaskCreateElementSet::Restore(void)
objectN.c_str());
Gui::Command::doCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()");
}
- else if (objectN.find(Fem::FemSetElementNodesObject::elementsName) != std::string::npos) {
+ else if (objectN.find(Fem::FemSetElementNodesObject::getElementName())
+ != std::string::npos) {
if (elList > 0) {
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.removeObject(\'%s\')",
diff --git a/src/Mod/Fem/Gui/TaskCreateElementSet.h b/src/Mod/Fem/Gui/TaskCreateElementSet.h
index 6ffd875b3c..d10f1cc994 100644
--- a/src/Mod/Fem/Gui/TaskCreateElementSet.h
+++ b/src/Mod/Fem/Gui/TaskCreateElementSet.h
@@ -1,30 +1,27 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
- * *
- * based on: TaskCreateNodeSet.h *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
- * This file is part of the FreeCAD CAx development system. *
+ * This file is part of FreeCAD. *
* *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
* *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
* *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
* *
***************************************************************************/
-#ifndef GUI_TASKVIEW_TaskCreateElementSet_H
-#define GUI_TASKVIEW_TaskCreateElementSet_H
+#ifndef FemGui_TaskCreateElementSet_H
+#define FemGui_TaskCreateElementSet_H
#include
#include
@@ -93,4 +90,4 @@ private:
} // namespace FemGui
-#endif // GUI_TASKVIEW_TaskCreateElementSet_H
+#endif // FemGui_TaskCreateElementSet_H
diff --git a/src/Mod/Fem/Gui/TaskDlgCreateElementSet.cpp b/src/Mod/Fem/Gui/TaskDlgCreateElementSet.cpp
index a987486d93..f591ff014f 100644
--- a/src/Mod/Fem/Gui/TaskDlgCreateElementSet.cpp
+++ b/src/Mod/Fem/Gui/TaskDlgCreateElementSet.cpp
@@ -1,30 +1,27 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
* *
- * based on: TaskDlgCreateNodeSet.cpp *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
- * This file is part of the FreeCAD CAx development system. *
+ * This file is part of FreeCAD. *
* *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
* *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
* *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
* *
***************************************************************************/
+
#include "PreCompiled.h"
-
-
#include
#include
#include
@@ -72,9 +69,6 @@ bool TaskDlgCreateElementSet::accept()
try {
FemSetElementNodesObject->Elements.setValues(param->elementTempSet);
FemSetElementNodesObject->recomputeFeature();
- // Gui::Document* doc = Gui::Application::Instance->activeDocument();
- // if(doc)
- // doc->resetEdit();
param->MeshViewProvider->resetHighlightNodes();
FemSetElementNodesObject->Label.setValue(name->name);
Gui::Command::doCommand(Gui::Command::Gui, "Gui.activeDocument().resetEdit()");
diff --git a/src/Mod/Fem/Gui/TaskDlgCreateElementSet.h b/src/Mod/Fem/Gui/TaskDlgCreateElementSet.h
index dc0b96767b..8bb85f08b7 100644
--- a/src/Mod/Fem/Gui/TaskDlgCreateElementSet.h
+++ b/src/Mod/Fem/Gui/TaskDlgCreateElementSet.h
@@ -1,31 +1,29 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
* *
- * based on: FemSetNodesObject.h *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
- * This file is part of the FreeCAD CAx development system. *
+ * This file is part of FreeCAD. *
* *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
* *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
* *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
* *
***************************************************************************/
-#ifndef ROBOTGUI_TaskDlgCreateElementSet_H
-#define ROBOTGUI_TaskDlgCreateElementSet_H
+#ifndef FemGui_TaskDlgCreateElementSet_H
+#define FemGui_TaskDlgCreateElementSet_H
#include
#include
@@ -83,4 +81,4 @@ protected:
} // namespace FemGui
-#endif // ROBOTGUI_TASKDLGSIMULATE_H
+#endif // FemGui_TaskDlgCreateElementSet_H
diff --git a/src/Mod/Fem/Gui/ViewProviderSetElementNodes.cpp b/src/Mod/Fem/Gui/ViewProviderSetElementNodes.cpp
index 87d26d5297..a8f266725f 100644
--- a/src/Mod/Fem/Gui/ViewProviderSetElementNodes.cpp
+++ b/src/Mod/Fem/Gui/ViewProviderSetElementNodes.cpp
@@ -1,25 +1,23 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
* *
- * based on: ViewProviderSetNodes.cpp *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
- * This file is part of the FreeCAD CAx development system. *
+ * This file is part of FreeCAD. *
* *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
* *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
* *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
* *
***************************************************************************/
@@ -47,9 +45,7 @@ bool ViewProviderSetElementNodes::doubleClicked()
bool ViewProviderSetElementNodes::setEdit(int)
{
- Gui::TaskView::TaskDialog* dlg =
- new TaskDlgCreateElementSet(static_cast(getObject()));
- Gui::Control().showDialog(dlg);
+ doubleClicked();
return true;
}
diff --git a/src/Mod/Fem/Gui/ViewProviderSetElementNodes.h b/src/Mod/Fem/Gui/ViewProviderSetElementNodes.h
index f9971d2b8a..46a173fde9 100644
--- a/src/Mod/Fem/Gui/ViewProviderSetElementNodes.h
+++ b/src/Mod/Fem/Gui/ViewProviderSetElementNodes.h
@@ -1,25 +1,23 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
* *
- * based on: ViewProviderSetNodes.h *
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
* *
- * This file is part of the FreeCAD CAx development system. *
+ * This file is part of FreeCAD. *
* *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
+ * FreeCAD is free software: you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation, either version 2.1 of the *
+ * License, or (at your option) any later version. *
* *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
+ * FreeCAD is distributed in the hope that it will be useful, but *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
* *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with FreeCAD. If not, see *
+ * . *
* *
***************************************************************************/
diff --git a/src/Mod/Fem/Gui/Workbench.cpp b/src/Mod/Fem/Gui/Workbench.cpp
index 394a38f0fe..2f2600013d 100644
--- a/src/Mod/Fem/Gui/Workbench.cpp
+++ b/src/Mod/Fem/Gui/Workbench.cpp
@@ -1,9 +1,5 @@
/***************************************************************************
* Copyright (c) 2023 Peter McB *
- * additional statement(s) for element sets: *
- * added entry to Gui::MenuItem* mesh *
- * *
- * added to: Workbench.cpp
* Copyright (c) 2008 Werner Mayer *
* *
* This file is part of the FreeCAD CAx development system. *