|
|
|
@ -230,7 +230,10 @@ def paint_gl():
|
|
|
|
|
if (__move_bb_top_left is not None and |
|
|
|
|
__move_bb_bottom_right is not None): |
|
|
|
|
|
|
|
|
|
# Mark points that are selected in the bounding box |
|
|
|
|
# and draw them using the normal function |
|
|
|
|
highlight_selection() |
|
|
|
|
draw_points(__current_points, Color.GREY) |
|
|
|
|
|
|
|
|
|
if __move_bb_top_left is None and __move_bb_bottom_right is None: |
|
|
|
|
# Currently this fires all the time - not great. Needs to only fire |
|
|
|
@ -301,10 +304,6 @@ def highlight_selection():
|
|
|
|
|
top_left = get_bb_top_left() |
|
|
|
|
bottom_right = get_bb_bottom_right() |
|
|
|
|
|
|
|
|
|
ct = COLOR_TO_RGBA[Color.BLUE] |
|
|
|
|
|
|
|
|
|
glBegin(GL_POINTS) |
|
|
|
|
glColor3f(ct[0], ct[1], ct[2]) |
|
|
|
|
for point in __current_points.points: |
|
|
|
|
if box_hit(point.x, point.y, top_left[0], top_left[1], |
|
|
|
|
bottom_right[0], bottom_right[1]): |
|
|
|
@ -339,10 +338,9 @@ def highlight_selection():
|
|
|
|
|
# next mouse click. First mouse click will call |
|
|
|
|
# "remove_selection" to terminate movement. "remove_selection" |
|
|
|
|
# will also be called on mode change. |
|
|
|
|
glVertex3f(__clamp_x(point.x), |
|
|
|
|
__clamp_y(point.y), |
|
|
|
|
0.0) |
|
|
|
|
glEnd() |
|
|
|
|
point.select() |
|
|
|
|
else: |
|
|
|
|
point.unselect() |
|
|
|
|
|
|
|
|
|
def draw_selection_box(color): |
|
|
|
|
""" |
|
|
|
@ -418,15 +416,21 @@ def draw_points(point_set, color):
|
|
|
|
|
if not isinstance(color, Color): |
|
|
|
|
raise ValueError("Color must exist in the Color enumeration") |
|
|
|
|
|
|
|
|
|
ct = COLOR_TO_RGBA[color] |
|
|
|
|
|
|
|
|
|
glViewport(0, 0, __WIDTH, __HEIGHT) |
|
|
|
|
glPointSize(__current_points.point_size) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
glBegin(GL_POINTS) |
|
|
|
|
glColor3f(ct[0], ct[1], ct[2]) |
|
|
|
|
for point in point_set.points: |
|
|
|
|
|
|
|
|
|
if point.selected: |
|
|
|
|
blue = COLOR_TO_RGBA[Color.BLUE] |
|
|
|
|
glColor3f(blue[0], blue[1], blue[2]) |
|
|
|
|
else: |
|
|
|
|
ct = COLOR_TO_RGBA[color] |
|
|
|
|
glColor3f(ct[0], ct[1], ct[2]) |
|
|
|
|
|
|
|
|
|
glVertex3f(__clamp_x(point.x), |
|
|
|
|
__clamp_y(point.y), |
|
|
|
|
0.0) # Z is currently fixed to 0 |
|
|
|
|