← Back to team overview

kicad-developers team mailing list archive

Re: Module classes refactorization

 

On Sun, Jun 22, 2014 at 11:20:05AM +0200, Maciej Sumiński wrote:
> 1) Change MODULE-specific structures (TEXTE_MODULE, EDGE_MODULE) to have a
> common interface for position control.

Good idea if you make it aware of relative coordinates... on way would
be it taking a 'parent' object anyway and having the BOARD parent simply
have coordinates 0,0. If you ever used *any* kind of display graph it
should be clear...

> 2) Unify the way undo buffer works in the layout and module editors.

I still don't know how undo exactly works (except that it copies a lot
of stuff) so I can't comment on that... seems a good thing if it could
be done.

> 3) Create an abstract class BOARD_CONTAINER.
> The class will contain 3 pure virtual methods, that have the same purpose as
> in the BOARD class:
> - void Add( BOARD_ITEM* aItem[, bool aAppend] )
> - BOARD_ITEM* Remove( BOARD_ITEM* aItem )
> - void Delete( BOARD_ITEM* aItem )
> If BOARD and MODULE classes implement the BOARD_CONTAINER interface, tools
> may add/remove items without testing if it is a board or module.

...thus falling into my previous idea of a display graph (actually
a containment graph, here). That would represent intermediate nodes.

Leafs would be non-containers (like text and lines). Also that would
bring homogeinity (hope I spelled that right:P) to the capabilities of
entities on board vs entities on module.

-- 
Lorenzo Marcantonio
Logos Srl


References