SetBranchSceneCommand.h header

#include <ew/core/SetBranchSceneCommand.h>

Namespace ew::core

SetBranchSceneCommand class

class ew::core::SetBranchSceneCommand

Command that replaces a scene's nodes, links and start node together. Undo restores all three.

Whole-graph rather than per-node, because the edits an author actually makes are not per-node: deleting a node also deletes every link touching it, and adding a choice adds a node and two links at once. A per-node command would make one gesture take several undo steps, so pressing Ctrl+Z would leave the scene in a state the author never created.

Members

ew::core::branching::SetBranchSceneCommand::SetBranchSceneCommand(BranchScene &scene, std::vector< BranchNode > nodes, std::vector< BranchLink > links, ew::core::foundation::BranchNodeId startNodeId)

Creates a command that applies nodes, links and startNodeId to scene.

ew::core::branching::SetBranchSceneCommand::~SetBranchSceneCommand() override

Destroys the command.

void ew::core::branching::SetBranchSceneCommand::apply() override

Records the scene's current contents and applies the new ones.

void ew::core::branching::SetBranchSceneCommand::undo() override

Restores the previous contents.

QString ew::core::branching::SetBranchSceneCommand::description() const override

Returns a short description for the undo/redo UI.

ew::core::foundation::OperationSubject ew::core::branching::SetBranchSceneCommand::subject() const override

Returns the subject this command changes. See Command::subject().