Skip to content

Commit fce68ef

Browse files
added button to re-activate observation settings
1 parent d99dd9b commit fce68ef

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/PRo3D.Core/GisApp-Model.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ type ObservationInfoAction =
9090
| SetObserver of option<EntitySpiceName>
9191
| SetTime of DateTime
9292
| SetReferenceFrame of option<FrameSpiceName>
93+
| Reset
9394

9495
[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
9596
module GisSurface =

src/PRo3D.Core/GisApp/ObservationInfo.fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ module ObservationInfo =
2626
{m with time = {m.time with date = time}}
2727
| ObservationInfoAction.SetReferenceFrame frame ->
2828
{m with referenceFrame = frame}
29+
| ObservationInfoAction.Reset ->
30+
match m.target with
31+
| None -> { m with target = None }
32+
| Some (EntitySpiceName n) -> // hack: perform dummy change to trigger recomputation of all parameters
33+
{m with target = Some (EntitySpiceName (n + "")) }
2934

3035
let view (m : AdaptiveObservationInfo)
3136
(entities : amap<EntitySpiceName, AdaptiveEntity>)
@@ -73,6 +78,7 @@ module ObservationInfo =
7378
Calendar.CalendarType.DateTime
7479
] |> UI.map CalendarMessage
7580
Html.row "Reference Frame:" [frameDropdown]
81+
Html.row "Reset" [button [onClick (fun _ -> Reset)] [text "Re-use settings above"]]
7682
]
7783
)
7884

src/PRo3D.Core/Sg.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ module Sg =
341341
match planet with
342342
| Planet.Mars | Planet.Earth -> refsystem
343343
| Planet.ENU -> refsystem2
344+
| Planet.Moon | Planet.Dimorphos | Planet.Deimos | Planet.Didymos | Planet.Phobos -> refsystem
344345
| _ -> xyzSystem
345346
)
346347

src/PRo3D.Viewer/Viewer/Viewer.fs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,6 +1297,14 @@ module ViewerApp =
12971297
let m = { m with shiftFlag = true}
12981298
Log.line "[Viewer] ShiftFlag %A" m.shiftFlag
12991299
m
1300+
| Aardvark.Application.Keys.C ->
1301+
Log.line "[Viewer] reset orbit to center"
1302+
let c = m.scene.config
1303+
let ref = m.scene.referenceSystem
1304+
let navigation' =
1305+
Navigation.update c ref navConf true None m.navigation (Navigation.Action.ArcBallAction(ArcBallController.Message.Pick V3d.Zero))
1306+
{ m with navigation = navigation' }
1307+
13001308
| _ -> m
13011309

13021310

0 commit comments

Comments
 (0)