LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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_EDITOR_CMDDRAGSELECTEDSYMBOLITEMS_H
21#define LIBREPCB_EDITOR_CMDDRAGSELECTEDSYMBOLITEMS_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommandgroup.h"
27
30
31#include <QtCore>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37namespace editor {
38
39class CmdCircleEdit;
40class CmdImageEdit;
41class CmdPolygonEdit;
42class CmdSymbolPinEdit;
43class CmdTextEdit;
44class SymbolGraphicsItem;
45
46/*******************************************************************************
47 * Class CmdDragSelectedSymbolItems
48 ******************************************************************************/
49
54public:
55 // Constructors / Destructor
59 const PositiveLength& grid) noexcept;
61
62 // Getters
63 int getSelectedItemsCount() const noexcept;
64 bool hasOffTheGridElements() const noexcept { return mHasOffTheGridElements; }
65
66 // General Methods
67 void snapToGrid(const PositiveLength& grid) noexcept;
68 void setDeltaToStartPos(const Point& delta) noexcept;
69 void translate(const Point& deltaPos) noexcept;
70 void rotate(const Angle& angle) noexcept;
71 void mirror(Qt::Orientation orientation) noexcept;
72
73 // Operator Overloadings
75 delete;
76
77private:
78 // Private Methods
79
81 bool performExecute() override;
82
83 void deleteAllCommands() noexcept;
84
85 // Private Member Variables
92
93 // Move commands
99};
100
101/*******************************************************************************
102 * End of File
103 ******************************************************************************/
104
105} // namespace editor
106} // namespace librepcb
107
108#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The CmdCircleEdit class.
Definition cmdcircleedit.h:51
The CmdDragSelectedSymbolItems class.
Definition cmddragselectedsymbolitems.h:53
CmdDragSelectedSymbolItems(const CmdDragSelectedSymbolItems &other)=delete
Point mDeltaPos
Definition cmddragselectedsymbolitems.h:87
bool mHasOffTheGridElements
Definition cmddragselectedsymbolitems.h:91
void translate(const Point &deltaPos) noexcept
Definition cmddragselectedsymbolitems.cpp:171
QList< CmdSymbolPinEdit * > mPinEditCmds
Definition cmddragselectedsymbolitems.h:94
~CmdDragSelectedSymbolItems() noexcept
Definition cmddragselectedsymbolitems.cpp:129
void snapToGrid(const PositiveLength &grid) noexcept
Definition cmddragselectedsymbolitems.cpp:146
Angle mDeltaRot
Definition cmddragselectedsymbolitems.h:88
void mirror(Qt::Orientation orientation) noexcept
Definition cmddragselectedsymbolitems.cpp:212
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition cmddragselectedsymbolitems.h:96
bool hasOffTheGridElements() const noexcept
Definition cmddragselectedsymbolitems.h:64
bool mSnappedToGrid
Definition cmddragselectedsymbolitems.h:90
int getSelectedItemsCount() const noexcept
Definition cmddragselectedsymbolitems.cpp:137
QList< CmdImageEdit * > mImageEditCmds
Definition cmddragselectedsymbolitems.h:98
QList< CmdTextEdit * > mTextEditCmds
Definition cmddragselectedsymbolitems.h:97
CmdDragSelectedSymbolItems & operator=(const CmdDragSelectedSymbolItems &rhs)=delete
bool performExecute() override
Execute the command the first time.
Definition cmddragselectedsymbolitems.cpp:235
bool mMirrored
Definition cmddragselectedsymbolitems.h:89
QList< CmdCircleEdit * > mCircleEditCmds
Definition cmddragselectedsymbolitems.h:95
void rotate(const Angle &angle) noexcept
Definition cmddragselectedsymbolitems.cpp:193
void setDeltaToStartPos(const Point &delta) noexcept
Definition cmddragselectedsymbolitems.cpp:166
Point mCenterPos
Definition cmddragselectedsymbolitems.h:86
void deleteAllCommands() noexcept
Definition cmddragselectedsymbolitems.cpp:268
The CmdImageEdit class.
Definition cmdimageedit.h:45
The CmdPolygonEdit class.
Definition cmdpolygonedit.h:51
The CmdSymbolPinEdit class.
Definition cmdsymbolpinedit.h:48
The CmdTextEdit class.
Definition cmdtextedit.h:51
The SymbolGraphicsItem class.
Definition symbolgraphicsitem.h:55
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition undocommandgroup.h:44
Definition occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810