LibrePCB Developers Documentation
cmddragselectedschematicitems.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_CMDDRAGSELECTEDSCHEMATICITEMS_H
21#define LIBREPCB_EDITOR_CMDDRAGSELECTEDSCHEMATICITEMS_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 CmdPolygonEdit;
40class CmdSchematicNetLabelEdit;
41class CmdSchematicNetPointEdit;
42class CmdSymbolInstanceEdit;
43class CmdSymbolInstanceTextsReset;
44class CmdTextEdit;
45class SchematicGraphicsScene;
46
47/*******************************************************************************
48 * Class CmdDragSelectedSchematicItems
49 ******************************************************************************/
50
55public:
56 // Constructors / Destructor
58 const Point& startPos = Point()) noexcept;
60
61 // General Methods
62 void resetAllTexts() noexcept;
63 void setCurrentPosition(const Point& pos) noexcept;
64 void rotate(const Angle& angle, bool aroundCurrentPosition) noexcept;
65 void mirror(Qt::Orientation orientation, bool aroundCurrentPosition) noexcept;
66
67private:
68 // Private Methods
69
71 virtual bool performExecute() override;
72
74 virtual void performPostExecution() noexcept override;
75
76 // Private Member Variables
85
86 // Move commands
87 QList<CmdSymbolInstanceEdit*> mSymbolEditCmds;
88 QList<CmdSymbolInstanceTextsReset*> mSymbolTextsResetCmds;
89 QList<CmdSchematicNetPointEdit*> mNetPointEditCmds;
90 QList<CmdSchematicNetLabelEdit*> mNetLabelEditCmds;
91 QList<CmdPolygonEdit*> mPolygonEditCmds;
92 QList<CmdTextEdit*> mTextEditCmds;
93};
94
95/*******************************************************************************
96 * End of File
97 ******************************************************************************/
98
99} // namespace editor
100} // namespace librepcb
101
102#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 CmdDragSelectedSchematicItems class.
Definition: cmddragselectedschematicitems.h:54
void mirror(Qt::Orientation orientation, bool aroundCurrentPosition) noexcept
Definition: cmddragselectedschematicitems.cpp:187
int mItemCount
Definition: cmddragselectedschematicitems.h:78
Point mDeltaPos
Definition: cmddragselectedschematicitems.h:80
QList< CmdSchematicNetLabelEdit * > mNetLabelEditCmds
Definition: cmddragselectedschematicitems.h:90
SchematicGraphicsScene & mScene
Definition: cmddragselectedschematicitems.h:77
QList< CmdSchematicNetPointEdit * > mNetPointEditCmds
Definition: cmddragselectedschematicitems.h:89
Angle mDeltaAngle
Definition: cmddragselectedschematicitems.h:82
QList< CmdSymbolInstanceEdit * > mSymbolEditCmds
Definition: cmddragselectedschematicitems.h:87
bool mTextsReset
Definition: cmddragselectedschematicitems.h:84
~CmdDragSelectedSchematicItems() noexcept
Definition: cmddragselectedschematicitems.cpp:124
virtual void performPostExecution() noexcept override
Perform custom actions after modifying the undo stack state.
Definition: cmddragselectedschematicitems.cpp:264
QList< CmdSymbolInstanceTextsReset * > mSymbolTextsResetCmds
Definition: cmddragselectedschematicitems.h:88
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition: cmddragselectedschematicitems.h:91
void resetAllTexts() noexcept
Definition: cmddragselectedschematicitems.cpp:131
QList< CmdTextEdit * > mTextEditCmds
Definition: cmddragselectedschematicitems.h:92
CmdDragSelectedSchematicItems(SchematicGraphicsScene &scene, const Point &startPos=Point()) noexcept
Definition: cmddragselectedschematicitems.cpp:56
void setCurrentPosition(const Point &pos) noexcept
Definition: cmddragselectedschematicitems.cpp:135
Point mStartPos
Definition: cmddragselectedschematicitems.h:79
virtual bool performExecute() override
Execute the command the first time.
Definition: cmddragselectedschematicitems.cpp:217
bool mMirrored
Definition: cmddragselectedschematicitems.h:83
void rotate(const Angle &angle, bool aroundCurrentPosition) noexcept
Definition: cmddragselectedschematicitems.cpp:161
Point mCenterPos
Definition: cmddragselectedschematicitems.h:81
The SchematicGraphicsScene class.
Definition: schematicgraphicsscene.h:67
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