ITLJXDCETDPXJCHHSYRGJL4V7UJWNG7BQP57PPDF365HMWPNHUQQC
2WCRFGIG5PSVW6PSVJEC4RVQADWMWXM7SX4VCYGFPPPC6UN6N7ZAC
EAI4GDFVBMMFBHE3DTHAO6M4CTOMMCX77CVEVUFSVNSEUYBCXTBAC
ACSSNXV42QLP5AJPQF5ZQJAC2BTIZULX3543SDQAJJT4LBETYF7AC
RSWQPKYWMLVXPFAGSCLBEKSXR2VMBHQDWCHTZ3DNILL475H7MHTQC
DAO6H35AWHIN7CU6O2MYC22CQCR4QEBYYJ2G6S3PMZY7ZWYOUVNAC
J4GXXT5TT6X7Y72ZBDX5WRWH5DHRYX2LLKYN77XMHOQXUJMBHWBAC
OYLAFIHLW6O3VBMJHWRJM4QS5VEA2UJXLLTSHUEELUMYUA5L3NJAC
GTVYKS7NK2OLG7JW6TRK274LCABRJRAUVL2NJRK4IXGDSFN7T7ZAC
return (tl, tr, bl, br)
self.children = (tl, tr, bl, br)
return self.children
def get_leaf_nodes(self, max_depth=None):
if not self.children:
return [self]
if max_depth is not None and self.depth >= max_depth:
return [self]
result = []
for child in self.children:
result.extend(child.get_leaf_nodes(max_depth))
return result
quad = Quad(self, (0, 0, self.width, self.height), 0)
self.error_sum = quad.error * quad.area
self.push(quad)
self.root = Quad(self, (0, 0, self.width, self.height), 0)
self.error_sum = self.root.error * self.root.area
self.push(self.root)