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

Method getSubtreeNodesRecursively

bt_editor/graphic_container.cpp:235–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233
234
235std::set<QtNodes::Node*> GraphicContainer::getSubtreeNodesRecursively(Node &root_node)
236{
237 std::set<QtNodes::Node*> nodes;
238 std::function<void(QtNodes::Node&)> selectRecursively;
239
240 selectRecursively = [&](QtNodes::Node& node)
241 {
242 nodes.insert( &node );
243 auto children = getChildren(*_scene, node, false);
244 for (auto& child: children)
245 {
246 selectRecursively(*child);
247 }
248 };
249
250 selectRecursively(root_node);
251 return nodes;
252}
253
254void GraphicContainer::createSubtree(Node &root_node, QString subtree_name )
255{

Callers

nothing calls this directly

Calls 1

getChildrenFunction · 0.85

Tested by

no test coverage detected