← Back to team overview

kicad-developers team mailing list archive

Small update about the graphics backends


--========GMX79371268699667251323 Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit


I'd just like to post a small update about the progress of the graphics abstraction layer.

Drawing primitives like lines, polylines, circles, rectangles, polygons work so far - for both Cairo and Opengl. My implementation draws also a grid and handles the transformation world <-> screen. Also panning and zooming is working with the test examples. I've tested it with Linux/Windows and wxWidgets 2.9.

I've declared a base class called GRAPHICS_ABSTRACTION_LAYER, this is an abstract class, containing mainly pure virtual methods. From this class are OPENGL_GAL and CAIRO_GAL derived, these classes have also the class wxWindow as parent. 
Drawing works this way, first you create an instance of the GAL inside a frame constructor:

gal = new CAIRO_GAL( this, size );

Then you can use it for drawing, for example:

gal -> BeginDrawing();
gal -> SetStrokeColor( COLOR4D( 1, 0, 1, 0.6 ) );
gal -> SetLineWidth( 10.0 );
gal -> DrawPolyline( pointList );
gal -> EndDrawing();

That's roughly how it's used - there are of course much more methods for setting up the transformation, grid etc.

My next goal is to implement a grouping function - that's in OpenGL simply a display list - for Cairo I'll implement a miniature VM for repeating the commands (this works already for a simple group). This function should give a good speedup. Paths are currently handled automatically - a new path is created if you're changing an attribute like the pen size.

My goal is to get an easy to use graphics backend for KiCad, which supports software and hardware rendering as well. When I'm happy with all tests, I'd start for instance with the Gerber viewer. But I guess this needs some time.

I've attached a screenshot of some tests (hope the attachment is not too large, left Cairo, right OpenGL) - of course all created windows are usable simultaneous.

Bye ..
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
 --========GMX79371268699667251323 Content-Type: image/jpeg; name="ScreenShotGAL.JPG"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ScreenShotGAL.JPG"

[Attachment content not displayed.] --========GMX79371268699667251323-- 

Follow ups