← Back to team overview

kicad-developers team mailing list archive

Re: Experiments and considerations for more layer

 

On Fri, Sep 06, 2013 at 08:53:12AM +0200, Maciej Sumiński wrote:
> BTW: This is the way how it is done in the VIEW class in the GAL -
> items are held using R-trees, which are created for every layer. It
> was also necessary to know which layers are occupied by a single
> item, so there is ViewGetLayers() function that returns an int[]
> containing layer numbers for the given item. The layer numbers are
> computed during the function call (ie. ViewGetLayers() is overridden
> in derived classes, so eg. TRACK may return a different set of
> layers than SEGVIA), but I lean toward using std::bitset.

Other than being a technique listen even in '80 computer graphics books,
I suppose that's needed also for 1) culling the primitives using the
rtree and 2) sorting the draw operation by layers to achieve correct
blending.

IIRC even using the z-buffer and checking blending only works correcly
when drawing from bottom up, in opengl (and probably everywhere else
too)

Also since these are somewhat easy to maintain indices they would surely
help for all the layer-oriented operation in kicad... even picking
(which is more 'position oriented') has a layer priority depending on
the current/mode layer and would benefit from it.

-- 
Lorenzo Marcantonio
Logos Srl


Follow ups

References