[vtkusers] vtkCommand calldata parameter of Execute()

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Jan 2 18:43:40 EST 2012


Then you are looking at the wrong side of the problem. Try to get and
keep a reference of the object you are interested in and fetch the
information that you need each time you get a callback (with no
parameter).

On Mon, Jan 2, 2012 at 4:22 PM, Luke <hazelnusse at gmail.com> wrote:
>> 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