[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] sip support for Numeric extensions?
From:       Gerard Vermeulen <gvermeul () grenoble ! cnrs ! fr>
Date:       2003-10-02 9:09:16
[Download RAW message or body]

On Wed, 01 Oct 2003 14:39:27 -0600
Joe Van Andel <vanandel@atd.ucar.edu> wrote:

> Has anyone used SIP to build C++ extensions that accept Numeric arrays 
> as arguments, and return Numeric arrays?
> 
> I've found the PyQwt package that converts Numeric arrays to 
> QwtArray's.  This is a good start, but I also need to code extensions 
> that return Numeric arrays.
> 
> If so, could you share a sample of your code (and .sip files)?
> 
I never did, but you can trick sip into returning any kind of Python object
as shown in the attached file (this code returns VTK Python extension objects).

Pointers to classes that should not be handled by sip are replaced by pointers
to void.  This implies that you have provide %MemberCode to do the interfacing
yourself. 

Beware, you have to patch sip's output to import the Numerical Python
extensions.

If you don't get it working, send me a very simple example and I'll wrap it
for you.

Gerard 


["renderwindow.sip" (application/octet-stream)]
_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic