KiCad PCB EDA Suite
zones_functions_for_undo_redo.h
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2009 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
9  * Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, you may find one here:
23  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24  * or you may search the http://www.gnu.org website for the version 2 license,
25  * or you may write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27  */
28 
29 
30 /* These functions are relative to undo redo function, when zones are involved.
31  * When a zone outline is modified (or created) this zone, or others zones on the same layer
32  * and with the same netcode can change or can be deleted
33  * This is due to the fact overlapping zones are merged
34  * Also, when a zone outline is modified by adding a cutout area,
35  * this zone can be converted to more than one area, if the outline is break to 2 or more outlines
36  * and therefore new zones are created
37  *
38  * Due to the complexity of potential changes, and the fact there are only few zones
39  * in a board, and a zone has only few segments outlines, the more easy way to
40  * undo redo changes is to make a copy of all zones that can be changed
41  * and see after zone edition or creation what zones that are really modified,
42  * and ones they are modified (changes, deletion or addition)
43 */
44 
45 #ifndef ZONES_FUNCTIONS_TO_UNDO_REDO_H
46 #define ZONES_FUNCTIONS_TO_UNDO_REDO_H
47 
48 
59 int SaveCopyOfZones(PICKED_ITEMS_LIST & aPickList, BOARD* aPcb, int aNetCode, LAYER_NUM aLayer );
60 
61 
70 void UpdateCopyOfZonesList( PICKED_ITEMS_LIST& aPickList, PICKED_ITEMS_LIST& aAuxiliaryList, BOARD* aPcb );
71 
72 #endif // ZONES_FUNCTIONS_TO_UNDO_REDO_H
int SaveCopyOfZones(PICKED_ITEMS_LIST &aPickList, BOARD *aPcb, int aNetCode, LAYER_NUM aLayer)
Function SaveCopyOfZones creates a copy of zones having a given netcode on a given layer...
void UpdateCopyOfZonesList(PICKED_ITEMS_LIST &aPickList, PICKED_ITEMS_LIST &aAuxiliaryList, BOARD *aPcb)
Function UpdateCopyOfZonesList check a pick list to remove zones identical to their copies and set th...
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169