Skip to content

Commit

Permalink
bugfix for sequenced bookmarks bug in combination with traverses
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaNowak committed Jul 15, 2024
1 parent 0a41c73 commit f372ac9
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 38 deletions.
1 change: 1 addition & 0 deletions dotnetRunViewer.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet run src\PRo3D.sln --project src\PRo3D.Viewer\PRo3D.Viewer.fsproj -loadRecent
92 changes: 54 additions & 38 deletions src/PRo3D.Viewer/Viewer/ViewerLenses.fs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ module ViewerLenses =
m.scene.surfacesModel.sgSurfaces then state
else
Log.warn "[ViewerLenses] Surfaces have been added or removed making this scene state invalid.
Not applying surfaces for this scene state."
Not applying surfaces for this scene state. Update Scene State for this bookmark
or delete and create new bookmark."
{state with stateSurfaces = m.scene.surfacesModel.surfaces}

Log.line "m.origin = %s, state.origin = %s" (string m.scene.referenceSystem.origin) (string state.stateReferenceSystem.origin)
let scaleBars = // check scale bars; using old segments for performance reasons
if haveSameKeys state.stateScaleBars.scaleBars
m.scene.scaleBars.scaleBars then
Expand Down Expand Up @@ -139,44 +140,59 @@ module ViewerLenses =
state.stateConfig.farPlane
| true ->
state.stateConfig.frustumModel.frustum
{m with
drawing = {m.drawing with annotations = state.stateAnnoatations}
scene =
{m.scene with
surfacesModel = {m.scene.surfacesModel with surfaces = state.stateSurfaces}
sceneObjectsModel = state.stateSceneObjects
scaleBars = scaleBars
geologicSurfacesModel = state.stateGeologicSurfaces
config =
{m.scene.config with
nearPlane =
{m.scene.config.nearPlane with value = state.stateConfig.nearPlane}
farPlane =
{m.scene.config.farPlane with value = state.stateConfig.farPlane}
frustumModel = state.stateConfig.frustumModel
arrowLength =
{m.scene.config.arrowLength with value = state.stateConfig.arrowLength}
arrowThickness =
{m.scene.config.arrowLength with value = state.stateConfig.arrowThickness}
dnsPlaneSize =
{m.scene.config.dnsPlaneSize with value = state.stateConfig.dnsPlaneSize}
lodColoring = state.stateConfig.lodColoring
drawOrientationCube = state.stateConfig.drawOrientationCube
}
referenceSystem =
{m.scene.referenceSystem with
origin = state.stateReferenceSystem.origin
isVisible = state.stateReferenceSystem.isVisible
size =
{m.scene.referenceSystem.size with
value = state.stateReferenceSystem.size}
selectedScale = state.stateReferenceSystem.selectedScale
let m =
let refSysState =
/// UPDATING REF SYSTEM HERE LEADS TO TRAVERSE CALCULATIONS BERING TRIGGERED, EVEN IF THE REF SYSTEM DOES NOT CHANGE!
/// so we check manually if the reference system has changed, and only assign it if there is a change
{m.scene.referenceSystem with
origin = state.stateReferenceSystem.origin
isVisible = state.stateReferenceSystem.isVisible
size =
{m.scene.referenceSystem.size with
value = state.stateReferenceSystem.size}
selectedScale = state.stateReferenceSystem.selectedScale
}
if m.scene.referenceSystem <> refSysState then
{m with scene =
{m.scene with
referenceSystem = refSysState
}
traverses = traverses

}
frustum = frustum
}
else
m

let m =
{m with
drawing = {m.drawing with annotations = state.stateAnnoatations}
scene =
{m.scene with
surfacesModel = {m.scene.surfacesModel with surfaces = state.stateSurfaces}
sceneObjectsModel = state.stateSceneObjects
scaleBars = scaleBars
geologicSurfacesModel = state.stateGeologicSurfaces
config =
{m.scene.config with
nearPlane =
{m.scene.config.nearPlane with value = state.stateConfig.nearPlane}
farPlane =
{m.scene.config.farPlane with value = state.stateConfig.farPlane}
frustumModel = state.stateConfig.frustumModel
arrowLength =
{m.scene.config.arrowLength with value = state.stateConfig.arrowLength}
arrowThickness =
{m.scene.config.arrowLength with value = state.stateConfig.arrowThickness}
dnsPlaneSize =
{m.scene.config.dnsPlaneSize with value = state.stateConfig.dnsPlaneSize}
lodColoring = state.stateConfig.lodColoring
drawOrientationCube = state.stateConfig.drawOrientationCube
}
traverses = traverses

}
frustum = frustum
}

m
)

let _savedTimeSteps =
Expand Down

0 comments on commit f372ac9

Please sign in to comment.