|
|
@ -23,11 +23,12 @@ def __handle_add_point(ctx, event): |
|
|
|
representation, and adds it to the list. |
|
|
|
representation, and adds it to the list. |
|
|
|
""" |
|
|
|
""" |
|
|
|
print("[ADD] GOT POINT: ({}, {})".format(event.x(), event.y())) |
|
|
|
print("[ADD] GOT POINT: ({}, {})".format(event.x(), event.y())) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_drawing_mode(Mode.ADD, event) |
|
|
|
|
|
|
|
|
|
|
|
# Convert to our point representation and add to list widget |
|
|
|
# Convert to our point representation and add to list widget |
|
|
|
# Point representation is a class called Point with coordinates, |
|
|
|
# Point representation is a class called Point with coordinates, |
|
|
|
# and attributes (currently always None) |
|
|
|
# and attributes (currently always None) |
|
|
|
# |
|
|
|
|
|
|
|
set_drawing_mode(Mode.ADD, event) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __handle_edit_point(ctx, event): |
|
|
|
def __handle_edit_point(ctx, event): |
|
|
|
# TODO: This function and delete definitely need to make sure they are |
|
|
|
# TODO: This function and delete definitely need to make sure they are |
|
|
@ -43,15 +44,25 @@ def __handle_edit_point(ctx, event): |
|
|
|
# applicable. |
|
|
|
# applicable. |
|
|
|
print("[EDIT] GOT POINT: ({}, {})".format(event.x(), event.y())) |
|
|
|
print("[EDIT] GOT POINT: ({}, {})".format(event.x(), event.y())) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Store old x, y from event |
|
|
|
|
|
|
|
set_drawing_mode(Mode.DELETE, event) |
|
|
|
|
|
|
|
# after this remove the point from the list |
|
|
|
|
|
|
|
|
|
|
|
def __handle_move_points(ctx, event): |
|
|
|
def __handle_move_points(ctx, event): |
|
|
|
# TODO: Should move the associated points in the list to the new location. |
|
|
|
# TODO: Should move the associated points in the list to the new location. |
|
|
|
print("[MOVE] Pressed - NOTE NEED DRAG EVENT") |
|
|
|
print("[MOVE] Pressed - NOTE NEED DRAG EVENT") |
|
|
|
|
|
|
|
# Store list of old points that are captured |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_drawing_mode(Mode.MOVE, event) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Find and move all points from the old list to their new locations |
|
|
|
|
|
|
|
|
|
|
|
def __handle_delete_point(ctx, event): |
|
|
|
def __handle_delete_point(ctx, event): |
|
|
|
# TODO: Needs to also delete the point from the list. |
|
|
|
|
|
|
|
print("[DELETE] GOT POINT: ({}, {})".format(event.x(), event.y())) |
|
|
|
print("[DELETE] GOT POINT: ({}, {})".format(event.x(), event.y())) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_drawing_mode(Mode.DELETE, event) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Find the point from event and remove it from the list |
|
|
|
|
|
|
|
|
|
|
|
# Simple dispatcher to make it easy to dispatch the right mode |
|
|
|
# Simple dispatcher to make it easy to dispatch the right mode |
|
|
|
# function when the OpenGL window is clicked. |
|
|
|
# function when the OpenGL window is clicked. |
|
|
|