Loading diagrammes/diagrammeDeClasseV2.png 0 → 100644 +79.2 KiB Loading image diff... model/node.py +12 −1 Original line number Diff line number Diff line Loading @@ -118,10 +118,12 @@ class BinaryNode(Node): def __init__(self, left, right): super(Node, self).__init__() self.left = left self.left.setParent(self, 0) self.right = right # in a few funtions, we need that each node knows its parent self.left.setParent(self, 0) self.right.setParent(self, 1) self.parent = None # we need the position of the node compared with the others nodes of the tree to draw a tree self.x = 0 self.y = 0 self.height = 0 Loading @@ -129,6 +131,15 @@ class BinaryNode(Node): self.offset = 0 def setup(self, depth=0, places=None, offsets=None): """ this function permeats to give the position of the node compared with the others nodes of the tree in which it is part by filling the fields x, y and offset of the node :param depth: the depth of the node in the tree :param places: :param offsets: :return: """ if places is None: places = defaultdict(lambda: 0) if offsets is None: Loading Loading
model/node.py +12 −1 Original line number Diff line number Diff line Loading @@ -118,10 +118,12 @@ class BinaryNode(Node): def __init__(self, left, right): super(Node, self).__init__() self.left = left self.left.setParent(self, 0) self.right = right # in a few funtions, we need that each node knows its parent self.left.setParent(self, 0) self.right.setParent(self, 1) self.parent = None # we need the position of the node compared with the others nodes of the tree to draw a tree self.x = 0 self.y = 0 self.height = 0 Loading @@ -129,6 +131,15 @@ class BinaryNode(Node): self.offset = 0 def setup(self, depth=0, places=None, offsets=None): """ this function permeats to give the position of the node compared with the others nodes of the tree in which it is part by filling the fields x, y and offset of the node :param depth: the depth of the node in the tree :param places: :param offsets: :return: """ if places is None: places = defaultdict(lambda: 0) if offsets is None: Loading