From 04b34b17402c02f035b6a906f4f6d92ca2a82078 Mon Sep 17 00:00:00 2001 From: rnowak Date: Wed, 28 Feb 2024 13:05:42 +0100 Subject: [PATCH] bookmark animation for GIS functionality finsihed apart from actually calling spice function and transforming surfaces #379 --- .../SequencedBookmarks/BookmarkAnimations.fs | 1 - .../SequencedBookmarksApp.fs | 13 ++++++------ src/PRo3D.Viewer/Viewer/ViewerLenses.fs | 21 ++++++++++++++++++- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/PRo3D.Core/SequencedBookmarks/BookmarkAnimations.fs b/src/PRo3D.Core/SequencedBookmarks/BookmarkAnimations.fs index 5a6a0fe0..c32de3cc 100644 --- a/src/PRo3D.Core/SequencedBookmarks/BookmarkAnimations.fs +++ b/src/PRo3D.Core/SequencedBookmarks/BookmarkAnimations.fs @@ -349,7 +349,6 @@ module BookmarkAnimations = let pathWithPausing (m : SequencedBookmarks) (lenses : BookmarkLenses<'a>) (outerModel : 'a) = - let aspectRatio = m.resolutionX.value / m.resolutionY.value let bookmarks = orderedLoadedBookmarks m let animations = bookmarks diff --git a/src/PRo3D.Core/SequencedBookmarks/SequencedBookmarksApp.fs b/src/PRo3D.Core/SequencedBookmarks/SequencedBookmarksApp.fs index 4b05fc05..f1c27b64 100644 --- a/src/PRo3D.Core/SequencedBookmarks/SequencedBookmarksApp.fs +++ b/src/PRo3D.Core/SequencedBookmarks/SequencedBookmarksApp.fs @@ -236,7 +236,8 @@ module SequencedBookmarksApp = let m = selectSBookmark m firstBookmark match m.animationSettings.useGlobalAnimation with | true -> - pathWithPausing m lenses outerModel//smoothPathAllBookmarks m lenses outerModel //does not work with focal length + //smoothPathAllBookmarks m lenses outerModel //removed because it does not work with focal length + pathWithPausing m lenses outerModel | false -> pathWithPausing m lenses outerModel | None -> @@ -662,20 +663,18 @@ module SequencedBookmarksApp = ) let viewSnapshotGUI (model:AdaptiveSequencedBookmarks) = + // recording not in use because as it is, it only works on + // hardware that allows PRo3D to run smoothly let startRecordingButton = button [clazz "ui icon button"; onMouseClick (fun _ -> StartRecording )] [ i [clazz "red circle icon"] [] ] - - let stopRecordingButton = button [clazz "ui icon button"; onMouseClick (fun _ -> StopRecording )] [ i [clazz "red stop icon"] [] ] - - - let recordingButton = + let recordingButton = model.isRecording |> AVal.map (fun r -> if r then stopRecordingButton else startRecordingButton) |> AList.ofAValSingle - + let generateButton = button [clazz "ui icon button"; onMouseClick (fun _ -> GenerateSnapshots )] [ i [clazz "camera icon"] [] ] diff --git a/src/PRo3D.Viewer/Viewer/ViewerLenses.fs b/src/PRo3D.Viewer/Viewer/ViewerLenses.fs index 9443b6bf..cb5fcf44 100644 --- a/src/PRo3D.Viewer/Viewer/ViewerLenses.fs +++ b/src/PRo3D.Viewer/Viewer/ViewerLenses.fs @@ -213,7 +213,26 @@ module ViewerLenses = | Some state -> Optic.set _sceneState state m | None -> m - updateSceneState sb m + let m = updateSceneState sb m + + let m = + match sb.observationInfo with + | Some info -> + match info.valuesIfComplete with + | Some (t, o, r) -> + // call spice function and transform surfaces here! + Log.line "[Debug] Call to spice function with + target: %s observer: %s reference frame: %s + time: %s" + t.Value o.Value r.spiceName.Value (string info.time.date) + m + | None -> + m + | None -> + m + + m + match sb with | SequencedBookmark.LoadedBookmark loaded -> update loaded