MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / disconnect

Method disconnect

QtNodeEditor/src/NodeConnectionInteraction.cpp:142–165  ·  view source on GitHub ↗

1) Node and Connection should be already connected 2) If so, clear Connection entry in the NodeState 3) Set Connection end to 'requiring a port'

Source from the content-addressed store, hash-verified

140/// 2) If so, clear Connection entry in the NodeState
141/// 3) Set Connection end to 'requiring a port'
142bool
143NodeConnectionInteraction::
144disconnect(PortType portToDisconnect) const
145{
146 PortIndex portIndex =
147 _connection->getPortIndex(portToDisconnect);
148
149 NodeState &state = _node->nodeState();
150
151 // clear pointer to Connection in the NodeState
152 state.getEntries(portToDisconnect)[portIndex].clear();
153
154 // 4) Propagate invalid data to IN node
155 _connection->propagateEmptyData();
156
157 // clear Connection side
158 _connection->clearNode(portToDisconnect);
159
160 _connection->setRequiredPort(portToDisconnect);
161
162 _connection->connectionGraphicsObject().grabMouse();
163
164 return true;
165}
166
167
168// ------------------ util functions below

Callers

nothing calls this directly

Calls 2

setRequiredPortMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected