[vtkusers] new VTK_WRAP_PYTHON_SIP

Clinton Stimpson clinton at elemtech.com
Thu Aug 5 11:32:27 EDT 2010


  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 
> <mailto: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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100805/059e2b29/attachment.htm>


More information about the vtkusers mailing list