def set_lod(limit, item, draw=None):
    # This function replaces the paint() methods of the given item and its
    # children. The new version doesn't actually draw any of the items if the
    # level of detail OF THE TOP ITEM (which is the only one checked) is under
    # the threshold
    # Only the top-level item is checked, because children might have different
    # scales

    paint_orig = item.paint # store reference to original paint method
    top_item = draw is None
    if draw is None:
        draw = [True]

    # Overrides paint() on that item
    def paint_with_lod_check(painter, option, widget):
        if top_item:
            draw[0] = option.levelOfDetailFromTransform(
                    painter.worldTransform()) > limit
        if draw[0]:
            return paint_orig(painter, option, widget)
    item.paint = paint_with_lod_check

    # Recursively process children
    for i in item.childItems():
        set_lod(limit, i, draw)
Sets the limit of level of detail used when painting items.
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/pipeline_view.py/set_lod