1 /* 2 * LibrePCB - Professional EDA for everyone! 3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors. 4 * https://librepcb.org/ 5 * 6 * This program is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef LIBREPCB_PROJECT_CMDBOARDPLANEEDIT_H 21 #define LIBREPCB_PROJECT_CMDBOARDPLANEEDIT_H 22 23 /******************************************************************************* 24 * Includes 25 ******************************************************************************/ 26 #include "../items/bi_plane.h" 27 28 #include <librepcb/common/geometry/path.h> 29 #include <librepcb/common/undocommand.h> 30 31 #include <QtCore> 32 33 /******************************************************************************* 34 * Namespace / Forward Declarations 35 ******************************************************************************/ 36 namespace librepcb { 37 namespace project { 38 39 class NetSignal; 40 41 /******************************************************************************* 42 * Class CmdBoardPlaneEdit 43 ******************************************************************************/ 44 45 /** 46 * @brief The CmdBoardPlaneEdit class 47 */ 48 class CmdBoardPlaneEdit final : public UndoCommand { 49 public: 50 // Constructors / Destructor 51 CmdBoardPlaneEdit(BI_Plane& plane, bool rebuildOnChanges) noexcept; 52 ~CmdBoardPlaneEdit() noexcept; 53 54 // Setters 55 void translate(const Point& deltaPos, bool immediate) noexcept; 56 void rotate(const Angle& angle, const Point& center, bool immediate) noexcept; 57 void mirror(const Point& center, Qt::Orientation orientation, 58 bool immediate) noexcept; 59 void setOutline(const Path& outline, bool immediate) noexcept; 60 void setLayerName(const GraphicsLayerName& layerName, 61 bool immediate) noexcept; 62 void setNetSignal(NetSignal& netsignal) noexcept; 63 void setMinWidth(const UnsignedLength& minWidth) noexcept; 64 void setMinClearance(const UnsignedLength& minClearance) noexcept; 65 void setConnectStyle(BI_Plane::ConnectStyle style) noexcept; 66 void setPriority(int priority) noexcept; 67 void setKeepOrphans(bool keepOrphans) noexcept; 68 69 private: 70 // Private Methods 71 72 /// @copydoc UndoCommand::performExecute() 73 bool performExecute() override; 74 75 /// @copydoc UndoCommand::performUndo() 76 void performUndo() override; 77 78 /// @copydoc UndoCommand::performRedo() 79 void performRedo() override; 80 81 // Private Member Variables 82 83 // Attributes from the constructor 84 BI_Plane& mPlane; 85 bool mDoRebuildOnChanges; 86 87 // General Attributes 88 Path mOldOutline; 89 Path mNewOutline; 90 GraphicsLayerName mOldLayerName; 91 GraphicsLayerName mNewLayerName; 92 NetSignal* mOldNetSignal; 93 NetSignal* mNewNetSignal; 94 UnsignedLength mOldMinWidth; 95 UnsignedLength mNewMinWidth; 96 UnsignedLength mOldMinClearance; 97 UnsignedLength mNewMinClearance; 98 BI_Plane::ConnectStyle mOldConnectStyle; 99 BI_Plane::ConnectStyle mNewConnectStyle; 100 int mOldPriority; 101 int mNewPriority; 102 bool mOldKeepOrphans; 103 bool mNewKeepOrphans; 104 }; 105 106 /******************************************************************************* 107 * End of File 108 ******************************************************************************/ 109 110 } // namespace project 111 } // namespace librepcb 112 113 #endif // LIBREPCB_PROJECT_CMDBOARDPLANEEDIT_H 114