Add item move up/down commands

This commit is contained in:
Zheng, Lei 2017-10-20 04:29:54 +08:00
parent c263aaa94e
commit fbbb1ab567
4 changed files with 1329 additions and 11 deletions

View File

@ -0,0 +1,622 @@
<?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="svg3612"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="OpenSCAD_TreeItemDown.svg">
<defs
id="defs3614">
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Mend"
style="overflow:visible;">
<path
id="path3835"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
transform="scale(0.4) rotate(180) translate(10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Mstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Mstart"
style="overflow:visible">
<path
id="path3832"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
transform="scale(0.4) translate(10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Lstart"
style="overflow:visible">
<path
id="path3826"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
transform="scale(0.8) translate(12.5,0)" />
</marker>
<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="perspective3620" />
<inkscape:perspective
id="perspective3588"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3692"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient3144-6">
<stop
id="stop3146-9"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop3148-2"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient3701">
<stop
id="stop3703"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop3705"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3144-6"
id="radialGradient3688"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
cx="225.26402"
cy="672.79736"
fx="225.26402"
fy="672.79736"
r="34.345188" />
<linearGradient
id="linearGradient3708">
<stop
id="stop3710"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop3712"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<inkscape:perspective
id="perspective3805"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient3864-0-0">
<stop
id="stop3866-5-7"
offset="0"
style="stop-color:#0619c0;stop-opacity:1;" />
<stop
id="stop3868-7-6"
offset="1"
style="stop-color:#379cfb;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3377">
<stop
id="stop3379"
offset="0"
style="stop-color:#ffaa00;stop-opacity:1;" />
<stop
id="stop3381"
offset="1"
style="stop-color:#faff2b;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3864-0">
<stop
id="stop3866-5"
offset="0"
style="stop-color:#0619c0;stop-opacity:1;" />
<stop
id="stop3868-7"
offset="1"
style="stop-color:#379cfb;stop-opacity:1;" />
</linearGradient>
<inkscape:perspective
id="perspective3902"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5048">
<stop
style="stop-color:black;stop-opacity:0;"
offset="0"
id="stop5050" />
<stop
id="stop5056"
offset="0.5"
style="stop-color:black;stop-opacity:1;" />
<stop
style="stop-color:black;stop-opacity:0;"
offset="1"
id="stop5052" />
</linearGradient>
<linearGradient
id="linearGradient3841-0-3">
<stop
id="stop3843-1-3"
offset="0"
style="stop-color:#0619c0;stop-opacity:1;" />
<stop
id="stop3845-0-8"
offset="1"
style="stop-color:#379cfb;stop-opacity:1;" />
</linearGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
fy="114.5684"
fx="20.892099"
r="5.256"
cy="114.5684"
cx="20.892099"
id="aigrd2">
<stop
id="stop15566"
style="stop-color:#F0F0F0"
offset="0" />
<stop
id="stop15568"
style="stop-color:#9a9a9a;stop-opacity:1.0000000;"
offset="1.0000000" />
</radialGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
fy="64.567902"
fx="20.892099"
r="5.257"
cy="64.567902"
cx="20.892099"
id="aigrd3">
<stop
id="stop15573"
style="stop-color:#F0F0F0"
offset="0" />
<stop
id="stop15575"
style="stop-color:#9a9a9a;stop-opacity:1.0000000;"
offset="1.0000000" />
</radialGradient>
<linearGradient
id="linearGradient15662">
<stop
style="stop-color:#ffffff;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop15664" />
<stop
style="stop-color:#f8f8f8;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop15666" />
</linearGradient>
<radialGradient
r="86.70845"
fy="35.736916"
fx="33.966679"
cy="35.736916"
cx="33.966679"
gradientTransform="matrix(0.96049297,0,0,1.041132,-52.144249,-702.33158)"
gradientUnits="userSpaceOnUse"
id="radialGradient4452"
xlink:href="#linearGradient259"
inkscape:collect="always" />
<linearGradient
id="linearGradient259">
<stop
style="stop-color:#fafafa;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop260" />
<stop
style="stop-color:#bbbbbb;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop261" />
</linearGradient>
<radialGradient
r="37.751713"
fy="3.7561285"
fx="8.824419"
cy="3.7561285"
cx="8.824419"
gradientTransform="matrix(0.96827297,0,0,1.032767,-48.790699,-701.68513)"
gradientUnits="userSpaceOnUse"
id="radialGradient4454"
xlink:href="#linearGradient269"
inkscape:collect="always" />
<linearGradient
id="linearGradient269">
<stop
style="stop-color:#a3a3a3;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop270" />
<stop
style="stop-color:#4c4c4c;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop271" />
</linearGradient>
<inkscape:perspective
id="perspective4947"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient4095">
<stop
style="stop-color:#005bff;stop-opacity:1;"
offset="0"
id="stop4097" />
<stop
style="stop-color:#c1e3f7;stop-opacity:1;"
offset="1"
id="stop4099" />
</linearGradient>
<inkscape:perspective
id="perspective5027"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective5076"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4247"
id="linearGradient4253"
x1="394.15784"
y1="185.1304"
x2="434.73947"
y2="140.22731"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.94231826,0,0,0.94231826,23.727549,8.8262536)" />
<linearGradient
id="linearGradient4247">
<stop
style="stop-color:#2e8207;stop-opacity:1;"
offset="0"
id="stop4249" />
<stop
style="stop-color:#52ff00;stop-opacity:1;"
offset="1"
id="stop4251" />
</linearGradient>
<linearGradient
y2="140.22731"
x2="434.73947"
y1="185.1304"
x1="394.15784"
gradientTransform="matrix(0.94231826,0,0,0.94231826,23.727549,8.8262536)"
gradientUnits="userSpaceOnUse"
id="linearGradient5087"
xlink:href="#linearGradient4247"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5141"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<marker
inkscape:stockid="Arrow1Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mstart-9"
style="overflow:visible">
<path
inkscape:connector-curvature="0"
id="path3832-1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
transform="matrix(0.4,0,0,0.4,4,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mend-2"
style="overflow:visible">
<path
inkscape:connector-curvature="0"
id="path3835-7"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
</marker>
<linearGradient
id="linearGradient3895-5">
<stop
style="stop-color:#729fcf;stop-opacity:1;"
offset="0"
id="stop3897-6" />
<stop
style="stop-color:#204a87;stop-opacity:1;"
offset="1"
id="stop3899-2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3094-7-8"
id="linearGradient3092-0-6"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,-77.468037,60.464466)"
x1="51.284271"
y1="24.928932"
x2="39.543564"
y2="31.991449" />
<linearGradient
id="linearGradient3094-7-8">
<stop
id="stop3096-6-7"
offset="0"
style="stop-color:#4e9a06;stop-opacity:1" />
<stop
id="stop3098-0-4"
offset="1"
style="stop-color:#8ae234;stop-opacity:1" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="4.7232161"
inkscape:cx="28.754177"
inkscape:cy="23.110975"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1375"
inkscape:window-height="876"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:snap-bbox="true">
<inkscape:grid
type="xygrid"
id="grid3086"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata3617">
<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 />
<dc:creator>
<cc:Agent>
<dc:title>[Sebastian Hoogen]</dc:title>
</cc:Agent>
</dc:creator>
<dc:title>OpenSCAD_RemoveSubtree</dc:title>
<dc:date>2012-05-03</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/OpenSCAD/Resources/icons/OpenSCAD_RemoveSubtree.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="ccc"
id="path5098-3"
d="m 8.999987,12.999998 0,42.000002 12,0"
style="fill:none;stroke:#2e3436;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path5100-6"
d="m 23,23 -14.000013,-2e-6"
style="fill:none;stroke:#2e3436;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
sodipodi:nodetypes="ccc"
id="path5098-36"
d="m 8.999987,12.999998 0,42.000002 12,0"
style="fill:none;stroke:#d3d7cf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path5100-7"
d="m 24,23 -15.000013,-2e-6"
style="fill:none;stroke:#d3d7cf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<rect
ry="0"
rx="0"
y="3"
x="3.0000002"
height="10"
width="37.999989"
id="rect4258-1-7-4-5"
style="color:#000000;fill:#eeeeec;stroke:#2e3436;stroke-width:1.99999988;stroke-linecap:butt;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" />
<rect
style="fill:#d3d7cf;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect3852-5-3"
width="34"
height="6"
x="5"
y="5" />
<g
id="g4294"
transform="translate(8.5333989,-17.066798)">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#eeeeec;stroke:#2e3436;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4258-1-7-4-3"
width="26.38888"
height="9.9999943"
x="21"
y="51"
rx="0"
ry="0" />
<rect
y="53"
x="23"
height="6"
width="22"
id="rect3852-5-5"
style="fill:#d3d7cf;fill-opacity:1;stroke:#ffffff;stroke-width:1.99999976;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<path
sodipodi:nodetypes="ccc"
id="path5098-3-2"
d="m 17,24 0,15 12,0"
style="fill:none;stroke:#2e3436;stroke-width:5.99999952;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccc"
id="path5098-36-6"
d="m 17,23 0,16 12,0"
style="fill:none;stroke:#d3d7cf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<g
id="g4290"
transform="translate(-1.1976703,-17.789654)">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#3465a4;stroke:#0b1521;stroke-width:1.99999976;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4258-1-7-4-7-3-6"
width="24"
height="10"
x="25"
y="35"
rx="0"
ry="0" />
<rect
y="37"
x="27"
height="6"
width="20"
id="rect3852-5-0"
style="fill:#3465a4;fill-opacity:1;stroke:#729fcf;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
id="g4298"
transform="translate(0.29941747,-1.0479616)">
<rect
ry="0"
rx="0"
y="51"
x="21"
height="9.9999943"
width="26.38888"
id="rect4300"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#eeeeec;stroke:#2e3436;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<rect
style="fill:#d3d7cf;fill-opacity:1;stroke:#ffffff;stroke-width:1.99999976;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4302"
width="22"
height="6"
x="23"
y="53" />
</g>
<g
id="g3088-1-9"
transform="matrix(-0.66486414,0.64701268,-0.66486414,-0.64701268,57.051255,92.542229)">
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="cccccccc"
id="path3343-0-2"
d="m -32.236782,40.77521 6.566914,6.566914 -11.246832,11.246832 8.755886,8.755886 11.246832,-11.246832 6.566915,6.566914 2.5513411,-24.441055 z"
style="fill:url(#linearGradient3092-0-6);fill-opacity:1;fill-rule:evenodd;stroke:#172a04;stroke-width:2.69526935;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="cccccccc"
id="path3343-2-2-4"
d="m -25.390575,43.122684 4.159045,4.159045 -11.246832,11.246832 4.377943,4.377943 11.246832,-11.246832 4.159046,4.159046 1.513234,-14.221358 z"
style="fill:none;stroke:#8ae234;stroke-width:3.13808823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -0,0 +1,622 @@
<?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="svg3612"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="OpenSCAD_TreeItemUp.svg">
<defs
id="defs3614">
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Mend"
style="overflow:visible;">
<path
id="path3835"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
transform="scale(0.4) rotate(180) translate(10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Mstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Mstart"
style="overflow:visible">
<path
id="path3832"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
transform="scale(0.4) translate(10,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Lstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Lstart"
style="overflow:visible">
<path
id="path3826"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
transform="scale(0.8) translate(12.5,0)" />
</marker>
<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="perspective3620" />
<inkscape:perspective
id="perspective3588"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3692"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient3144-6">
<stop
id="stop3146-9"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop3148-2"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient3701">
<stop
id="stop3703"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop3705"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3144-6"
id="radialGradient3688"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
cx="225.26402"
cy="672.79736"
fx="225.26402"
fy="672.79736"
r="34.345188" />
<linearGradient
id="linearGradient3708">
<stop
id="stop3710"
style="stop-color:#ffffff;stop-opacity:1"
offset="0" />
<stop
id="stop3712"
style="stop-color:#ffffff;stop-opacity:0"
offset="1" />
</linearGradient>
<inkscape:perspective
id="perspective3805"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient3864-0-0">
<stop
id="stop3866-5-7"
offset="0"
style="stop-color:#0619c0;stop-opacity:1;" />
<stop
id="stop3868-7-6"
offset="1"
style="stop-color:#379cfb;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3377">
<stop
id="stop3379"
offset="0"
style="stop-color:#ffaa00;stop-opacity:1;" />
<stop
id="stop3381"
offset="1"
style="stop-color:#faff2b;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3864-0">
<stop
id="stop3866-5"
offset="0"
style="stop-color:#0619c0;stop-opacity:1;" />
<stop
id="stop3868-7"
offset="1"
style="stop-color:#379cfb;stop-opacity:1;" />
</linearGradient>
<inkscape:perspective
id="perspective3902"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient5048">
<stop
style="stop-color:black;stop-opacity:0;"
offset="0"
id="stop5050" />
<stop
id="stop5056"
offset="0.5"
style="stop-color:black;stop-opacity:1;" />
<stop
style="stop-color:black;stop-opacity:0;"
offset="1"
id="stop5052" />
</linearGradient>
<linearGradient
id="linearGradient3841-0-3">
<stop
id="stop3843-1-3"
offset="0"
style="stop-color:#0619c0;stop-opacity:1;" />
<stop
id="stop3845-0-8"
offset="1"
style="stop-color:#379cfb;stop-opacity:1;" />
</linearGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
fy="114.5684"
fx="20.892099"
r="5.256"
cy="114.5684"
cx="20.892099"
id="aigrd2">
<stop
id="stop15566"
style="stop-color:#F0F0F0"
offset="0" />
<stop
id="stop15568"
style="stop-color:#9a9a9a;stop-opacity:1.0000000;"
offset="1.0000000" />
</radialGradient>
<radialGradient
gradientUnits="userSpaceOnUse"
fy="64.567902"
fx="20.892099"
r="5.257"
cy="64.567902"
cx="20.892099"
id="aigrd3">
<stop
id="stop15573"
style="stop-color:#F0F0F0"
offset="0" />
<stop
id="stop15575"
style="stop-color:#9a9a9a;stop-opacity:1.0000000;"
offset="1.0000000" />
</radialGradient>
<linearGradient
id="linearGradient15662">
<stop
style="stop-color:#ffffff;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop15664" />
<stop
style="stop-color:#f8f8f8;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop15666" />
</linearGradient>
<radialGradient
r="86.70845"
fy="35.736916"
fx="33.966679"
cy="35.736916"
cx="33.966679"
gradientTransform="matrix(0.96049297,0,0,1.041132,-52.144249,-702.33158)"
gradientUnits="userSpaceOnUse"
id="radialGradient4452"
xlink:href="#linearGradient259"
inkscape:collect="always" />
<linearGradient
id="linearGradient259">
<stop
style="stop-color:#fafafa;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop260" />
<stop
style="stop-color:#bbbbbb;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop261" />
</linearGradient>
<radialGradient
r="37.751713"
fy="3.7561285"
fx="8.824419"
cy="3.7561285"
cx="8.824419"
gradientTransform="matrix(0.96827297,0,0,1.032767,-48.790699,-701.68513)"
gradientUnits="userSpaceOnUse"
id="radialGradient4454"
xlink:href="#linearGradient269"
inkscape:collect="always" />
<linearGradient
id="linearGradient269">
<stop
style="stop-color:#a3a3a3;stop-opacity:1.0000000;"
offset="0.0000000"
id="stop270" />
<stop
style="stop-color:#4c4c4c;stop-opacity:1.0000000;"
offset="1.0000000"
id="stop271" />
</linearGradient>
<inkscape:perspective
id="perspective4947"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient4095">
<stop
style="stop-color:#005bff;stop-opacity:1;"
offset="0"
id="stop4097" />
<stop
style="stop-color:#c1e3f7;stop-opacity:1;"
offset="1"
id="stop4099" />
</linearGradient>
<inkscape:perspective
id="perspective5027"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective5076"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4247"
id="linearGradient4253"
x1="394.15784"
y1="185.1304"
x2="434.73947"
y2="140.22731"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.94231826,0,0,0.94231826,23.727549,8.8262536)" />
<linearGradient
id="linearGradient4247">
<stop
style="stop-color:#2e8207;stop-opacity:1;"
offset="0"
id="stop4249" />
<stop
style="stop-color:#52ff00;stop-opacity:1;"
offset="1"
id="stop4251" />
</linearGradient>
<linearGradient
y2="140.22731"
x2="434.73947"
y1="185.1304"
x1="394.15784"
gradientTransform="matrix(0.94231826,0,0,0.94231826,23.727549,8.8262536)"
gradientUnits="userSpaceOnUse"
id="linearGradient5087"
xlink:href="#linearGradient4247"
inkscape:collect="always" />
<inkscape:perspective
id="perspective5141"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<marker
inkscape:stockid="Arrow1Mstart"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mstart-9"
style="overflow:visible">
<path
inkscape:connector-curvature="0"
id="path3832-1"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
transform="matrix(0.4,0,0,0.4,4,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Mend"
orient="auto"
refY="0"
refX="0"
id="Arrow1Mend-2"
style="overflow:visible">
<path
inkscape:connector-curvature="0"
id="path3835-7"
d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
</marker>
<linearGradient
id="linearGradient3895-5">
<stop
style="stop-color:#729fcf;stop-opacity:1;"
offset="0"
id="stop3897-6" />
<stop
style="stop-color:#204a87;stop-opacity:1;"
offset="1"
id="stop3899-2" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3094-7-8"
id="linearGradient3092-0-6"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,-77.468037,60.464466)"
x1="51.284271"
y1="24.928932"
x2="39.543564"
y2="31.991449" />
<linearGradient
id="linearGradient3094-7-8">
<stop
id="stop3096-6-7"
offset="0"
style="stop-color:#4e9a06;stop-opacity:1" />
<stop
id="stop3098-0-4"
offset="1"
style="stop-color:#8ae234;stop-opacity:1" />
</linearGradient>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="9.4464321"
inkscape:cx="31.440725"
inkscape:cy="46.79818"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1375"
inkscape:window-height="876"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:snap-bbox="true">
<inkscape:grid
type="xygrid"
id="grid3086"
empspacing="2"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata3617">
<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 />
<dc:creator>
<cc:Agent>
<dc:title>[Sebastian Hoogen]</dc:title>
</cc:Agent>
</dc:creator>
<dc:title>OpenSCAD_RemoveSubtree</dc:title>
<dc:date>2012-05-03</dc:date>
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
<dc:publisher>
<cc:Agent>
<dc:title>FreeCAD</dc:title>
</cc:Agent>
</dc:publisher>
<dc:identifier>FreeCAD/src/Mod/OpenSCAD/Resources/icons/OpenSCAD_RemoveSubtree.svg</dc:identifier>
<dc:rights>
<cc:Agent>
<dc:title>FreeCAD LGPL2+</dc:title>
</cc:Agent>
</dc:rights>
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
<dc:contributor>
<cc:Agent>
<dc:title>[agryson] Alexander Gryson</dc:title>
</cc:Agent>
</dc:contributor>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="ccc"
id="path5098-3"
d="m 8.999987,12.999998 0,42.000002 12,0"
style="fill:none;stroke:#2e3436;stroke-width:6;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path5100-6"
d="m 23,23 -14.000013,-2e-6"
style="fill:none;stroke:#2e3436;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
sodipodi:nodetypes="ccc"
id="path5098-36"
d="m 8.999987,12.999998 0,42.000002 12,0"
style="fill:none;stroke:#d3d7cf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
id="path5100-7"
d="m 24,23 -15.000013,-2e-6"
style="fill:none;stroke:#d3d7cf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<rect
ry="0"
rx="0"
y="3"
x="3.0000002"
height="10"
width="37.999989"
id="rect4258-1-7-4-5"
style="color:#000000;fill:#eeeeec;stroke:#2e3436;stroke-width:1.99999988;stroke-linecap:butt;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" />
<rect
style="fill:#d3d7cf;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect3852-5-3"
width="34"
height="6"
x="5"
y="5" />
<g
id="g4294"
transform="translate(8.5333989,-17.066798)">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#eeeeec;stroke:#2e3436;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4258-1-7-4-3"
width="26.38888"
height="9.9999943"
x="21"
y="51"
rx="0"
ry="0" />
<rect
y="53"
x="23"
height="6"
width="22"
id="rect3852-5-5"
style="fill:#d3d7cf;fill-opacity:1;stroke:#ffffff;stroke-width:1.99999976;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<path
sodipodi:nodetypes="ccc"
id="path5098-3-2"
d="m 17,24 0,15 12,0"
style="fill:none;stroke:#2e3436;stroke-width:5.99999952;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccc"
id="path5098-36-6"
d="m 17,23 0,16 12,0"
style="fill:none;stroke:#d3d7cf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
<g
id="g4290"
transform="translate(-3.293593,14.671458)">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#3465a4;stroke:#0b1521;stroke-width:1.99999976;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="rect4258-1-7-4-7-3-6"
width="24"
height="10"
x="25"
y="35"
rx="0"
ry="0" />
<rect
y="37"
x="27"
height="6"
width="20"
id="rect3852-5-0"
style="fill:#3465a4;fill-opacity:1;stroke:#729fcf;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
id="g4298"
transform="translate(2.6947575,-33.385052)">
<rect
ry="0"
rx="0"
y="51"
x="21"
height="9.9999943"
width="26.38888"
id="rect4300"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#eeeeec;stroke:#2e3436;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
<rect
style="fill:#d3d7cf;fill-opacity:1;stroke:#ffffff;stroke-width:1.99999976;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4302"
width="22"
height="6"
x="23"
y="53" />
</g>
<g
id="g3088-1-9"
transform="matrix(0.66486414,-0.64701268,0.66486414,0.64701268,13.343491,-16.273096)">
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="cccccccc"
id="path3343-0-2"
d="m -32.236782,40.77521 6.566914,6.566914 -11.246832,11.246832 8.755886,8.755886 11.246832,-11.246832 6.566915,6.566914 2.5513411,-24.441055 z"
style="fill:url(#linearGradient3092-0-6);fill-opacity:1;fill-rule:evenodd;stroke:#172a04;stroke-width:2.69526927;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
<path
inkscape:export-ydpi="4.1683898"
inkscape:export-xdpi="4.1683898"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/changeprop.png"
sodipodi:nodetypes="cccccccc"
id="path3343-2-2-4"
d="m -25.390575,43.122684 4.159045,4.159045 -11.246832,11.246832 4.377943,4.377943 11.246832,-11.246832 4.159046,4.159046 1.513234,-14.221358 z"
style="fill:none;stroke:#8ae234;stroke-width:3.13808823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 21 KiB

View File

@ -95,7 +95,8 @@ class AsmGroup(AsmBase):
def setGroupMode(self):
self.Object.GroupMode = 1 # auto delete children
self.Object.setPropertyStatus('GroupMode','Hidden')
self.Object.setPropertyStatus('GroupMode','Immutable')
# self.Object.setPropertyStatus('GroupMode','Immutable')
self.Object.setPropertyStatus('GroupMode','ReadOnly')
self.Object.setPropertyStatus('GroupMode','Transient')
def attach(self,obj):
@ -151,7 +152,7 @@ class AsmElement(AsmBase):
def linkSetup(self,obj):
super(AsmElement,self).linkSetup(obj)
obj.configLinkProperty('LinkedObject')
obj.setPropertyStatus('LinkedObject','Immutable')
# obj.setPropertyStatus('LinkedObject','Immutable')
obj.setPropertyStatus('LinkedObject','ReadOnly')
def attach(self,obj):
@ -314,7 +315,7 @@ class AsmElementLink(AsmBase):
def linkSetup(self,obj):
super(AsmElementLink,self).linkSetup(obj)
obj.configLinkProperty('LinkedObject')
obj.setPropertyStatus('LinkedObject','Immutable')
# obj.setPropertyStatus('LinkedObject','Immutable')
obj.setPropertyStatus('LinkedObject','ReadOnly')
def attach(self,obj):
@ -325,9 +326,6 @@ class AsmElementLink(AsmBase):
obj.ViewObject.Proxy.onExecute(self.getInfo(True))
return False
def getAssembly(self):
return self.parent.parent.parent
def getElement(self):
linked = self.Object.getLinkedObject(False)
if not linked:
@ -336,6 +334,9 @@ class AsmElementLink(AsmBase):
raise RuntimeError('Invalid element type')
return linked.Proxy
def getAssembly(self):
return self.parent.parent.parent
def getSubName(self):
link = self.Object.LinkedObject
if not isinstance(link,tuple):
@ -615,10 +616,7 @@ class ViewProviderAsmElementLink(ViewProviderAsmBase):
obj.recompute()
return
try:
asm3.solver.solve(obj.Proxy.getAssembly().Object)
except RuntimeError as e:
logger.error(e)
obj.Proxy.parent.solve()
return ctx.placement
def onDragEnd(self):
@ -638,6 +636,17 @@ class AsmConstraint(AsmGroup):
self.parent = getProxy(parent,AsmConstraintGroup)
super(AsmConstraint,self).__init__()
def solve(self, excp=False):
try:
asm3.solver.solve(self.getAssembly().Object)
except RuntimeError as e:
if excp:
raise e
logger.error(e)
def getAssembly(self):
return self.parent.parent
def checkSupport(self):
# this function maybe called during document restore, hence the
# extensive check below
@ -786,7 +795,7 @@ class AsmConstraint(AsmGroup):
AsmElementLink.make(AsmElementLink.MakeInfo(cstr,*e))
cstr.Proxy._initializing = False
if cstr.recompute() and asm3.gui.AsmCmdManager.AutoRecompute:
asm3.solver.solve(cstr.Proxy.getAssembly().Object)
cstr.Proxy.solve()
return cstr

65
gui.py
View File

@ -236,3 +236,68 @@ class AsmCmdAutoRecompute(AsmCmdCheckable):
_menuText = 'Auto recompute'
_iconName = 'Assembly_AutoRecompute.svg'
_saveParam = True
class AsmCmdUp(AsmCmdBase):
_id = 6
_menuText = 'Move item up'
_iconName = 'Assembly_TreeItemUp.svg'
@classmethod
def getSelection(cls):
from asm3.assembly import isTypeOf, Assembly, AsmGroup
sels = FreeCADGui.Selection.getSelectionEx('',False)
if len(sels)!=1 or len(sels[0].SubElementNames)!=1:
return
obj,parent,_ = FreeCADGui.Selection.resolveObject(
sels[0].Object, sels[0].SubElementNames[0])
if isTypeOf(parent,Assembly) or not isTypeOf(parent,AsmGroup) or \
len(parent.Group) <= 1:
return
return (obj,parent,sels[0].Object,sels[0].SubElementNames[0])
@classmethod
def checkActive(cls):
cls._active = True if cls.getSelection() else False
@classmethod
def move(cls,step):
ret = cls.getSelection()
if not ret:
return
obj,parent,topParent,subname = ret
children = parent.Group
i = children.index(obj)
j = i+step
if j<0:
j = len(children)-1
elif j>=len(children):
j = 0
logger.debug('move {}:{} -> {}:{}'.format(
i,objName(obj),j,objName(children[j])))
parent.Document.openTransaction(cls._menuText)
parent.Group = {i:children[j],j:obj}
parent.Document.commitTransaction()
# The tree view may deselect the item because of claimChildren changes,
# so we restore the selection here
FreeCADGui.Selection.addSelection(topParent,subname)
if AsmCmdManager.AutoRecompute:
parent.Proxy.solve()
@classmethod
def onClearSelection(cls):
cls._active = False
@classmethod
def Activated(cls):
cls.move(-1)
class AsmCmdDown(AsmCmdUp):
_id = 7
_menuText = 'Move item down'
_iconName = 'Assembly_TreeItemDown.svg'
@classmethod
def Activated(cls):
cls.move(1)