def __del__(self): ColorAssign.removeColor(self.__color) NameAssign.removeName(self.__name) try: ObjectLists.removeFromPoiList(self) ObjectLists.removeFromObjDict(str(self.__id)) except ValueError: pass
def __init__(self, positionVector: Vector3D, directionVectorOne: Vector3D, directionVectorTwo: Vector3D, normalVector: Vector3D, scalarParameter: float, name=None, color=None): """The init method of the plane class. Takes positionVector and directionVectorOne and directionVectorTwo as Vector3D, parameter as int or float, name as string and color as tuple of format: (Red, Green, Blue)(Valuerange = 0 to 256).""" self.__positionVector = positionVector self.__directionVectorOne = directionVectorOne self.__directionVectorTwo = directionVectorTwo self.__normalVector = normalVector # Following code checks if a normalVector was passed. If not: generates normalVector from directionVectors. try: self.__scalarParameter = scalarParameter except Exception: pass if name is None: self.__name = NameAssign.getNewName() else: self.__name = name if color is None: self.__color = ColorAssign.getNewColor() else: self.__color = color Plane.__idCount += 1 self.__id = str(self.__idTag) + str(self.__idCount) ObjectLists.appendObjDict({str(self.__id): self}) ObjectLists.appendPlaList(self)
def __init__(self, x=0, y=0, z=0, name=None, color=None): self.__x = float(x) self.__y = float(y) self.__z = float(z) Point.__idCount += 1 self.__id = str(self.__idTag + str(self.__idCount)) if name is None: self.__name = NameAssign.getNewName() else: self.__name = name if color is None: self.__color = ColorAssign.getNewColor() else: self.__color = color ObjectLists.appendObjDict({str(self.__id): self}) ObjectLists.appendPoiList(self)
def __init__(self, x=0.0, y=0.0, z=0.0, name=None, color=None): """The init function for the Vector3D class. Takes x, y and z values as int or float. Name has to be a string.""" self.__x = float(x) self.__y = float(y) self.__z = float(z) if name is None: self.__name = NameAssign.getNewName() else: self.__name = name if color is None: self.__color = ColorAssign.getNewColor() else: self.__color = color Vector3D.__idCount += 1 self.__id = str(self.__idTag + str(self.__idCount)) ObjectLists.appendObjDict({str(self.__id): self}) ObjectLists.appendVecList(self)
def __init__(self, positionVector: Vector3D, directionVector: Vector3D, name=None, color=None): """The init method of the line class. Takes positionVector and directionVector as Vector3D, parameter as int or float, name as string and color as tuple of format: (Red, Green, Blue)(Valuerange = 0 to 256). Pass dtype None for color or name for it to be automatically assigned.""" self.__positionVector = positionVector self.__directionVector = directionVector if name is None: self.__name = NameAssign.getNewName() else: self.__name = name if color is None: self.__color = ColorAssign.getNewColor() else: self.__color = color Line.__idCount += 1 self.__id = str(self.__idTag) + str(self.__idCount) ObjectLists.appendObjDict({str(self.__id): self}) ObjectLists.appendLinList(self)