[vtkusers] Handling "out" pointer callData parameters in events from Python
Elvis Stansvik
elvis.stansvik at orexplore.com
Sun Jun 26 10:30:57 EDT 2016
2016-06-26 16:13 GMT+02:00 David Gobbi <david.gobbi at gmail.com>:
> On Sun, Jun 26, 2016 at 2:08 AM, Elvis Stansvik <
> elvis.stansvik at orexplore.com> wrote:
>>
>> David Gobbi, I think you worked on calldata support for Python (?), do
>> you know if it's currently impossible to handle these events correctly from
>> Python? (since they expect an answer through a memory write).
>>
>> I find these events quite strange actually. An event to me is something
>> you fire and forget, not a request for information like these ones seems to
>> be. Anyone know why the API was built like this?
>>
>
> I suspect that vtkGenericOpenGLRenderWindow is the only class that expects
> values to be returned via the calldata pointer. This behavior is
> sufficiently strange that the Python wrappers will probably never support
> it.
>
> Instead of returning the information via the calldata pointer, you can
> call the following methods that were added to the class for this purpose:
>
> // Description:
> // Allow to update state within observer callback without changing
> // data argument and MTime.
> void SetIsDirect(int newValue);
> void SetSupportsOpenGL(int newValue);
> void SetIsCurrent(bool newValue);
>
> These methods were added in order to make it possible to use this class
> with Java, but they should work equally well with Python.
>
Excellent, thanks! I actually browsed past them while looking at the code,
but in a rush didn't realize that's precisely what they were for.
Elvis
>
> - David
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160626/fab288be/attachment.html>
More information about the vtkusers
mailing list