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>

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg2860"
sodipodi:version="0.32"
inkscape:version="0.48.5 r10040"
sodipodi:docname="fem-femmesh-clear-mesh.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<defs
id="defs2862">
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3692"
cx="45.883327"
cy="28.869568"
fx="45.883327"
fy="28.869568"
r="19.467436"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3703"
gradientUnits="userSpaceOnUse"
cx="135.38333"
cy="97.369568"
fx="135.38333"
fy="97.369568"
r="19.467436"
gradientTransform="matrix(0.97435,0.2250379,-0.4623105,2.0016728,48.487554,-127.99883)" />
<linearGradient
id="linearGradient3377">
<stop
id="stop3379"
offset="0"
style="stop-color:#faff2b;stop-opacity:1;" />
<stop
id="stop3381"
offset="1"
style="stop-color:#ffaa00;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3377"
id="radialGradient3705"
gradientUnits="userSpaceOnUse"
cx="148.88333"
cy="81.869568"
fx="148.88333"
fy="81.869568"
r="19.467436"
gradientTransform="matrix(1.3852588,-5.1367833e-2,3.7056289e-2,0.9993132,-60.392403,7.7040438)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="64 : 32 : 1"
inkscape:persp3d-origin="32 : 21.333333 : 1"
id="perspective2868" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.5"
inkscape:cx="-0.90909091"
inkscape:cy="29.272727"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1280"
inkscape:window-height="750"
inkscape:window-x="156"
inkscape:window-y="158"
inkscape:window-maximized="0" />
<metadata
id="metadata2865">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.40000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:sans-serif"
d="m 11.754269,47.678609 c -1.228162,1.228162 -1.228174,3.337636 0,4.565809 1.228166,1.228166 3.339029,1.229544 4.567192,0.0014 L 52.2458,16.321461 c 1.228162,-1.228163 1.226784,-3.339026 -0.0014,-4.567192 -1.228173,-1.228174 -3.337647,-1.228162 -4.565809,0 l -35.92434,35.92434 z"
id="rect4154"
inkscape:connector-curvature="0" />
<path
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.40000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:sans-serif"
d="M 32,3.369141 C 16.223038,3.3691411 3.3691407,16.223038 3.3691406,32 3.3691406,47.776962 16.223038,60.630859 32,60.630859 47.776962,60.630859 60.630859,47.776962 60.630859,32 60.630859,16.223038 47.776962,3.369141 32,3.369141 z m 0,6 C 44.534321,9.369141 54.630859,19.465679 54.630859,32 54.630859,44.534321 44.534321,54.630859 32,54.630859 19.465679,54.630859 9.3691406,44.534321 9.3691406,32 9.3691407,19.465679 19.465679,9.3691411 32,9.369141 z"
id="path4152"
inkscape:connector-curvature="0" />
</g>
</svg>

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())