We decided to divide our structure in three directories : buttleofx/core, buttleofx/data and buttleofx/gui.
For the moment, we can find the undo/redo commands in this directory. For every undoable action in the application, we will have a class with the undo and redo commands. For example, when a node is dragged, it is possible to undo the action. For this we will have a CommandSetCoord class with fucntions such as UndoCommand and RedoCommand.
It will contain all the data needed to manage the application. We created a singleton ButtleData defined by a Graph and the corresponding GraphWrapper.
Concerning the graphical user interface, we have been working hard on the data structure but finally got to something relevant. We will have three main layers :
The core objects
This layer will store the hard data, for example the Nodes’ name, type, position, …
It will contain python objects such as a Node class and a Graph class.
They are necessary to bind the qml data with the python data. For example, to expose the Nodes’ data in the form of QProperties.
It will contain objects such as a NodeWrapper class and a GraphWrapper class.
The qml objects
These are the one that the user will be able to see in the application. They are created from a model defined by the wrappers.
We want to separate the data concerning our three elements, so we will have three directories :
Each one will include the corresponding core objects, wrappers and qml objects. This way, we can work on and execute the three elements separatly.