MCPcopy Create free account
hub / github.com/Gecode/gecode / setCurrentNode

Method setCurrentNode

gecode/gist/treecanvas.cpp:1326–1359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1324 }
1325
1326 void
1327 TreeCanvas::setCurrentNode(VisualNode* n, bool finished, bool update) {
1328 if (finished)
1329 mutex.lock();
1330 if (update && n != nullptr && n != currentNode &&
1331 n->getStatus() != UNDETERMINED && !n->isHidden()) {
1332 Space* curSpace = nullptr;
1333 for (int i=0; i<moveInspectors.size(); i++) {
1334 if (moveInspectors[i].second) {
1335 if (curSpace == nullptr)
1336 curSpace = n->getSpace(*na,curBest,c_d,a_d);
1337 try {
1338 moveInspectors[i].first->inspect(*curSpace);
1339 } catch (Exception& e) {
1340 qFatal("Exception in move inspector %d: %s.\n Stopping.",
1341 i, e.what());
1342 }
1343 }
1344 }
1345 }
1346 if (n != nullptr) {
1347 currentNode->setMarked(false);
1348 currentNode = n;
1349 currentNode->setMarked(true);
1350 emit statusChanged(currentNode,stats,finished);
1351 if (update) {
1352 compareNodes = false;
1353 setCursor(QCursor(Qt::ArrowCursor));
1354 QWidget::update();
1355 }
1356 }
1357 if (finished)
1358 mutex.unlock();
1359 }
1360
1361 void
1362 TreeCanvas::mousePressEvent(QMouseEvent* event) {

Callers 2

runMethod · 0.80
selectBookmarkMethod · 0.80

Calls 8

updateFunction · 0.85
getStatusMethod · 0.80
isHiddenMethod · 0.80
setMarkedMethod · 0.80
sizeMethod · 0.45
getSpaceMethod · 0.45
inspectMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected