MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / disconnectInputInternal

Method disconnectInputInternal

Engine/NodeInputs.cpp:1165–1239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163} // Node::disconnectInput
1164
1165int
1166Node::disconnectInputInternal(Node* input, bool useGuiValues)
1167{
1168 assert(_imp->inputsInitialized);
1169 assert(input);
1170 if (!input) {
1171 throw std::logic_error(__func__);
1172 }
1173 int found = -1;
1174 NodePtr inputShared;
1175 {
1176 QMutexLocker l(&_imp->inputsMutex);
1177 if (!useGuiValues) {
1178 for (std::size_t i = 0; i < _imp->inputs.size(); ++i) {
1179 NodePtr curInput = _imp->inputs[i].lock();
1180 if (curInput.get() == input) {
1181 inputShared = curInput;
1182 found = (int)i;
1183 break;
1184 }
1185 }
1186 } else {
1187 for (std::size_t i = 0; i < _imp->guiInputs.size(); ++i) {
1188 NodePtr curInput = _imp->guiInputs[i].lock();
1189 if (curInput.get() == input) {
1190 inputShared = curInput;
1191 found = (int)i;
1192 break;
1193 }
1194 }
1195 }
1196 }
1197 if (found != -1) {
1198 {
1199 QMutexLocker l(&_imp->inputsMutex);
1200 if (!useGuiValues) {
1201 _imp->inputs[found].reset();
1202 _imp->guiInputs[found].reset();
1203 } else {
1204 _imp->guiInputs[found].reset();
1205 }
1206 }
1207 input->disconnectOutput(useGuiValues, this);
1208 Q_EMIT inputChanged(found);
1209 bool mustCallEnd = false;
1210 if (!useGuiValues) {
1211 beginInputEdition();
1212 mustCallEnd = true;
1213 onInputChanged(found);
1214 }
1215 bool creatingNodeTree = getApp()->isCreatingNodeTree();
1216 if (!creatingNodeTree) {
1217 ///Recompute the hash
1218 if ( !getApp()->getProject()->isProjectClosing() ) {
1219 computeHash();
1220 }
1221 }
1222

Callers 1

deactivateMethod · 0.80

Calls 12

getAppFunction · 0.85
disconnectOutputMethod · 0.80
isCreatingNodeTreeMethod · 0.80
isProjectClosingMethod · 0.80
getProjectMethod · 0.80
emptyMethod · 0.80
sizeMethod · 0.45
lockMethod · 0.45
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected