[vtkusers] new VTK_WRAP_PYTHON_SIP

Clinton Stimpson clinton at elemtech.com
Thu Aug 5 17:00:37 EDT 2010


You'll need to turn on VTK_USE_QVTK_QTOPENGL to get access to that.

Clint

On Thursday, August 05, 2010 02:56:09 pm Eric E. Monson wrote:
> Hey Clint,
> 
> Should QVTKWidget2 be accessible from Python? I can see vtk.QVTKWidget, but
> not version 2... I see you have a Python test for it, but it doesn't show
> up as a possibility when I do "import vtk".
> 
> Thanks,
> -Eric
> 
> On Aug 5, 2010, at 11:32 AM, Clinton Stimpson wrote:
> > On 08/05/2010 08:12 AM, Marcus D. Hanwell wrote:
> >> On Thu, Aug 5, 2010 at 9:34 AM, Eric E. Monson <emonson at cs.duke.edu>
> >> wrote: Hey all,
> >> 
> >> When someone involved gets a chance, could you give a quick summary of
> >> what we get with the new VTK_WRAP_PYTHON_SIP option? I don't understand
> >> enough about wrapping in general to follow anything too detailed, but I
> >> was wondering if there was a simple example of what new things this
> >> will allow us to do, or what it is building towards?
> >> 
> >> I think this is Clinton's Qt/VTK wrapping work, allowing you to use both
> >> VTK and PyQt to build rich applications in Python. It would be great to
> >> get an overview of where this is at, I have been watching some of the
> >> threads exchanging information with David Gobbi with great interest.
> >> 
> >> One of the large challenges is getting Qt objects into and out of VTK
> >> objects. I did some previous work where we had to use sip to bridge the
> >> two Python wrapped modules (our library and PyQt). I will not guess any
> >> further, but I think this is basically what is being done.
> > 
> > Yes... its to mix PyQt and VTK for python.
> > Some degree of mixing was possible before, but what's new is that if you
> > have a VTK class in C++ that takes Qt types, or a Qt class in C++ that
> > takes VTK types, those are now usable from python. And yes, sip is being
> > used in the bridge.  There are some auto-generated .sip files for all
> > VTK classes so they can be included in user's .sip files when wrapping
> > their own Qt classes.  Also, the VTK wrapper generator understands Qt
> > types, and auto generates SIP code to do Python/C++ conversions.
> > 
> > So basically, QVTKWidget can now be used from python along with a bunch
> > of other C++ classes.
> > 
> > Its actually quite usable now and if people want to start using it and
> > give feedback, that would be appreciated. There are a few tests in
> > VTK/GUISupport/Qt/Testing/Python that can be used as examples. But, I
> > still need to write some more .sip files for some Qt classes, such as
> > the new QGraphicsView code.
> > 
> > If there are any specific questions, feel free to ask.  And if there are
> > any issues, please let me know.
> > 
> > Thanks,
> > Clint
> > 
> > _______________________________________________
> > Powered by www.kitware.com
> > 
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> > 
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> > 
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list