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.

86 lines
2.8 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2016 CERN
  5. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  6. * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, you may find one here:
  20. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  21. * or you may search the http://www.gnu.org website for the version 2 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. #ifndef BOARD_COMMIT_H
  26. #define BOARD_COMMIT_H
  27. #include <commit.h>
  28. class BOARD_ITEM;
  29. class PCB_SHAPE;
  30. class ZONE;
  31. class BOARD;
  32. class PICKED_ITEMS_LIST;
  33. class PCB_TOOL_BASE;
  34. class TOOL_MANAGER;
  35. class EDA_DRAW_FRAME;
  36. class TOOL_BASE;
  37. #define SKIP_UNDO 0x0001
  38. #define APPEND_UNDO 0x0002
  39. #define SKIP_SET_DIRTY 0x0004
  40. #define SKIP_CONNECTIVITY 0x0008
  41. #define ZONE_FILL_OP 0x0010
  42. #define SKIP_TEARDROPS 0x0020
  43. class BOARD_COMMIT : public COMMIT
  44. {
  45. public:
  46. BOARD_COMMIT( EDA_DRAW_FRAME* aFrame );
  47. BOARD_COMMIT( TOOL_BASE* aTool );
  48. BOARD_COMMIT( TOOL_MANAGER* aMgr );
  49. BOARD_COMMIT( TOOL_MANAGER* aMgr, bool aIsBoardEditor );
  50. virtual ~BOARD_COMMIT() {}
  51. BOARD* GetBoard() const;
  52. virtual void Push( const wxString& aMessage = wxEmptyString, int aCommitFlags = 0 ) override;
  53. virtual void Revert() override;
  54. COMMIT& Stage( EDA_ITEM* aItem, CHANGE_TYPE aChangeType,
  55. BASE_SCREEN* aScreen = nullptr ) override;
  56. COMMIT& Stage( std::vector<EDA_ITEM*>& container, CHANGE_TYPE aChangeType,
  57. BASE_SCREEN* aScreen = nullptr ) override;
  58. COMMIT& Stage( const PICKED_ITEMS_LIST& aItems,
  59. UNDO_REDO aModFlag = UNDO_REDO::UNSPECIFIED,
  60. BASE_SCREEN* aScreen = nullptr ) override;
  61. static EDA_ITEM* MakeImage( EDA_ITEM* aItem );
  62. private:
  63. EDA_ITEM* parentObject( EDA_ITEM* aItem ) const override;
  64. EDA_ITEM* makeImage( EDA_ITEM* aItem ) const override;
  65. void propagateDamage( BOARD_ITEM* aItem, std::vector<ZONE*>* aStaleZones );
  66. private:
  67. TOOL_MANAGER* m_toolMgr;
  68. bool m_isBoardEditor;
  69. bool m_isFootprintEditor;
  70. };
  71. #endif