<div dir="ltr"><div><div><div><div><div><div>Hi all,<br><br></div>I'm trying to create our own customized and simplified QVTKRenderWindowInteractor, since there are features in it that we don't need (stereo stuff, PySide/PyQt4/QWidget compat, ...), I came across the magic it does in its __getattr__ in order to behave like a vtkGenericRenderWindowInteractor:<br><br>    def __getattr__(self, attr):<br>        """Makes the object behave like a vtkGenericRenderWindowInteractor"""<br>        if attr == '__vtk__':<br>            return lambda t=self._Iren: t<br>        elif hasattr(self._Iren, attr):<br>            return getattr(self._Iren, attr)<br>        else:<br>            raise AttributeError(self.__class__.__name__ +<br>                  " has no attribute named " + attr)<br><br></div>Forgive my ignorance, but is this behavior something that is essential to keep? Or was this added just as a convenience, so that instances of the class can be passed to VTK methods that expect an interactor?<br><br></div><div>In short, I'd like to know if I can remove this whole thing, and if so, what the consequences would be.<br><br></div>If it's just a convenience, I think we'd want to remove it. I think we want to encapsulate as much as possible of the VTK workings inside the widget as possible, and only make the interactor / render window used inside it available through getters (or attributes).<br><br></div>My goal is to have something that feels more like a Qt API for this class.. But since I'm new to VTK, and still haven't quite figured out how the class is to be used in certain situations (see my post about using it with context views for instance), I'd appreciate some guidance.<br><br></div>Cheers,<br></div>Elvis<br><br></div>