Exemplo n.º 1
0
def test_thick_line_tool():
    img = data.camera()
    viewer = ImageViewer(img)

    tool = ThickLineTool(viewer, maxdist=10)
    tool.end_points = get_end_points(img)

    do_event(viewer, 'scroll', button='up')
    assert_equal(tool.linewidth, 2)

    do_event(viewer, 'scroll', button='down')

    assert_equal(tool.linewidth, 1)

    do_event(viewer, 'key_press', key='+')
    assert_equal(tool.linewidth, 2)

    do_event(viewer, 'key_press', key='-')
    assert_equal(tool.linewidth, 1)
Exemplo n.º 2
0
def test_thick_line_tool():
    img = data.camera()
    viewer = ImageViewer(img)

    tool = ThickLineTool(viewer, maxdist=10)
    tool.end_points = get_end_points(img)

    do_event(viewer, 'scroll', button='up')
    assert_equal(tool.linewidth, 2)

    do_event(viewer, 'scroll', button='down')

    assert_equal(tool.linewidth, 1)

    do_event(viewer, 'key_press',  key='+')
    assert_equal(tool.linewidth, 2)

    do_event(viewer, 'key_press', key='-')
    assert_equal(tool.linewidth, 1)
Exemplo n.º 3
0
def test_thick_line_tool():
    img = data.camera()
    viewer = ImageViewer(img)

    tool = ThickLineTool(viewer, maxdist=10, line_props=dict(color="red"), handle_props=dict(markersize=5))
    tool.end_points = get_end_points(img)

    do_event(viewer, "scroll", button="up")
    assert_equal(tool.linewidth, 2)

    do_event(viewer, "scroll", button="down")

    assert_equal(tool.linewidth, 1)

    do_event(viewer, "key_press", key="+")
    assert_equal(tool.linewidth, 2)

    do_event(viewer, "key_press", key="-")
    assert_equal(tool.linewidth, 1)
Exemplo n.º 4
0
def test_thick_line_tool():
    img = data.camera()
    viewer = ImageViewer(img)

    tool = ThickLineTool(viewer, maxdist=10, line_props=dict(color='red'),
                         handle_props=dict(markersize=5))
    tool.end_points = get_end_points(img)

    do_event(viewer, 'scroll', button='up')
    assert_equal(tool.linewidth, 2)

    do_event(viewer, 'scroll', button='down')

    assert_equal(tool.linewidth, 1)

    do_event(viewer, 'key_press',  key='+')
    assert_equal(tool.linewidth, 2)

    do_event(viewer, 'key_press', key='-')
    assert_equal(tool.linewidth, 1)
Exemplo n.º 5
0
def test_thick_line_tool():
    img = data.camera()
    viewer = ImageViewer(img)

    tool = ThickLineTool(viewer, maxdist=10, line_props=dict(color='red'),
                         handle_props=dict(markersize=5))
    tool.end_points = get_end_points(img)

    do_event(viewer, 'scroll', button='up')
    assert_equal(tool.linewidth, 2)

    do_event(viewer, 'scroll', button='down')

    assert_equal(tool.linewidth, 1)

    do_event(viewer, 'key_press',  key='+')
    assert_equal(tool.linewidth, 2)

    do_event(viewer, 'key_press', key='-')
    assert_equal(tool.linewidth, 1)
Exemplo n.º 6
0
def test_thick_line_tool():
    img = data.camera()
    viewer = ImageViewer(img)

    tool = ThickLineTool(viewer.ax, maxdist=10)
    tool.end_points = get_end_points(img)

    scroll_up = create_mouse_event(viewer.ax, button='up')
    tool.on_scroll(scroll_up)
    assert_equal(tool.linewidth, 2)

    scroll_down = create_mouse_event(viewer.ax, button='down')
    tool.on_scroll(scroll_down)
    assert_equal(tool.linewidth, 1)

    key_up = create_mouse_event(viewer.ax, key='+')
    tool.on_key_press(key_up)
    assert_equal(tool.linewidth, 2)

    key_down = create_mouse_event(viewer.ax, key='-')
    tool.on_key_press(key_down)
    assert_equal(tool.linewidth, 1)
Exemplo n.º 7
0
def test_thick_line_tool():
    img = data.camera()
    viewer = ImageViewer(img)

    tool = ThickLineTool(viewer.ax, maxdist=10)
    tool.end_points = get_end_points(img)

    scroll_up = create_mouse_event(viewer.ax, button='up')
    tool.on_scroll(scroll_up)
    assert_equal(tool.linewidth, 2)

    scroll_down = create_mouse_event(viewer.ax, button='down')
    tool.on_scroll(scroll_down)
    assert_equal(tool.linewidth, 1)

    key_up = create_mouse_event(viewer.ax, key='+')
    tool.on_key_press(key_up)
    assert_equal(tool.linewidth, 2)

    key_down = create_mouse_event(viewer.ax, key='-')
    tool.on_key_press(key_down)
    assert_equal(tool.linewidth, 1)