LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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
28
#include <
librepcb/core/types/angle.h
>
29
#include <
librepcb/core/types/point.h
>
30
31
#include <QtCore>
32
33
/*******************************************************************************
34
* Namespace / Forward Declarations
35
******************************************************************************/
36
namespace
librepcb
{
37
namespace
editor {
38
39
class
CmdCircleEdit;
40
class
CmdFootprintPadEdit;
41
class
CmdHoleEdit;
42
class
CmdPolygonEdit;
43
class
CmdStrokeTextEdit;
44
class
CmdZoneEdit;
45
class
FootprintGraphicsItem;
46
47
/*******************************************************************************
48
* Class CmdDragSelectedFootprintItems
49
******************************************************************************/
50
54
class
CmdDragSelectedFootprintItems
final :
public
UndoCommandGroup
{
55
public
:
56
// Constructors / Destructor
57
CmdDragSelectedFootprintItems
() =
delete
;
58
CmdDragSelectedFootprintItems
(
const
CmdDragSelectedFootprintItems
& other) =
59
delete
;
60
explicit
CmdDragSelectedFootprintItems
(
FootprintGraphicsItem
& item,
61
const
PositiveLength
& grid)
noexcept
;
62
~CmdDragSelectedFootprintItems
() noexcept;
63
64
// Getters
65
int
getSelectedItemsCount
() const noexcept;
66
bool
hasOffTheGridElements
() const noexcept {
return
mHasOffTheGridElements
; }
67
const
QList<Point>&
getPositions
() const noexcept {
return
mPositions
; }
68
69
// General Methods
70
void
snapToGrid
(
const
PositiveLength
& grid)
noexcept
;
71
void
setDeltaToStartPos
(
const
Point
& delta)
noexcept
;
72
void
setNewPositions
(QList<Point> positions);
73
void
translate
(
const
Point
& deltaPos)
noexcept
;
74
void
rotate
(
const
Angle
& angle)
noexcept
;
75
void
mirrorGeometry
(Qt::Orientation orientation)
noexcept
;
76
void
mirrorLayer
() noexcept;
77
78
// Operator Overloadings
79
CmdDragSelectedFootprintItems
& operator=(
80
const
CmdDragSelectedFootprintItems
& rhs) = delete;
81
82
private:
83
// Private Methods
84
86
bool
performExecute
() override;
87
88
void
deleteAllCommands
() noexcept;
89
90
// Private Member Variables
91
QList<
Point
>
mPositions
;
92
Point
mCenterPos
;
93
Point
mDeltaPos
;
94
Angle
mDeltaRot
;
95
bool
mMirroredGeometry
;
96
bool
mMirroredLayer
;
97
bool
mSnappedToGrid
;
98
bool
mNewPositionsSet
;
99
bool
mHasOffTheGridElements
;
100
101
// Move commands
102
QList<
CmdFootprintPadEdit
*>
mPadEditCmds
;
103
QList<
CmdCircleEdit
*>
mCircleEditCmds
;
104
QList<
CmdPolygonEdit
*>
mPolygonEditCmds
;
105
QList<
CmdStrokeTextEdit
*>
mTextEditCmds
;
106
QList<
CmdZoneEdit
*>
mZoneEditCmds
;
107
QList<
CmdHoleEdit
*>
mHoleEditCmds
;
108
};
109
110
/*******************************************************************************
111
* End of File
112
******************************************************************************/
113
114
}
// namespace editor
115
}
// namespace librepcb
116
117
#endif
angle.h
librepcb::Angle
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition
angle.h:76
librepcb::Point
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition
point.h:78
librepcb::editor::CmdCircleEdit
The CmdCircleEdit class.
Definition
cmdcircleedit.h:51
librepcb::editor::CmdDragSelectedFootprintItems
The CmdDragSelectedFootprintItems class.
Definition
cmddragselectedfootprintitems.h:54
librepcb::editor::CmdDragSelectedFootprintItems::mPositions
QList< Point > mPositions
Definition
cmddragselectedfootprintitems.h:91
librepcb::editor::CmdDragSelectedFootprintItems::mMirroredLayer
bool mMirroredLayer
Definition
cmddragselectedfootprintitems.h:96
librepcb::editor::CmdDragSelectedFootprintItems::mNewPositionsSet
bool mNewPositionsSet
Definition
cmddragselectedfootprintitems.h:98
librepcb::editor::CmdDragSelectedFootprintItems::mDeltaPos
Point mDeltaPos
Definition
cmddragselectedfootprintitems.h:93
librepcb::editor::CmdDragSelectedFootprintItems::mHasOffTheGridElements
bool mHasOffTheGridElements
Definition
cmddragselectedfootprintitems.h:99
librepcb::editor::CmdDragSelectedFootprintItems::translate
void translate(const Point &deltaPos) noexcept
Definition
cmddragselectedfootprintitems.cpp:226
librepcb::editor::CmdDragSelectedFootprintItems::mPadEditCmds
QList< CmdFootprintPadEdit * > mPadEditCmds
Definition
cmddragselectedfootprintitems.h:102
librepcb::editor::CmdDragSelectedFootprintItems::CmdDragSelectedFootprintItems
CmdDragSelectedFootprintItems()=delete
librepcb::editor::CmdDragSelectedFootprintItems::mirrorLayer
void mirrorLayer() noexcept
Definition
cmddragselectedfootprintitems.cpp:296
librepcb::editor::CmdDragSelectedFootprintItems::snapToGrid
void snapToGrid(const PositiveLength &grid) noexcept
Definition
cmddragselectedfootprintitems.cpp:172
librepcb::editor::CmdDragSelectedFootprintItems::mZoneEditCmds
QList< CmdZoneEdit * > mZoneEditCmds
Definition
cmddragselectedfootprintitems.h:106
librepcb::editor::CmdDragSelectedFootprintItems::getPositions
const QList< Point > & getPositions() const noexcept
Definition
cmddragselectedfootprintitems.h:67
librepcb::editor::CmdDragSelectedFootprintItems::CmdDragSelectedFootprintItems
CmdDragSelectedFootprintItems(const CmdDragSelectedFootprintItems &other)=delete
librepcb::editor::CmdDragSelectedFootprintItems::mMirroredGeometry
bool mMirroredGeometry
Definition
cmddragselectedfootprintitems.h:95
librepcb::editor::CmdDragSelectedFootprintItems::~CmdDragSelectedFootprintItems
~CmdDragSelectedFootprintItems() noexcept
Definition
cmddragselectedfootprintitems.cpp:154
librepcb::editor::CmdDragSelectedFootprintItems::mDeltaRot
Angle mDeltaRot
Definition
cmddragselectedfootprintitems.h:94
librepcb::editor::CmdDragSelectedFootprintItems::mPolygonEditCmds
QList< CmdPolygonEdit * > mPolygonEditCmds
Definition
cmddragselectedfootprintitems.h:104
librepcb::editor::CmdDragSelectedFootprintItems::hasOffTheGridElements
bool hasOffTheGridElements() const noexcept
Definition
cmddragselectedfootprintitems.h:66
librepcb::editor::CmdDragSelectedFootprintItems::mTextEditCmds
QList< CmdStrokeTextEdit * > mTextEditCmds
Definition
cmddragselectedfootprintitems.h:105
librepcb::editor::CmdDragSelectedFootprintItems::mirrorGeometry
void mirrorGeometry(Qt::Orientation orientation) noexcept
Definition
cmddragselectedfootprintitems.cpp:273
librepcb::editor::CmdDragSelectedFootprintItems::mSnappedToGrid
bool mSnappedToGrid
Definition
cmddragselectedfootprintitems.h:97
librepcb::editor::CmdDragSelectedFootprintItems::getSelectedItemsCount
int getSelectedItemsCount() const noexcept
Definition
cmddragselectedfootprintitems.cpp:162
librepcb::editor::CmdDragSelectedFootprintItems::mHoleEditCmds
QList< CmdHoleEdit * > mHoleEditCmds
Definition
cmddragselectedfootprintitems.h:107
librepcb::editor::CmdDragSelectedFootprintItems::performExecute
bool performExecute() override
Execute the command the first time.
Definition
cmddragselectedfootprintitems.cpp:319
librepcb::editor::CmdDragSelectedFootprintItems::mCircleEditCmds
QList< CmdCircleEdit * > mCircleEditCmds
Definition
cmddragselectedfootprintitems.h:103
librepcb::editor::CmdDragSelectedFootprintItems::setNewPositions
void setNewPositions(QList< Point > positions)
Definition
cmddragselectedfootprintitems.cpp:200
librepcb::editor::CmdDragSelectedFootprintItems::rotate
void rotate(const Angle &angle) noexcept
Definition
cmddragselectedfootprintitems.cpp:251
librepcb::editor::CmdDragSelectedFootprintItems::setDeltaToStartPos
void setDeltaToStartPos(const Point &delta) noexcept
Definition
cmddragselectedfootprintitems.cpp:195
librepcb::editor::CmdDragSelectedFootprintItems::mCenterPos
Point mCenterPos
Definition
cmddragselectedfootprintitems.h:92
librepcb::editor::CmdDragSelectedFootprintItems::deleteAllCommands
void deleteAllCommands() noexcept
Definition
cmddragselectedfootprintitems.cpp:355
librepcb::editor::CmdFootprintPadEdit
The CmdFootprintPadEdit class.
Definition
cmdfootprintpadedit.h:48
librepcb::editor::CmdHoleEdit
The CmdHoleEdit class.
Definition
cmdholeedit.h:53
librepcb::editor::CmdPolygonEdit
The CmdPolygonEdit class.
Definition
cmdpolygonedit.h:51
librepcb::editor::CmdStrokeTextEdit
The CmdStrokeTextEdit class.
Definition
cmdstroketextedit.h:51
librepcb::editor::CmdZoneEdit
The CmdZoneEdit class.
Definition
cmdzoneedit.h:48
librepcb::editor::FootprintGraphicsItem
The FootprintGraphicsItem class.
Definition
footprintgraphicsitem.h:66
librepcb::editor::UndoCommandGroup
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition
undocommandgroup.h:44
librepcb
Definition
occmodel.cpp:77
librepcb::PositiveLength
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition
length.h:810
point.h
libs
librepcb
editor
library
cmd
cmddragselectedfootprintitems.h
Generated on Sun Feb 15 2026 17:10:31 for LibrePCB Developers Documentation by
1.9.8