| 514 | } |
| 515 | |
| 516 | int32_t PyScene::add_camera_group(const std::string& name, const int32_t parent, const size_t camera_count) { |
| 517 | std::optional<vis::op::SceneGraphStateSnapshot> history_before; |
| 518 | if (auto* const scene_manager = get_scene_manager()) { |
| 519 | history_before = vis::op::SceneGraphPatchEntry::captureState(*scene_manager, {name}); |
| 520 | } |
| 521 | |
| 522 | const int32_t node_id = scene_->addCameraGroup(name, parent, camera_count); |
| 523 | if (node_id == core::NULL_NODE) { |
| 524 | return core::NULL_NODE; |
| 525 | } |
| 526 | const auto* const added = scene_->getNodeById(node_id); |
| 527 | const std::string added_name = added ? added->name : name; |
| 528 | |
| 529 | if (auto* const scene_manager = get_scene_manager()) { |
| 530 | ensure_scene_manager_content_type(*scene_manager, vis::SceneManager::ContentType::Dataset); |
| 531 | vis::op::undoHistory().push(std::make_unique<vis::op::SceneGraphPatchEntry>( |
| 532 | *scene_manager, |
| 533 | "Add Camera Group", |
| 534 | std::move(*history_before), |
| 535 | vis::op::SceneGraphPatchEntry::captureState(*scene_manager, {added_name}))); |
| 536 | } |
| 537 | return node_id; |
| 538 | } |
| 539 | |
| 540 | int32_t PyScene::add_camera(const std::string& name, |
| 541 | const int32_t parent, |
nothing calls this directly
no test coverage detected