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 CmdPolygonEdit;
41class CmdSymbolPinEdit;
42class CmdTextEdit;
43class SymbolGraphicsItem;
44
45/*******************************************************************************
46 * Class CmdDragSelectedSymbolItems
47 ******************************************************************************/
48
53public:
54 // Constructors / Destructor
58 const PositiveLength& grid) noexcept;
60
61 // Getters
62 int getSelectedItemsCount() const noexcept;
63 bool hasOffTheGridElements() const noexcept { return mHasOffTheGridElements; }
64
65 // General Methods
66 void snapToGrid(const PositiveLength& grid) noexcept;
67 void setDeltaToStartPos(const Point& delta) noexcept;
68 void translate(const Point& deltaPos) noexcept;
69 void rotate(const Angle& angle) noexcept;
70 void mirror(Qt::Orientation orientation) noexcept;
71
72 // Operator Overloadings
74 delete;
75
76private:
77 // Private Methods
78
80 bool performExecute() override;
81
82 void deleteAllCommands() noexcept;
83
84 // Private Member Variables
91
92 // Move commands
97};
98
99/*******************************************************************************
100 * End of File
101 ******************************************************************************/
102
103} // namespace editor
104} // namespace librepcb
105
106#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:52
CmdDragSelectedSymbolItems(const CmdDragSelectedSymbolItems &other)=delete
Point mDeltaPos
Definition cmddragselectedsymbolitems.h:86
bool mHasOffTheGridElements
Definition cmddragselectedsymbolitems.h:90
void translate(const Point &deltaPos) noexcept
Definition cmddragselectedsymbolitems.cpp:153
QList< CmdSymbolPinEdit * > mPinEditCmds
Definition cmddragselectedsymbolitems.h:93
~CmdDragSelectedSymbolItems() noexcept
Definition cmddragselectedsymbolitems.cpp:114
void snapToGrid(const PositiveLength &grid) noexcept
Definition cmddragselectedsymbolitems.cpp:131
Angle mDeltaRot
Definition cmddragselectedsymbolitems.h:87
void mirror(Qt::Orientation orientation) noexcept
Definition cmddragselectedsymbolitems.cpp:188
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition cmddragselectedsymbolitems.h:95
bool hasOffTheGridElements() const noexcept
Definition cmddragselectedsymbolitems.h:63
bool mSnappedToGrid
Definition cmddragselectedsymbolitems.h:89
int getSelectedItemsCount() const noexcept
Definition cmddragselectedsymbolitems.cpp:122
QList< CmdTextEdit * > mTextEditCmds
Definition cmddragselectedsymbolitems.h:96
CmdDragSelectedSymbolItems & operator=(const CmdDragSelectedSymbolItems &rhs)=delete
bool performExecute() override
Execute the command the first time.
Definition cmddragselectedsymbolitems.cpp:208
bool mMirrored
Definition cmddragselectedsymbolitems.h:88
QList< CmdCircleEdit * > mCircleEditCmds
Definition cmddragselectedsymbolitems.h:94
void rotate(const Angle &angle) noexcept
Definition cmddragselectedsymbolitems.cpp:172
void setDeltaToStartPos(const Point &delta) noexcept
Definition cmddragselectedsymbolitems.cpp:148
Point mCenterPos
Definition cmddragselectedsymbolitems.h:85
void deleteAllCommands() noexcept
Definition cmddragselectedsymbolitems.cpp:238
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:56
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