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

Method debugPrint

bt_editor/bt_editor_base.cpp:75–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void AbsBehaviorTree::debugPrint() const
76{
77 if( !rootNode() )
78 {
79 qDebug() << "Empty AbsBehaviorTree";
80 return;
81 }
82 std::function<void(const AbstractTreeNode*,int)> recursiveStep;
83
84 recursiveStep = [&](const AbstractTreeNode* node, int indent)
85 {
86 for(int i=0; i< indent; i++) printf(" ");
87
88 printf("%s (%s)",
89 node->instance_name.toStdString().c_str(),
90 node->model.registration_ID.toStdString().c_str() );
91 std::cout << std::endl; // force flush
92
93 for(int index: node->children_index)
94 {
95 auto child_node = &_nodes[index];
96 recursiveStep( child_node, indent+1);
97 }
98 };
99
100 recursiveStep( rootNode(), 0 );
101
102}
103
104bool AbsBehaviorTree::operator ==(const AbsBehaviorTree &other) const
105{

Callers 2

loadFileMethod · 0.80
testSubtreeMethod · 0.80

Calls

no outgoing calls

Tested by 2

loadFileMethod · 0.64
testSubtreeMethod · 0.64