[vtkusers] Handling "out" pointer callData parameters in events from Python
elvis.stansvik at orexplore.com
Sun Jun 26 04:08:15 EDT 2016
2016-06-23 16:26 GMT+02:00 Elvis Stansvik <elvis.stansvik at orexplore.com>:
> Hi all,
> I'm trying to make a QOpenGLWidget based VTK widget, and I'm taking
> inspiration from QVTKWidget2 and this stack overflow answer:
> which provides a QVTKWidget3 based on QOpenGLWidget.
> Given how QVTKWidget2 handles IsCurrentEvent, IsDirectEvent and
> SupportsOpenGLEvent from the render window , e.g:
> void QVTKWidget2::IsCurrent(vtkObject*, unsigned long, void*, void*
> bool* ptr = reinterpret_cast<bool*>(call_data);
> *ptr = QGLContext::currentContext() == this->context();
> Is there any way to do this operation from Python? I know there's some
> support for callData, but how would I effect a write to the memory pointed
> at by the call_data parameter like this from Python?
> If it's not possible, am I completely doomed in trying to make a Python
> class similar to QVTKWidget2?
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?
> Many thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers