MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / onLayerAdded

Method onLayerAdded

pj_app/src/ui/Scene3DConfigPanel.cpp:927–947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

925}
926
927void Scene3DConfigPanel::onLayerAdded(ObjectTopicId topic_id) {
928 if (bound_dock_ == nullptr) {
929 return;
930 }
931 ISceneLayer* layer = bound_dock_->layerFor(topic_id);
932 if (layer == nullptr) {
933 return;
934 }
935 const SceneLayerInfo info = layer->info();
936 if (info.object_type == sdk::BuiltinObjectType::kRobotDescription) {
937 // Robot layers get a Model/URDF row, not a Topics-list row. Idempotent, so
938 // a row already created by onAddModelClicked is not duplicated here.
939 addRobotRow(info.topic_id.id, info.display_name, info.display_name);
940 return;
941 }
942 layer_list_->addRow(rowFromLayerInfo(info));
943 const auto warning = bound_dock_->orphanState(topic_id);
944 layer_list_->setRowWarning(static_cast<qint64>(topic_id.id), warning.is_orphan, warning.reason);
945 // A new same-family sibling can enable the apply-to-family button.
946 updateParamsToolbarState();
947}
948
949void Scene3DConfigPanel::onLayerRemoved(ObjectTopicId topic_id) {
950 layer_list_->removeRow(static_cast<qint64>(topic_id.id));

Callers

nothing calls this directly

Calls 6

rowFromLayerInfoFunction · 0.85
layerForMethod · 0.80
addRowMethod · 0.80
orphanStateMethod · 0.80
setRowWarningMethod · 0.80
infoMethod · 0.45

Tested by

no test coverage detected