LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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 {
37
38class Schematic;
39
40namespace editor {
41
42class CmdPolygonEdit;
43class CmdSchematicNetLabelEdit;
44class CmdSchematicNetPointEdit;
45class CmdSymbolInstanceEdit;
46class CmdSymbolInstanceTextsReset;
47class CmdTextEdit;
48class SchematicGraphicsScene;
49
50/*******************************************************************************
51 * Class CmdDragSelectedSchematicItems
52 ******************************************************************************/
53
58public:
59 // Constructors / Destructor
61 const Point& startPos = Point()) noexcept;
63
64 // General Methods
65 void snapToGrid() noexcept;
66 void resetAllTexts() noexcept;
67 void setCurrentPosition(const Point& pos) noexcept;
68 void rotate(const Angle& angle, bool aroundCurrentPosition) noexcept;
69 void mirror(Qt::Orientation orientation, bool aroundCurrentPosition) noexcept;
70
71private:
72 // Private Methods
73
75 virtual bool performExecute() override;
76
78 virtual void performPostExecution() noexcept override;
79
80 // Private Member Variables
90
91 // Move commands
92 QList<CmdSymbolInstanceEdit*> mSymbolEditCmds;
93 QList<CmdSymbolInstanceTextsReset*> mSymbolTextsResetCmds;
94 QList<CmdSchematicNetPointEdit*> mNetPointEditCmds;
95 QList<CmdSchematicNetLabelEdit*> mNetLabelEditCmds;
96 QList<CmdPolygonEdit*> mPolygonEditCmds;
97 QList<CmdTextEdit*> mTextEditCmds;
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:76
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Schematic class represents one schematic page of a project and is always part of a circuit.
Definition schematic.h:74
The CmdDragSelectedSchematicItems class.
Definition cmddragselectedschematicitems.h:57
void mirror(Qt::Orientation orientation, bool aroundCurrentPosition) noexcept
Definition cmddragselectedschematicitems.cpp:207
int mItemCount
Definition cmddragselectedschematicitems.h:82
Point mDeltaPos
Definition cmddragselectedschematicitems.h:84
Schematic & mSchematic
Definition cmddragselectedschematicitems.h:81
QList< CmdSchematicNetLabelEdit * > mNetLabelEditCmds
Definition cmddragselectedschematicitems.h:95
QList< CmdSchematicNetPointEdit * > mNetPointEditCmds
Definition cmddragselectedschematicitems.h:94
Angle mDeltaAngle
Definition cmddragselectedschematicitems.h:86
QList< CmdSymbolInstanceEdit * > mSymbolEditCmds
Definition cmddragselectedschematicitems.h:92
bool mTextsReset
Definition cmddragselectedschematicitems.h:89
~CmdDragSelectedSchematicItems() noexcept
Definition cmddragselectedschematicitems.cpp:125
virtual void performPostExecution() noexcept override
Perform custom actions after modifying the undo stack state.
Definition cmddragselectedschematicitems.cpp:283
QList< CmdSymbolInstanceTextsReset * > mSymbolTextsResetCmds
Definition cmddragselectedschematicitems.h:93
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition cmddragselectedschematicitems.h:96
void resetAllTexts() noexcept
Definition cmddragselectedschematicitems.cpp:152
bool mSnappedToGrid
Definition cmddragselectedschematicitems.h:87
void snapToGrid() noexcept
Definition cmddragselectedschematicitems.cpp:132
QList< CmdTextEdit * > mTextEditCmds
Definition cmddragselectedschematicitems.h:97
void setCurrentPosition(const Point &pos) noexcept
Definition cmddragselectedschematicitems.cpp:156
Point mStartPos
Definition cmddragselectedschematicitems.h:83
virtual bool performExecute() override
Execute the command the first time.
Definition cmddragselectedschematicitems.cpp:236
bool mMirrored
Definition cmddragselectedschematicitems.h:88
void rotate(const Angle &angle, bool aroundCurrentPosition) noexcept
Definition cmddragselectedschematicitems.cpp:182
Point mCenterPos
Definition cmddragselectedschematicitems.h:85
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