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
68 // General Methods
69 void snapToGrid() noexcept;
70 void setDeltaToStartPos(const Point& delta) noexcept;
71 void translate(const Point& deltaPos) noexcept;
72 void rotate(const Angle& angle) noexcept;
73 void mirrorGeometry(Qt::Orientation orientation) noexcept;
74 void mirrorLayer() noexcept;
75
76 // Operator Overloadings
78 const CmdDragSelectedFootprintItems& rhs) = delete;
79
80private:
81 // Private Methods
82
84 bool performExecute() override;
85
86 void deleteAllCommands() noexcept;
87
88 // Private Member Variables
97
98 // Move commands
105};
106
107/*******************************************************************************
108 * End of File
109 ******************************************************************************/
110
111} // namespace editor
112} // namespace librepcb
113
114#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
bool mMirroredLayer
Definition: cmddragselectedfootprintitems.h:94
Point mDeltaPos
Definition: cmddragselectedfootprintitems.h:91
bool mHasOffTheGridElements
Definition: cmddragselectedfootprintitems.h:96
void translate(const Point &deltaPos) noexcept
Definition: cmddragselectedfootprintitems.cpp:201
QList< CmdFootprintPadEdit * > mPadEditCmds
Definition: cmddragselectedfootprintitems.h:99
void mirrorLayer() noexcept
Definition: cmddragselectedfootprintitems.cpp:271
QList< CmdZoneEdit * > mZoneEditCmds
Definition: cmddragselectedfootprintitems.h:103
CmdDragSelectedFootprintItems(const CmdDragSelectedFootprintItems &other)=delete
bool mMirroredGeometry
Definition: cmddragselectedfootprintitems.h:93
~CmdDragSelectedFootprintItems() noexcept
Definition: cmddragselectedfootprintitems.cpp:155
Angle mDeltaRot
Definition: cmddragselectedfootprintitems.h:92
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmddragselectedfootprintitems.h:101
bool hasOffTheGridElements() const noexcept
Definition: cmddragselectedfootprintitems.h:66
QList< CmdStrokeTextEdit * > mTextEditCmds
Definition: cmddragselectedfootprintitems.h:102
void mirrorGeometry(Qt::Orientation orientation) noexcept
Definition: cmddragselectedfootprintitems.cpp:248
bool mSnappedToGrid
Definition: cmddragselectedfootprintitems.h:95
int getSelectedItemsCount() const noexcept
Definition: cmddragselectedfootprintitems.cpp:163
void snapToGrid() noexcept
Definition: cmddragselectedfootprintitems.cpp:173
QList< CmdHoleEdit * > mHoleEditCmds
Definition: cmddragselectedfootprintitems.h:104
bool performExecute() override
Execute the command the first time.
Definition: cmddragselectedfootprintitems.cpp:294
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmddragselectedfootprintitems.h:100
void rotate(const Angle &angle) noexcept
Definition: cmddragselectedfootprintitems.cpp:226
void setDeltaToStartPos(const Point &delta) noexcept
Definition: cmddragselectedfootprintitems.cpp:196
Point mCenterPos
Definition: cmddragselectedfootprintitems.h:90
const PackageEditorState::Context & mContext
Definition: cmddragselectedfootprintitems.h:89
void deleteAllCommands() noexcept
Definition: cmddragselectedfootprintitems.cpp:330
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:89