LibrePCB Developers Documentation
cmdboardpolygonedit.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_CMDBOARDPOLYGONEDIT_H
21#define LIBREPCB_EDITOR_CMDBOARDPOLYGONEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommand.h"
27
29
30#include <QtCore>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36
37class Angle;
38class BI_Polygon;
39
40namespace editor {
41
42/*******************************************************************************
43 * Class CmdBoardPolygonEdit
44 ******************************************************************************/
45
49class CmdBoardPolygonEdit final : public UndoCommand {
50public:
51 // Constructors / Destructor
54 explicit CmdBoardPolygonEdit(BI_Polygon& polygon) noexcept;
55 ~CmdBoardPolygonEdit() noexcept;
56
57 // Getters
58 BI_Polygon& getObj() const noexcept { return mPolygon; }
59
60 // Setters
61 void setLayer(const Layer& layer, bool immediate) noexcept;
62 void setLineWidth(const UnsignedLength& width, bool immediate) noexcept;
63 void setIsFilled(bool filled, bool immediate) noexcept;
64 void setIsGrabArea(bool grabArea, bool immediate) noexcept;
65 void setPath(const Path& path, bool immediate) noexcept;
66 void translate(const Point& deltaPos, bool immediate) noexcept;
67 void snapToGrid(const PositiveLength& gridInterval, bool immediate) noexcept;
68 void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
69 void mirrorGeometry(Qt::Orientation orientation, const Point& center,
70 bool immediate) noexcept;
71 void mirrorLayer(int innerLayerCount, bool immediate) noexcept;
72 void setLocked(bool locked) noexcept;
73
74 // Operator Overloadings
76
77private: // Methods
79 bool performExecute() override;
80
82 void performUndo() override;
83
85 void performRedo() override;
86
87private: // Data
91};
92
93/*******************************************************************************
94 * End of File
95 ******************************************************************************/
96
97} // namespace editor
98} // namespace librepcb
99
100#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The BI_Polygon class.
Definition: bi_polygon.h:46
The BoardPolygonData class.
Definition: boardpolygondata.h:45
The Layer class provides all supported geometry layers.
Definition: layer.h:42
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition: path.h:58
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition: point.h:79
The CmdBoardPolygonEdit class.
Definition: cmdboardpolygonedit.h:49
void performRedo() override
Redo the command.
Definition: cmdboardpolygonedit.cpp:144
void mirrorLayer(int innerLayerCount, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:116
void setLayer(const Layer &layer, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:57
void translate(const Point &deltaPos, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:95
void setIsGrabArea(bool grabArea, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:80
void setIsFilled(bool filled, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:73
void performUndo() override
Undo the command.
Definition: cmdboardpolygonedit.cpp:135
void setLineWidth(const UnsignedLength &width, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:65
void mirrorGeometry(Qt::Orientation orientation, const Point &center, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:110
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:100
~CmdBoardPolygonEdit() noexcept
Definition: cmdboardpolygonedit.cpp:47
BI_Polygon & mPolygon
Definition: cmdboardpolygonedit.h:88
BoardPolygonData mOldData
Definition: cmdboardpolygonedit.h:89
BI_Polygon & getObj() const noexcept
Definition: cmdboardpolygonedit.h:58
CmdBoardPolygonEdit & operator=(const CmdBoardPolygonEdit &rhs)=delete
void setPath(const Path &path, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:88
CmdBoardPolygonEdit(const CmdBoardPolygonEdit &other)=delete
bool performExecute() override
Execute the command the first time.
Definition: cmdboardpolygonedit.cpp:130
void setLocked(bool locked) noexcept
Definition: cmdboardpolygonedit.cpp:121
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition: cmdboardpolygonedit.cpp:105
BoardPolygonData mNewData
Definition: cmdboardpolygonedit.h:90
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< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696