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

Method onSmartRemove

bt_editor/graphic_container.cpp:523–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523void GraphicContainer::onSmartRemove(QtNodes::Node* node)
524{
525 auto parent_node = GetParentNode( node );
526 NodeState::ConnectionPtrSet conn_out = node->nodeState().connections(PortType::Out, 0);
527
528 if( !parent_node || conn_out.size() == 0 )
529 {
530 return;
531 }
532
533 {
534 const QSignalBlocker blocker(this);
535 for( auto& it: conn_out)
536 {
537 auto child_node = it.second->getNode(PortType::In);
538 _scene->createConnection( *child_node, 0, *parent_node, 0 );
539 }
540 _scene->removeNode( *node );
541 nodeReorder();
542 }
543 undoableChange();
544}
545
546void GraphicContainer::insertNodeInConnection(Connection &connection, QString node_name)
547{

Callers 1

onDestroySubTreeMethod · 0.80

Calls 1

GetParentNodeFunction · 0.85

Tested by

no test coverage detected