Skip to content

Commit

Permalink
FEM: add icons for clear mesh and mesh info command
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Dec 23, 2016
1 parent 2733d03 commit b05f111
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Mod/Fem/Gui/Resources/Fem.qrc
Expand Up @@ -25,10 +25,12 @@
<file>icons/fem-control-solver.svg</file>
<file>icons/fem-cylinder.svg</file>
<file>icons/fem-data.png</file>
<file>icons/fem-femmesh-clear-mesh.svg</file>
<file>icons/fem-femmesh-create-node-by-poly.svg</file>
<file>icons/fem-femmesh-from-shape.svg</file>
<file>icons/fem-femmesh-gmsh-from-shape.svg</file>
<file>icons/fem-femmesh-netgen-from-shape.svg</file>
<file>icons/fem-femmesh-print-info.svg</file>
<file>icons/fem-femmesh-region.svg</file>
<file>icons/fem-femmesh-to-mesh.svg</file>
<file>icons/fem-frequency-analysis.svg</file>
Expand Down
120 changes: 120 additions & 0 deletions src/Mod/Fem/Gui/Resources/icons/fem-femmesh-clear-mesh.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 119 additions & 0 deletions src/Mod/Fem/Gui/Resources/icons/fem-femmesh-print-info.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Mod/Fem/_CommandClearMesh.py
Expand Up @@ -37,7 +37,7 @@ class _CommandClearMesh(FemCommands):
"clear the FEM mesh"
def __init__(self):
super(_CommandClearMesh, self).__init__()
self.resources = {'Pixmap': 'fem-femmesh-from-shape',
self.resources = {'Pixmap': 'fem-femmesh-clear-mesh',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_ClearMesh", "Clear FEM mesh"),
# 'Accel': "Z, Z",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_ClearMesh", "Clear the Mesh of a FEM mesh object")}
Expand Down
7 changes: 6 additions & 1 deletion src/Mod/Fem/_CommandPrintMeshInfo.py
Expand Up @@ -31,13 +31,14 @@
from FemCommands import FemCommands
import FreeCADGui
from PySide import QtCore
from PySide import QtGui


class _CommandPrintMeshInfo(FemCommands):
"Print FEM mesh info"
def __init__(self):
super(_CommandPrintMeshInfo, self).__init__()
self.resources = {'Pixmap': 'fem-femmesh-from-shape',
self.resources = {'Pixmap': 'fem-femmesh-print-info',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_PrintMeshInfo", "Print FEM mesh info"),
# 'Accel': "Z, Z",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_PrintMeshInfo", "Print FEM mesh info")}
Expand All @@ -49,6 +50,10 @@ def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Print FEM mesh info")
FreeCADGui.doCommand("print(App.ActiveDocument." + sel[0].Name + ".FemMesh)")

FreeCADGui.addModule("PySide")
FreeCADGui.doCommand("mesh_info = str(App.ActiveDocument." + sel[0].Name + ".FemMesh)")
FreeCADGui.doCommand("PySide.QtGui.QMessageBox.information(None, 'FEM Mesh Info', mesh_info)")

FreeCADGui.Selection.clearSelection()

FreeCADGui.addCommand('Fem_PrintMeshInfo',_CommandPrintMeshInfo())

0 comments on commit b05f111

Please sign in to comment.