[vtkusers] vtkRenderWindowInteractor() in addition to other kind of interactors

Andaharoo Andx_roo at live.com
Tue Nov 13 19:39:59 EST 2018


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


More information about the vtkusers mailing list