-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathnotes.todo
98 lines (78 loc) · 4.81 KB
/
notes.todo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Nodes:
Design:
* Undefined number of inputs
* Single Output
* Inputs are on left side of the node
* Output is on the righ side of the node
* Natural layout flow is left to right
* Name of a node is unique
To do:
✔ Optimize redraw by caching as much as possible any computation @done (17-11-22 09:04)
☐ Handle undefined numbers of inputs
☐ Create a disabled state
☐ Handles deletion (with edges gracefully reconnecting)
Edges:
Design:
* An edge is defined but its parent output and its named input
* Edge name is hashed from its parents
* A edge is only valid if it doesn't create a loop
To do:
✔ Create edge interactively @done (17-10-04 09:01)
✔ Adjust arrow size (lod bug) and implement dynamic scale @done (17-10-04 09:06)
✔ Optimize redraw by caching as much as possible any computation @done (17-11-22 09:04)
✔ Optimize redraw by updating line through callbacks @done (17-10-28 13:14)
☐ Handles deletion
Nodegraph view:
Design:
* Zoom limits (no more than 1:1, no less than 1:10)
* Bounds (no infinite canvas)
To do:
✔ Limit fit all unzoom @done (17-10-05 08:53)
✔ Write a custom select rubber band (default one evaluate everything on each frame) @done (17-11-22 09:04)
✔ Add/Remove selection with rubber band @done (17-11-25 23:23)
✔ Re-implement toggle selection when ctrl+click on node @done (17-12-08 09:15)
☐ Add a node creation widget (tab)
✔ Re-implement pan to be always available (midle-click, alt) @done (17-12-08 19:05)
✔ Switch to custom cursor when shift/ctrl on selection @done (17-12-18 11:08)
✔ Support toggle selection (shift+ctrl) @done (17-12-18 11:15)
☐ refactor keypress and modifiers handler
Performances issues:
* OpenGL viewport don't accept partial redraw, hence redraw has to happen on the whole viewport regardless of what need to be redrawn.
* Using regular viewport allows for partial redraw but then edges are not redrawn well -> prepareGeometryChange() signal wasn't emitted before update...
* Hierarchy of graphicsItem contained by a Node (NodeSlot, NodeSlotLabel) is forcing QT to multiply draw calls (3 instead of 1). KILLING rubber band selection refresh.
* Knobs have to be set visible (or not) on every redraw.
* Selection rubber band still too slow. Custom one that is only an outline and evaluate selection on mouse button release?
* Moving a lot of nodes with edges (+400) shows limit of edges refresh loop. Either find a way to only change the position of the edge (as you would do with a regular QGraphicsItem) or, even better, look into bitmap caching of all nodes and edges that moves uniformly (only redrawing edges connected to non-selected nodes)
Performance influenced design:
* Using partial redraw (no OpenGL viewport) but limiting complexity by forcing to bounding rectangle.
* Node Slot is part of the Node QGraphicsItem (i.e. included in Node paint call).
* Edges are QGraphicsItem which are refreshed either completely (redefining line and shape) or only by adjusting their position.
* Nodes have many level of detail based on zoom level.
* Custom rubber band that only refresh selection when releasing mouse button.
Events:
* First event goes to View, then Scene, then from highest item in the stack to lowest under the mouse cursor.
* If not calling ancestor, stop propagation.
TESTS:
* Check zoom limits
* Check left click selection (node, edge)
* Check Lasso selection (nodes, edges)
* Check add/remove from selection shortcut, with single left click selection then lasso selection.
* Check selected nodes can be me moved
* Check creation of a node
* Check Creation of a edge (from a input to an output and opposite)
* Check Pan shortcut (alone, then combined with other actions)
* Check Creation of an edge (auto-drop to destination node)
* Check Deletion of Nodes (no connections)
* Check Deletion of Edges.
* Check Deletions of a connected node (automatic re-connection)
* Check saving a graph
* check loading a graph
BUGS:
✔ Hidden Rubberband and interactive edge are taken into account for fitInView @done (18-05-20 12:20)
☐ Can't connect anymore to specific input (always use the connect_to_next_available)
☐ When trying to connect on a input slot already connected, replace connection.
Next thing to do:
Move node mousePresseEvent input/output detection to public function that requires a point in scene coordinates
Move start_interactive_edge from node.py to scene.py in MousePressEvent.
In scene.py, mouseReleaseEvent, use utility function to detect if drop in slot.
Remove complex/useless self._hover_slot (which is not updated anyway when in interactive_edge mode)