LibrePCB Developers Documentation
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#include "../pkg/fsm/packageeditorstate.h"
28
31
32#include <QtCore>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38namespace editor {
39
40class CmdCircleEdit;
41class CmdFootprintPadEdit;
42class CmdHoleEdit;
43class CmdPolygonEdit;
44class CmdStrokeTextEdit;
45class CmdZoneEdit;
46
47/*******************************************************************************
48 * Class CmdDragSelectedFootprintItems
49 ******************************************************************************/
50
55public:
56 // Constructors / Destructor
59 delete;
61 const PackageEditorState::Context& context) 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() 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
101
102 // Move commands
109};
110
111/*******************************************************************************
112 * End of File
113 ******************************************************************************/
114
115} // namespace editor
116} // namespace librepcb
117
118#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The CmdCircleEdit class.
Definition: cmdcircleedit.h:51
The CmdDragSelectedFootprintItems class.
Definition: cmddragselectedfootprintitems.h:54
QList< Point > mPositions
Definition: cmddragselectedfootprintitems.h:92
bool mMirroredLayer
Definition: cmddragselectedfootprintitems.h:97
bool mNewPositionsSet
Definition: cmddragselectedfootprintitems.h:99
Point mDeltaPos
Definition: cmddragselectedfootprintitems.h:94
bool mHasOffTheGridElements
Definition: cmddragselectedfootprintitems.h:100
void translate(const Point &deltaPos) noexcept
Definition: cmddragselectedfootprintitems.cpp:232
QList< CmdFootprintPadEdit * > mPadEditCmds
Definition: cmddragselectedfootprintitems.h:103
void mirrorLayer() noexcept
Definition: cmddragselectedfootprintitems.cpp:302
QList< CmdZoneEdit * > mZoneEditCmds
Definition: cmddragselectedfootprintitems.h:107
const QList< Point > & getPositions() const noexcept
Definition: cmddragselectedfootprintitems.h:67
CmdDragSelectedFootprintItems(const CmdDragSelectedFootprintItems &other)=delete
bool mMirroredGeometry
Definition: cmddragselectedfootprintitems.h:96
~CmdDragSelectedFootprintItems() noexcept
Definition: cmddragselectedfootprintitems.cpp:160
Angle mDeltaRot
Definition: cmddragselectedfootprintitems.h:95
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmddragselectedfootprintitems.h:105
bool hasOffTheGridElements() const noexcept
Definition: cmddragselectedfootprintitems.h:66
QList< CmdStrokeTextEdit * > mTextEditCmds
Definition: cmddragselectedfootprintitems.h:106
void mirrorGeometry(Qt::Orientation orientation) noexcept
Definition: cmddragselectedfootprintitems.cpp:279
bool mSnappedToGrid
Definition: cmddragselectedfootprintitems.h:98
int getSelectedItemsCount() const noexcept
Definition: cmddragselectedfootprintitems.cpp:168
void snapToGrid() noexcept
Definition: cmddragselectedfootprintitems.cpp:178
QList< CmdHoleEdit * > mHoleEditCmds
Definition: cmddragselectedfootprintitems.h:108
bool performExecute() override
Execute the command the first time.
Definition: cmddragselectedfootprintitems.cpp:325
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmddragselectedfootprintitems.h:104
void setNewPositions(QList< Point > positions)
Definition: cmddragselectedfootprintitems.cpp:206
void rotate(const Angle &angle) noexcept
Definition: cmddragselectedfootprintitems.cpp:257
void setDeltaToStartPos(const Point &delta) noexcept
Definition: cmddragselectedfootprintitems.cpp:201
Point mCenterPos
Definition: cmddragselectedfootprintitems.h:93
const PackageEditorState::Context & mContext
Definition: cmddragselectedfootprintitems.h:91
void deleteAllCommands() noexcept
Definition: cmddragselectedfootprintitems.cpp:361
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 PackageEditorState class is the base class of all package editor FSM states.
Definition: packageeditorstate.h:52
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
Definition: packageeditorfsm.h:90