Add `vtkAbstractComplexGestureRecognizer`
Originally posed by @jcfr in !10786 (comment 1462226)
Add a class like
vtkAbstractComplexGestureRecognizer
that would be a "friend" ofvtkVRRenderWindowInteractor
.The class
vtkRenderWindowInteractor3D
would have aSet/GetComplexGestureRecognizer()
Then the implementation of
vtkVRRenderWindowInteractor::HandleComplexGestureEvents/RecognizeComplexGesture
would delegrate the calls tothis->ComplexGestureRecognizer->HandleComplexGestureEvents/RecognizeComplexGesture
.That way, in the context of Slicer, I could have the same recognizer for both the
OpenXR
andOpenVR
runtimes.Rational: This would allow to access ivars like the following without having to add additional set/get functions:
StartingPhysicalEventPositions
/PhysicalEventPositions
StartingPhysicalEventPoses
/PhysicalEventPoses
StartingPhysicalToWorldMatrix
Originally posed by @LucasGandelKitware in !10786 (comment 1464424)
I am fine with placing the complex gesture logic in a dedicated class, but I think the accessors are preferred over the "friend" class approach, as this will also help interactor styles to access the PhysicalEventPoses of both controllers for custom interactions.
This is highly related to a design issue in VTK, where the event data that is passed to callback does not contain enough information when a more global state is required.