| 645 | |
| 646 | |
| 647 | void GraphicContainer::loadSceneFromTree(const AbsBehaviorTree &tree) |
| 648 | { |
| 649 | AbsBehaviorTree abs_tree = tree; |
| 650 | _scene->clearScene(); |
| 651 | |
| 652 | auto& first_qt_node = _scene->createNodeAtPos( "Root", "Root", QPointF(0,0) ); |
| 653 | |
| 654 | QPointF cursor( - first_qt_node.nodeGeometry().width()*0.5, |
| 655 | - first_qt_node.nodeGeometry().height()*0.5); |
| 656 | |
| 657 | _scene->setNodePosition( first_qt_node, cursor ); |
| 658 | |
| 659 | auto root_node = abs_tree.rootNode(); |
| 660 | |
| 661 | if( root_node->model.registration_ID == "Root" ) |
| 662 | { |
| 663 | root_node->graphic_node = &first_qt_node; |
| 664 | int root_child_index = root_node->children_index.front(); |
| 665 | root_node = abs_tree.node(root_child_index); |
| 666 | } |
| 667 | |
| 668 | recursiveLoadStep(cursor, abs_tree, root_node, &first_qt_node, 1 ); |
| 669 | NodeReorder( *_scene, abs_tree ); |
| 670 | } |
| 671 | |
| 672 | void GraphicContainer::appendTreeToNode(Node &node, AbsBehaviorTree& subtree) |
| 673 | { |
no test coverage detected