![]() |
HAL
|
Moves a node. More...
#include <action_move_node.h>
Public Member Functions | |
ActionMoveNode (u32 ctxID, const QPoint &to) | |
ActionMoveNode (u32 ctxId=0, const GridPlacement *gridPlc=nullptr) | |
bool | exec () override |
QString | tagname () const override |
void | writeToXml (QXmlStreamWriter &xmlOut) const override |
void | readFromXml (QXmlStreamReader &xmlIn) override |
void | addToHash (QCryptographicHash &cryptoHash) const override |
![]() | |
virtual | ~UserAction () |
virtual UserActionObject | object () const |
virtual void | setObject (const UserActionObject &obj) |
int | compoundOrder () const |
void | setCompoundOrder (int cmpord) |
qint64 | timeStamp () const |
QString | cryptographicHash (int recordNo) const |
UserAction * | undoAction () const |
QString | debugDump () const |
void | setObjectLock (bool lock) |
void | setParentObjectLock (bool lock) |
bool | hasProjectModified () const |
Additional Inherited Members | |
![]() | |
UserAction () | |
void | writeParentObjectToXml (QXmlStreamWriter &xmlOut) const |
void | readParentObjectFromXml (QXmlStreamReader &xmlIn) |
![]() | |
static QString | setToText (const QSet< u32 > &set) |
static QSet< u32 > | setFromText (const QString &s) |
static QString | gridToText (const QHash< hal::Node, QPoint > &grid) |
static QHash< hal::Node, QPoint > | gridFromText (const QString &txt) |
![]() | |
UserActionObject | mObject |
UserActionObject | mParentObject |
int | mCompoundOrder |
UserAction * | mUndoAction |
qint64 | mTimeStamp |
bool | mObjectLock |
bool | mParentObjectLock |
bool | mProjectModified |
Moves a node.
Moves a node to another grid position in the GraphicsScene. The Context ID should be provided by passing it in the UserActionObject of type UserActionObjectType::Context.
Undo Action: ActionMoveNode
Definition at line 42 of file action_move_node.h.
empty constructor
ctxId | Action constructor. |
The action object will be set by 'from' node
ctxID | - context |
from | - The initial position of the node to move |
to | - The destination of the node Action constructor. |
The action object is the node to be moved
ctxID | - context |
to | - The destination of the node |
Definition at line 46 of file action_move_node.cpp.
Referenced by exec().
hal::ActionMoveNode::ActionMoveNode | ( | u32 | ctxId = 0 , |
const GridPlacement * | gridPlc = nullptr |
||
) |
Action constructor.
Will move the nodes according to GridPlacement position info, no action object should be given
ctxID | - context |
gridPlc | - The grid placement instance to copy (if any) |
Definition at line 38 of file action_move_node.cpp.
|
overridevirtual |
Hook for derived classes to add parameter to cryptographic hash.
cryptoHash | - Additional hash data. |
Reimplemented from hal::UserAction.
Definition at line 97 of file action_move_node.cpp.
References QCryptographicHash::addData().
|
overridevirtual |
Executes user interaction and returns true on success. Note: Each implementation of exec() must include a call to the exec() method of base class to store the UserAction object in history and to transfer its ownership.
Reimplemented from hal::UserAction.
Definition at line 123 of file action_move_node.cpp.
References ActionMoveNode(), hal::GraphContext::add(), hal::GraphContext::clear(), hal::UserAction::exec(), hal::Node::Gate, hal::UserActionObjectType::Gate, hal::GraphContextManager::getContextById(), hal::GuiApiClasses::View::getGridPlacement(), hal::GraphContext::getLayouter(), hal::gGraphContextManager, hal::UserActionObject::id(), QSet::insert(), QHash::isEmpty(), hal::Node::isNull(), QHash::keys(), hal::UserAction::mObject, hal::Node::Module, hal::UserActionObjectType::Module, hal::UserAction::mUndoAction, hal::GraphLayouter::nodeToPositionMap(), hal::Node::None, hal::GraphContext::scheduleSceneUpdate(), hal::Node::type(), and hal::UserActionObject::type().
Referenced by hal::GraphGraphicsView::dropEvent().
|
overridevirtual |
Reads user interaction as well as arguments from xml macro file.
xmlIn | - The xml reader. |
Reimplemented from hal::UserAction.
Definition at line 107 of file action_move_node.cpp.
References QXmlStreamReader::name(), QXmlStreamReader::readElementText(), and QXmlStreamReader::readNextStartElement().
|
overridevirtual |
The xml tagname for the action is purely virtual and needs to be implemented in derived class.
Implements hal::UserAction.
Definition at line 92 of file action_move_node.cpp.
References hal::ActionMoveNodeFactory::sFactory, and hal::UserActionFactory::tagname().
|
overridevirtual |
Persist user interaction in xml macro file.
xmlOut | - The xml writer. |
Reimplemented from hal::UserAction.
Definition at line 102 of file action_move_node.cpp.
References QString::arg(), QXmlStreamWriter::writeTextElement(), QPoint::x(), and QPoint::y().