LibrePCB Developers Documentation
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#include "../sym/fsm/symboleditorstate.h"
28
31
32#include <QtCore>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38namespace editor {
39
40class CmdCircleEdit;
41class CmdPolygonEdit;
42class CmdSymbolPinEdit;
43class CmdTextEdit;
44
45/*******************************************************************************
46 * Class CmdDragSelectedSymbolItems
47 ******************************************************************************/
48
53public:
54 // Constructors / Destructor
58 const SymbolEditorState::Context& context) noexcept;
60
61 // Getters
62 int getSelectedItemsCount() const noexcept;
63 bool hasOffTheGridElements() const noexcept { return mHasOffTheGridElements; }
64
65 // General Methods
66 void snapToGrid() 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
85 const SymbolEditorState::Context& mContext;
92
93 // Move commands
98};
99
100/*******************************************************************************
101 * End of File
102 ******************************************************************************/
103
104} // namespace editor
105} // namespace librepcb
106
107#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 CmdDragSelectedSymbolItems class.
Definition: cmddragselectedsymbolitems.h:52
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:158
const SymbolEditorState::Context & mContext
Definition: cmddragselectedsymbolitems.h:85
QList< CmdSymbolPinEdit * > mPinEditCmds
Definition: cmddragselectedsymbolitems.h:94
~CmdDragSelectedSymbolItems() noexcept
Definition: cmddragselectedsymbolitems.cpp:119
Angle mDeltaRot
Definition: cmddragselectedsymbolitems.h:88
void mirror(Qt::Orientation orientation) noexcept
Definition: cmddragselectedsymbolitems.cpp:193
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmddragselectedsymbolitems.h:96
bool hasOffTheGridElements() const noexcept
Definition: cmddragselectedsymbolitems.h:63
bool mSnappedToGrid
Definition: cmddragselectedsymbolitems.h:90
int getSelectedItemsCount() const noexcept
Definition: cmddragselectedsymbolitems.cpp:127
void snapToGrid() noexcept
Definition: cmddragselectedsymbolitems.cpp:136
QList< CmdTextEdit * > mTextEditCmds
Definition: cmddragselectedsymbolitems.h:97
bool performExecute() override
Execute the command the first time.
Definition: cmddragselectedsymbolitems.cpp:213
bool mMirrored
Definition: cmddragselectedsymbolitems.h:89
QList< CmdCircleEdit * > mCircleEditCmds
Definition: cmddragselectedsymbolitems.h:95
void rotate(const Angle &angle) noexcept
Definition: cmddragselectedsymbolitems.cpp:177
void setDeltaToStartPos(const Point &delta) noexcept
Definition: cmddragselectedsymbolitems.cpp:153
Point mCenterPos
Definition: cmddragselectedsymbolitems.h:86
void deleteAllCommands() noexcept
Definition: cmddragselectedsymbolitems.cpp:243
The CmdPolygonEdit class.
Definition: cmdpolygonedit.h:51
The CmdSymbolPinEdit class.
Definition: cmdsymbolpinedit.h:48
The CmdTextEdit class.
Definition: cmdtextedit.h:51
The SymbolEditorState class is the base class of all symbol editor FSM states.
Definition: symboleditorstate.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: symboleditorfsm.h:76