| 889 | } |
| 890 | |
| 891 | void Scene::OnSetCameraViewMode(MVS::IIndex camID) { |
| 892 | if (!IsOpen() || camID >= images.size()) |
| 893 | return; |
| 894 | |
| 895 | // Save current camera state if entering camera view mode for the first time |
| 896 | if (!window.GetCamera().IsCameraViewMode()) |
| 897 | window.GetCamera().SaveCurrentState(); |
| 898 | window.GetCamera().SetCurrentCamID(camID); |
| 899 | |
| 900 | // Get the Image from images and then access the MVS::Image via its index |
| 901 | Image& image = images[camID]; |
| 902 | const MVS::Image& imageData = scene.images[image.idx]; |
| 903 | |
| 904 | // Load the image if not already loaded |
| 905 | if (!image.IsValid() && !image.IsImageLoading()) { |
| 906 | // Load image asynchronously |
| 907 | image.SetImageLoading(); |
| 908 | events.AddEvent(new EVTLoadImage(this, camID, IMAGE_MAX_RESOLUTION)); |
| 909 | } |
| 910 | |
| 911 | // Update camera with the scene data and viewport |
| 912 | window.GetCamera().SetCameraFromSceneData(imageData); |
| 913 | } |
| 914 | |
| 915 | void Scene::OnSelectPointsByCamera(bool highlightCameraVisiblePoints) { |
| 916 | if (!scene.pointcloud.IsValid() || scene.images.empty()) |
nothing calls this directly
no test coverage detected