Draft: Small fix to Point tool

This commit is contained in:
Yorik van Havre
2012-09-01 17:08:04 -03:00
parent f1a3e3d0f2
commit 71618a405b

View File

@@ -3752,6 +3752,9 @@ class Point:
def Activated(self):
self.view = Draft.get3DView()
self.stack = []
rot = self.view.getCameraNode().getField("orientation").getValue()
upv = Vector(rot.multVec(coin.SbVec3f(0,1,0)).getValue())
plane.setup(DraftVecUtils.neg(self.view.getViewDirection()), Vector(0,0,0), upv)
self.point = None
# adding 2 callback functions
self.callbackClick = self.view.addEventCallbackPivy(coin.SoMouseButtonEvent.getClassTypeId(),self.click)
@@ -3772,7 +3775,7 @@ class Point:
self.view.removeEventCallbackPivy(coin.SoMouseButtonEvent.getClassTypeId(),self.callbackClick)
self.view.removeEventCallbackPivy(coin.SoLocation2Event.getClassTypeId(),self.callbackMove)
FreeCAD.ActiveDocument.openTransaction("Create Point")
Draft.makePoint((self.stack[0][0]),(self.stack[0][1]),0.0)
Draft.makePoint((self.stack[0][0]),(self.stack[0][1]),self.stack[0][2])
FreeCAD.ActiveDocument.commitTransaction()
FreeCADGui.Snapper.off()