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

Method applySceneControlsTo

pj_app/src/ui/Scene3DConfigPanel.cpp:525–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523}
524
525void Scene3DConfigPanel::applySceneControlsTo(Scene3DDockWidget* dock) {
526 if (dock == nullptr) {
527 return;
528 }
529 auto* view = dock->sceneView();
530 if (view == nullptr) {
531 return;
532 }
533 // The scene-control field set is mirrored across FOUR sites — keep them in sync
534 // when adding a control (a miss is silent, no compile error): this push,
535 // loadControlsFromDock (reflect-on-bind), and Scene3DDockWidget's
536 // xmlSaveState/xmlLoadState (per-dock layout persistence).
537 view->setGridVisible(grid_eye_->isChecked());
538 view->setGridStyle(
539 grid_cells_button_->isChecked() ? pj::scene3d::GridRenderPass::Style::kFilledCells
540 : pj::scene3d::GridRenderPass::Style::kLines);
541 view->setGridExtentMetres(static_cast<float>(grid_size_->value()));
542 view->setGridDivisions(grid_divisions_->value());
543 view->setAxesVisible(gizmo_eye_->isChecked());
544 view->setGizmoSize(static_cast<float>(gizmo_size_->value()));
545 view->setGizmoOpacity(static_cast<float>(gizmo_opacity_->value()));
546 view->setTfConnectionsVisible(tf_lines_button_->isChecked());
547
548 // Per-view look knobs: drives only the bound dock's view. Sibling docks keep
549 // their own MeshShadingParams and converge when the panel rebinds and applies.
550 auto& shading = view->meshShadingParams();
551 shading.meshes_visible = mesh_eye_->isChecked();
552 shading.mesh_opacity = static_cast<float>(mesh_opacity_->value());
553 shading.collisions_visible = collision_eye_->isChecked();
554 shading.collision_opacity = static_cast<float>(collision_opacity_->value());
555 shading.shadows_enabled = shadows_eye_->isChecked();
556 view->update();
557}
558
559void Scene3DConfigPanel::loadControlsFromDock(Scene3DDockWidget* dock) {
560 if (dock == nullptr) {

Callers 1

makeSceneDockMethod · 0.80

Calls 12

sceneViewMethod · 0.80
setGridStyleMethod · 0.80
setGridExtentMetresMethod · 0.80
setGridDivisionsMethod · 0.80
setAxesVisibleMethod · 0.80
setGridVisibleMethod · 0.45
isCheckedMethod · 0.45
valueMethod · 0.45
setGizmoSizeMethod · 0.45
setGizmoOpacityMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected