[wxPython] drawing too slow

Hi!

I have a chart to draw which is too slow in Python and would like to draw
it in a C++ extension.
I would have to use the dc and a list of python objects as parameters, is
that possible?

I would greatly appreciate any sort of suggestion how to do that or where I
can find some sort of 'cookbook' to have a start.

Thanks in advance,
Mike

Michael_Perkonigg@uniquare.com wrote:

Hi!

I have a chart to draw which is too slow in Python and would like to draw
it in a C++ extension.
I would have to use the dc and a list of python objects as parameters, is
that possible?

I would greatly appreciate any sort of suggestion how to do that or where I
can find some sort of 'cookbook' to have a start.

Look at SciPy weave

HTH
Niki Spahiev

Michael_Perkonigg@uniquare.com wrote:

I have a chart to draw which is too slow in Python and would like to draw
it in a C++ extension.
I would have to use the dc and a list of python objects as parameters, is
that possible?

Give us a little more detail about what it is you want to draw, there
may be a Python solution.

Have you chaecked out or used the new DC.DrawPointList() and
DC.DrawLineList() methods? They speed things up a lot for drawing a lot
of points and lines. by moving the lopp into C++. Robin put them in as a
demo, and it was discussed to add a full set of DrawObjectList methods
for rectangles, polygons etc. I think the speed up will be less
substantial for more complex objects, but I'd love to have them anyway.
I have been using the two existing methods with good results, and I
intend to delve into the C++ to add the other eventually. If they would
work for you ,it would be a great contribution to the wxPython project.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I have a chart to draw which is too slow in Python and would like to draw
it in a C++ extension.
I would have to use the dc and a list of python objects as parameters, is
that possible?

Yes.

I would greatly appreciate any sort of suggestion how to do that or where

I

can find some sort of 'cookbook' to have a start.

Look at the Python docs about Extending Python.

Your extension will have to include export.h from wxPython and call
wxPyCoreAPI_IMPORT() in it's init function. Then look at the extension
functions that SWIG generates in the wxPython sources and use similar code
for your drawing function.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!