[vtkusers] vtkRenderWindowInteractor() in addition to other kind of interactors
Andreas Pedroni
anpedroni at gmail.com
Wed Nov 14 03:17:56 EST 2018
Hi,
Thank you very much for the help. Indeed, I am not used to oop and I was a confused in the https://www.vtk.org/Wiki/VTK/Examples/Python/Animation <https://www.vtk.org/Wiki/VTK/Examples/Python/Animation> that the „actor“ was not defined in class vtkTimerCallback.
Best Andreas
> Am 14.11.2018 um 01:39 schrieb Andaharoo <Andx_roo at live.com>:
>
> I rarely write python so I'm not the best help. This doesn't have much to do
> with VTK this is just basic oop. I'd suggest reading/learning about it
> online. Here's the absolute simplest solution.
>
> If you simply want to hold a reference to the VideoCapture object in the
> class then create a variable of it in the class. I don't write python so
> excuse my example but it should get the idea across. Ex:
>
> class vtkTimerCallback():
> cap = None # Create an empty reference to an object
> ... All the other stuff
>
> Then in the Python Animation example before starting the timer, right under
> "cb.actor = actor" you can add "cb.cap = cap" to give vtkTimerCallback a
> reference to the capture object. If you don't do this cb.cap will be None
> and not work.
>
> Note: In python objects are passed by reference so "_cap" will be a
> reference to "cap" after "=" operator. IE: It's the same object. NOT a copy.
> Both "_cap" and "cap" point to the same data.
>
> Also I'd recommend using vtkImageActor which is both a mapper and actor that
> directly takes vtkImageData for display on a 3d plane.
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181114/743f2d84/attachment.html>
More information about the vtkusers
mailing list