LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmdmoveselectedfootprintitems.h
Go to the documentation of this file.
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_LIBRARY_EDITOR_CMDMOVESELECTEDFOOTPRINTITEMS_H
21 #define LIBREPCB_LIBRARY_EDITOR_CMDMOVESELECTEDFOOTPRINTITEMS_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../packageeditorstate.h"
27 
30 
31 #include <QtCore>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 
38 class CmdCircleEdit;
39 class CmdStrokeTextEdit;
40 class CmdPolygonEdit;
41 class CmdHoleEdit;
42 
43 namespace library {
44 
45 class CmdFootprintPadEdit;
46 
47 namespace editor {
48 
49 /*******************************************************************************
50  * Class CmdMoveSelectedFootprintItems
51  ******************************************************************************/
52 
60 public:
61  // Constructors / Destructor
64  delete;
66  const Point& startPos) noexcept;
68 
69  // General Methods
70  void setCurrentPosition(const Point& pos) noexcept;
71 
72  // Operator Overloadings
74  const CmdMoveSelectedFootprintItems& rhs) = delete;
75 
76 private:
77  // Private Methods
78 
80  bool performExecute() override;
81 
82  void deleteAllCommands() noexcept;
83 
84  // Private Member Variables
88 
89  // Move commands
90  QList<CmdFootprintPadEdit*> mPadEditCmds;
91  QList<CmdCircleEdit*> mCircleEditCmds;
92  QList<CmdPolygonEdit*> mPolygonEditCmds;
93  QList<CmdStrokeTextEdit*> mTextEditCmds;
94  QList<CmdHoleEdit*> mHoleEditCmds;
95 };
96 
97 /*******************************************************************************
98  * End of File
99  ******************************************************************************/
100 
101 } // namespace editor
102 } // namespace library
103 } // namespace librepcb
104 
105 #endif // LIBREPCB_LIBRARY_EDITOR_CMDMOVESELECTEDFOOTPRINTITEMS_H
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmdmoveselectedfootprintitems.h:92
Point mStartPos
Definition: cmdmoveselectedfootprintitems.h:86
QList< CmdStrokeTextEdit * > mTextEditCmds
Definition: cmdmoveselectedfootprintitems.h:93
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition: undocommandgroup.h:46
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmdmoveselectedfootprintitems.h:91
QList< CmdHoleEdit * > mHoleEditCmds
Definition: cmdmoveselectedfootprintitems.h:94
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:81
const PackageEditorState::Context & mContext
Definition: cmdmoveselectedfootprintitems.h:85
The CmdMoveSelectedFootprintItems class.
Definition: cmdmoveselectedfootprintitems.h:59
bool performExecute() override
Execute the command the first time.
Definition: cmdmoveselectedfootprintitems.cpp:133
~CmdMoveSelectedFootprintItems() noexcept
Definition: cmdmoveselectedfootprintitems.cpp:95
QList< CmdFootprintPadEdit * > mPadEditCmds
Definition: cmdmoveselectedfootprintitems.h:90
Point mDeltaPos
Definition: cmdmoveselectedfootprintitems.h:87
void deleteAllCommands() noexcept
Definition: cmdmoveselectedfootprintitems.cpp:165
void setCurrentPosition(const Point &pos) noexcept
Definition: cmdmoveselectedfootprintitems.cpp:103
CmdMoveSelectedFootprintItems & operator=(const CmdMoveSelectedFootprintItems &rhs)=delete