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

Tri-State plane display in 3D viewport #5440

Merged
merged 13 commits into from
May 5, 2021
Merged

Tri-State plane display in 3D viewport #5440

merged 13 commits into from
May 5, 2021

Conversation

daniel-wer
Copy link
Member

@daniel-wer daniel-wer commented Apr 29, 2021

Add a new display mode for the planes in the 3D viewport which hides them alltogether. Also, move the setting to the 3D viewport where it can be more easily discovered.
Additionally, I added a setting to hide the dataset bounding box in the 3D view as requested in the issue.

tri-state-plane-toggle-v3

TODO:

  • Add an evolution that modifies the saved user settings and recommended configurations. (@fm3 Could you point me to an evolution that modifies json in the postgres database?)

URL of deployed dev instance (used for testing):

Steps to test:

  • Open a tracing and use the different plane display settings. The settings can be found when clicking the cogwheel in the upper right of the 3D viewport. The new option (left) should hide everything related to the planes.
  • Test the setting to hide the dataset bounding box. The setting should be persisted.
  • Create a task type and activate the recommended settings. There should be an explanation which values can be used for the tdViewDisplayPlanes setting and changing it to something else should not validate.

Issues:


@daniel-wer daniel-wer self-assigned this Apr 29, 2021
@fm3
Copy link
Member

fm3 commented Apr 29, 2021

@daniel-wer sure :) You can find different json manipulations in conf/evolutions/{051-add-source-view-configuration.sql, 052-replace-segmentation-opacity.sql, 057-add-layer-specific-view-configs.sql, 063-novelUserExperienceinfos.sql}. I think most of them were written by @youri-k

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!! The UI looks top-notch 🕺

I only left some small questions. Will wait for the migrations now :)

@@ -26,7 +26,6 @@ object UserConfiguration {
"dynamicSpaceDirection" -> JsBoolean(true),
"displayCrosshair" -> JsBoolean(true),
"scale" -> JsNumber(1),
"tdViewDisplayPlanes" -> JsBoolean(true),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be two new lines for tdViewDisplayPlanes and tdViewDisplayDatasetBorders?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or doesn't the dictionary need to be complete here? If so, we could think about removing all the default values here, since there are defined in the front-end, too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding, these default values are unnecessary as they are defined in the frontend as well. @fm3 Do you see any reason why we would still need these defined in scala?
If not, I could go through the list, double check that the frontend default is the same as the backend one and remove them from the backend.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youri-k can you answer that? I’m not sure about those defaults and their duplication. If you also don’t know for sure, we can dive into the code and figure out what’s redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to note is that the list is very incomplete already and contains unused settings like isosurfaceBBsize, layoutScaleValue, and renderComments.
I had an in-depth look in the frontend and there these backend "default" values are not needed. The frontend defines a default value for each setting and uses those unless they are overwritten by the user config that is fetched from the server (which happens after users changed settings).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, after repeated deja-vus I found out that we had this exact discussion before 🙈
Issue: #3906
Discussion: #3895 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd propose to remove the backend default UserConfiguration in this PR once and for all. I don't see a reason why the defaults need to be duplicated in the backend.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd propose to remove the backend default UserConfiguration in this PR once and for all. I don't see a reason why the defaults need to be duplicated in the backend.

I agree with you. I don't see any benefits, as well.

Copy link
Member

@fm3 fm3 May 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the entire UserConfiguration wrapper in the backend (it now only handles this as a JsObject).

I believe this fixes #3906

The evolutions look good :) Only open question: does the task-type part handle NULL values for the recommendedConfiguration correctly? Or does it go to its else branch then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that the WHERE recommendedconfiguration ? 'tdViewDisplayPlanes' evaluates to false if recommendedconfiguration is NULL or if the 'tdViewDisplayPlanes' key doesn't exist. I think these are all the cases we need to worry about. If the key exists, its value will be a boolean which is where the CASE comes into play.

frontend/javascripts/oxalis/view/td_view_controls.js Outdated Show resolved Hide resolved
frontend/javascripts/oxalis/controller/scene_controller.js Outdated Show resolved Hide resolved
@normanrz
Copy link
Member

normanrz commented May 2, 2021

@daniel-wer While you're at it, could also do #5380?

@daniel-wer
Copy link
Member Author

I wrote and tested the evolution to change tdViewDisplayPlanes from a boolean to the tri-state enum.
Also, I removed all entries of the backend user configuration. However, there is still an empty configuration: {} inserted into the default user configuration and now that the defaults are no longer needed the scala code can probably be cleaned up a little bit. @youri-k or @fm3 Could one of you have a look at that and review my evolution as well?

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Front-end looks perfect :)

@@ -48,8 +44,6 @@ class Cube {
const color = properties.color || 0x000000;
this.showCrossSections = properties.showCrossSections || false;

_.extend(this, BackboneEvents);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome :)

Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend/SQL LGTM

@fm3 fm3 merged commit 3005b90 into master May 5, 2021
@fm3 fm3 deleted the tri-state-plane-display branch May 5, 2021 11:54
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

Successfully merging this pull request may close these issues.

Tri-state data display in 3D viewport clean up userconfiguration json
5 participants