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 translate(const Point& deltaPos, bool immediate) noexcept;
64 void snapToGrid(const PositiveLength& gridInterval, bool immediate) noexcept;
65 void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
66 void mirror(Qt::Orientation orientation, const Point& center,
67 bool immediate) noexcept;
68 void setDiameter(const PositiveLength& diameter, bool immediate) noexcept;
69 void setStopMaskConfig(const MaskConfig& config) noexcept;
70
71 // Operator Overloadings
72 CmdHoleEdit& operator=(const CmdHoleEdit& rhs) = delete;
73
74private:
75 // Private Methods
76
78 bool performExecute() override;
79
81 void performUndo() override;
82
84 void performRedo() override;
85
86 // Private Member Variables
87
88 // Attributes from the constructor
90
91 // General Attributes
98};
99
100/*******************************************************************************
101 * Undo Commands
102 ******************************************************************************/
103
110
111/*******************************************************************************
112 * End of File
113 ******************************************************************************/
114
115} // namespace editor
116} // namespace librepcb
117
118#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:119
void setStopMaskConfig(const MaskConfig &config) noexcept
Definition: cmdholeedit.cpp:95
void translate(const Point &deltaPos, bool immediate) noexcept
Definition: cmdholeedit.cpp:64
CmdHoleEdit(const CmdHoleEdit &other)=delete
NonEmptyPath mNewPath
Definition: cmdholeedit.h:93
void performUndo() override
Undo the command.
Definition: cmdholeedit.cpp:113
PositiveLength mNewDiameter
Definition: cmdholeedit.h:95
PositiveLength mOldDiameter
Definition: cmdholeedit.h:94
void setDiameter(const PositiveLength &diameter, bool immediate) noexcept
Definition: cmdholeedit.cpp:88
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition: cmdholeedit.cpp:69
NonEmptyPath mOldPath
Definition: cmdholeedit.h:92
~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:82
bool performExecute() override
Execute the command the first time.
Definition: cmdholeedit.cpp:104
MaskConfig mNewStopMaskConfig
Definition: cmdholeedit.h:97
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition: cmdholeedit.cpp:76
Hole & mHole
Definition: cmdholeedit.h:89
MaskConfig mOldStopMaskConfig
Definition: cmdholeedit.h:96
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:221
Definition: hole.h:110