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 CmdImageEdit;
43class CmdPolygonEdit;
44class CmdSchematicBusJunctionEdit;
45class CmdSchematicBusLabelEdit;
46class CmdSchematicNetLabelEdit;
47class CmdSchematicNetPointEdit;
48class CmdSymbolInstanceEdit;
49class CmdSymbolInstanceTextsReset;
50class CmdTextEdit;
51class SchematicGraphicsScene;
52
53/*******************************************************************************
54 * Class CmdDragSelectedSchematicItems
55 ******************************************************************************/
56
61public:
62 // Constructors / Destructor
64 const Point& startPos = Point()) noexcept;
66
67 // General Methods
68 void snapToGrid() noexcept;
69 void resetAllTexts() noexcept;
70 void setCurrentPosition(const Point& pos) noexcept;
71 void rotate(const Angle& angle, bool aroundCurrentPosition) noexcept;
72 void mirror(Qt::Orientation orientation, bool aroundCurrentPosition) noexcept;
73
74private:
75 // Private Methods
76
78 virtual bool performExecute() override;
79
81 virtual void performPostExecution() noexcept override;
82
83 // Private Member Variables
93
94 // Move commands
95 QList<CmdSymbolInstanceEdit*> mSymbolEditCmds;
96 QList<CmdSymbolInstanceTextsReset*> mSymbolTextsResetCmds;
97 QList<CmdSchematicBusJunctionEdit*> mBusJunctionEditCmds;
98 QList<CmdSchematicBusLabelEdit*> mBusLabelEditCmds;
99 QList<CmdSchematicNetPointEdit*> mNetPointEditCmds;
100 QList<CmdSchematicNetLabelEdit*> mNetLabelEditCmds;
101 QList<CmdPolygonEdit*> mPolygonEditCmds;
102 QList<CmdTextEdit*> mTextEditCmds;
103 QList<CmdImageEdit*> mImageEditCmds;
104};
105
106/*******************************************************************************
107 * End of File
108 ******************************************************************************/
109
110} // namespace editor
111} // namespace librepcb
112
113#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:81
The CmdDragSelectedSchematicItems class.
Definition cmddragselectedschematicitems.h:60
void mirror(Qt::Orientation orientation, bool aroundCurrentPosition) noexcept
Definition cmddragselectedschematicitems.cpp:266
QList< CmdSchematicBusLabelEdit * > mBusLabelEditCmds
Definition cmddragselectedschematicitems.h:98
int mItemCount
Definition cmddragselectedschematicitems.h:85
Point mDeltaPos
Definition cmddragselectedschematicitems.h:87
Schematic & mSchematic
Definition cmddragselectedschematicitems.h:84
QList< CmdSchematicNetLabelEdit * > mNetLabelEditCmds
Definition cmddragselectedschematicitems.h:100
QList< CmdSchematicNetPointEdit * > mNetPointEditCmds
Definition cmddragselectedschematicitems.h:99
QList< CmdSchematicBusJunctionEdit * > mBusJunctionEditCmds
Definition cmddragselectedschematicitems.h:97
Angle mDeltaAngle
Definition cmddragselectedschematicitems.h:89
QList< CmdSymbolInstanceEdit * > mSymbolEditCmds
Definition cmddragselectedschematicitems.h:95
bool mTextsReset
Definition cmddragselectedschematicitems.h:92
~CmdDragSelectedSchematicItems() noexcept
Definition cmddragselectedschematicitems.cpp:157
virtual void performPostExecution() noexcept override
Perform custom actions after modifying the undo stack state.
Definition cmddragselectedschematicitems.cpp:366
QList< CmdSymbolInstanceTextsReset * > mSymbolTextsResetCmds
Definition cmddragselectedschematicitems.h:96
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition cmddragselectedschematicitems.h:101
void resetAllTexts() noexcept
Definition cmddragselectedschematicitems.cpp:193
bool mSnappedToGrid
Definition cmddragselectedschematicitems.h:90
void snapToGrid() noexcept
Definition cmddragselectedschematicitems.cpp:164
QList< CmdImageEdit * > mImageEditCmds
Definition cmddragselectedschematicitems.h:103
QList< CmdTextEdit * > mTextEditCmds
Definition cmddragselectedschematicitems.h:102
void setCurrentPosition(const Point &pos) noexcept
Definition cmddragselectedschematicitems.cpp:197
Point mStartPos
Definition cmddragselectedschematicitems.h:86
virtual bool performExecute() override
Execute the command the first time.
Definition cmddragselectedschematicitems.cpp:304
bool mMirrored
Definition cmddragselectedschematicitems.h:91
void rotate(const Angle &angle, bool aroundCurrentPosition) noexcept
Definition cmddragselectedschematicitems.cpp:232
Point mCenterPos
Definition cmddragselectedschematicitems.h:88
The SchematicGraphicsScene class.
Definition schematicgraphicsscene.h:76
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