[vtkusers] Handling "out" pointer callData parameters in events from Python
David Gobbi
david.gobbi at gmail.com
Sun Jun 26 10:13:01 EDT 2016
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.
- David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160626/21e8a4e3/attachment.html>
More information about the vtkusers
mailing list