Draft: various cleanup
Mainly added an empty line at the end of each file and changed docstrings.
This commit is contained in:
committed by
Yorik van Havre
parent
2c4de88132
commit
125d0ca84d
@@ -60,49 +60,53 @@ def array(objectslist, arg1, arg2, arg3, arg4=None, arg5=None, arg6=None):
|
||||
array(objectslist, center, totalangle, totalnum) for polar array
|
||||
"""
|
||||
|
||||
def rectArray(objectslist,xvector,yvector,xnum,ynum):
|
||||
utils.type_check([(xvector, App.Vector),
|
||||
(yvector, App.Vector),
|
||||
(xnum,int), (ynum,int)],
|
||||
"rectArray")
|
||||
if not isinstance(objectslist,list): objectslist = [objectslist]
|
||||
for xcount in range(xnum):
|
||||
currentxvector=App.Vector(xvector).multiply(xcount)
|
||||
if not xcount==0:
|
||||
move(objectslist,currentxvector,True)
|
||||
for ycount in range(ynum):
|
||||
currentxvector=App.Vector(currentxvector)
|
||||
currentyvector=currentxvector.add(App.Vector(yvector).multiply(ycount))
|
||||
if not ycount==0:
|
||||
move(objectslist,currentyvector,True)
|
||||
|
||||
def rectArray2(objectslist,xvector,yvector,zvector,xnum,ynum,znum):
|
||||
utils.type_check([(xvector,App.Vector), (yvector,App.Vector), (zvector,App.Vector),(xnum,int), (ynum,int),(znum,int)], "rectArray2")
|
||||
if not isinstance(objectslist,list): objectslist = [objectslist]
|
||||
for xcount in range(xnum):
|
||||
currentxvector=App.Vector(xvector).multiply(xcount)
|
||||
if not xcount==0:
|
||||
move(objectslist,currentxvector,True)
|
||||
for ycount in range(ynum):
|
||||
currentxvector=App.Vector(currentxvector)
|
||||
currentyvector=currentxvector.add(App.Vector(yvector).multiply(ycount))
|
||||
if not ycount==0:
|
||||
move(objectslist,currentyvector,True)
|
||||
for zcount in range(znum):
|
||||
currentzvector=currentyvector.add(App.Vector(zvector).multiply(zcount))
|
||||
if not zcount==0:
|
||||
move(objectslist,currentzvector,True)
|
||||
|
||||
def polarArray(objectslist,center,angle,num):
|
||||
utils.type_check([(center,App.Vector), (num,int)], "polarArray")
|
||||
if not isinstance(objectslist,list): objectslist = [objectslist]
|
||||
fraction = float(angle)/num
|
||||
for i in range(num):
|
||||
currangle = fraction + (i*fraction)
|
||||
rotate(objectslist,currangle,center,copy=True)
|
||||
if arg6:
|
||||
rectArray2(objectslist,arg1,arg2,arg3,arg4,arg5,arg6)
|
||||
rectArray2(objectslist, arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
elif arg4:
|
||||
rectArray(objectslist,arg1,arg2,arg3,arg4)
|
||||
rectArray(objectslist, arg1,arg2, arg3, arg4)
|
||||
else:
|
||||
polarArray(objectslist,arg1,arg2,arg3)
|
||||
polarArray(objectslist, arg1, arg2, arg3)
|
||||
|
||||
|
||||
def rectArray(objectslist,xvector,yvector,xnum,ynum):
|
||||
utils.type_check([(xvector, App.Vector),
|
||||
(yvector, App.Vector),
|
||||
(xnum,int), (ynum,int)],
|
||||
"rectArray")
|
||||
if not isinstance(objectslist,list): objectslist = [objectslist]
|
||||
for xcount in range(xnum):
|
||||
currentxvector=App.Vector(xvector).multiply(xcount)
|
||||
if not xcount==0:
|
||||
move(objectslist,currentxvector,True)
|
||||
for ycount in range(ynum):
|
||||
currentxvector=App.Vector(currentxvector)
|
||||
currentyvector=currentxvector.add(App.Vector(yvector).multiply(ycount))
|
||||
if not ycount==0:
|
||||
move(objectslist,currentyvector,True)
|
||||
|
||||
|
||||
def rectArray2(objectslist,xvector,yvector,zvector,xnum,ynum,znum):
|
||||
utils.type_check([(xvector,App.Vector), (yvector,App.Vector), (zvector,App.Vector),(xnum,int), (ynum,int),(znum,int)], "rectArray2")
|
||||
if not isinstance(objectslist,list): objectslist = [objectslist]
|
||||
for xcount in range(xnum):
|
||||
currentxvector=App.Vector(xvector).multiply(xcount)
|
||||
if not xcount==0:
|
||||
move(objectslist,currentxvector,True)
|
||||
for ycount in range(ynum):
|
||||
currentxvector=App.Vector(currentxvector)
|
||||
currentyvector=currentxvector.add(App.Vector(yvector).multiply(ycount))
|
||||
if not ycount==0:
|
||||
move(objectslist,currentyvector,True)
|
||||
for zcount in range(znum):
|
||||
currentzvector=currentyvector.add(App.Vector(zvector).multiply(zcount))
|
||||
if not zcount==0:
|
||||
move(objectslist,currentzvector,True)
|
||||
|
||||
|
||||
def polarArray(objectslist,center,angle,num):
|
||||
utils.type_check([(center,App.Vector), (num,int)], "polarArray")
|
||||
if not isinstance(objectslist,list): objectslist = [objectslist]
|
||||
fraction = float(angle)/num
|
||||
for i in range(num):
|
||||
currangle = fraction + (i*fraction)
|
||||
rotate(objectslist,currangle,center,copy=True)
|
||||
|
||||
@@ -271,4 +271,3 @@ def downgrade(objects, delete=False, force=None):
|
||||
App.ActiveDocument.removeObject(n)
|
||||
gui_utils.select(addList)
|
||||
return [addList,deleteList]
|
||||
|
||||
|
||||
@@ -112,4 +112,4 @@ def heal(objlist=None, delete=True, reparent=True):
|
||||
|
||||
if dellist and delete:
|
||||
for n in dellist:
|
||||
App.ActiveDocument.removeObject(n)
|
||||
App.ActiveDocument.removeObject(n)
|
||||
|
||||
@@ -88,4 +88,4 @@ def join_two_wires(wire1, wire2):
|
||||
return True
|
||||
|
||||
|
||||
joinTwoWires = join_two_wires
|
||||
joinTwoWires = join_two_wires
|
||||
|
||||
@@ -169,6 +169,10 @@ def move(objectslist, vector, copy=False):
|
||||
|
||||
|
||||
def move_vertex(object, vertex_index, vector):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
points = object.Points
|
||||
points[vertex_index] = points[vertex_index].add(vector)
|
||||
object.Points = points
|
||||
@@ -178,6 +182,10 @@ moveVertex = move_vertex
|
||||
|
||||
|
||||
def move_edge(object, edge_index, vector):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
moveVertex(object, edge_index, vector)
|
||||
if utils.isClosedEdge(edge_index, object):
|
||||
moveVertex(object, 0, vector)
|
||||
@@ -189,6 +197,10 @@ moveEdge = move_edge
|
||||
|
||||
|
||||
def copy_moved_edges(arguments):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
copied_edges = []
|
||||
for argument in arguments:
|
||||
copied_edges.append(copy_moved_edge(argument[0], argument[1], argument[2]))
|
||||
@@ -199,6 +211,10 @@ copyMovedEdges = copy_moved_edges
|
||||
|
||||
|
||||
def copy_moved_edge(object, edge_index, vector):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
vertex1 = object.Placement.multVec(object.Points[edge_index]).add(vector)
|
||||
if utils.isClosedEdge(edge_index, object):
|
||||
vertex2 = object.Placement.multVec(object.Points[0]).add(vector)
|
||||
|
||||
@@ -154,6 +154,10 @@ def rotate(objectslist, angle, center=App.Vector(0,0,0),
|
||||
|
||||
|
||||
def rotate_vertex(object, vertex_index, angle, center, axis):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
points = object.Points
|
||||
points[vertex_index] = object.Placement.inverse().multVec(
|
||||
rotate_vector_from_center(
|
||||
@@ -166,6 +170,10 @@ rotateVertex = rotate_vertex
|
||||
|
||||
|
||||
def rotate_vector_from_center(vector, angle, axis, center):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
rv = vector.sub(center)
|
||||
rv = DraftVecUtils.rotate(rv, math.radians(angle), axis)
|
||||
return center.add(rv)
|
||||
@@ -175,6 +183,10 @@ rotateVectorFromCenter = rotate_vector_from_center
|
||||
|
||||
|
||||
def rotate_edge(object, edge_index, angle, center, axis):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
rotateVertex(object, edge_index, angle, center, axis)
|
||||
if utils.isClosedEdge(edge_index, object):
|
||||
rotateVertex(object, 0, angle, center, axis)
|
||||
@@ -186,6 +198,10 @@ rotateEdge = rotate_edge
|
||||
|
||||
|
||||
def copy_rotated_edges(arguments):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
copied_edges = []
|
||||
for argument in arguments:
|
||||
copied_edges.append(copy_rotated_edge(argument[0], argument[1],
|
||||
@@ -197,6 +213,10 @@ copyRotatedEdges = copy_rotated_edges
|
||||
|
||||
|
||||
def copy_rotated_edge(object, edge_index, angle, center, axis):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
vertex1 = rotate_vector_from_center(
|
||||
object.Placement.multVec(object.Points[edge_index]),
|
||||
angle, axis, center)
|
||||
@@ -208,4 +228,5 @@ def copy_rotated_edge(object, edge_index, angle, center, axis):
|
||||
vertex2 = rotate_vector_from_center(
|
||||
object.Placement.multVec(object.Points[edge_index+1]),
|
||||
angle, axis, center)
|
||||
return make_line(vertex1, vertex2)
|
||||
return make_line(vertex1, vertex2)
|
||||
|
||||
@@ -129,6 +129,10 @@ def scale(objectslist, scale=App.Vector(1,1,1),
|
||||
|
||||
|
||||
def scale_vertex(obj, vertex_index, scale, center):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
points = obj.Points
|
||||
points[vertex_index] = obj.Placement.inverse().multVec(
|
||||
scaleVectorFromCenter(
|
||||
@@ -141,6 +145,10 @@ scaleVertex = scale_vertex
|
||||
|
||||
|
||||
def scale_vector_from_center(vector, scale, center):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
return vector.sub(center).scale(scale.x, scale.y, scale.z).add(center)
|
||||
|
||||
|
||||
@@ -148,6 +156,10 @@ scaleVectorFromCenter = scale_vector_from_center
|
||||
|
||||
|
||||
def scale_edge(obj, edge_index, scale, center):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
scaleVertex(obj, edge_index, scale, center)
|
||||
if utils.isClosedEdge(edge_index, obj):
|
||||
scaleVertex(obj, 0, scale, center)
|
||||
@@ -159,6 +171,10 @@ scaleEdge = scale_edge
|
||||
|
||||
|
||||
def copy_scaled_edge(obj, edge_index, scale, center):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
import Part
|
||||
vertex1 = scaleVectorFromCenter(
|
||||
obj.Placement.multVec(obj.Points[edge_index]),
|
||||
@@ -178,6 +194,10 @@ copyScaledEdge = copy_scaled_edge
|
||||
|
||||
|
||||
def copy_scaled_edges(arguments):
|
||||
"""
|
||||
Needed for SubObjects modifiers.
|
||||
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).
|
||||
"""
|
||||
copied_edges = []
|
||||
for argument in arguments:
|
||||
copied_edges.append(copyScaledEdge(argument[0], argument[1],
|
||||
@@ -185,4 +205,4 @@ def copy_scaled_edges(arguments):
|
||||
join_wires(copied_edges)
|
||||
|
||||
|
||||
copyScaledEdges = copy_scaled_edges
|
||||
copyScaledEdges = copy_scaled_edges
|
||||
|
||||
@@ -70,4 +70,4 @@ def split_open_wire(wire, newPoint, edgeIndex):
|
||||
make_wire(wire2Points, placement=wire.Placement)
|
||||
|
||||
|
||||
splitOpenWire = split_open_wire
|
||||
splitOpenWire = split_open_wire
|
||||
|
||||
@@ -45,7 +45,7 @@ def make_array(baseobject, arg1, arg2, arg3, arg4=None,
|
||||
|
||||
|
||||
Rectangular array
|
||||
------
|
||||
-----------------
|
||||
make_array(object,xvector,yvector,xnum,ynum,[name])
|
||||
makeArray(object,xvector,yvector,zvector,xnum,ynum,znum,[name])
|
||||
|
||||
@@ -55,7 +55,7 @@ def make_array(baseobject, arg1, arg2, arg3, arg4=None,
|
||||
|
||||
|
||||
Polar array
|
||||
------
|
||||
-----------
|
||||
makeArray(object,center,totalangle,totalnum,[name]) for polar array, or
|
||||
|
||||
center is a vector, totalangle is the angle to cover (in degrees) and totalnum
|
||||
@@ -63,7 +63,7 @@ def make_array(baseobject, arg1, arg2, arg3, arg4=None,
|
||||
|
||||
|
||||
Circular array
|
||||
------
|
||||
--------------
|
||||
makeArray(object,rdistance,tdistance,axis,center,ncircles,symmetry,[name])
|
||||
|
||||
In case of a circular array, rdistance is the distance of the
|
||||
@@ -122,4 +122,4 @@ def make_array(baseobject, arg1, arg2, arg3, arg4=None,
|
||||
return obj
|
||||
|
||||
|
||||
makeArray = make_array
|
||||
makeArray = make_array
|
||||
|
||||
@@ -60,4 +60,4 @@ def make_block(objectslist):
|
||||
return obj
|
||||
|
||||
|
||||
makeBlock = make_block
|
||||
makeBlock = make_block
|
||||
|
||||
@@ -132,4 +132,4 @@ def make_circle(radius, placement=None, face=None, startangle=None, endangle=Non
|
||||
return obj
|
||||
|
||||
|
||||
makeCircle = make_circle
|
||||
makeCircle = make_circle
|
||||
|
||||
@@ -130,4 +130,4 @@ def make_clone(obj, delta=None, forcedraft=False):
|
||||
return cl
|
||||
|
||||
|
||||
clone = make_clone
|
||||
clone = make_clone
|
||||
|
||||
@@ -208,4 +208,5 @@ def make_copy(obj, force=None, reparent=False):
|
||||
setattr(par, prop, newobj)
|
||||
|
||||
gui_utils.format_object(newobj, obj)
|
||||
return newobj
|
||||
return newobj
|
||||
|
||||
@@ -21,10 +21,11 @@
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
"""This module provides the code for Draft make_drawing_view function.
|
||||
OBSOLETE: Drawing Workbench was substituted by TechDraw.
|
||||
"""
|
||||
## @package make_drawingview
|
||||
# \ingroup DRAFT
|
||||
# \brief This module provides the code for Draft make_drawing_view function.
|
||||
# \brief This module provides the code for Draft make_drawing_view function
|
||||
|
||||
import FreeCAD as App
|
||||
|
||||
@@ -37,6 +38,7 @@ 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
|
||||
@@ -101,4 +103,4 @@ def make_drawing_view(obj, page, lwmod=None, tmod=None, otherProjection=None):
|
||||
return viewobj
|
||||
|
||||
|
||||
makeDrawingView = make_drawing_view
|
||||
makeDrawingView = make_drawing_view
|
||||
|
||||
@@ -82,4 +82,4 @@ def make_ellipse(majradius, minradius, placement=None, face=True, support=None):
|
||||
return obj
|
||||
|
||||
|
||||
makeEllipse = make_ellipse
|
||||
makeEllipse = make_ellipse
|
||||
|
||||
@@ -63,4 +63,4 @@ def make_facebinder(selectionset, name="Facebinder"):
|
||||
return fb
|
||||
|
||||
|
||||
makeFacebinder = make_facebinder
|
||||
makeFacebinder = make_facebinder
|
||||
|
||||
@@ -70,4 +70,4 @@ def make_line(first_param, last_param=None):
|
||||
return obj
|
||||
|
||||
|
||||
makeLine = make_line
|
||||
makeLine = make_line
|
||||
|
||||
@@ -110,4 +110,5 @@ def make_path_array(baseobject,pathobject,count,xlate=None,align=False,pathobjsu
|
||||
gui_utils.select(obj)
|
||||
return obj
|
||||
|
||||
makePathArray = make_path_array
|
||||
|
||||
makePathArray = make_path_array
|
||||
|
||||
@@ -93,4 +93,4 @@ def make_point(X=0, Y=0, Z=0, color=None, name = "Point", point_size= 5):
|
||||
return obj
|
||||
|
||||
|
||||
makePoint = make_point
|
||||
makePoint = make_point
|
||||
|
||||
@@ -63,4 +63,4 @@ def make_point_array(base, ptlst):
|
||||
return obj
|
||||
|
||||
|
||||
makePointArray = make_point_array
|
||||
makePointArray = make_point_array
|
||||
|
||||
@@ -88,4 +88,4 @@ def make_polygon(nfaces, radius=1, inscribed=True, placement=None, face=None, su
|
||||
return obj
|
||||
|
||||
|
||||
makePolygon = make_polygon
|
||||
makePolygon = make_polygon
|
||||
|
||||
@@ -82,4 +82,4 @@ def make_rectangle(length, height, placement=None, face=None, support=None):
|
||||
return obj
|
||||
|
||||
|
||||
makeRectangle = make_rectangle
|
||||
makeRectangle = make_rectangle
|
||||
|
||||
@@ -68,4 +68,4 @@ def make_shape2dview(baseobj,projectionVector=None,facenumbers=[]):
|
||||
return obj
|
||||
|
||||
|
||||
makeShape2DView = make_shape2dview
|
||||
makeShape2DView = make_shape2dview
|
||||
|
||||
@@ -69,4 +69,4 @@ def make_shapestring(String, FontFile, Size=100, Tracking=0):
|
||||
return obj
|
||||
|
||||
|
||||
makeShapeString = make_shapestring
|
||||
makeShapeString = make_shapestring
|
||||
|
||||
@@ -333,4 +333,4 @@ def make_sketch(objectslist, autoconstraints=False, addTo=None,
|
||||
return nobj
|
||||
|
||||
|
||||
makeSketch = make_sketch
|
||||
makeSketch = make_sketch
|
||||
|
||||
@@ -120,4 +120,4 @@ def make_wire(pointslist, closed=False, placement=None, face=None, support=None,
|
||||
return obj
|
||||
|
||||
|
||||
makeWire = make_wire
|
||||
makeWire = make_wire
|
||||
|
||||
@@ -55,4 +55,4 @@ def make_workingplaneproxy(placement):
|
||||
return obj
|
||||
|
||||
|
||||
makeWorkingPlaneProxy = make_workingplaneproxy
|
||||
makeWorkingPlaneProxy = make_workingplaneproxy
|
||||
|
||||
@@ -184,7 +184,6 @@ class Array(DraftLink):
|
||||
return super(Array, self).buildShape(obj, pl, pls)
|
||||
|
||||
def rectArray(self,pl,xvector,yvector,zvector,xnum,ynum,znum):
|
||||
import Part
|
||||
base = [pl.copy()]
|
||||
for xcount in range(xnum):
|
||||
currentxvector=App.Vector(xvector).multiply(xcount)
|
||||
@@ -209,7 +208,6 @@ class Array(DraftLink):
|
||||
return base
|
||||
|
||||
def circArray(self,pl,rdist,tdist,axis,center,cnum,sym):
|
||||
import Part
|
||||
sym = max(1, sym)
|
||||
lead = (0,1,0)
|
||||
if axis.x == 0 and axis.z == 0: lead = (1,0,0)
|
||||
@@ -232,7 +230,6 @@ class Array(DraftLink):
|
||||
|
||||
def polarArray(self,spl,center,angle,num,axis,axisvector):
|
||||
#print("angle ",angle," num ",num)
|
||||
import Part
|
||||
spin = App.Placement(App.Vector(), spl.Rotation)
|
||||
pl = App.Placement(spl.Base, App.Rotation())
|
||||
center = center.sub(spl.Base)
|
||||
@@ -257,4 +254,4 @@ class Array(DraftLink):
|
||||
return base
|
||||
|
||||
|
||||
_Array = Array
|
||||
_Array = Array
|
||||
|
||||
@@ -152,4 +152,4 @@ class DraftObject(object):
|
||||
pass
|
||||
|
||||
|
||||
_DraftObject = DraftObject
|
||||
_DraftObject = DraftObject
|
||||
|
||||
@@ -193,4 +193,4 @@ class BezCurve(DraftObject):
|
||||
return pn + knot
|
||||
|
||||
|
||||
_BezCurve = BezCurve
|
||||
_BezCurve = BezCurve
|
||||
|
||||
@@ -53,4 +53,4 @@ class Block(DraftObject):
|
||||
obj.Placement = plm
|
||||
obj.positionBySupport()
|
||||
|
||||
_Block = Block
|
||||
_Block = Block
|
||||
|
||||
@@ -133,4 +133,4 @@ class BSpline(DraftObject):
|
||||
obj.positionBySupport()
|
||||
|
||||
|
||||
_BSpline = BSpline
|
||||
_BSpline = BSpline
|
||||
|
||||
@@ -95,4 +95,4 @@ class Circle(DraftObject):
|
||||
obj.positionBySupport()
|
||||
|
||||
|
||||
_Circle = Circle
|
||||
_Circle = Circle
|
||||
|
||||
@@ -128,4 +128,4 @@ class Clone(DraftObject):
|
||||
return None
|
||||
|
||||
|
||||
_Clone = Clone
|
||||
_Clone = Clone
|
||||
|
||||
@@ -401,5 +401,3 @@ class AngularDimension(DimensionBase):
|
||||
obj.setEditorMode('Normal',2)
|
||||
if hasattr(obj,"Support"):
|
||||
obj.setEditorMode('Support',2)
|
||||
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ from draftobjects.base import DraftObject
|
||||
class DraftLink(DraftObject):
|
||||
"""
|
||||
Documentation needed.
|
||||
I guess the DraftLink was introduced by Realthunder to allow
|
||||
the use of new App::Link object into Draft Array objects during
|
||||
the development of version 0.19.
|
||||
DraftLink was introduced by Realthunder to allow the use of new
|
||||
App::Link object into Draft Array objects during version 0.19 development
|
||||
cycle.
|
||||
"""
|
||||
|
||||
def __init__(self,obj,tp):
|
||||
@@ -177,4 +177,4 @@ class DraftLink(DraftObject):
|
||||
'-Immutable' if obj.ExpandArray else 'Immutable')
|
||||
|
||||
|
||||
_DraftLink = DraftLink
|
||||
_DraftLink = DraftLink
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
# * *
|
||||
# ***************************************************************************
|
||||
"""This module provides the object code for the Draft DrawingView object.
|
||||
This module is obsolete, since Drawing was substituted by TechDraw.
|
||||
"""
|
||||
## @package drawingview
|
||||
# \ingroup DRAFT
|
||||
@@ -34,8 +35,7 @@ import FreeCAD as App
|
||||
|
||||
import DraftVecUtils
|
||||
|
||||
import getSVG as svg
|
||||
getSVG = svg.getSVG
|
||||
from getSVG import getSVG
|
||||
|
||||
import draftutils.utils as utils
|
||||
|
||||
@@ -45,7 +45,7 @@ from draftobjects.base import DraftObject
|
||||
class DrawingView(DraftObject):
|
||||
"""The Draft DrawingView object
|
||||
|
||||
TODO: this class is obsolete, since Drawing was substituted by TechDraw.
|
||||
OBSOLETE: this class is obsolete, since Drawing was substituted by TechDraw.
|
||||
"""
|
||||
|
||||
def __init__(self, obj):
|
||||
@@ -138,4 +138,4 @@ class DrawingView(DraftObject):
|
||||
return utils.getDXF(obj)
|
||||
|
||||
|
||||
_DrawingView = DrawingView
|
||||
_DrawingView = DrawingView
|
||||
|
||||
@@ -99,4 +99,4 @@ class Ellipse(DraftObject):
|
||||
obj.positionBySupport()
|
||||
|
||||
|
||||
_Ellipse = Ellipse
|
||||
_Ellipse = Ellipse
|
||||
|
||||
@@ -123,4 +123,4 @@ class Facebinder(DraftObject):
|
||||
self.execute(obj)
|
||||
|
||||
|
||||
_Facebinder = Facebinder
|
||||
_Facebinder = Facebinder
|
||||
|
||||
@@ -238,4 +238,4 @@ class Label(DraftAnnotation):
|
||||
def onChanged(self,obj,prop):
|
||||
'''Do something when a property has changed'''
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
@@ -74,4 +74,4 @@ class Point(DraftObject):
|
||||
obj.Z.Value)
|
||||
|
||||
|
||||
_Point = Point
|
||||
_Point = Point
|
||||
|
||||
@@ -104,4 +104,4 @@ class PointArray(DraftObject):
|
||||
obj.Shape = obj.Base.Shape.copy()
|
||||
|
||||
|
||||
_PointArray = PointArray
|
||||
_PointArray = PointArray
|
||||
|
||||
@@ -119,4 +119,4 @@ class Polygon(DraftObject):
|
||||
obj.positionBySupport()
|
||||
|
||||
|
||||
_Polygon = Polygon
|
||||
_Polygon = Polygon
|
||||
|
||||
@@ -177,4 +177,4 @@ class Rectangle(DraftObject):
|
||||
obj.positionBySupport()
|
||||
|
||||
|
||||
_Rectangle = Rectangle
|
||||
_Rectangle = Rectangle
|
||||
|
||||
@@ -269,4 +269,4 @@ class Shape2DView(DraftObject):
|
||||
obj.Placement = pl
|
||||
|
||||
|
||||
_Shape2DView = Shape2DView
|
||||
_Shape2DView = Shape2DView
|
||||
|
||||
@@ -200,4 +200,4 @@ class ShapeString(DraftObject):
|
||||
return ret
|
||||
|
||||
|
||||
_ShapeString = ShapeString
|
||||
_ShapeString = ShapeString
|
||||
|
||||
@@ -248,4 +248,4 @@ class Wire(DraftObject):
|
||||
obj.End = displayfpend
|
||||
|
||||
|
||||
_Wire = Wire
|
||||
_Wire = Wire
|
||||
|
||||
@@ -72,4 +72,4 @@ class WorkingPlaneProxy:
|
||||
|
||||
def __setstate__(self,state):
|
||||
if state:
|
||||
self.Type = state
|
||||
self.Type = state
|
||||
|
||||
@@ -72,4 +72,4 @@ class ViewProviderDraftArray(ViewProviderDraft):
|
||||
vobj.DiffuseColor = colors
|
||||
|
||||
|
||||
_ViewProviderDraftArray = ViewProviderDraftArray
|
||||
_ViewProviderDraftArray = ViewProviderDraftArray
|
||||
|
||||
@@ -524,4 +524,4 @@ class ViewProviderDraftPart(ViewProviderDraftAlt):
|
||||
return ":/icons/Tree_Part.svg"
|
||||
|
||||
|
||||
_ViewProviderDraftPart = ViewProviderDraftPart
|
||||
_ViewProviderDraftPart = ViewProviderDraftPart
|
||||
|
||||
@@ -77,4 +77,4 @@ class ViewProviderClone:
|
||||
vobj.DiffuseColor = colors
|
||||
|
||||
|
||||
_ViewProviderClone = ViewProviderClone
|
||||
_ViewProviderClone = ViewProviderClone
|
||||
|
||||
@@ -114,5 +114,3 @@ class ViewProviderDraftAnnotation(object):
|
||||
if hasattr(self.Object,"Group"):
|
||||
objs.extend(self.Object.Group)
|
||||
return objs
|
||||
|
||||
|
||||
|
||||
@@ -68,4 +68,4 @@ class ViewProviderDraftLink:
|
||||
return obj.ElementList
|
||||
|
||||
|
||||
_ViewProviderDraftLink = ViewProviderDraftLink
|
||||
_ViewProviderDraftLink = ViewProviderDraftLink
|
||||
|
||||
@@ -53,4 +53,4 @@ class ViewProviderFacebinder(ViewProviderDraft):
|
||||
return False
|
||||
|
||||
|
||||
_ViewProviderFacebinder = ViewProviderFacebinder
|
||||
_ViewProviderFacebinder = ViewProviderFacebinder
|
||||
|
||||
@@ -319,4 +319,4 @@ class ViewProviderLabel(ViewProviderDraftAnnotation):
|
||||
v = vobj.Object.Placement.Rotation.multVec(v)
|
||||
pos = vobj.Object.Placement.Base.add(v)
|
||||
self.textpos.translation.setValue(pos)
|
||||
self.textpos.rotation.setValue(vobj.Object.Placement.Rotation.Q)
|
||||
self.textpos.rotation.setValue(vobj.Object.Placement.Rotation.Q)
|
||||
|
||||
@@ -52,4 +52,4 @@ class ViewProviderPoint(ViewProviderDraft):
|
||||
return ":/icons/Draft_Dot.svg"
|
||||
|
||||
|
||||
_ViewProviderPoint = ViewProviderPoint
|
||||
_ViewProviderPoint = ViewProviderPoint
|
||||
|
||||
@@ -41,4 +41,4 @@ class ViewProviderRectangle(ViewProviderDraft):
|
||||
"Draft", QT_TRANSLATE_NOOP("App::Property", _tip))
|
||||
|
||||
|
||||
_ViewProviderRectangle = ViewProviderRectangle
|
||||
_ViewProviderRectangle = ViewProviderRectangle
|
||||
|
||||
Reference in New Issue
Block a user