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'
| 140 | /// 2) If so, clear Connection entry in the NodeState |
| 141 | /// 3) Set Connection end to 'requiring a port' |
| 142 | bool |
| 143 | NodeConnectionInteraction:: |
| 144 | disconnect(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 |
nothing calls this directly
no test coverage detected