Re: efficient use of canvas lines



I was faced with the same problems when writing the image/vector
viewing program giv. giv allows you to show an image as a background
and on top, vector graphics. Actually, in my company it is regularly
being used to show vector graphics without underlying images with 
hundreds of thousands of vectors of CAM data.

The way I solved the display problem is by creating my own simplistic
canvas widget called gtk image viewer. Whenever the widget is scrolled
or zoomed (either by a program or by the default gimp like bindings)
an exposure event is generated. In that exposure event it is possible
to do gdk_draw_foo() etc. The widget provides convenience functions
for going back and forth between the coordinate systems of the image and
the widget. In giv I draw the vector graphics by storing the vectors in
compact GArrays and iterating over the array whenever I get an exposure
event. A more efficient approach might be built by storing the vectors
in e.g. an octree.

giv also includes code to generate postscript out of the vector graphics.
But this part really could be improved.

Regards,
Dov
-- 
                                                                    ___
Dov Grobgeld                        | Email: dov orbotech com      /+  \  PCB
Algorithms Group Leader, Orbotech   | Phone: +972-8-9423882        \  +/  AOI
POB 215, Yavne 81102, Israel	    | Fax:   +972-8-9423775       __| |
               Disclaimer: All views above are mine alone.        ____|




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]