← Back to team overview

kicad-developers team mailing list archive

Re: proposal to move drawing routines to separate class


Le 30/01/2012 19:06, Dick Hollenbeck a écrit :

Jean-Pierre and Tom,

Wayne came to stay at our house this weekend.  He is a great guy, even classier than he
comes across in his emails.

I believe it easily.

During our visit we talked about many things, one of which was an idea that came in from
Tom last year.

Attached is a sketch of a class would be compiled multiple times to remove the drawing
code from the graphical objects, isolating it into a single class.  The  advantage is that
we can use alternative output devices (and graphical or plotting libraries), without
constantly adding member functions.  The member functions we assume will cause problems
linking these container objects as DLL/DSOs, in a way that we can put scripting and
command line processors up on top of them.

I sketched this out this morning, and it provides the basic idea.  We sacrifice
polymorphism in BOARD_ITEM::Draw(), but the overhead of PAINTER::Draw() is minimal
relative to other bottlenecks.  It will simply mean you call PAINTER::Draw() almost

To interpret the context of the code, we are assuming the following:

1) bottom end (data model) PCBNEW code will be linked into a DLL/DSO

2) bottom end (data model) EESCHEMA code will be linked into a DLL/DSO.

3) they will never be linked together, but might operate together under one process.

This means we can multiply compile class PAINTER with either


There is no reason to have an inheritance tree in class PAINTER, since it is multiply
compiled, separately linked.  When and if we ever change
graphical libraries, we REPLACE it at compile time, not runtime.

Please let me know if you have any questions, and what you guys think.  Tom since this was
originally your idea, I wanted to bounce this off you also.

I agree.
This approach has some advantages.
And graphical libraries will certainly change in the future.



BTW, I have been told that I was spending too much time on KiCad, so my contribution rate
is throttled down now to some hours on the weekend.  Vacation time is over.  So the move
to PCBNEW millimeters will go slower now.

Also, the increased productivity of our face to face meeting really brought home how
inefficient a mailing list is for idea exchange.  We might want to start using another
medium for design idea exchange, maybe IRC, or whatever.  (The developer's list is
morphing into a user support mailing list, and it is hard to hear ourselves think here
sometimes.  Part of that is because folks have to join developers to submit a bug?)

Jean-Pierre CHARRAS

Follow ups