[ui] make Nodes moves undoable

Handle nodes move and auto-layout on Python side by using GraphLayout and MoveNodeCommand.

* Node QML component relies on underlying core.Node object's position
* MoveNodeCommand is called after a Node has been dragged
* partial/full auto-layout for specific graph operations (Duplication, Augmentation...) are now part of those operations
* serialized position in node data allows to properly restore nodes coordinates on undo/redo
* remove all layout/node moving code from QML
This commit is contained in:
Yann Lanthony 2018-07-26 22:37:01 +02:00
parent 830173047c
commit f415745a4a
8 changed files with 75 additions and 124 deletions

View file

@ -24,7 +24,6 @@ Item {
implicitWidth: 300
implicitHeight: 400
signal requestGraphAutoLayout()
// Load a 3D media file in the 3D viewer
function load3DMedia(filepath)
@ -79,7 +78,6 @@ Item {
reconstruction: root.reconstruction
Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height
onRequestGraphAutoLayout: graphEditor.doAutoLayout()
}
}
Panel {