LibrePCB Developers Documentation
cmdholeedit.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_CMDHOLEEDIT_H
21#define LIBREPCB_EDITOR_CMDHOLEEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../undocommand.h"
29#include "cmdlistelementsswap.h"
30
34
35#include <QtCore>
36
37/*******************************************************************************
38 * Namespace / Forward Declarations
39 ******************************************************************************/
40namespace librepcb {
41
42class Angle;
43
44namespace editor {
45
46/*******************************************************************************
47 * Class CmdHoleEdit
48 ******************************************************************************/
49
53class CmdHoleEdit final : public UndoCommand {
54public:
55 // Constructors / Destructor
56 CmdHoleEdit() = delete;
57 CmdHoleEdit(const CmdHoleEdit& other) = delete;
58 explicit CmdHoleEdit(Hole& hole) noexcept;
59 ~CmdHoleEdit() noexcept;
60
61 // Setters
62 void setPath(const NonEmptyPath& path, bool immediate) noexcept;
63 void setPositionOfFirstVertex(const Point& pos, bool immediate) noexcept;
64 void translate(const Point& deltaPos, bool immediate) noexcept;
65 void snapToGrid(const PositiveLength& gridInterval, bool immediate) noexcept;
66 void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
67 void mirror(Qt::Orientation orientation, const Point& center,
68 bool immediate) noexcept;
69 void setDiameter(const PositiveLength& diameter, bool immediate) noexcept;
70 void setStopMaskConfig(const MaskConfig& config) noexcept;
71
72 // Operator Overloadings
73 CmdHoleEdit& operator=(const CmdHoleEdit& rhs) = delete;
74
75private:
76 // Private Methods
77
79 bool performExecute() override;
80
82 void performUndo() override;
83
85 void performRedo() override;
86
87 // Private Member Variables
88
89 // Attributes from the constructor
91
92 // General Attributes
99};
100
101/*******************************************************************************
102 * Undo Commands
103 ******************************************************************************/
104
111
112/*******************************************************************************
113 * End of File
114 ******************************************************************************/
115
116} // namespace editor
117} // namespace librepcb
118
119#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The Hole class.
Definition: hole.h:45
The MaskConfig class defines how to add automatic stop mask or solder paste.
Definition: maskconfig.h:45
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The CmdHoleEdit class.
Definition: cmdholeedit.h:53
void performRedo() override
Redo the command.
Definition: cmdholeedit.cpp:125
void setStopMaskConfig(const MaskConfig &config) noexcept
Definition: cmdholeedit.cpp:101
void translate(const Point &deltaPos, bool immediate) noexcept
Definition: cmdholeedit.cpp:70
CmdHoleEdit(const CmdHoleEdit &other)=delete
NonEmptyPath mNewPath
Definition: cmdholeedit.h:94
void setPositionOfFirstVertex(const Point &pos, bool immediate) noexcept
Definition: cmdholeedit.cpp:64
void performUndo() override
Undo the command.
Definition: cmdholeedit.cpp:119
PositiveLength mNewDiameter
Definition: cmdholeedit.h:96
PositiveLength mOldDiameter
Definition: cmdholeedit.h:95
void setDiameter(const PositiveLength &diameter, bool immediate) noexcept
Definition: cmdholeedit.cpp:94
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition: cmdholeedit.cpp:75
NonEmptyPath mOldPath
Definition: cmdholeedit.h:93
~CmdHoleEdit() noexcept
Definition: cmdholeedit.cpp:48
void setPath(const NonEmptyPath &path, bool immediate) noexcept
Definition: cmdholeedit.cpp:58
void mirror(Qt::Orientation orientation, const Point &center, bool immediate) noexcept
Definition: cmdholeedit.cpp:88
bool performExecute() override
Execute the command the first time.
Definition: cmdholeedit.cpp:110
MaskConfig mNewStopMaskConfig
Definition: cmdholeedit.h:98
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition: cmdholeedit.cpp:82
Hole & mHole
Definition: cmdholeedit.h:90
MaskConfig mOldStopMaskConfig
Definition: cmdholeedit.h:97
The CmdListElementInsert class.
Definition: cmdlistelementinsert.h:46
The CmdListElementRemove class.
Definition: cmdlistelementremove.h:46
The CmdListElementsSwap class.
Definition: cmdlistelementsswap.h:46
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
type_safe::constrained_type< Path, NonEmptyPathConstraint, NonEmptyPathVerifier > NonEmptyPath
Definition: path.h:222
Definition: hole.h:110