LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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_EDITOR_CMDDRAGSELECTEDFOOTPRINTITEMS_H
21#define LIBREPCB_EDITOR_CMDDRAGSELECTEDFOOTPRINTITEMS_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 CmdFootprintPadEdit;
41class CmdHoleEdit;
42class CmdPolygonEdit;
43class CmdStrokeTextEdit;
44class CmdZoneEdit;
45class FootprintGraphicsItem;
46
47/*******************************************************************************
48 * Class CmdDragSelectedFootprintItems
49 ******************************************************************************/
50
55public:
56 // Constructors / Destructor
59 delete;
61 const PositiveLength& grid) noexcept;
63
64 // Getters
65 int getSelectedItemsCount() const noexcept;
66 bool hasOffTheGridElements() const noexcept { return mHasOffTheGridElements; }
67 const QList<Point>& getPositions() const noexcept { return mPositions; }
68
69 // General Methods
70 void snapToGrid(const PositiveLength& grid) noexcept;
71 void setDeltaToStartPos(const Point& delta) noexcept;
72 void setNewPositions(QList<Point> positions);
73 void translate(const Point& deltaPos) noexcept;
74 void rotate(const Angle& angle) noexcept;
75 void mirrorGeometry(Qt::Orientation orientation) noexcept;
76 void mirrorLayer() noexcept;
77
78 // Operator Overloadings
80 const CmdDragSelectedFootprintItems& rhs) = delete;
81
82private:
83 // Private Methods
84
86 bool performExecute() override;
87
88 void deleteAllCommands() noexcept;
89
90 // Private Member Variables
100
101 // Move commands
108};
109
110/*******************************************************************************
111 * End of File
112 ******************************************************************************/
113
114} // namespace editor
115} // namespace librepcb
116
117#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 CmdDragSelectedFootprintItems class.
Definition cmddragselectedfootprintitems.h:54
QList< Point > mPositions
Definition cmddragselectedfootprintitems.h:91
bool mMirroredLayer
Definition cmddragselectedfootprintitems.h:96
bool mNewPositionsSet
Definition cmddragselectedfootprintitems.h:98
Point mDeltaPos
Definition cmddragselectedfootprintitems.h:93
bool mHasOffTheGridElements
Definition cmddragselectedfootprintitems.h:99
void translate(const Point &deltaPos) noexcept
Definition cmddragselectedfootprintitems.cpp:226
QList< CmdFootprintPadEdit * > mPadEditCmds
Definition cmddragselectedfootprintitems.h:102
void mirrorLayer() noexcept
Definition cmddragselectedfootprintitems.cpp:296
void snapToGrid(const PositiveLength &grid) noexcept
Definition cmddragselectedfootprintitems.cpp:172
QList< CmdZoneEdit * > mZoneEditCmds
Definition cmddragselectedfootprintitems.h:106
const QList< Point > & getPositions() const noexcept
Definition cmddragselectedfootprintitems.h:67
CmdDragSelectedFootprintItems(const CmdDragSelectedFootprintItems &other)=delete
bool mMirroredGeometry
Definition cmddragselectedfootprintitems.h:95
~CmdDragSelectedFootprintItems() noexcept
Definition cmddragselectedfootprintitems.cpp:154
Angle mDeltaRot
Definition cmddragselectedfootprintitems.h:94
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition cmddragselectedfootprintitems.h:104
bool hasOffTheGridElements() const noexcept
Definition cmddragselectedfootprintitems.h:66
QList< CmdStrokeTextEdit * > mTextEditCmds
Definition cmddragselectedfootprintitems.h:105
void mirrorGeometry(Qt::Orientation orientation) noexcept
Definition cmddragselectedfootprintitems.cpp:273
bool mSnappedToGrid
Definition cmddragselectedfootprintitems.h:97
int getSelectedItemsCount() const noexcept
Definition cmddragselectedfootprintitems.cpp:162
QList< CmdHoleEdit * > mHoleEditCmds
Definition cmddragselectedfootprintitems.h:107
bool performExecute() override
Execute the command the first time.
Definition cmddragselectedfootprintitems.cpp:319
QList< CmdCircleEdit * > mCircleEditCmds
Definition cmddragselectedfootprintitems.h:103
void setNewPositions(QList< Point > positions)
Definition cmddragselectedfootprintitems.cpp:200
void rotate(const Angle &angle) noexcept
Definition cmddragselectedfootprintitems.cpp:251
void setDeltaToStartPos(const Point &delta) noexcept
Definition cmddragselectedfootprintitems.cpp:195
Point mCenterPos
Definition cmddragselectedfootprintitems.h:92
void deleteAllCommands() noexcept
Definition cmddragselectedfootprintitems.cpp:355
The CmdFootprintPadEdit class.
Definition cmdfootprintpadedit.h:48
The CmdHoleEdit class.
Definition cmdholeedit.h:53
The CmdPolygonEdit class.
Definition cmdpolygonedit.h:51
The CmdStrokeTextEdit class.
Definition cmdstroketextedit.h:51
The CmdZoneEdit class.
Definition cmdzoneedit.h:48
The FootprintGraphicsItem class.
Definition footprintgraphicsitem.h:66
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