FEM: add icons for clear mesh and mesh info command

This commit is contained in:
Bernd Hahnebach
2016-12-23 17:31:59 +01:00
parent 2733d03be5
commit b05f11183b
5 changed files with 248 additions and 2 deletions

View File

@@ -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>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 271 KiB

View File

@@ -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")}

View File

@@ -31,13 +31,14 @@ import FreeCAD
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")}
@@ -49,6 +50,10 @@ class _CommandPrintMeshInfo(FemCommands):
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())