Commit ae05cd80 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Remove arcs support in zone outlines: this is a legacy code from FreePCB,...

Remove arcs support in zone outlines: this is a legacy code from FreePCB, never used, never tested, never maintained.
parent f96d557e
Loading
Loading
Loading
Loading
+26 −58
Original line number Diff line number Diff line
@@ -1041,7 +1041,7 @@ public:
     * @param aLayer = the layer of area
     * @param aStartPointPosition = position of the first point of the polygon outline of this area
     * @param aHatch = hatch option
     * @return pointer to the new area
     * @return a reference to the new area
     */
    ZONE_CONTAINER* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode,
                             int aLayer, wxPoint aStartPointPosition, int aHatch );
@@ -1054,58 +1054,30 @@ public:
    ZONE_CONTAINER* InsertArea( int netcode, int iarea, int layer, int x, int y, int hatch );

    /**
     * Function TestAreaPolygon
     * Test an area for self-intersection.
     *
     * @param CurrArea = copper area to test
     * @return :
     * -1 if arcs intersect other sides
     *  0 if no intersecting sides
     *  1 if intersecting sides, but no intersecting arcs
     * Also sets utility2 flag of area with return value
     */
    int TestAreaPolygon( ZONE_CONTAINER* CurrArea );

    /**
     * Function ClipAreaPolygon
     * Process an area that has been modified, by clipping its polygon against itself.
     * Function NormalizeAreaPolygon
     * Process an area that has been modified, by normalizing its polygon against itself.
     * i.e. convert a self-intersecting polygon to one (or more) non self-intersecting polygon(s)
     * This may change the number and order of copper areas in the net.
     * @param aNewZonesList = a PICKED_ITEMS_LIST * where to store new areas pickers (useful
     *                        in undo commands) can be NULL
     * @param aNewZonesList = a PICKED_ITEMS_LIST * where to store new created areas pickers
     * @param aCurrArea = the zone to process
     * @param bMessageBoxInt == true, shows message when clipping occurs.
     * @param  bMessageBoxArc == true, shows message when clipping can't be done due to arcs.
     * @param bRetainArcs = true to handle arcs (not really used in KiCad)
     * @return :
     *  -1 if arcs intersect other sides, so polygon can't be clipped
     *   0 if no intersecting sides
     *   1 if intersecting sides
     * @return true if changes are made
     * Also sets areas->utility1 flags if areas are modified
     */
    int ClipAreaPolygon( PICKED_ITEMS_LIST* aNewZonesList,
                         ZONE_CONTAINER*    aCurrArea,
                         bool               bMessageBoxArc,
                         bool               bMessageBoxInt,
                         bool               bRetainArcs = true );
    bool NormalizeAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList,
                               ZONE_CONTAINER* aCurrArea );

    /**
     * Process an area that has been modified, by clipping its polygon against
     * itself and the polygons for any other areas on the same net.
     * Function OnAreaPolygonModified
     * Process an area that has been modified, by normalizing its polygon
     * and merging the intersecting polygons for any other areas on the same net.
     * This may change the number and order of copper areas in the net.
     * @param aModifiedZonesList = a PICKED_ITEMS_LIST * where to store deleted or added areas
     *                      (useful in undo commands. Can be NULL
     *                             (useful in undo commands can be NULL
     * @param modified_area = area to test
     * @param bMessageBoxInt : if true, shows message boxes when clipping occurs.
     * @param bMessageBoxArc if true, shows message when clipping can't be done due to arcs.
     * @return :
     * -1 if arcs intersect other sides, so polygon can't be clipped
     *  0 if no intersecting sides
     *  1 if intersecting sides, polygon clipped
     * @return true if some areas modified
    */
    int AreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList,
                             ZONE_CONTAINER*    modified_area,
                             bool               bMessageBoxArc,
                             bool               bMessageBoxInt );
    bool OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList,
                                ZONE_CONTAINER*    modified_area );

    /**
     * Function CombineAllAreasInNet
@@ -1113,15 +1085,13 @@ public:
     * @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas (useful
     *                       in undo commands can be NULL
     * @param aNetCode = net to consider
     * @param bMessageBox : if true display warning message box
     * @param bUseUtility : if true, don't check areas if both utility flags are 0
     * @param aUseUtility : if true, don't check areas if both utility flags are 0
     * Sets utility flag = 1 for any areas modified
     * If an area has self-intersecting arcs, doesn't try to combine it
     * @return true if some areas modified
     */
    int CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList,
    bool CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList,
                              int                aNetCode,
                              bool               bMessageBox,
                              bool               bUseUtility );
                              bool               aUseUtility );

    /**
     * Function RemoveArea
@@ -1154,17 +1124,15 @@ public:
    /**
     * Function CombineAreas
     * If possible, combine 2 copper areas
     * @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas (useful
     *                       in undo commands can be NULL
     * @param aDeletedList = a PICKED_ITEMS_LIST * where to store deleted areas
     *                      (useful for undo).
     * @param area_ref = the main area (zone)
     * @param area_to_combine = the zone that can be merged with area_ref
     * area_ref must be BEFORE area_to_combine
     * area_to_combine will be deleted, if areas are combined
     * @return : 0 if no intersection
     *         1 if intersection
     *         2 if arcs intersect
     * @return : true if area_to_combine is combined with area_ref (and therefore be deleted)
     */
    int CombineAreas( PICKED_ITEMS_LIST* aDeletedList,
    bool CombineAreas( PICKED_ITEMS_LIST* aDeletedList,
                       ZONE_CONTAINER*    area_ref,
                       ZONE_CONTAINER*    area_to_combine );

+0 −2
Original line number Diff line number Diff line
@@ -65,7 +65,6 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD* aBoard ) :
    SetDoNotAllowTracks( true );                // has meaning only if m_isKeepout == true
    m_cornerRadius = 0;
    utility    = 0;                             // flags used in polygon calculations
    utility2   = 0;                             // flags used in polygon calculations
    m_Poly     = new CPolyLine();               // Outlines
    aBoard->GetZoneSettings().ExportSetting( *this );
}
@@ -102,7 +101,6 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) :


    utility    = aZone.utility;
    utility2   = aZone.utility;
}


+1 −1
Original line number Diff line number Diff line
@@ -573,7 +573,7 @@ public:

    // thickness of the copper bridge in thermal reliefs
    int                   m_ThermalReliefCopperBridge;
    int                   utility, utility2;                // flags used in polygon calculations
    int                   utility;                // flags used in polygon calculations

    // true when a zone was filled, false after deleting the filled areas
    bool                  m_IsFilled;
+5 −7
Original line number Diff line number Diff line
@@ -44,8 +44,6 @@
#include <zones_functions_for_undo_redo.h>
#include <drc_stuff.h>

bool s_Verbose = false;       // false if zone outline diags must not be shown

// Outline creation:
static void Abort_Zone_Create_Outline( EDA_DRAW_PANEL* Panel, wxDC* DC );
static void Show_New_Edge_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
@@ -141,7 +139,7 @@ void PCB_EDIT_FRAME::duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone )
        GetScreen()->SetCurItem( NULL );       // This outline may be deleted when merging outlines

        // Combine zones if possible
        GetBoard()->AreaPolygonModified( &_AuxiliaryList, newZone, true, s_Verbose );
        GetBoard()->OnAreaPolygonModified( &_AuxiliaryList, newZone );

        // Redraw zones
        GetBoard()->RedrawAreasOutlines( m_canvas, aDC, GR_OR, newZone->GetLayer() );
@@ -334,7 +332,7 @@ void PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER*

    // Combine zones if possible
    wxBusyCursor dummy;
    GetBoard()->AreaPolygonModified( &_AuxiliaryList, aZone, true, s_Verbose );
    GetBoard()->OnAreaPolygonModified( &_AuxiliaryList, aZone );
    m_canvas->Refresh();


@@ -389,7 +387,7 @@ void PCB_EDIT_FRAME::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* aZone )
    aZone->m_Poly->DeleteCorner( aZone->m_CornerSelection );

    // modify zones outlines according to the new aZone shape
    GetBoard()->AreaPolygonModified( &_AuxiliaryList, aZone, true, s_Verbose );
    GetBoard()->OnAreaPolygonModified( &_AuxiliaryList, aZone );

    if( DC )
    {
@@ -768,7 +766,7 @@ bool PCB_EDIT_FRAME::End_Zone( wxDC* DC )
    GetScreen()->SetCurItem( NULL );       // This outline can be deleted when merging outlines

    // Combine zones if possible :
    GetBoard()->AreaPolygonModified( &_AuxiliaryList, zone, true, s_Verbose );
    GetBoard()->OnAreaPolygonModified( &_AuxiliaryList, zone );

    // Redraw the real edge zone :
    GetBoard()->RedrawAreasOutlines( m_canvas, DC, GR_OR, layer );
@@ -898,7 +896,7 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* aZone )
        aZone->SetNetName( net->GetNetname() );

    // Combine zones if possible
    GetBoard()->AreaPolygonModified( &_AuxiliaryList, aZone, true, s_Verbose );
    GetBoard()->OnAreaPolygonModified( &_AuxiliaryList, aZone );

    // Redraw the real new zone outlines
    GetBoard()->RedrawAreasOutlines( m_canvas, DC, GR_OR, -1 );
Loading