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

ENH: Handle 3D events in MRML interactor style and markups VTK widget… #1142

Closed
wants to merge 1 commit into from

Conversation

cpinter
Copy link
Member

@cpinter cpinter commented May 24, 2019

…s

@cpinter cpinter force-pushed the markups-3d-event-handling branch from f6524dd to 4bfcfc6 Compare May 28, 2019 19:32
@cpinter
Copy link
Member Author

cpinter commented May 28, 2019

I think this should be good to go as a first step. @lassoan what do you think?
Then I'll commit the related SlicerVR changes as well

Copy link
Contributor

@lassoan lassoan left a comment

Choose a reason for hiding this comment

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

It looks good, thank you! Added a few minor comments.

{
public:
static vtkMRMLViewInteractorStyle *New();
vtkTypeMacro(vtkMRMLViewInteractorStyle,vtkInteractorStyleUser);
vtkTypeMacro(vtkMRMLViewInteractorStyle,vtkInteractorStyle3D);
Copy link
Contributor

Choose a reason for hiding this comment

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

why was it necessary to switch to vtkInteractorStyle3D?

Copy link
Member Author

Choose a reason for hiding this comment

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

This may not have been necessary. Now that I checked again, the OnMove3D and OnButton3D functions are available in vtkInteractorStyle, which is the subclass of vtkInteractorStyleUser (I think this is what I missed). Do you want me to change back?

Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to use as simple base class as possible, so if vtkInteractorStyle3D is not needed then change back to the old one.

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 know know... It was a subclass of the 3D interactor so that vtkVirtualRealityViewInteractorStyle can call Dolly3D and other functions that it needs. I'll revert OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

Such methods are moved to the camera widget. Handling such events n the he widget allows remapping of GUI events to various interactions and a more stable routing of events (e.g., the effect of a gesture may depend in what widget currently has the focus and what state it is in).

For short term you can choose any option, but in the mid/long term we are moving away from one centralized interactor style + some widgets and instead we will handle all interactions in widgets.

If the new model works well then we'll work on pushing it into VTK, thereby reducing redundancy.

@cpinter cpinter force-pushed the markups-3d-event-handling branch from 4bfcfc6 to 5799603 Compare May 30, 2019 18:35
@cpinter
Copy link
Member Author

cpinter commented May 30, 2019

Thanks for the review!

It's integrated in Slicer/Slicer@3cec087

I'll continue with mapping states to interaction contexts and then handling further events (button press)

@cpinter cpinter closed this May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants