Draft: small fix to dimensions

This commit is contained in:
Yorik van Havre 2012-07-02 09:54:41 -03:00
parent e882b8c35c
commit 8fdcaa0db8

View File

@ -253,7 +253,7 @@ def shapify(obj):
FreeCAD.ActiveDocument.recompute() FreeCAD.ActiveDocument.recompute()
return newobj return newobj
def getGroupContents(objectslist): def getGroupContents(objectslist,walls=False):
'''getGroupContents(objectlist): if any object of the given list '''getGroupContents(objectlist): if any object of the given list
is a group, its content is appened to the list, which is returned''' is a group, its content is appened to the list, which is returned'''
newlist = [] newlist = []
@ -262,6 +262,11 @@ def getGroupContents(objectslist):
newlist.extend(getGroupContents(obj.Group)) newlist.extend(getGroupContents(obj.Group))
else: else:
newlist.append(obj) newlist.append(obj)
if walls:
if getType(obj) == "Wall":
for o in obj.OutList:
if (getType(o) == "Window") or isClone(o,"Window"):
newlist.append(o)
return newlist return newlist
def printShape(shape): def printShape(shape):
@ -269,6 +274,8 @@ def printShape(shape):
print "solids: ", len(shape.Solids) print "solids: ", len(shape.Solids)
print "faces: ", len(shape.Faces) print "faces: ", len(shape.Faces)
print "wires: ", len(shape.Wires) print "wires: ", len(shape.Wires)
print "edges: ", len(shape.Edges)
print "verts: ", len(shape.Vertexes)
if shape.Faces: if shape.Faces:
for f in range(len(shape.Faces)): for f in range(len(shape.Faces)):
print "face ",f,":" print "face ",f,":"
@ -1964,7 +1971,7 @@ class _ViewProviderDimension:
[p2.x,p2.y,p2.z], [p2.x,p2.y,p2.z],
[p3.x,p3.y,p3.z], [p3.x,p3.y,p3.z],
[p4.x,p4.y,p4.z]]) [p4.x,p4.y,p4.z]])
self.line.numVertices.setValues([4]) self.line.numVertices.setValue(4)
else: else:
ts = (len(text)*obj.ViewObject.FontSize)/4 ts = (len(text)*obj.ViewObject.FontSize)/4
rm = ((p3.sub(p2)).Length/2)-ts rm = ((p3.sub(p2)).Length/2)-ts