Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DrawPanel Feature: Polyline #695

Open
wants to merge 75 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
e8569ee
adding polyline class
ganimtron-10 Jul 14, 2022
72011f6
adding tutorial file
ganimtron-10 Jul 15, 2022
54cedb7
adding poluline to the DrawShape
ganimtron-10 Jul 15, 2022
395f878
adding key release callback
ganimtron-10 Jul 15, 2022
d527745
adding interface to identity key status
ganimtron-10 Jul 15, 2022
c4fd598
adding DrawShapeGroup
ganimtron-10 Jul 15, 2022
f054c14
adding bb border
ganimtron-10 Jul 15, 2022
a02f5c5
adding borders to the shape
ganimtron-10 Jul 19, 2022
53e9f15
adding borders to the shape
ganimtron-10 Jul 19, 2022
0d5c8d6
Merge branch 'new_bb_border' of https://github.com/ganimtron-10/fury …
ganimtron-10 Jul 19, 2022
e81ee05
rebasing
ganimtron-10 Jul 24, 2022
b27ff81
removing prints
ganimtron-10 Jul 24, 2022
39ab852
adding on_mouse_move callback
ganimtron-10 Jul 27, 2022
bd738e8
integrating polyline
ganimtron-10 Jul 27, 2022
b884525
Merge branch 'new_bb_border' into new-gshape-border
ganimtron-10 Jul 27, 2022
23e07f2
updating method name
ganimtron-10 Jul 27, 2022
2221388
updating selection of shape
ganimtron-10 Aug 1, 2022
88efc7a
Merge branch 'rotation' into new-gshape-border
ganimtron-10 Aug 1, 2022
2e324cf
removing position property and bring_to_top
ganimtron-10 Aug 1, 2022
b7a4d74
updating position of all grouped shapes
ganimtron-10 Aug 1, 2022
4123985
adding group rotation
ganimtron-10 Aug 2, 2022
471a90c
removing extra point
ganimtron-10 Aug 3, 2022
6ba3587
remove print statement
ganimtron-10 Aug 3, 2022
c1825b4
adding pass statement
ganimtron-10 Aug 3, 2022
214e801
Merge branch 'fury-gl:master' into new-gshape-border
ganimtron-10 Aug 6, 2022
babb57c
adding support for shortcut keys
ganimtron-10 Aug 6, 2022
5c4af4d
Merge branch 'new-gshape-border' of https://github.com/ganimtron-10/f…
ganimtron-10 Aug 6, 2022
b41164b
fixing pep
ganimtron-10 Aug 6, 2022
e14e573
fixing selection issue
ganimtron-10 Aug 7, 2022
b3266e6
updating clear method
ganimtron-10 Aug 7, 2022
b11045d
updating individual selection
ganimtron-10 Aug 7, 2022
1abada7
deleting extra remove function
ganimtron-10 Aug 7, 2022
4b43a97
keeping rotation slider on the top
ganimtron-10 Aug 7, 2022
d0ac73c
adding docs
ganimtron-10 Aug 10, 2022
8771333
removing print stmts
ganimtron-10 Aug 10, 2022
e4c6a6b
removing grouped shapes on mode change
ganimtron-10 Aug 13, 2022
d192694
updating polyline to use points_data
ganimtron-10 Aug 14, 2022
ad59616
Merge branch 'master' into new-gshape-border
ganimtron-10 Aug 19, 2022
b0f0668
removing extra comments
ganimtron-10 Aug 19, 2022
c5960ba
maintaining consistency in callback names
ganimtron-10 Aug 19, 2022
3a0ae3d
Merge branch 'rotation' into new-gshape-border
ganimtron-10 Aug 19, 2022
66cf810
removing prints
ganimtron-10 Aug 20, 2022
1ae116c
initializing `DrawShapeGroup`'s scene
ganimtron-10 Aug 20, 2022
a76f5de
renaming interactive parameter
ganimtron-10 Aug 21, 2022
ce0c2e3
adding control points
ganimtron-10 Aug 21, 2022
5f6000a
Merge branch 'rotation' into new-gshape-border
ganimtron-10 Aug 23, 2022
e57ac1c
removing redundant position param
ganimtron-10 Aug 23, 2022
36adf82
fix overlapping of the shapes when translated near the borders
ganimtron-10 Aug 28, 2022
8371bea
Merge branch 'rotation' into new-gshape-border
ganimtron-10 Aug 29, 2022
75d2416
Merge branch 'polyline_with_class' into polyline-with-grouping
ganimtron-10 Aug 29, 2022
2cd3683
Merge branch 'master' into new-gshape-border
ganimtron-10 Aug 30, 2022
a3d277d
making adjustment to support merging
ganimtron-10 Aug 30, 2022
32abd65
Merge branch 'master' into new-gshape-border
ganimtron-10 Sep 7, 2022
f746f10
Merge branch 'master' into new-gshape-border
ganimtron-10 Sep 9, 2022
4fe5d3b
using cal_bounding_box from helper
ganimtron-10 Sep 9, 2022
0fde858
Merge branch 'master' into new-gshape-border
ganimtron-10 Sep 12, 2022
bace0bb
fixing integrating issues
ganimtron-10 Sep 12, 2022
674c529
adding debug param
ganimtron-10 Sep 12, 2022
924c730
updating tests
ganimtron-10 Sep 14, 2022
5e0fa69
updating rotation test
ganimtron-10 Sep 16, 2022
b75d667
adding highlight_color param
ganimtron-10 Sep 16, 2022
cc6d974
adding test for grouping feature
ganimtron-10 Sep 16, 2022
3fa0b23
Merge branch 'new-gshape-border' into polyline-with-grouping
ganimtron-10 Sep 18, 2022
56d4154
adding rotation
ganimtron-10 Sep 21, 2022
8f31701
implementing set_position function
ganimtron-10 Sep 25, 2022
793281f
fixing rotation issue
ganimtron-10 Sep 27, 2022
a5cea7b
removing polyline tutorial
ganimtron-10 Sep 27, 2022
357d4a8
removing commented code
ganimtron-10 Sep 27, 2022
03d9089
renaming resize function
ganimtron-10 Sep 27, 2022
32a1520
simplifying polyline reference in drawane;
ganimtron-10 Sep 27, 2022
b9456b9
fixing looping issue
ganimtron-10 Sep 27, 2022
1c8315e
adding docs to the functions
ganimtron-10 Sep 30, 2022
63c3eff
adding and updating old tests
ganimtron-10 Sep 30, 2022
34eb0d2
fixing polyline group translation issue
ganimtron-10 Oct 6, 2022
a1d3b4f
Merge branch 'fury-gl:master' into polyline-with-grouping
ganimtron-10 Nov 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fury/data/files/test_ui_draw_panel_basic.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"CharEvent": 0, "MouseMoveEvent": 993, "KeyPressEvent": 0, "KeyReleaseEvent": 0, "LeftButtonPressEvent": 17, "LeftButtonReleaseEvent": 17, "RightButtonPressEvent": 0, "RightButtonReleaseEvent": 0, "MiddleButtonPressEvent": 0, "MiddleButtonReleaseEvent": 0}
{"CharEvent": 0, "MouseMoveEvent": 4726, "KeyPressEvent": 0, "KeyReleaseEvent": 0, "LeftButtonPressEvent": 24, "LeftButtonReleaseEvent": 24, "RightButtonPressEvent": 1, "RightButtonReleaseEvent": 1, "MiddleButtonPressEvent": 0, "MiddleButtonReleaseEvent": 0}
Binary file modified fury/data/files/test_ui_draw_panel_basic.log.gz
Binary file not shown.
1 change: 1 addition & 0 deletions fury/data/files/test_ui_draw_panel_grouping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"CharEvent": 0, "MouseMoveEvent": 3810, "KeyPressEvent": 6, "KeyReleaseEvent": 6, "LeftButtonPressEvent": 16, "LeftButtonReleaseEvent": 16, "RightButtonPressEvent": 1, "RightButtonReleaseEvent": 1, "MiddleButtonPressEvent": 0, "MiddleButtonReleaseEvent": 0}
Binary file not shown.
1 change: 1 addition & 0 deletions fury/data/files/test_ui_draw_panel_polyline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"CharEvent": 0, "MouseMoveEvent": 3289, "KeyPressEvent": 0, "KeyReleaseEvent": 0, "LeftButtonPressEvent": 21, "LeftButtonReleaseEvent": 21, "RightButtonPressEvent": 2, "RightButtonReleaseEvent": 2, "MiddleButtonPressEvent": 0, "MiddleButtonReleaseEvent": 0}
Binary file not shown.
2 changes: 1 addition & 1 deletion fury/data/files/test_ui_draw_panel_rotation.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"CharEvent": 0, "MouseMoveEvent": 208, "KeyPressEvent": 0, "KeyReleaseEvent": 0, "LeftButtonPressEvent": 13, "LeftButtonReleaseEvent": 13, "RightButtonPressEvent": 0, "RightButtonReleaseEvent": 0, "MiddleButtonPressEvent": 0, "MiddleButtonReleaseEvent": 0}
{"CharEvent": 0, "MouseMoveEvent": 3626, "KeyPressEvent": 0, "KeyReleaseEvent": 0, "LeftButtonPressEvent": 20, "LeftButtonReleaseEvent": 20, "RightButtonPressEvent": 1, "RightButtonReleaseEvent": 1, "MiddleButtonPressEvent": 0, "MiddleButtonReleaseEvent": 0}
Binary file modified fury/data/files/test_ui_draw_panel_rotation.log.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions fury/ui/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ def mouse_move_callback2(istyle, obj, self):
ANTICLOCKWISE_ROTATION_X = np.array([-10, 1, 0, 0])
CLOCKWISE_ROTATION_X = np.array([10, 1, 0, 0])

def key_press_callback(self, istyle, obj, _what):
def on_key_press_callback(self, istyle, obj, _what):
has_changed = False
if istyle.event.key == "Left":
has_changed = True
Expand Down Expand Up @@ -1009,8 +1009,8 @@ def _setup(self):

# TODO: this is currently not running
self.add_callback(actor, "KeyPressEvent",
self.key_press_callback)
# self.on_key_press = self.key_press_callback2
self.on_key_press_callback)
# self.on_key_press = self.on_key_press_callback2

def _get_actors(self):
"""Get the actors composing this UI component."""
Expand Down
12 changes: 10 additions & 2 deletions fury/ui/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ def __init__(self, position=(0, 0)):
self.on_middle_mouse_double_clicked = lambda i_ren, obj, element: None
self.on_middle_mouse_button_dragged = lambda i_ren, obj, element: None
self.on_key_press = lambda i_ren, obj, element: None
self.on_key_release = lambda i_ren, obj, element: None
self.on_mouse_move = lambda i_ren, obj, element: None

@abc.abstractmethod
def _setup(self):
Expand Down Expand Up @@ -261,7 +263,8 @@ def handle_events(self, actor):
self.add_callback(actor, "MiddleButtonReleaseEvent",
self.middle_button_release_callback)
self.add_callback(actor, "MouseMoveEvent", self.mouse_move_callback)
self.add_callback(actor, "KeyPressEvent", self.key_press_callback)
self.add_callback(actor, "KeyPressEvent", self.on_key_press_callback)
self.add_callback(actor, "KeyReleaseEvent", self.on_key_release_callback)

@staticmethod
def left_button_click_callback(i_ren, obj, self):
Expand Down Expand Up @@ -304,6 +307,7 @@ def middle_button_release_callback(i_ren, obj, self):

@staticmethod
def mouse_move_callback(i_ren, obj, self):
self.on_mouse_move(i_ren, obj, self)
left_pressing_or_dragging = (self.left_button_state == "pressing" or
self.left_button_state == "dragging")

Expand All @@ -325,9 +329,13 @@ def mouse_move_callback(i_ren, obj, self):
self.on_middle_mouse_button_dragged(i_ren, obj, self)

@staticmethod
def key_press_callback(i_ren, obj, self):
def on_key_press_callback(i_ren, obj, self):
self.on_key_press(i_ren, obj, self)

@staticmethod
def on_key_release_callback(i_ren, obj, self):
self.on_key_release(i_ren, obj, self)


class Rectangle2D(UI):
"""A 2D rectangle sub-classed from UI."""
Expand Down
Loading