← Back to team overview

kicad-developers team mailing list archive

Re: CPolyLine refactor

 

Le 21/11/2016 à 18:07, Tomasz Wlostowski a écrit :
> On 21.11.2016 13:56, Alejandro Garcia Montoro wrote:
>> Hi!
>>
>> I'm working on the CPolyLine refactor into SHAPE_POLY_SET. Before coding
>> anything more, I want to discuss with you the changes I have to do, just
>> to be sure I'm not doing any useless work.
>>
>> The classes that use CPolyLine, and that have to be modified, are:
>>
>>   * ZONE_CONTAINER: This class has two CPolyLine members: m_Poly and
>>     m_smoothedPoly. The latter is not used, but the former is the one
>>     that has all the information about the zone. It's necessary to
>>     carefully refactor this class, as the interface of CPolyLine and
>>     SHAPE_POLY_SET is not exactly the same, e.g., the Hatch-related
>>     functions are not yet implemented in SHAPE_POLY_SET or the code in
>>     DrawWhileCreateOutline access the methods of the old CPOLYGONS_LIST
>>     class.
> 
> Hi Alejandro,

m_smoothedPoly temporary stores the outline (from m_Poly) before building the filled areas in zone,
because the zone outline can be smoothed or chamfered before filling this zone.

> 
> If it's only about hatching, it's (as far as I know) only for the
> purpose of displaying a hatched zone outline (JP, please confirm). Then
> it belongs to the renderer (be it legacy or GAL), not to the polygon class.

Yes, the hatches are only for rendering purposes.
(more easy to see the different zone outlines, especially when zones overlap, and more easy to see
complex outlines with holes).


>>   * BOARD, PCB_PAINTER and POINT_EDITOR: These classes use instances of
>>     the ZONE_CONTAINER class, that still has methods that return
>>     CPolyLine objects. The work on these classes should be more or less
>>     straightforward when the refactor on the first one is finished.
> OK.
>>
>> I would like to set up some tests on these classes, just to be sure that
>> the refactor does not change anything. Does anyone have some tests using
>> these classes that I could reuse?
> I don't ;-)
>>
>> Furthermore, some more instances of CPolyLine HATCH_STYLE enum are
>> found. I am not sure that the hatch style should be inside
>> SHAPE_POLY_SET, that contains just geometric information: what do you think?
> As said above, I don't think SHAPE_POLY_SET should contain hatching
> functions.
> 
> Best,
> Tom
>>
>> Any comments on this will be appreciated.
>>
>> Regards,
>> Alejandro


-- 
Jean-Pierre CHARRAS


Follow ups

References