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

Method getCurrentPortMapping

bt_editor/models/BehaviorTreeNodeModel.cpp:374–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374PortsMapping BehaviorTreeDataModel::getCurrentPortMapping() const
375{
376 PortsMapping out;
377
378 for(const auto& it: _ports_widgets)
379 {
380 const auto& label = it.first;
381 const auto& value = it.second;
382
383 if(auto linedit = dynamic_cast<QLineEdit*>( value ) )
384 {
385 out.insert( std::make_pair( label, linedit->text() ) );
386 }
387 else if( auto combo = dynamic_cast<QComboBox*>( value ) )
388 {
389 out.insert( std::make_pair( label, combo->currentText() ) );
390 }
391 }
392 return out;
393}
394
395QJsonObject BehaviorTreeDataModel::save() const
396{

Callers 3

BuildTreeFromSceneFunction · 0.80
substituteNodeMethod · 0.80
RecursivelyCreateXmlFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected