[vtkusers] Handling "out" pointer callData parameters in events from Python

Elvis Stansvik elvis.stansvik at orexplore.com
Thu Jun 23 10:26:35 EDT 2016


Hi all,

I'm trying to make a QOpenGLWidget based VTK widget, and I'm taking
inspiration from QVTKWidget2 and this stack overflow answer:

    http://stackoverflow.com/a/26946040/252857

which provides a QVTKWidget3 based on QOpenGLWidget.

Given how QVTKWidget2 handles IsCurrentEvent, IsDirectEvent and
SupportsOpenGLEvent from the render window [1], e.g:

void QVTKWidget2::IsCurrent(vtkObject*, unsigned long, void*, void*
call_data)
{
  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?

Many thanks in advance,
Elvis

[1]
https://gitlab.kitware.com/vtk/vtk/blob/master/GUISupport/QtOpenGL/QVTKWidget2.cxx#L458-474
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160623/ce09cb96/attachment.html>


More information about the vtkusers mailing list