[vtkusers] vtkCommand calldata parameter of Execute()

Luke hazelnusse at gmail.com
Mon Jan 2 16:22:11 EST 2012


> Let's pretend that A and B are 2 instance of some vtkObject and C a
> vtkCommand instance.
>
> if you do :
>
> A.AddObserver(vtkCommand::XXXX_A, C);
> B.AddObserver(vtkCommand::XXXX_B, C);
>
> When you call
>
> A.InvokeEvent(vtkCommand::XXXX_A, whatever)

In the case of the animation code I am trying to make, I think
renderWindowInteractor is calling InvokeEvent internally somewhere (it
isn't called explicitly in the animation example [0]), so therefore I
don't have control over the "whatever" parameter that ends up getting
passed to the Execute() method of the vtkCommand subclass.  Somehow
the timer must be calling the InvokeEvent, but I don't see how to get
my extra parameter to the timer so that it can be passed to Execute().

An example or brief description of how the animation example [0] would
be modified to customize what gets passed for the callData parameter
to Execute() would be really helpful.  I still don't see how to do it.

Thanks,
~Luke

[0] -- http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Animation



More information about the vtkusers mailing list