Merge branch 'master' of ssh://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad

This commit is contained in:
wmayer 2012-12-19 12:11:06 +01:00
commit 343effebc2
9 changed files with 49 additions and 34 deletions

View File

@ -1796,7 +1796,8 @@ class _ViewProviderDraft:
def unsetEdit(self,vp,mode):
if FreeCAD.activeDraftCommand:
FreeCAD.activeDraftCommand.finish()
return
FreeCADGui.Control.closeDialog()
return False
def getIcon(self):
return(":/icons/Draft_Draft.svg")

View File

@ -908,6 +908,7 @@ class DraftToolBar:
if self.cancel:
self.cancel()
self.cancel = None
FreeCADGui.ActiveDocument.resetEdit()
def escape(self):
"escapes the current command"
@ -919,6 +920,7 @@ class DraftToolBar:
def closeLine(self):
"close button action"
self.sourceCmd.finish(True)
FreeCADGui.ActiveDocument.resetEdit()
def wipeLine(self):
"wipes existing segments of a line"

View File

@ -3114,12 +3114,17 @@ class Edit(Modifier):
Modifier.finish(self)
plane.restore()
self.running = False
FreeCADGui.ActiveDocument.resetEdit()
def action(self,arg):
"scene event handler"
if arg["Type"] == "SoKeyboardEvent":
if arg["Key"] == "ESCAPE":
self.finish()
elif arg["Key"] == "f":
self.finish()
elif arg["Key"] == "c":
self.finish(closed=True)
elif arg["Type"] == "SoLocation2Event": #mouse movement detection
if self.editing != None:
self.point,ctrlPoint,info = getPoint(self,arg)

View File

@ -14,7 +14,7 @@
height="64px"
id="svg2726"
sodipodi:version="0.32"
inkscape:version="0.48.1 r9760"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Snap_Grid.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
@ -88,10 +88,10 @@
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1280"
inkscape:window-height="755"
inkscape:window-width="1920"
inkscape:window-height="1057"
inkscape:window-x="0"
inkscape:window-y="22"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata2731">
@ -113,13 +113,12 @@
id="g4289"
transform="matrix(0.1621282,0,0,0.1621282,6.3605986,-66.108806)">
<path
sodipodi:type="inkscape:offset"
inkscape:radius="2.8284271"
inkscape:original="M 12.90625 7.03125 L 12.90625 16 L 4.9375 16 L 4.9375 21.65625 L 12.90625 21.65625 L 12.90625 46 L 4.9375 46 L 4.9375 51.65625 L 12.90625 51.65625 L 12.90625 58.46875 L 18.5625 58.46875 L 18.5625 51.65625 L 40.90625 51.65625 L 40.90625 58.46875 L 46.5625 58.46875 L 46.5625 51.65625 L 56.125 51.65625 L 56.125 46 L 46.5625 46 L 46.5625 21.65625 L 56.125 21.65625 L 56.125 16 L 46.5625 16 L 46.5625 7.03125 L 40.90625 7.03125 L 40.90625 16 L 18.5625 16 L 18.5625 7.03125 L 12.90625 7.03125 z M 18.5625 21.65625 L 40.90625 21.65625 L 40.90625 46 L 18.5625 46 L 18.5625 21.65625 z "
style="color:#000000;fill:#00b286;fill-opacity:1;fill-rule:nonzero;stroke:#002e2e;stroke-width:4.00000003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
transform="matrix(6.1679584,0,0,6.1679584,-28.130145,407.75637)"
style="color:#000000;fill:#00b286;fill-opacity:1;fill-rule:nonzero;stroke:#002e2e;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="M 12.90625,4.1875 C 11.415109,4.17955 10.05455,5.5401086 10.0625,7.03125 l 0,6.125 -5.125,0 C 3.4463586,13.1483 2.0858004,14.508859 2.09375,16 l 0,5.65625 C 2.0858,23.147391 3.4463586,24.50795 4.9375,24.5 l 5.125,0 0,18.65625 -5.125,0 C 3.4463586,43.1483 2.0858004,44.508859 2.09375,46 l 0,5.65625 C 2.0858,53.147391 3.4463586,54.50795 4.9375,54.5 l 5.125,0 0,3.96875 c -0.0079,1.491141 1.352609,2.8517 2.84375,2.84375 l 5.65625,0 c 1.491141,0.008 2.8517,-1.352609 2.84375,-2.84375 l 0,-3.96875 16.65625,0 0,3.96875 c -0.008,1.491141 1.352609,2.8517 2.84375,2.84375 l 5.65625,0 c 1.491141,0.008 2.8517,-1.352609 2.84375,-2.84375 l 0,-3.96875 6.71875,0 c 1.491141,0.008 2.8517,-1.352609 2.84375,-2.84375 l 0,-5.65625 c 0.008,-1.491141 -1.352609,-2.8517 -2.84375,-2.84375 l -6.71875,0 0,-18.65625 6.71875,0 c 1.491141,0.008 2.8517,-1.352609 2.84375,-2.84375 l 0,-5.65625 c 0.008,-1.491141 -1.352609,-2.8517 -2.84375,-2.84375 l -6.71875,0 0,-6.125 C 49.4142,5.5401086 48.053641,4.1795504 46.5625,4.1875 l -5.65625,0 C 39.415109,4.17955 38.05455,5.5401086 38.0625,7.03125 l 0,6.125 -16.65625,0 0,-6.125 C 21.4142,5.5401086 20.053641,4.1795504 18.5625,4.1875 z m 8.5,20.3125 c 0,0 5.037824,0 7.813866,0 2.776041,0 8.842384,0 8.842384,0 0,0 0.25713,5.190231 0.25713,8.299606 0,3.109375 -0.25713,10.356644 -0.25713,10.356644 0,0 -5.552083,0.128565 -8.328125,0.128565 -2.776042,0 -8.328125,-0.128565 -8.328125,-0.128565 0,0 -0.128565,-6.733009 -0.128565,-9.842384 0,-3.109375 0.128565,-8.813866 0.128565,-8.813866 z"
id="path3775"
d="M 12.90625,4.1875 A 2.8287099,2.8287099 0 0 0 10.0625,7.03125 l 0,6.125 -5.125,0 A 2.8287099,2.8287099 0 0 0 2.09375,16 l 0,5.65625 A 2.8287099,2.8287099 0 0 0 4.9375,24.5 l 5.125,0 0,18.65625 -5.125,0 A 2.8287099,2.8287099 0 0 0 2.09375,46 l 0,5.65625 A 2.8287099,2.8287099 0 0 0 4.9375,54.5 l 5.125,0 0,3.96875 a 2.8287099,2.8287099 0 0 0 2.84375,2.84375 l 5.65625,0 a 2.8287099,2.8287099 0 0 0 2.84375,-2.84375 l 0,-3.96875 16.65625,0 0,3.96875 a 2.8287099,2.8287099 0 0 0 2.84375,2.84375 l 5.65625,0 a 2.8287099,2.8287099 0 0 0 2.84375,-2.84375 l 0,-3.96875 6.71875,0 a 2.8287099,2.8287099 0 0 0 2.84375,-2.84375 l 0,-5.65625 A 2.8287099,2.8287099 0 0 0 56.125,43.15625 l -6.71875,0 0,-18.65625 6.71875,0 a 2.8287099,2.8287099 0 0 0 2.84375,-2.84375 l 0,-5.65625 A 2.8287099,2.8287099 0 0 0 56.125,13.15625 l -6.71875,0 0,-6.125 A 2.8287099,2.8287099 0 0 0 46.5625,4.1875 l -5.65625,0 A 2.8287099,2.8287099 0 0 0 38.0625,7.03125 l 0,6.125 -16.65625,0 0,-6.125 A 2.8287099,2.8287099 0 0 0 18.5625,4.1875 l -5.65625,0 z m 8.5,20.3125 16.65625,0 0,18.65625 -16.65625,0 0,-18.65625 z"
transform="matrix(6.1679584,0,0,6.1679584,-28.130145,407.75637)" />
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccccccczczczczc" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -14,7 +14,7 @@
height="64px"
id="svg2726"
sodipodi:version="0.32"
inkscape:version="0.48.1 r9760"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Snap_Ortho.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
@ -196,17 +196,17 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.75"
inkscape:cx="12.13888"
inkscape:cy="24.347498"
inkscape:zoom="11"
inkscape:cx="22.199652"
inkscape:cy="28.79221"
inkscape:current-layer="g4289"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1280"
inkscape:window-height="755"
inkscape:window-x="0"
inkscape:window-y="22"
inkscape:window-height="777"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata2731">
@ -228,10 +228,11 @@
id="g4289"
transform="matrix(0.1621282,0,0,0.1621282,6.3605986,-66.108806)">
<path
style="color:#000000;fill:#00b286;fill-opacity:1;fill-rule:nonzero;stroke:#002e2e;stroke-width:24.16598901;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"
d="m 138.09323,476.2983 0,99.86419 -99.86419,0 0,49.08818 99.86419,0 0,99.86418 49.08818,0 0,-99.86418 99.86419,0 0,-49.08818 -99.86419,0 0,-99.86419 -49.08818,0 z"
style="color:#000000;fill:#00b286;fill-opacity:1;fill-rule:nonzero;stroke:#002e2e;stroke-width:24.16598892;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"
d="m 138.09323,476.2983 c 0,0 0.56072,34.97023 0.56072,51.61427 0,16.64403 -0.56072,48.24992 -0.56072,48.24992 0,0 -32.16661,0 -48.810648,0 -16.644032,0 -51.053542,0 -51.053542,0 l 0,49.08818 99.86419,0 c 0,0 0,34.97023 0,51.61426 0,16.64403 0,48.24992 0,48.24992 l 49.08818,0 0,-99.86418 99.86419,0 0,-49.08818 c 0,0 -33.84879,-1.12145 -50.49282,-1.12145 -16.64404,0 -49.37137,1.12145 -49.37137,1.12145 0,0 0.55862,-32.72629 0.56072,-49.37137 0.002,-16.64508 -0.56072,-50.49282 -0.56072,-50.49282 z"
id="rect6083"
inkscape:connector-curvature="0" />
inkscape:connector-curvature="0"
sodipodi:nodetypes="czczccczccccczczcc" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -14,7 +14,7 @@
height="64px"
id="svg2726"
sodipodi:version="0.32"
inkscape:version="0.48.1 r9760"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Snap_Perpendicular.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
@ -58,17 +58,17 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.8890873"
inkscape:cx="21.852178"
inkscape:cy="16.273213"
inkscape:zoom="7.7781746"
inkscape:cx="24.45243"
inkscape:cy="13.674951"
inkscape:current-layer="g4289"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1280"
inkscape:window-height="755"
inkscape:window-width="1920"
inkscape:window-height="1057"
inkscape:window-x="0"
inkscape:window-y="22"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata2731">
@ -91,9 +91,10 @@
transform="matrix(0.1621282,0,0,0.1621282,6.3605986,-66.108806)">
<path
style="color:#000000;fill:#00b286;fill-opacity:1;fill-rule:nonzero;stroke:#002e2e;stroke-width:29.87757301;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"
d="m 126.31496,439.55224 0,254.71983 -137.088541,0 0,69.15728 340.250461,0 0,-69.15728 -132.51282,0 0,-254.71983 -70.6491,0 z"
d="m 126.31496,439.55224 c 0,0 -0.79298,86.49258 -0.79298,128.94588 0,42.45331 0.79298,125.77395 0.79298,125.77395 l -137.088541,0 0,69.15728 c 0,0 111.830851,0.79298 168.539261,0.79298 56.70841,0 171.7112,-0.79298 171.7112,-0.79298 l 0,-69.15728 -132.51282,0 c 0,0 0.79298,-56.05449 0.79298,-121.80903 0,-65.75454 -0.79298,-132.9108 -0.79298,-132.9108 z"
id="rect3942"
inkscape:connector-curvature="0" />
inkscape:connector-curvature="0"
sodipodi:nodetypes="czccczccczcc" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -199,6 +199,8 @@ class AddSCADTask:
FreeCAD.Console.PrintError(unicode(translate('OpenSCAD','Running OpenSCAD failed'))+u'\n')
class AddOpenSCADElement:
def IsActive(self):
return not FreeCADGui.Control.activeDialog()
def Activated(self):
panel = AddSCADTask()
FreeCADGui.Control.showDialog(panel)

View File

@ -539,7 +539,10 @@ def p_linear_extrude_with_twist(p):
print "Linear Extrude With Twist"
h = float(p[3]['height'])
print "Twist : ",p[3]
t = float(p[3]['twist'])
if 'twist' in p[3]:
t = float(p[3]['twist'])
else:
t = 0
if (len(p[6]) > 1) :
obj = fuse(p[6],"Linear Extrude Union")
else :
@ -862,7 +865,7 @@ def p_square_action(p) :
mysquare = doc.addObject('Part::Plane',p[1])
mysquare.Length=x
mysquare.Width=y
if p[9]=='true' :
if p[3]['center']=='true' :
center(mysquare,x,y,0)
p[0] = [mysquare]

View File

@ -11,14 +11,15 @@ def replaceobj(parent,oldchild,newchild):
setattr(parent,propname,newchild)
print propname, parent.getPropertyByName(propname)
#else: print propname,propvalue
parent.touch()
def replaceobjfromselection(objs):
assert(len(objs)==3)
if objs[0] in objs[1].InList: parent, oldchild, newchild = objs
if objs[2] in objs[0].InList: oldchild, newchild, parent = objs
elif objs[0] in objs[1].InList: parent, oldchild, newchild = objs
elif objs[0] in objs[2].InList: parent, newchild, oldchild = objs
elif objs[1] in objs[0].InList: oldchild, parent, newchild = objs
elif objs[1] in objs[2].InList: newchild, parent, oldchild = objs
elif objs[2] in objs[0].InList: oldchild, newchild, parent = objs
elif objs[2] in objs[1].InList: newchild, oldchild, parent = objs
else: assert(False)
replaceobj(parent,oldchild,newchild)