Skip to content

Added duplicate selection (CTRL+D), undo and redo (CTRL+Z/Y) with scene history. - #133

Open
ReubenJCarter wants to merge 53 commits into
paceholder:masterfrom
ScanLAB-Projects:master
Open

ReubenJCarter wants to merge 53 commits into
paceholder:masterfrom
ScanLAB-Projects:master

Conversation

@ReubenJCarter

Copy link
Copy Markdown

No description provided.

@paceholder

Copy link
Copy Markdown
Owner

My laptop is in repair and I was busy with our small baby last weeks.
I will come back to it as soon as I can.

Thanks
Dmitry

@Daguerreo Daguerreo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be const and inline as other getters

Comment thread src/NodeDataModel.cpp
}


void NodeDataModel::setToolTipText(QString text)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to const QString& text

Comment thread include/nodes/internal/FlowScene.hpp Outdated

Node&restoreNode(QJsonObject const& nodeJson);

QUuid pasteNode(QJsonObject &json);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it const reference

Comment thread src/FlowView.cpp Outdated
_scene->UpdateHistory();
}

void FlowView::duplicateSelectedNode()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of implicit conversion warning float-double

Comment thread src/FlowView.cpp Outdated

//create nodes
std::vector<Node*> createdNodes;
std::vector<Node*> couterpartNode;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "counterPart" ?

Comment thread src/FlowScene.cpp

void FlowScene::pasteConnection(QJsonObject const &connectionJson, QUuid newIn, QUuid newOut)
{
QUuid nodeInId = QUuid(connectionJson["in_id"].toString());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused nodeInId and nodeOutId

Comment thread 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused variable

@paceholder

Copy link
Copy Markdown
Owner

This pull request has a plenty of unrelated features.
Some of them seemed to be half-baked.

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

jacquespillet and others added 20 commits November 23, 2023 16:44
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.
contextMenuEvent was an empty stub, so a group's colour could only be set by
editing the saved JSON. The colour is stored in r/g/b, which Group::save()
already writes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
FlowView::setNavigation(blender, trackpadScroll), default Blender + trackpad:
middle-drag or Alt+left-drag pans, Ctrl+that zooms, left-drag on empty space
box-selects, Home frames all nodes; trackpad scroll pans and Ctrl+scroll
(pinch) zooms at the cursor, or the wheel zooms in mouse mode.
blender=false keeps the original left-drag pan / wheel step zoom.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…p under the mouse

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Drawing mode: auto (software over Remote Desktop, where OpenGL falls back to
  slow software GL), OpenGL, or software; software repaints only what changed.
- Low detail below 40% zoom: embedded widgets hidden.
- Anti-aliasing off while panning/zooming, back on 150 ms after.
- Optional frame-time overlay to measure (ms/frame, mode, node count).
- Group collapse button: hamburger icon, always top-left; name keeps clear.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Zoom no longer scales with the trackpad pan speed and each step is capped
at one notch (1.1x at zoom speed 1), so coarse Ctrl+scroll/pinch steps over
RDP don't jump. Pan speed default 4. The frame-time overlay also shows the
last raw wheel event (angle/pixel delta, modifier) to tune against.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Zoom felt slow/jumpy: every step jumped to the new scale and forced every
visible node to re-render its DeviceCoordinateCache at the new zoom level.
Wheel/pinch zoom now accumulates a target (1.2x per notch at zoom speed 1,
at most ~3 notches queued) and eases towards it at 60 fps; while zooming,
nodes use ItemCoordinateCache (scaled pixmap) and return to the crisp
device cache 150 ms after the last step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Groups: colour/collapse menu, Blender-style navigation, faster drawing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants