| 523 | } |
| 524 | |
| 525 | void 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 | |
| 559 | void Scene3DConfigPanel::loadControlsFromDock(Scene3DDockWidget* dock) { |
| 560 | if (dock == nullptr) { |
no test coverage detected