-
Notifications
You must be signed in to change notification settings - Fork 175
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
feat(fe2): Update Section Box controls to include visibility #3333
Conversation
@@ -180,6 +180,10 @@ export class LegacyViewer extends Viewer { | |||
this.sections.enabled = true | |||
} | |||
|
|||
public setSectionBoxVisibility(visible: boolean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexandruPopovici I made this change to test my frontend work, it works so I've left it in, but can you check incase I've done something wrong here?
One problem is that when the frontend updates the section box visibility, I need to slightly move the camera for the change to be visible. EG. Turn off section box visibility. Section box will remain, until I slightly move the camera. Is this something that should be fixed in the viewer? I can probably fix in frontend, but it would be a bit hacky.
Don't think there's any great urgency in this task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewwallacespeckle
The viewer employs on-demand rendering. This means that it is not constantly rendering, but rather it only does so when it needs to, or when it's told to. We're doing this mostly for mobile platform's sake where rendering each frame would drain battery pointlessly.
That's why whenever the client does something that needs to trigger a render, it needs to call requestRender
, otherwise no change can be seen since there is no rendering happening. Moving the camera triggers a render request implicitly, that's why you were seeing that behavior.
I've added the calls to requestRender
in the places that were missing it. Also, I've added a better approach on showing/hiding the section box that does not go through the LegacyViewer
. We shouldn't add functionality in there, we actually need to retire it.
Let me know if you're having other issues with this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexandruPopovici, that's working perfectly! Thanks for the explanation too, I'll know better for next time.
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
I have made this so the toggle in the left hand menu toggle visibility. This allows the user to toggle it using shift+b. On load, section box is both disabled, and invisible. On first click, it is enabled and set as visible. This will also trigger the "Reset Section Box" button. Any further clicks to the sidebar button will simply toggle visibility. A click of reset will return everything to it's original state. @benjaminvo Can you check the UI and see if you are happy with this implementation? If so I'll get it in today and reply to the user on the forum who requested it. |
@andrewwallacespeckle I like it! Only issue is that the "Reset section box" button appears as soon as you enter the section box tool. It should ideally only appear if the section box has been edited. If this somehow shows to be difficult you can also just merge this now and create a follow up PR. |
📸 Preview service has generated an image. |
This change has been made and it is now ready for a final review |
📸 Preview service has generated an image. |
@benjaminvo Yeah, outlines should be visible there |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
This reverts commit 1697b12.
@andrewwallacespeckle I just tested – is it just me or does the section box now reset when you toggle the tool? |
📸 Preview service has generated an image. |
…/specklesystems/speckle-server into andrew/web-1962-hide-section-box
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
📸 Preview service has generated an image. |
(User request)
Allow user to hide the section box including the gizmo after making the "cut".
Now: Section box is reset when you deselect in the section box tool.
Future: Save the current cut when clicking away from the section box tool. Instead show the "Reset filters" button in the bottom so users can reset the model from there.
This is already supported per the viewer docs.