[vtkusers] Question about the shape-shifting __getattr__ magic of QVTKRenderWindowInteractor

David Gobbi david.gobbi at gmail.com
Wed Jun 15 08:47:09 EDT 2016


On Wed, Jun 15, 2016 at 5:55 AM, Elvis Stansvik <
elvis.stansvik at orexplore.com> wrote:

>
> 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?
>

The name of the class is "QVTKRenderWindowInteractor" which is a contract
with the user that the class can be used where a vtkRenderWindowInteractor
can be used.  The author of QVTKRenderWindowInteractor must have wanted it
to appear as if it was subclass of vtkRenderWindowInteractor, but didn't
want to use multiple inheritance.

In short, I'd like to know if I can remove this whole thing, and if so,
> what the consequences would be.
>

Removing it would break some people's apps.


> 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.
>

If you're changing the API to have a different feel, then you're writing a
new class, so give your new class a new name.

Cheers,
 - David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160615/d3823c6e/attachment.html>


More information about the vtkusers mailing list