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  void mirrorGeometry(Qt::Orientation orientation) noexcept;
71  void mirrorLayer() noexcept;
72 
73  // Operator Overloadings
75  const CmdDragSelectedFootprintItems& rhs) = delete;
76 
77 private:
78  // Private Methods
79 
81  bool performExecute() override;
82 
83  void deleteAllCommands() noexcept;
84 
85  // Private Member Variables
92 
93  // Move commands
94  QList<CmdFootprintPadEdit*> mPadEditCmds;
95  QList<CmdCircleEdit*> mCircleEditCmds;
96  QList<CmdPolygonEdit*> mPolygonEditCmds;
97  QList<CmdStrokeTextEdit*> mTextEditCmds;
98  QList<CmdHoleEdit*> mHoleEditCmds;
99 };
100 
101 /*******************************************************************************
102  * End of File
103  ******************************************************************************/
104 
105 } // namespace editor
106 } // namespace library
107 } // namespace librepcb
108 
109 #endif // LIBREPCB_LIBRARY_EDITOR_CMDDRAGSELECTEDFOOTPRINTITEMS_H
bool mMirroredLayer
Definition: cmddragselectedfootprintitems.h:91
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmddragselectedfootprintitems.h:95
QList< CmdStrokeTextEdit * > mTextEditCmds
Definition: cmddragselectedfootprintitems.h:97
Point mDeltaPos
Definition: cmddragselectedfootprintitems.h:88
Angle mDeltaRot
Definition: cmddragselectedfootprintitems.h:89
void rotate(const Angle &angle) noexcept
Definition: cmddragselectedfootprintitems.cpp:152
~CmdDragSelectedFootprintItems() noexcept
Definition: cmddragselectedfootprintitems.cpp:117
const PackageEditorState::Context & mContext
Definition: cmddragselectedfootprintitems.h:86
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition: undocommandgroup.h:43
bool mMirroredGeometry
Definition: cmddragselectedfootprintitems.h:90
void setDeltaToStartPos(const Point &delta) noexcept
Definition: cmddragselectedfootprintitems.cpp:125
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
void mirrorLayer() noexcept
Definition: cmddragselectedfootprintitems.cpp:191
bool performExecute() override
Execute the command the first time.
Definition: cmddragselectedfootprintitems.cpp:203
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
void mirrorGeometry(Qt::Orientation orientation) noexcept
Definition: cmddragselectedfootprintitems.cpp:171
QList< CmdHoleEdit * > mHoleEditCmds
Definition: cmddragselectedfootprintitems.h:98
CmdDragSelectedFootprintItems & operator=(const CmdDragSelectedFootprintItems &rhs)=delete
The CmdDragSelectedFootprintItems class.
Definition: cmddragselectedfootprintitems.h:56
Point mCenterPos
Definition: cmddragselectedfootprintitems.h:87
QList< CmdFootprintPadEdit * > mPadEditCmds
Definition: cmddragselectedfootprintitems.h:94
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmddragselectedfootprintitems.h:96
void deleteAllCommands() noexcept
Definition: cmddragselectedfootprintitems.cpp:236
void translate(const Point &deltaPos) noexcept
Definition: cmddragselectedfootprintitems.cpp:130