

def visit(self):
    '\n        This function *visits* its children in a recursive\n        way.\n\n        It will first *visit* the children that\n        that have a z-order value less than 0.\n\n        Then it will call the :meth:`draw` method to\n        draw itself.\n\n        And finally it will *visit* the rest of the\n        children (the ones with a z-value bigger\n        or equal than 0)\n\n        Before *visiting* any children it will call\n        the :meth:`transform` method to apply any possible\n        transformations.\n        '
    if (not self.visible):
        return
    position = 0
    if (self.grid and self.grid.active):
        self.grid.before_draw()
    if (self.children and (self.children[0][0] < 0)):
        gl.glPushMatrix()
        self.transform()
        for (z, c) in self.children:
            if (z >= 0):
                break
            position += 1
            c.visit()
        gl.glPopMatrix()
    self.draw()
    if (position < len(self.children)):
        gl.glPushMatrix()
        self.transform()
        for (z, c) in self.children[position:]:
            c.visit()
        gl.glPopMatrix()
    if (self.grid and self.grid.active):
        self.grid.after_draw(self.camera)

dataset/ETHPy150Open los-cocos/cocos/cocos/cocosnode.py CocosNode.visit/original