LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmddragselectedfootprintitems.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_CMDDRAGSELECTEDFOOTPRINTITEMS_H
21 #define LIBREPCB_LIBRARY_EDITOR_CMDDRAGSELECTEDFOOTPRINTITEMS_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 CmdDragSelectedFootprintItems
51  ******************************************************************************/
52 
57 public:
58  // Constructors / Destructor
61  delete;
63  const PackageEditorState::Context& context) noexcept;
65 
66  // General Methods
67  void setDeltaToStartPos(const Point& delta) noexcept;
68  void translate(const Point& deltaPos) noexcept;
69  void rotate(const Angle& angle) noexcept;
70 
71  // Operator Overloadings
73  const CmdDragSelectedFootprintItems& rhs) = delete;
74 
75 private:
76  // Private Methods
77 
79  bool performExecute() override;
80 
81  void deleteAllCommands() noexcept;
82 
83  // 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_CMDDRAGSELECTEDFOOTPRINTITEMS_H
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmddragselectedfootprintitems.h:91
QList< CmdStrokeTextEdit * > mTextEditCmds
Definition: cmddragselectedfootprintitems.h:93
Point mDeltaPos
Definition: cmddragselectedfootprintitems.h:86
Angle mDeltaRot
Definition: cmddragselectedfootprintitems.h:87
void rotate(const Angle &angle) noexcept
Definition: cmddragselectedfootprintitems.cpp:150
~CmdDragSelectedFootprintItems() noexcept
Definition: cmddragselectedfootprintitems.cpp:115
const PackageEditorState::Context & mContext
Definition: cmddragselectedfootprintitems.h:84
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition: undocommandgroup.h:43
void setDeltaToStartPos(const Point &delta) noexcept
Definition: cmddragselectedfootprintitems.cpp:123
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
bool performExecute() override
Execute the command the first time.
Definition: cmddragselectedfootprintitems.cpp:173
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
QList< CmdHoleEdit * > mHoleEditCmds
Definition: cmddragselectedfootprintitems.h:94
CmdDragSelectedFootprintItems & operator=(const CmdDragSelectedFootprintItems &rhs)=delete
The CmdDragSelectedFootprintItems class.
Definition: cmddragselectedfootprintitems.h:56
Point mCenterPos
Definition: cmddragselectedfootprintitems.h:85
QList< CmdFootprintPadEdit * > mPadEditCmds
Definition: cmddragselectedfootprintitems.h:90
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmddragselectedfootprintitems.h:92
void deleteAllCommands() noexcept
Definition: cmddragselectedfootprintitems.cpp:205
void translate(const Point &deltaPos) noexcept
Definition: cmddragselectedfootprintitems.cpp:128