Added duplicate selection (CTRL+D), undo and redo (CTRL+Z/Y) with scene history.#133
Added duplicate selection (CTRL+D), undo and redo (CTRL+Z/Y) with scene history.#133ReubenJCarter wants to merge 44 commits intopaceholder:masterfrom
Conversation
…odes as the performance was bad. Added OpenGL rendering for flow view.
…hat have no endpoint on selection
… data model to nodes when duplicating
|
My laptop is in repair and I was busy with our small baby last weeks. Thanks |
… performance benefits
# Conflicts: # src/FlowView.cpp # src/FlowView.hpp
Daguerreo
left a comment
There was a problem hiding this comment.
Indenting is not consistent with the project. Copy and Pasting a node from a scene to another should not throw in case the node is not registered in second scene but just not performing the operation.
| virtual | ||
| NodePainterDelegate* painterDelegate() const { return nullptr; } | ||
|
|
||
| QString toolTipText(); |
There was a problem hiding this comment.
Should be const and inline as other getters
| } | ||
|
|
||
|
|
||
| void NodeDataModel::setToolTipText(QString text) |
include/nodes/internal/FlowScene.hpp
Outdated
|
|
||
| Node&restoreNode(QJsonObject const& nodeJson); | ||
|
|
||
| QUuid pasteNode(QJsonObject &json); |
| _scene->UpdateHistory(); | ||
| } | ||
|
|
||
| void FlowView::duplicateSelectedNode() |
There was a problem hiding this comment.
a lot of implicit conversion warning float-double
src/FlowView.cpp
Outdated
|
|
||
| //create nodes | ||
| std::vector<Node*> createdNodes; | ||
| std::vector<Node*> couterpartNode; |
|
|
||
| void FlowScene::pasteConnection(QJsonObject const &connectionJson, QUuid newIn, QUuid newOut) | ||
| { | ||
| QUuid nodeInId = QUuid(connectionJson["in_id"].toString()); |
src/FlowView.cpp
Outdated
| if(j >=0 && k>=0 && j < couterpartNode.size() && k < couterpartNode.size()) | ||
| { | ||
| auto connection = _scene->createConnection(*createdNodes[j], portIndexIn, *createdNodes[k], portIndexOut); | ||
| auto& connectionRef = connection; |
|
This pull request has a plenty of unrelated features. Nevertheless, I took some coding samples from this work and implemented an Undo/Redo system and a Ctrl+D node duplication mechanism. I'll continlue looking through the code to take more features for master |
Added logic to avoid saving duplicate connections when serializing the scene and when exporting selected nodes and connections. This ensures that each connection is only included once in the resulting JSON, improving data integrity and preventing redundant entries.
No description provided.