LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmddragselectedsymbolitems.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_CMDDRAGSELECTEDSYMBOLITEMS_H
21 #define LIBREPCB_LIBRARY_EDITOR_CMDDRAGSELECTEDSYMBOLITEMS_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../symboleditorstate.h"
27 
30 
31 #include <QtCore>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 
38 class CmdCircleEdit;
39 class CmdTextEdit;
40 class CmdPolygonEdit;
41 
42 namespace library {
43 
44 class CmdSymbolPinEdit;
45 
46 namespace editor {
47 
48 /*******************************************************************************
49  * Class CmdDragSelectedSymbolItems
50  ******************************************************************************/
51 
56 public:
57  // Constructors / Destructor
58  CmdDragSelectedSymbolItems() = delete;
61  const SymbolEditorState::Context& context) noexcept;
62  ~CmdDragSelectedSymbolItems() noexcept;
63 
64  // General Methods
65  void setDeltaToStartPos(const Point& delta) noexcept;
66  void translate(const Point& deltaPos) noexcept;
67  void rotate(const Angle& angle) noexcept;
68 
69  // Operator Overloadings
71  delete;
72 
73 private:
74  // Private Methods
75 
77  bool performExecute() override;
78 
79  void deleteAllCommands() noexcept;
80 
81  // Private Member Variables
86 
87  // Move commands
88  QList<CmdSymbolPinEdit*> mPinEditCmds;
89  QList<CmdCircleEdit*> mCircleEditCmds;
90  QList<CmdPolygonEdit*> mPolygonEditCmds;
91  QList<CmdTextEdit*> mTextEditCmds;
92 };
93 
94 /*******************************************************************************
95  * End of File
96  ******************************************************************************/
97 
98 } // namespace editor
99 } // namespace library
100 } // namespace librepcb
101 
102 #endif // LIBREPCB_LIBRARY_EDITOR_CMDDRAGSELECTEDSYMBOLITEMS_H
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmddragselectedsymbolitems.h:89
QList< CmdTextEdit * > mTextEditCmds
Definition: cmddragselectedsymbolitems.h:91
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition: undocommandgroup.h:43
Point mCenterPos
Definition: cmddragselectedsymbolitems.h:83
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
const SymbolEditorState::Context & mContext
Definition: cmddragselectedsymbolitems.h:82
Point mDeltaPos
Definition: cmddragselectedsymbolitems.h:84
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:78
void setDeltaToStartPos(const Point &delta) noexcept
Definition: cmddragselectedsymbolitems.cpp:110
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmddragselectedsymbolitems.h:90
void translate(const Point &deltaPos) noexcept
Definition: cmddragselectedsymbolitems.cpp:115
CmdDragSelectedSymbolItems & operator=(const CmdDragSelectedSymbolItems &rhs)=delete
The CmdDragSelectedSymbolItems class.
Definition: cmddragselectedsymbolitems.h:55
~CmdDragSelectedSymbolItems() noexcept
Definition: cmddragselectedsymbolitems.cpp:102
Angle mDeltaRot
Definition: cmddragselectedsymbolitems.h:85
void deleteAllCommands() noexcept
Definition: cmddragselectedsymbolitems.cpp:183
QList< CmdSymbolPinEdit * > mPinEditCmds
Definition: cmddragselectedsymbolitems.h:88
void rotate(const Angle &angle) noexcept
Definition: cmddragselectedsymbolitems.cpp:134
bool performExecute() override
Execute the command the first time.
Definition: cmddragselectedsymbolitems.cpp:154