<div dir="ltr"><div><div><div><div>The MouseEvents.py example [1] currently does:<br><br>class MyInteractorStyle(vtk.vtkInteractorStyleTrackballCamera):<br> <br>    def __init__(self,parent=None):<br>        self.AddObserver("MiddleButtonPressEvent",self.middleButtonPressEvent)<br>        self.AddObserver("MiddleButtonReleaseEvent",self.middleButtonReleaseEvent)<br> <br>    def middleButtonPressEvent(self,obj,event):<br>        print("Middle Button pressed")<br>        self.OnMiddleButtonDown()<br>        return<br> <br>    def middleButtonReleaseEvent(self,obj,event):<br>        print("Middle Button released")<br>        self.OnMiddleButtonUp()<br>        return<br><br>But I don't understand the reason for calling e.g. self.OnMiddleButtonDown() ? Since this is not an override of a virtual function (which is not possible in Python), but simply adding another observer, I don't think it is needed? (..and I would think it would mean OnMiddleButtonDown is called twice, right?).<br><br></div>This leads me to another question: What if I really do want to override the behavior that the parent interactor style provides (or modify it by manipulating the event), what are my options?<br><br></div>I saw at<br><br>    <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/Interaction/MouseEventsObserver">http://www.vtk.org/Wiki/VTK/Examples/Python/Interaction/MouseEventsObserver</a><br><br></div>that you can remove all observers of an event from the interactor, but that seems like quite a hack :/ In my case, I'm interested in locking the camera rotation to a certain axis, but perhaps a custom interactor style is not the way to go?<br><br></div>Elvis<br><div><div><div><div><div><div><div><div><br>[1] <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/Interaction/MouseEvents">http://www.vtk.org/Wiki/VTK/Examples/Python/Interaction/MouseEvents</a><br></div></div></div></div></div></div></div></div></div>