21 bool ActionMoveNode::checkContextId()
25 log_warning(
"gui",
"ActionMoveNode invoked without context ID.");
31 log_warning(
"gui",
"ActionMoveNode invoked with illegal context ID {}.", mContextId);
39 : mContextId(ctxId), mSwap(false)
41 if (!checkContextId())
return;
43 mGridPlacement = *gridPlc;
47 : mContextId(ctxID), mTo(
to), mSwap(false)
49 if (!checkContextId())
return;
111 if (xmlIn.
name() ==
"to")
119 Q_ASSERT(sl.
size()==2);
120 return QPoint(sl.
at(0).toInt(),sl.
at(1).toInt());
125 if (!mContextId)
return false;
127 if (!ctx)
return false;
137 mGridPlacement = undo->mGridPlacement;
153 if (!mTargetNode.
isNull())
156 if (!mSwap)
return false;
159 mGridPlacement[ndToMove] = mTo;
168 for (
Node node : mGridPlacement.
keys())
170 if(node.isModule()) modIds.
insert(node.id());
171 else gateIds.
insert(node.id());
UserActionFactory for ActionMoveNode.
UserAction * newAction() const
static ActionMoveNodeFactory * sFactory
void addToHash(QCryptographicHash &cryptoHash) const override
void writeToXml(QXmlStreamWriter &xmlOut) const override
void readFromXml(QXmlStreamReader &xmlIn) override
QString tagname() const override
ActionMoveNode(u32 ctxID, const QPoint &to)
Logical container for modules, gates, and nets.
void add(const QSet< u32 > &modules, const QSet< u32 > &gates, PlacementHint placement=PlacementHint())
void scheduleSceneUpdate()
GraphLayouter * getLayouter() const
GraphContext * getContextById(u32 id) const
const QMap< Node, QPoint > nodeToPositionMap() const
static GridPlacement * getGridPlacement(int viewId)
The Node class object represents a module or a gate.
NodeType type() const
type getter for type information
bool isNull() const
isNull test for null-Node object typically returned from functions
The PlacementHint class object provides hints for the layouter how new box objects are placed on a vi...
The UserActionFactory is the abstract base class for registration.
The UserAction class is the abstract base class for user interactions.
UserActionObjectType::ObjectType type() const
#define log_warning(channel,...)
GraphContextManager * gGraphContextManager
void addData(const char *data, int length)
bool isEmpty() const const
QList< Key > keys() const const
const T & at(int i) const const
QSet::iterator insert(const T &value)
QStringList split(const QString &sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QStringRef name() const const
QString readElementText(QXmlStreamReader::ReadElementTextBehaviour behaviour)
bool readNextStartElement()
void writeTextElement(const QString &qualifiedName, const QString &text)