[Draft] Remove obsolete code related to Drawing WB
* [Draft] Remove obsolete code related to Drawing WB remove unused elif * [Draft] Remove obsolete code related to the Drawing WB * Update preferences-draftvisual.ui Also remove the template label. * Update utils.py Remove reference to "template" * Remove Draft_Drawing.svg from Draft.qrc --------- Co-authored-by: Roy-043 <info@b-k-g.nl> Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
@@ -115,7 +115,6 @@ SET(Draft_make_functions
|
||||
draftmake/make_clone.py
|
||||
draftmake/make_copy.py
|
||||
draftmake/make_dimension.py
|
||||
draftmake/make_drawingview.py
|
||||
draftmake/make_ellipse.py
|
||||
draftmake/make_facebinder.py
|
||||
draftmake/make_fillet.py
|
||||
@@ -148,7 +147,6 @@ SET(Draft_objects
|
||||
draftobjects/bspline.py
|
||||
draftobjects/circle.py
|
||||
draftobjects/clone.py
|
||||
draftobjects/drawingview.py
|
||||
draftobjects/ellipse.py
|
||||
draftobjects/facebinder.py
|
||||
draftobjects/draft_annotation.py
|
||||
@@ -231,7 +229,6 @@ SET(Modifier_tools
|
||||
draftguitools/gui_downgrade.py
|
||||
draftguitools/gui_trimex.py
|
||||
draftguitools/gui_scale.py
|
||||
draftguitools/gui_drawing.py
|
||||
draftguitools/gui_wire2spline.py
|
||||
draftguitools/gui_shape2dview.py
|
||||
draftguitools/gui_draft2sketch.py
|
||||
|
||||
@@ -219,11 +219,7 @@ from draftmake.make_circle import (make_circle,
|
||||
# arcs
|
||||
from draftmake.make_arc_3points import make_arc_3points
|
||||
|
||||
# drawing: obsolete since Drawing was replaced by TechDraw
|
||||
from draftobjects.drawingview import (DrawingView,
|
||||
_DrawingView)
|
||||
from draftmake.make_drawingview import (make_drawing_view,
|
||||
makeDrawingView)
|
||||
|
||||
|
||||
# ellipse
|
||||
from draftobjects.ellipse import (Ellipse,
|
||||
|
||||
@@ -1688,8 +1688,7 @@ class DraftToolBar:
|
||||
self.commands = ["Draft_Move","Draft_Rotate",
|
||||
"Draft_Scale","Draft_Offset",
|
||||
"Draft_Trimex","Draft_Upgrade",
|
||||
"Draft_Downgrade","Draft_Edit",
|
||||
"Draft_Drawing"]
|
||||
"Draft_Downgrade","Draft_Edit"]
|
||||
self.title = "Modify objects"
|
||||
def shouldShow(self):
|
||||
return (FreeCAD.ActiveDocument is not None) and (FreeCADGui.Selection.getSelection() != [])
|
||||
|
||||
@@ -184,7 +184,6 @@ from draftguitools.gui_upgrade import Upgrade
|
||||
from draftguitools.gui_downgrade import Downgrade
|
||||
from draftguitools.gui_trimex import Trimex
|
||||
from draftguitools.gui_scale import Scale
|
||||
from draftguitools.gui_drawing import Drawing
|
||||
from draftguitools.gui_wire2spline import WireToBSpline
|
||||
from draftguitools.gui_shape2dview import Shape2DView
|
||||
from draftguitools.gui_draft2sketch import Draft2Sketch
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
<file>icons/Draft_Downgrade.svg</file>
|
||||
<file>icons/Draft_Draft.svg</file>
|
||||
<file>icons/Draft_Draft2Sketch.svg</file>
|
||||
<file>icons/Draft_Drawing.svg</file>
|
||||
<file>icons/Draft_Edit.svg</file>
|
||||
<file>icons/Draft_Ellipse.svg</file>
|
||||
<file>icons/Draft_Facebinder.svg</file>
|
||||
|
||||
@@ -374,7 +374,7 @@
|
||||
<dc:title>FreeCAD</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier>FreeCAD/src/Mod/Draft/Resources/icons/Draft_Drawing.svg</dc:identifier>
|
||||
<dc:identifier>FreeCAD/src/Mod/Draft/Resources/icons/Draft_AutoGroup.svg</dc:identifier>
|
||||
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -370,7 +370,7 @@
|
||||
<dc:title>FreeCAD</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier>FreeCAD/src/Mod/Draft/Resources/icons/Draft_Drawing.svg</dc:identifier>
|
||||
<dc:identifier>FreeCAD/src/Mod/Draft/Resources/icons/Draft_AutoGroup_off.svg</dc:identifier>
|
||||
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -345,7 +345,7 @@
|
||||
<dc:title>FreeCAD</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier>FreeCAD/src/Mod/Draft/Resources/icons/Draft_Drawing.svg</dc:identifier>
|
||||
<dc:identifier>FreeCAD/src/Mod/Draft/Resources/icons/Draft_AutoGroup_on.svg</dc:identifier>
|
||||
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -1,522 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<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"
|
||||
version="1.1"
|
||||
id="svg3612"
|
||||
height="64px"
|
||||
width="64px">
|
||||
<defs
|
||||
id="defs3614">
|
||||
<linearGradient
|
||||
id="linearGradient3144-6">
|
||||
<stop
|
||||
offset="0"
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
id="stop3146-9" />
|
||||
<stop
|
||||
offset="1"
|
||||
style="stop-color:#ffffff;stop-opacity:0"
|
||||
id="stop3148-2" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3701">
|
||||
<stop
|
||||
offset="0"
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
id="stop3703" />
|
||||
<stop
|
||||
offset="1"
|
||||
style="stop-color:#ffffff;stop-opacity:0"
|
||||
id="stop3705" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3688"
|
||||
xlink:href="#linearGradient3144-6" />
|
||||
<linearGradient
|
||||
id="linearGradient3708">
|
||||
<stop
|
||||
offset="0"
|
||||
style="stop-color:#ffffff;stop-opacity:1"
|
||||
id="stop3710" />
|
||||
<stop
|
||||
offset="1"
|
||||
style="stop-color:#ffffff;stop-opacity:0"
|
||||
id="stop3712" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="115.01974"
|
||||
x2="654.80023"
|
||||
y1="77.046234"
|
||||
x1="696.67322"
|
||||
gradientTransform="matrix(0.2210246,-0.5789261,-0.71699693,-0.35346705,519.98085,464.19243)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3934"
|
||||
xlink:href="#linearGradient3864-0-0" />
|
||||
<linearGradient
|
||||
id="linearGradient3864-0-0">
|
||||
<stop
|
||||
style="stop-color:#0619c0;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3866-5-7" />
|
||||
<stop
|
||||
style="stop-color:#379cfb;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3868-7-6" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="30.27434"
|
||||
x2="619.30328"
|
||||
y1="44.024342"
|
||||
x1="597.77283"
|
||||
id="linearGradient3942"
|
||||
xlink:href="#linearGradient3377" />
|
||||
<linearGradient
|
||||
id="linearGradient3377">
|
||||
<stop
|
||||
style="stop-color:#ffaa00;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3379" />
|
||||
<stop
|
||||
style="stop-color:#faff2b;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3381" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="139.40982"
|
||||
x2="650.70459"
|
||||
y1="77.046234"
|
||||
x1="696.67322"
|
||||
gradientTransform="matrix(0.2210246,-0.5789261,-0.71699693,-0.35346705,536.41251,472.3612)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3657"
|
||||
xlink:href="#linearGradient3864-0" />
|
||||
<linearGradient
|
||||
id="linearGradient3864-0">
|
||||
<stop
|
||||
style="stop-color:#0619c0;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3866-5" />
|
||||
<stop
|
||||
style="stop-color:#379cfb;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3868-7" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5048">
|
||||
<stop
|
||||
id="stop5050"
|
||||
offset="0"
|
||||
style="stop-color:black;stop-opacity:0;" />
|
||||
<stop
|
||||
style="stop-color:black;stop-opacity:1;"
|
||||
offset="0.5"
|
||||
id="stop5056" />
|
||||
<stop
|
||||
id="stop5052"
|
||||
offset="1"
|
||||
style="stop-color:black;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5060">
|
||||
<stop
|
||||
id="stop5062"
|
||||
offset="0"
|
||||
style="stop-color:black;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop5064"
|
||||
offset="1"
|
||||
style="stop-color:black;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3841-0-3">
|
||||
<stop
|
||||
style="stop-color:#0619c0;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3843-1-3" />
|
||||
<stop
|
||||
style="stop-color:#379cfb;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3845-0-8" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="5.256"
|
||||
fy="114.5684"
|
||||
fx="20.892099"
|
||||
cy="114.5684"
|
||||
cx="20.892099"
|
||||
gradientTransform="matrix(0.229703,0,0,0.229703,4.613529,3.979808)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient2283"
|
||||
xlink:href="#aigrd2" />
|
||||
<radialGradient
|
||||
id="aigrd2"
|
||||
cx="20.892099"
|
||||
cy="114.5684"
|
||||
r="5.256"
|
||||
fx="20.892099"
|
||||
fy="114.5684"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
offset="0"
|
||||
style="stop-color:#F0F0F0"
|
||||
id="stop15566" />
|
||||
<stop
|
||||
offset="1.0000000"
|
||||
style="stop-color:#9a9a9a;stop-opacity:1.0000000;"
|
||||
id="stop15568" />
|
||||
</radialGradient>
|
||||
<radialGradient
|
||||
r="5.257"
|
||||
fy="64.567902"
|
||||
fx="20.892099"
|
||||
cy="64.567902"
|
||||
cx="20.892099"
|
||||
gradientTransform="matrix(0.229703,0,0,0.229703,4.613529,3.979808)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient2285"
|
||||
xlink:href="#aigrd3" />
|
||||
<radialGradient
|
||||
id="aigrd3"
|
||||
cx="20.892099"
|
||||
cy="64.567902"
|
||||
r="5.257"
|
||||
fx="20.892099"
|
||||
fy="64.567902"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
offset="0"
|
||||
style="stop-color:#F0F0F0"
|
||||
id="stop15573" />
|
||||
<stop
|
||||
offset="1.0000000"
|
||||
style="stop-color:#9a9a9a;stop-opacity:1.0000000;"
|
||||
id="stop15575" />
|
||||
</radialGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient15662"
|
||||
id="radialGradient15668"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.93578701,0,0,0.95695492,14.882422,-58.630722)"
|
||||
cx="8.1435566"
|
||||
cy="7.2678967"
|
||||
fx="8.1435566"
|
||||
fy="7.2678967"
|
||||
r="38.158695" />
|
||||
<linearGradient
|
||||
id="linearGradient15662">
|
||||
<stop
|
||||
id="stop15664"
|
||||
offset="0.0000000"
|
||||
style="stop-color:#ffffff;stop-opacity:1.0000000;" />
|
||||
<stop
|
||||
id="stop15666"
|
||||
offset="1.0000000"
|
||||
style="stop-color:#f8f8f8;stop-opacity:1.0000000;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient259"
|
||||
id="radialGradient4452"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.96049297,0,0,1.041132,-52.144249,-702.33158)"
|
||||
cx="33.966679"
|
||||
cy="35.736916"
|
||||
fx="33.966679"
|
||||
fy="35.736916"
|
||||
r="86.70845" />
|
||||
<linearGradient
|
||||
id="linearGradient259">
|
||||
<stop
|
||||
id="stop260"
|
||||
offset="0.0000000"
|
||||
style="stop-color:#fafafa;stop-opacity:1.0000000;" />
|
||||
<stop
|
||||
id="stop261"
|
||||
offset="1.0000000"
|
||||
style="stop-color:#bbbbbb;stop-opacity:1.0000000;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient269"
|
||||
id="radialGradient4454"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.96827297,0,0,1.032767,-48.790699,-701.68513)"
|
||||
cx="8.824419"
|
||||
cy="3.7561285"
|
||||
fx="8.824419"
|
||||
fy="3.7561285"
|
||||
r="37.751713" />
|
||||
<linearGradient
|
||||
id="linearGradient269">
|
||||
<stop
|
||||
id="stop270"
|
||||
offset="0.0000000"
|
||||
style="stop-color:#a3a3a3;stop-opacity:1.0000000;" />
|
||||
<stop
|
||||
id="stop271"
|
||||
offset="1.0000000"
|
||||
style="stop-color:#4c4c4c;stop-opacity:1.0000000;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient259"
|
||||
id="radialGradient3972"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.9839807,0,0,1.0179698,10.292146,-60.498192)"
|
||||
cx="3.7745965"
|
||||
cy="43.717598"
|
||||
fx="3.7745965"
|
||||
fy="43.717598"
|
||||
r="86.70845" />
|
||||
<radialGradient
|
||||
xlink:href="#linearGradient269"
|
||||
id="radialGradient3974"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.99195094,0,0,1.009791,13.727702,-59.866123)"
|
||||
cx="0.28083447"
|
||||
cy="43.445751"
|
||||
fx="0.28083447"
|
||||
fy="43.445751"
|
||||
r="37.751713" />
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="44"
|
||||
x2="48"
|
||||
y1="22"
|
||||
x1="43"
|
||||
id="linearGradient3909"
|
||||
xlink:href="#linearGradient3895" />
|
||||
<linearGradient
|
||||
id="linearGradient3895">
|
||||
<stop
|
||||
id="stop3897"
|
||||
offset="0"
|
||||
style="stop-color:#729fcf;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3899"
|
||||
offset="1"
|
||||
style="stop-color:#204a87;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
xlink:href="#linearGradient3895"
|
||||
id="linearGradient3023"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="43"
|
||||
y1="22"
|
||||
x2="48"
|
||||
y2="44"
|
||||
gradientTransform="translate(-27,-6)" />
|
||||
<linearGradient
|
||||
y2="609.50507"
|
||||
x2="302.85715"
|
||||
y1="366.64789"
|
||||
x1="302.85715"
|
||||
gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3092"
|
||||
xlink:href="#linearGradient5048" />
|
||||
<radialGradient
|
||||
r="117.14286"
|
||||
fy="486.64789"
|
||||
fx="605.71429"
|
||||
cy="486.64789"
|
||||
cx="605.71429"
|
||||
gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3094"
|
||||
xlink:href="#linearGradient5060" />
|
||||
<radialGradient
|
||||
r="117.14286"
|
||||
fy="486.64789"
|
||||
fx="605.71429"
|
||||
cy="486.64789"
|
||||
cx="605.71429"
|
||||
gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3096"
|
||||
xlink:href="#linearGradient5060" />
|
||||
</defs>
|
||||
<g
|
||||
id="layer1">
|
||||
<rect
|
||||
transform="matrix(3.5736813e-4,0.99999994,-0.99999992,3.9232174e-4,0,0)"
|
||||
rx="1.1771472"
|
||||
style="color:#000000;fill:url(#radialGradient3972);fill-opacity:1;fill-rule:nonzero;stroke:url(#radialGradient3974);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:block;overflow:visible"
|
||||
id="rect15391"
|
||||
width="35.727829"
|
||||
height="40.010132"
|
||||
x="17.057177"
|
||||
y="-56.932377"
|
||||
ry="1.1234856" />
|
||||
<rect
|
||||
transform="matrix(3.5899548e-4,0.99999994,-0.99999992,3.9054332e-4,0,0)"
|
||||
style="color:#000000;fill:none;stroke:url(#radialGradient15668);stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block;overflow:visible"
|
||||
id="rect15660"
|
||||
width="31.676243"
|
||||
height="36.087452"
|
||||
x="19.050236"
|
||||
y="-54.981792"
|
||||
ry="0.13810737"
|
||||
rx="0.14404793" />
|
||||
<g
|
||||
transform="matrix(3.6610713e-4,1.0244539,-0.97775283,3.8359374e-4,60.539218,10.930654)"
|
||||
id="g2270"
|
||||
style="stroke-width:2.02001595;display:inline">
|
||||
<g
|
||||
id="g1440"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:8.69966507;stroke-miterlimit:4"
|
||||
transform="matrix(0.229703,0,0,0.229703,4.967081,4.244972)">
|
||||
<radialGradient
|
||||
id="radialGradient1442"
|
||||
cx="20.892099"
|
||||
cy="114.5684"
|
||||
r="5.256"
|
||||
fx="20.892099"
|
||||
fy="114.5684"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
offset="0"
|
||||
style="stop-color:#F0F0F0"
|
||||
id="stop1444" />
|
||||
<stop
|
||||
offset="1"
|
||||
style="stop-color:#474747"
|
||||
id="stop1446" />
|
||||
</radialGradient>
|
||||
<path
|
||||
style="stroke:none"
|
||||
d="m 23.428,113.07 c 0,1.973 -1.6,3.572 -3.573,3.572 -1.974,0 -3.573,-1.6 -3.573,-3.572 0,-1.974 1.6,-3.573 3.573,-3.573 1.973,0 3.573,1.6 3.573,3.573 z"
|
||||
id="path1448" />
|
||||
<radialGradient
|
||||
id="radialGradient1450"
|
||||
cx="20.892099"
|
||||
cy="64.567902"
|
||||
r="5.257"
|
||||
fx="20.892099"
|
||||
fy="64.567902"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
offset="0"
|
||||
style="stop-color:#F0F0F0"
|
||||
id="stop1452" />
|
||||
<stop
|
||||
offset="1"
|
||||
style="stop-color:#474747"
|
||||
id="stop1454" />
|
||||
</radialGradient>
|
||||
<path
|
||||
style="stroke:none"
|
||||
d="m 23.428,63.07 c 0,1.973 -1.6,3.573 -3.573,3.573 -1.974,0 -3.573,-1.6 -3.573,-3.573 0,-1.974 1.6,-3.573 3.573,-3.573 1.973,0 3.573,1.6 3.573,3.573 z"
|
||||
id="path1456" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:url(#radialGradient2283);fill-rule:nonzero;stroke:none"
|
||||
d="m 9.9950109,29.952326 c 0,0.453204 -0.3675248,0.820499 -0.8207288,0.820499 -0.4534338,0 -0.8207289,-0.367524 -0.8207289,-0.820499 0,-0.453434 0.3675248,-0.820729 0.8207289,-0.820729 0.453204,0 0.8207288,0.367525 0.8207288,0.820729 z"
|
||||
id="path15570" />
|
||||
<path
|
||||
style="fill:url(#radialGradient2285);fill-rule:nonzero;stroke:none"
|
||||
d="m 9.9950109,18.467176 c 0,0.453204 -0.3675248,0.820729 -0.8207288,0.820729 -0.4534338,0 -0.8207289,-0.367525 -0.8207289,-0.820729 0,-0.453434 0.3675248,-0.820729 0.8207289,-0.820729 0.453204,0 0.8207288,0.367525 0.8207288,0.820729 z"
|
||||
id="path15577" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.01754384;display:inline"
|
||||
d="m 55.134004,22.057604 -37.063279,0.01454"
|
||||
id="path15672" />
|
||||
<path
|
||||
id="path4012"
|
||||
d="m 52.524227,25.481953 c 0,0 0,7.218203 0,10.517728 0,3.299525 0,9.279423 0,9.279423 0,0 -5.2823,0 -8.11927,0 -2.83698,0 -8.902579,0 -8.902579,0 0,0 5.371499,-6.247282 8.208469,-9.546808 2.83698,-3.299525 8.81338,-10.250343 8.81338,-10.250343 z"
|
||||
style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.20467828;display:inline"
|
||||
d="M 55.597596,23.076014 18.42567,23.090595"
|
||||
id="path15674" />
|
||||
<path
|
||||
transform="matrix(0.68171292,0,0,0.68171292,-411.28568,14.442144)"
|
||||
d="m 673.51919,30.587521 a 8.8388348,8.8388348 0 1 1 -17.67767,0 8.8388348,8.8388348 0 1 1 17.67767,0 z"
|
||||
id="path4014"
|
||||
style="color:#000000;fill:none;stroke:#204a87;stroke-width:2.93378626000000020;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" />
|
||||
<g
|
||||
transform="matrix(0.02116984,0,0,0.01522076,55.649294,54.012912)"
|
||||
id="g5022"
|
||||
style="stroke-width:112.62601471;display:inline">
|
||||
<rect
|
||||
style="opacity:0.40206185;color:#000000;fill:url(#linearGradient3092);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:112.62601471;marker:none;visibility:visible;display:inline;overflow:visible"
|
||||
id="rect4173"
|
||||
width="1339.6335"
|
||||
height="478.35718"
|
||||
x="-1559.2523"
|
||||
y="-150.69685" />
|
||||
<path
|
||||
style="opacity:0.40206185;color:#000000;fill:url(#radialGradient3094);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:112.62601471;marker:none;visibility:visible;display:inline;overflow:visible"
|
||||
d="m -219.61876,-150.68038 c 0,0 0,478.33079 0,478.33079 142.874166,0.90045 345.40022,-107.16966 345.40014,-239.196175 0,-132.026537 -159.436816,-239.134595 -345.40014,-239.134615 z"
|
||||
id="path5058" />
|
||||
<path
|
||||
id="path5018"
|
||||
d="m -1559.2523,-150.68038 c 0,0 0,478.33079 0,478.33079 -142.8742,0.90045 -345.4002,-107.16966 -345.4002,-239.196175 0,-132.026537 159.4368,-239.134595 345.4002,-239.134615 z"
|
||||
style="opacity:0.40206185;color:#000000;fill:url(#radialGradient3096);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:112.62601471;marker:none;visibility:visible;display:inline;overflow:visible" />
|
||||
</g>
|
||||
<path
|
||||
id="path3343"
|
||||
d="m 20,9 0,10 -17,0 0,14 17,0 0,10 18,-17 z"
|
||||
style="fill:url(#linearGradient3023);fill-opacity:1;fill-rule:evenodd;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
id="path3343-2"
|
||||
d="M 22.006611,13.642998 22,21 5,21 5,31 22,31 21.9934,38.357002 35,26 z"
|
||||
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
</g>
|
||||
<metadata
|
||||
id="metadata4251">
|
||||
<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:title>
|
||||
<cc:license
|
||||
rdf:resource="" />
|
||||
<dc:date>Mon Oct 10 13:44:52 2011 +0000</dc:date>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>[wmayer]</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>FreeCAD LGPL2+</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title>FreeCAD</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier>FreeCAD/src/Mod/Draft/Resources/icons/Draft_Drawing.svg</dc:identifier>
|
||||
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>[agryson] Alexander Gryson</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>arrow</rdf:li>
|
||||
<rdf:li>page</rdf:li>
|
||||
<rdf:li>shapes</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
<dc:description>An arrow pointing from left to right onto a page with shapes drawn on it</dc:description>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 18 KiB |
@@ -143,49 +143,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Default template sheet</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Gui::PrefFileChooser" name="gui::preffilechooser_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>The default template to use when creating a new drawing sheet</string>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>template</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Draft</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
|
||||
@@ -70,7 +70,7 @@ def heal(objlist=None, delete=True, reparent=True):
|
||||
for obj in objlist:
|
||||
dtype = utils.get_type(obj)
|
||||
ftype = obj.TypeId
|
||||
if ftype in ["Part::FeaturePython","App::FeaturePython","Part::Part2DObjectPython","Drawing::FeatureViewPython"]:
|
||||
if ftype in ["Part::FeaturePython","App::FeaturePython","Part::Part2DObjectPython"]:
|
||||
proxy = obj.Proxy
|
||||
if hasattr(obj,"ViewObject"):
|
||||
if hasattr(obj.ViewObject,"Proxy"):
|
||||
@@ -98,8 +98,6 @@ def heal(objlist=None, delete=True, reparent=True):
|
||||
elif ("DrawMode" in props) and ("FacesNumber" in props):
|
||||
print("Healing " + obj.Name + " of type Polygon")
|
||||
nobj = make_copy(obj,force="Polygon",reparent=reparent)
|
||||
elif ("FillStyle" in props) and ("FontSize" in props):
|
||||
nobj = make_copy(obj,force="DrawingView",reparent=reparent)
|
||||
else:
|
||||
dellist.pop()
|
||||
print("Object " + obj.Name + " is not healable")
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
# ***************************************************************************
|
||||
# * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
|
||||
# * (c) 2009, 2010 Ken Cline <cline@frii.com> *
|
||||
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
|
||||
# * *
|
||||
# * This file is part of the FreeCAD CAx development system. *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * 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 Library General Public License for more details. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with FreeCAD; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
"""Provides GUI tools to project an object into a Drawing Workbench page.
|
||||
|
||||
This commands takes a 2D geometrical element and creates a projection
|
||||
that is displayed in a drawing page in the Drawing Workbench.
|
||||
|
||||
This command should be considered obsolete as the Drawing Workbench
|
||||
is obsolete since 0.17.
|
||||
|
||||
A similar command is not planned for the TechDraw Workbench because
|
||||
it is not really necessary. TechDraw has its own set of tools
|
||||
to create 2D projections of 2D and 3D objects.
|
||||
"""
|
||||
## @package gui_drawing
|
||||
# \ingroup draftguitools
|
||||
# \brief Provides GUI tools to project an object into a Drawing Workbench page.
|
||||
|
||||
## \addtogroup draftguitools
|
||||
# @{
|
||||
from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
|
||||
import FreeCAD as App
|
||||
import FreeCADGui as Gui
|
||||
import Draft_rc
|
||||
import Draft
|
||||
import draftutils.utils as utils
|
||||
import draftguitools.gui_base_original as gui_base_original
|
||||
import draftguitools.gui_tool_utils as gui_tool_utils
|
||||
from draftutils.messages import _msg, _wrn
|
||||
from draftutils.translate import translate
|
||||
|
||||
# The module is used to prevent complaints from code checkers (flake8)
|
||||
True if Draft_rc.__name__ else False
|
||||
|
||||
|
||||
class Drawing(gui_base_original.Modifier):
|
||||
"""Gui Command for the Drawing tool.
|
||||
|
||||
This command should be considered obsolete as the Drawing Workbench
|
||||
is obsolete since 0.17.
|
||||
"""
|
||||
|
||||
def GetResources(self):
|
||||
"""Set icon, menu and tooltip."""
|
||||
|
||||
return {'Pixmap': 'Draft_Drawing',
|
||||
# 'Accel': "D, D",
|
||||
'MenuText': QT_TRANSLATE_NOOP("Draft_Drawing", "Drawing"),
|
||||
'ToolTip': QT_TRANSLATE_NOOP("Draft_Drawing", "Creates a 2D projection on a Drawing Workbench page from the selected objects.\nThis command is OBSOLETE since the Drawing Workbench became obsolete in 0.17.\nUse TechDraw Workbench instead for generating technical drawings.")}
|
||||
|
||||
def Activated(self):
|
||||
"""Execute when the command is called."""
|
||||
super(Drawing, self).Activated(name="Drawing")
|
||||
_wrn(translate("draft","The Drawing Workbench is obsolete since 0.17, consider using the TechDraw Workbench instead."))
|
||||
if not Gui.Selection.getSelection():
|
||||
self.ghost = None
|
||||
self.ui.selectUi()
|
||||
_msg(translate("draft", "Select an object to project"))
|
||||
self.call = \
|
||||
self.view.addEventCallback("SoEvent",
|
||||
gui_tool_utils.selectObject)
|
||||
else:
|
||||
self.proceed()
|
||||
|
||||
def proceed(self):
|
||||
"""Proceed with execution of the command after proper selection."""
|
||||
if self.call:
|
||||
self.view.removeEventCallback("SoEvent", self.call)
|
||||
|
||||
sel = Gui.Selection.getSelection()
|
||||
if not sel:
|
||||
self.page = self.createDefaultPage()
|
||||
else:
|
||||
self.page = None
|
||||
# if the user selected a page, put the objects on that page
|
||||
for obj in sel:
|
||||
if obj.isDerivedFrom("Drawing::FeaturePage"):
|
||||
self.page = obj
|
||||
break
|
||||
if not self.page:
|
||||
# no page selected, default to the first page in the document
|
||||
for obj in self.doc.Objects:
|
||||
if obj.isDerivedFrom("Drawing::FeaturePage"):
|
||||
self.page = obj
|
||||
break
|
||||
if not self.page:
|
||||
# no page in the document, create a default page.
|
||||
self.page = self.createDefaultPage()
|
||||
otherProjection = None
|
||||
# if an existing projection is selected,
|
||||
# reuse its projection properties
|
||||
for obj in sel:
|
||||
if obj.isDerivedFrom("Drawing::FeatureView"):
|
||||
otherProjection = obj
|
||||
break
|
||||
sel.reverse()
|
||||
for obj in sel:
|
||||
if (obj.ViewObject.isVisible()
|
||||
and not obj.isDerivedFrom("Drawing::FeatureView")
|
||||
and not obj.isDerivedFrom("Drawing::FeaturePage")):
|
||||
# name = 'View' + obj.Name
|
||||
# no reason to remove the old one...
|
||||
# oldobj = self.page.getObject(name)
|
||||
# if oldobj:
|
||||
# self.doc.removeObject(oldobj.Name)
|
||||
Draft.make_drawing_view(obj, self.page,
|
||||
otherProjection=otherProjection)
|
||||
self.doc.recompute()
|
||||
|
||||
def createDefaultPage(self):
|
||||
"""Create a default Drawing Workbench page."""
|
||||
_t = App.getResourceDir() + 'Mod/Drawing/Templates/A3_Landscape.svg'
|
||||
template = utils.getParam("template", _t)
|
||||
page = self.doc.addObject('Drawing::FeaturePage', 'Page')
|
||||
page.ViewObject.HintOffsetX = 200
|
||||
page.ViewObject.HintOffsetY = 100
|
||||
page.ViewObject.HintScale = 2
|
||||
page.Template = template
|
||||
self.doc.recompute()
|
||||
return page
|
||||
|
||||
|
||||
Gui.addCommand('Draft_Drawing', Drawing())
|
||||
|
||||
## @}
|
||||
@@ -1,111 +0,0 @@
|
||||
# ***************************************************************************
|
||||
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
|
||||
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
|
||||
# * Copyright (c) 2020 FreeCAD Developers *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program 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. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
"""Provides functions to create DrawingView objects.
|
||||
|
||||
These functions must be considered obsolete as the Drawing Workbench
|
||||
is obsolete since v0.17.
|
||||
"""
|
||||
## @package make_drawingview
|
||||
# \ingroup draftmake
|
||||
# \brief Provides functions to create DrawingView objects.
|
||||
|
||||
## \addtogroup draftmake
|
||||
# @{
|
||||
import FreeCAD as App
|
||||
import draftutils.utils as utils
|
||||
|
||||
from draftobjects.drawingview import DrawingView
|
||||
|
||||
|
||||
def make_drawing_view(obj, page, lwmod=None, tmod=None, otherProjection=None):
|
||||
"""
|
||||
make_drawing_view(object,page,[lwmod,tmod])
|
||||
|
||||
This function is OBSOLETE, since TechDraw substituted the Drawing Workbench.
|
||||
Add a View of the given object to the given page.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
lwmod :
|
||||
modifies lineweights (in percent),
|
||||
|
||||
tmod :
|
||||
modifies text heights (in percent).
|
||||
|
||||
The Hint scale, X and Y of the page are used.
|
||||
TODO: Document it properly
|
||||
"""
|
||||
if not App.ActiveDocument:
|
||||
App.Console.PrintError("No active document. Aborting\n")
|
||||
return
|
||||
if utils.get_type(obj) == "SectionPlane":
|
||||
import ArchSectionPlane
|
||||
viewobj = App.ActiveDocument.addObject("Drawing::FeatureViewPython","View")
|
||||
page.addObject(viewobj)
|
||||
ArchSectionPlane._ArchDrawingView(viewobj)
|
||||
viewobj.Source = obj
|
||||
viewobj.Label = "View of "+obj.Name
|
||||
elif utils.get_type(obj) == "Panel":
|
||||
import ArchPanel
|
||||
viewobj = ArchPanel.makePanelView(obj, page)
|
||||
else:
|
||||
viewobj = App.ActiveDocument.addObject("Drawing::FeatureViewPython",
|
||||
"View"+ obj.Name)
|
||||
DrawingView(viewobj)
|
||||
page.addObject(viewobj)
|
||||
if (otherProjection):
|
||||
if hasattr(otherProjection,"Scale"):
|
||||
viewobj.Scale = otherProjection.Scale
|
||||
if hasattr(otherProjection,"X"):
|
||||
viewobj.X = otherProjection.X
|
||||
if hasattr(otherProjection,"Y"):
|
||||
viewobj.Y = otherProjection.Y
|
||||
if hasattr(otherProjection,"Rotation"):
|
||||
viewobj.Rotation = otherProjection.Rotation
|
||||
if hasattr(otherProjection,"Direction"):
|
||||
viewobj.Direction = otherProjection.Direction
|
||||
else:
|
||||
if hasattr(page.ViewObject,"HintScale"):
|
||||
viewobj.Scale = page.ViewObject.HintScale
|
||||
if hasattr(page.ViewObject,"HintOffsetX"):
|
||||
viewobj.X = page.ViewObject.HintOffsetX
|
||||
if hasattr(page.ViewObject,"HintOffsetY"):
|
||||
viewobj.Y = page.ViewObject.HintOffsetY
|
||||
viewobj.Source = obj
|
||||
if lwmod: viewobj.LineweightModifier = lwmod
|
||||
if tmod: viewobj.TextModifier = tmod
|
||||
if hasattr(obj.ViewObject,"Pattern"):
|
||||
if str(obj.ViewObject.Pattern) in list(utils.svgpatterns().keys()):
|
||||
viewobj.FillStyle = str(obj.ViewObject.Pattern)
|
||||
if hasattr(obj.ViewObject,"DrawStyle"):
|
||||
viewobj.LineStyle = obj.ViewObject.DrawStyle
|
||||
if hasattr(obj.ViewObject,"LineColor"):
|
||||
viewobj.LineColor = obj.ViewObject.LineColor
|
||||
elif hasattr(obj.ViewObject,"TextColor"):
|
||||
viewobj.LineColor = obj.ViewObject.TextColor
|
||||
return viewobj
|
||||
|
||||
|
||||
makeDrawingView = make_drawing_view
|
||||
|
||||
## @}
|
||||
@@ -1,192 +0,0 @@
|
||||
# ***************************************************************************
|
||||
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
|
||||
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
|
||||
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
# * it under the terms of the GNU Lesser General Public License (LGPL) *
|
||||
# * as published by the Free Software Foundation; either version 2 of *
|
||||
# * the License, or (at your option) any later version. *
|
||||
# * for detail see the LICENCE text file. *
|
||||
# * *
|
||||
# * This program 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. *
|
||||
# * *
|
||||
# * You should have received a copy of the GNU Library General Public *
|
||||
# * License along with this program; if not, write to the Free Software *
|
||||
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# * USA *
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
"""Provides the object code for the DrawingView object (OBSOLETE).
|
||||
|
||||
This module is obsolete, since the Drawing Workbench stopped
|
||||
being developed in v0.17.
|
||||
The TechDraw Workbench replaces Drawing, and it no longer requires
|
||||
a `DrawingView` object to display objects in a drawing sheet.
|
||||
|
||||
This module is still provided in order to be able to open older files
|
||||
that use this `DrawingView` object. However, a GUI tool to create
|
||||
this object should no longer be available.
|
||||
"""
|
||||
## @package drawingview
|
||||
# \ingroup draftobjects
|
||||
# \brief Provides the object code for the DrawingView object (OBSOLETE).
|
||||
|
||||
## \addtogroup draftobjects
|
||||
# @{
|
||||
from PySide.QtCore import QT_TRANSLATE_NOOP
|
||||
|
||||
import draftfunctions.svg as get_svg
|
||||
import draftfunctions.dxf as get_dxf
|
||||
import draftutils.utils as utils
|
||||
import draftutils.groups as groups
|
||||
|
||||
from draftobjects.base import DraftObject
|
||||
|
||||
|
||||
class DrawingView(DraftObject):
|
||||
"""The DrawingView object. This class is OBSOLETE.
|
||||
|
||||
This object was used with the Drawing Workbench, but since this workbench
|
||||
because obsolete in v0.17, the object should no longer be used.
|
||||
It is retained for compatibility purposes, that is, to open older
|
||||
files that may contain this object.
|
||||
|
||||
To produce 2D drawings, use TechDraw Workbench.
|
||||
"""
|
||||
|
||||
def __init__(self, obj):
|
||||
super(DrawingView, self).__init__(obj, "DrawingView")
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"The linked object")
|
||||
obj.addProperty("App::PropertyLink",
|
||||
"Source",
|
||||
"Base",
|
||||
_tip)
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"Projection direction")
|
||||
obj.addProperty("App::PropertyVector",
|
||||
"Direction",
|
||||
"Shape View",
|
||||
_tip)
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"The width of the lines inside this object")
|
||||
obj.addProperty("App::PropertyFloat",
|
||||
"LineWidth",
|
||||
"View Style",
|
||||
_tip)
|
||||
obj.LineWidth = 0.35
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"The size of the texts inside this object")
|
||||
obj.addProperty("App::PropertyLength",
|
||||
"FontSize",
|
||||
"View Style",
|
||||
_tip)
|
||||
obj.FontSize = 12
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"The spacing between lines of text")
|
||||
obj.addProperty("App::PropertyLength",
|
||||
"LineSpacing",
|
||||
"View Style",
|
||||
_tip)
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"The color of the projected objects")
|
||||
obj.addProperty("App::PropertyColor",
|
||||
"LineColor",
|
||||
"View Style",
|
||||
_tip)
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"Shape Fill Style")
|
||||
obj.addProperty("App::PropertyEnumeration",
|
||||
"FillStyle",
|
||||
"View Style",
|
||||
_tip)
|
||||
obj.FillStyle = ['shape color'] + list(utils.svgpatterns().keys())
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"Line Style")
|
||||
obj.addProperty("App::PropertyEnumeration",
|
||||
"LineStyle",
|
||||
"View Style",
|
||||
_tip)
|
||||
obj.LineStyle = ['Solid', 'Dashed', 'Dotted', 'Dashdot']
|
||||
|
||||
_tip = QT_TRANSLATE_NOOP("App::Property",
|
||||
"If checked, source objects are displayed "
|
||||
"regardless of being visible in the 3D model")
|
||||
obj.addProperty("App::PropertyBool",
|
||||
"AlwaysOn",
|
||||
"View Style",
|
||||
_tip)
|
||||
|
||||
def execute(self, obj):
|
||||
"""Execute when the object is created or recomputed."""
|
||||
result = ""
|
||||
if hasattr(obj, "Source") and obj.Source:
|
||||
if hasattr(obj, "LineStyle"):
|
||||
ls = obj.LineStyle
|
||||
else:
|
||||
ls = None
|
||||
if hasattr(obj, "LineColor"):
|
||||
lc = obj.LineColor
|
||||
else:
|
||||
lc = None
|
||||
if hasattr(obj, "LineSpacing"):
|
||||
lp = obj.LineSpacing
|
||||
else:
|
||||
lp = None
|
||||
|
||||
if obj.Source.isDerivedFrom("App::DocumentObjectGroup"):
|
||||
svg = ""
|
||||
objs = groups.get_group_contents([obj.Source])
|
||||
for o in objs:
|
||||
v = o.ViewObject.isVisible()
|
||||
if hasattr(obj, "AlwaysOn") and obj.AlwaysOn:
|
||||
v = True
|
||||
if v:
|
||||
svg += get_svg.get_svg(o,
|
||||
obj.Scale,
|
||||
obj.LineWidth,
|
||||
obj.FontSize.Value,
|
||||
obj.FillStyle,
|
||||
obj.Direction, ls, lc, lp)
|
||||
else:
|
||||
svg = get_svg.get_svg(obj.Source,
|
||||
obj.Scale,
|
||||
obj.LineWidth,
|
||||
obj.FontSize.Value,
|
||||
obj.FillStyle,
|
||||
obj.Direction, ls, lc, lp)
|
||||
|
||||
result += '<g id="' + obj.Name + '"'
|
||||
result += ' transform="'
|
||||
result += 'rotate(' + str(obj.Rotation) + ','
|
||||
result += str(obj.X) + ',' + str(obj.Y)
|
||||
result += ') '
|
||||
result += 'translate(' + str(obj.X) + ',' + str(obj.Y) + ') '
|
||||
result += 'scale(' + str(obj.Scale) + ',' + str(-obj.Scale)
|
||||
result += ')'
|
||||
result += '">'
|
||||
result += svg
|
||||
result += '</g>'
|
||||
obj.ViewResult = result
|
||||
|
||||
def getDXF(self, obj):
|
||||
"""Return a DXF fragment."""
|
||||
return get_dxf.get_dxf(obj)
|
||||
|
||||
|
||||
# Alias for compatibility with v0.18 and earlier
|
||||
_DrawingView = DrawingView
|
||||
|
||||
## @}
|
||||
@@ -172,7 +172,7 @@ def get_param_type(param):
|
||||
"snapStyle", "dimstyle", "gridSize", "gridTransparency"):
|
||||
return "int"
|
||||
elif param in ("constructiongroupname", "textfont",
|
||||
"patternFile", "template", "snapModes",
|
||||
"patternFile", "snapModes",
|
||||
"FontFile", "ClonePrefix", "overrideUnit",
|
||||
"labeltype", "gridSpacing") or "inCommandShortcut" in param:
|
||||
return "string"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"""Provides support for importing and exporting SVG files.
|
||||
|
||||
It enables importing/exporting objects directly to/from the 3D document
|
||||
but doesn't handle the SVG output from the Drawing and TechDraw modules.
|
||||
but doesn't handle the SVG output from the TechDraw module.
|
||||
|
||||
Currently it only reads the following entities:
|
||||
* paths, lines, circular arcs, rects, circles, ellipses, polygons, polylines.
|
||||
|
||||