MCPcopy Create free account
hub / github.com/cdcseacave/openMVS / OnSetCameraViewMode

Method OnSetCameraViewMode

apps/Viewer/Scene.cpp:891–913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

889}
890
891void 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
915void Scene::OnSelectPointsByCamera(bool highlightCameraVisiblePoints) {
916 if (!scene.pointcloud.IsValid() || scene.images.empty())

Callers

nothing calls this directly

Calls 10

IsCameraViewModeMethod · 0.80
SaveCurrentStateMethod · 0.80
SetCurrentCamIDMethod · 0.80
IsImageLoadingMethod · 0.80
SetImageLoadingMethod · 0.80
AddEventMethod · 0.80
sizeMethod · 0.45
GetCameraMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected