FEM: utils, rename typeOfObj to type_of_obj

This commit is contained in:
Bernd Hahnebach
2018-12-06 10:16:18 +01:00
committed by Yorik van Havre
parent d40b23a142
commit e06a541fec
2 changed files with 52 additions and 52 deletions

View File

@@ -75,16 +75,9 @@ def getSingleMember(analysis, t):
return objs[0] if objs else None
def typeOfObj(obj):
'''returns objects TypeId (C++ objects) or Proxy.Type (Python objects)'''
if hasattr(obj, "Proxy") and hasattr(obj.Proxy, "Type"):
return obj.Proxy.Type
return obj.TypeId
def isOfTypeNew(obj, ty):
'''returns if an object is of a given TypeId (C++ objects) or Proxy.Type (Python objects)'''
if typeOfObj(obj) == ty:
if type_of_obj(obj) == ty:
return True
else:
return False
@@ -103,6 +96,13 @@ def isDerivedFrom(obj, t):
return obj.isDerivedFrom(t)
def type_of_obj(obj):
'''returns objects TypeId (C++ objects) or Proxy.Type (Python objects)'''
if hasattr(obj, "Proxy") and hasattr(obj.Proxy, "Type"):
return obj.Proxy.Type
return obj.TypeId
def getBoundBoxOfAllDocumentShapes(doc):
overalboundbox = None
for o in doc.Objects: