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  void mirror(Qt::Orientation orientation) noexcept;
69 
70  // Operator Overloadings
72  delete;
73 
74 private:
75  // Private Methods
76 
78  bool performExecute() override;
79 
80  void deleteAllCommands() noexcept;
81 
82  // Private Member Variables
87  bool mMirrored;
88 
89  // Move commands
90  QList<CmdSymbolPinEdit*> mPinEditCmds;
91  QList<CmdCircleEdit*> mCircleEditCmds;
92  QList<CmdPolygonEdit*> mPolygonEditCmds;
93  QList<CmdTextEdit*> mTextEditCmds;
94 };
95 
96 /*******************************************************************************
97  * End of File
98  ******************************************************************************/
99 
100 } // namespace editor
101 } // namespace library
102 } // namespace librepcb
103 
104 #endif // LIBREPCB_LIBRARY_EDITOR_CMDDRAGSELECTEDSYMBOLITEMS_H
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmddragselectedsymbolitems.h:91
QList< CmdTextEdit * > mTextEditCmds
Definition: cmddragselectedsymbolitems.h:93
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:84
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:83
Point mDeltaPos
Definition: cmddragselectedsymbolitems.h:85
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:111
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmddragselectedsymbolitems.h:92
void translate(const Point &deltaPos) noexcept
Definition: cmddragselectedsymbolitems.cpp:116
CmdDragSelectedSymbolItems & operator=(const CmdDragSelectedSymbolItems &rhs)=delete
The CmdDragSelectedSymbolItems class.
Definition: cmddragselectedsymbolitems.h:55
~CmdDragSelectedSymbolItems() noexcept
Definition: cmddragselectedsymbolitems.cpp:103
Angle mDeltaRot
Definition: cmddragselectedsymbolitems.h:86
void mirror(Qt::Orientation orientation) noexcept
Definition: cmddragselectedsymbolitems.cpp:151
void deleteAllCommands() noexcept
Definition: cmddragselectedsymbolitems.cpp:200
QList< CmdSymbolPinEdit * > mPinEditCmds
Definition: cmddragselectedsymbolitems.h:90
void rotate(const Angle &angle) noexcept
Definition: cmddragselectedsymbolitems.cpp:135
bool performExecute() override
Execute the command the first time.
Definition: cmddragselectedsymbolitems.cpp:171
bool mMirrored
Definition: cmddragselectedsymbolitems.h:87