wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
SplitCommand Class Reference

Undo command that inserts a Node junction into an existing connection. More...

#include <Commands.h>

Inheritance diagram for SplitCommand:
[legend]

Public Member Functions

void redo () override
 Inserts the node and splits the connection.
 SplitCommand (Connection *conn, QPointF mousePos, Scene *scene, QUndoCommand *parent=nullptr)
 Constructs the split command.
void undo () override
 Removes the node and restores the original connection.

Detailed Description

Undo command that inserts a Node junction into an existing connection.

Definition at line 249 of file Commands.h.

Constructor & Destructor Documentation

◆ SplitCommand()

SplitCommand::SplitCommand ( Connection * conn,
QPointF mousePos,
Scene * scene,
QUndoCommand * parent = nullptr )
explicit

Constructs the split command.

Parameters
connConnection to split.
mousePosScene position where the node will be inserted.
sceneTarget scene.
parentOptional parent undo command.

Definition at line 551 of file Commands.cpp.

References Connection::angle(), ElementFactory::buildElement(), Connection::endPort(), Port::graphicElement(), Constants::gridSize, ItemWithId::id(), PANDACEPTION, and Connection::startPort().

Member Function Documentation

◆ redo()

void SplitCommand::redo ( )
override

Inserts the node and splits the connection.

Definition at line 610 of file Commands.cpp.

References ElementFactory::buildElement(), CommandUtils::findConn(), CommandUtils::findElm(), PANDACEPTION, and qCDebug.

◆ undo()

void SplitCommand::undo ( )
override

Removes the node and restores the original connection.

Definition at line 663 of file Commands.cpp.

References CommandUtils::findConn(), CommandUtils::findElm(), PANDACEPTION, and qCDebug.


The documentation for this class was generated from the following files: