Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storing scene view settings #23

Open
madsendennis opened this issue Apr 18, 2018 · 1 comment
Open

Storing scene view settings #23

madsendennis opened this issue Apr 18, 2018 · 1 comment

Comments

@madsendennis
Copy link

Implementation of the possibility to store scene view settings.
Mainly:

  • Camera settings
  • Slicing positions
  • Window size
    This would make it easier to recreate exact screenshots.

Other possibilities would also be to store:

  • Level, window and opacity of 3D images
  • Opacity and color of meshes and landmarks

The settings can be saved to and loaded from a config file which also enables sharing of scene view settings.

@clangguth
Copy link
Member

Window size and perspective should already be saved and restored when exiting/reopening the application:

protected def saveWindowState(): Unit = {
GlobalSettings.set(GlobalSettings.Keys.WindowMaximized, maximized)
if (!maximized) {
// Saving width/height in maximized state is pointless. It should have been done *before*
// the window was maximized (see the maximize() method)
saveWindowWidthHeight()
}
}
protected def restoreWindowState(): Unit = {
val width = GlobalSettings.get[Int](GlobalSettings.Keys.WindowWidth).getOrElse(1024)
val height = GlobalSettings.get[Int](GlobalSettings.Keys.WindowHeight).getOrElse(768)
size = new Dimension(width, height)
centerOnScreen()
if (GlobalSettings.get[Boolean](GlobalSettings.Keys.WindowMaximized).getOrElse(false)) {
maximize()
}
}

So all the basics are already there (package settings), it's just a matter of controlling what to save/restore and how. I'd suggest reusing that base, just using a different file (possibly user-selectable), not the global settings one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants