Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
b29b8c04
Commit
b29b8c04
authored
Sep 07, 2016
by
Maxime Perrotin
Browse files
Create multi-point connections (early draft)
parent
fd8eeb02
Changes
1
Hide whitespace changes
Inline
Side-by-side
opengeode/opengeode.py
View file @
b29b8c04
...
...
@@ -1303,12 +1303,18 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
self
.
mode
=
'wait_next_connection_point'
# if not OK, reset and:
self
.
mode
=
'idle'
elif
self
.
mode
==
'wait_next_connection_point'
:
symb
=
self
.
symbol_near
(
event
.
scenePos
(),
dist
=
1
)
if
symb
:
# Here: create the actual connector
self
.
mode
=
'idle'
# pylint: disable=C0103
def
mouseMoveEvent
(
self
,
event
):
''' Handle Click + Mouse move, based on the mode '''
if
event
.
buttons
()
==
Qt
.
NoButton
or
self
.
mode
==
'idle'
:
if
(
event
.
buttons
()
==
Qt
.
NoButton
and
self
.
mode
!=
'wait_next_connection_point'
)
or
self
.
mode
==
'idle'
:
return
super
(
SDL_Scene
,
self
).
mouseMoveEvent
(
event
)
elif
self
.
mode
==
'select_items'
:
rect
=
QRectF
(
self
.
orig_pos
,
event
.
scenePos
())
...
...
@@ -1363,7 +1369,15 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
#self.removeItem(self.select_rect)
# XXX stop with removeItem, it provokes segfault
self
.
select_rect
.
hide
()
self
.
mode
=
'idle'
self
.
mode
=
'idle'
elif
self
.
mode
==
'wait_next_connection_point'
:
point
=
event
.
scenePos
()
self
.
edge_points
.
append
(
point
)
self
.
current_line
=
self
.
addLine
(
point
.
x
(),
point
.
y
(),
point
.
x
(),
point
.
y
())
super
(
SDL_Scene
,
self
).
mouseReleaseEvent
(
event
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment