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

Method onChangeNodesStatus

bt_editor/mainwindow.cpp:1343–1367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1341}
1342
1343void MainWindow::onChangeNodesStatus(const QString& bt_name,
1344 const std::vector<std::pair<int, NodeStatus> > &node_status)
1345{
1346 auto tree = BuildTreeFromScene( getTabByName(bt_name)->scene() );
1347
1348 for (auto& it: node_status)
1349 {
1350 const int index = it.first;
1351 const NodeStatus status = it.second;
1352 auto& abs_node = tree.nodes().at(index);
1353
1354 auto gui_node = abs_node.graphic_node;
1355 auto style = getStyleFromStatus( status );
1356 gui_node->nodeDataModel()->setNodeStyle( style.first );
1357 gui_node->nodeGraphicsObject().update();
1358
1359 const auto& conn_in = gui_node->nodeState().connections(PortType::In, 0 );
1360 if(conn_in.size() == 1)
1361 {
1362 auto conn = conn_in.begin()->second;
1363 conn->setStyle( style.second );
1364 conn->connectionGraphicsObject().update();
1365 }
1366 }
1367}
1368
1369void MainWindow::onTabCustomContextMenuRequested(const QPoint &pos)
1370{

Callers

nothing calls this directly

Calls 3

BuildTreeFromSceneFunction · 0.85
getStyleFromStatusFunction · 0.85
sceneMethod · 0.80

Tested by

no test coverage detected