You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
3.2 KiB

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