LibrePCB Developers Documentation
cmdboardnetlineedit.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_CMDBOARDNETLINEEDIT_H
21#define LIBREPCB_EDITOR_CMDBOARDNETLINEEDIT_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 Layer;
38
39namespace editor {
40
41/*******************************************************************************
42 * Class CmdBoardNetLineEdit
43 ******************************************************************************/
44
48class CmdBoardNetLineEdit final : public UndoCommand {
49public:
50 // Constructors / Destructor
51 explicit CmdBoardNetLineEdit(BI_NetLine& netline) noexcept;
52 ~CmdBoardNetLineEdit() noexcept;
53
54 // Getters
55 BI_NetLine& getObj() const noexcept { return mNetLine; }
56
57 // Setters
58 void setLayer(const Layer& layer) noexcept;
59 void setWidth(const PositiveLength& width) noexcept;
60
61private: // Methods
63 bool performExecute() override;
64
66 void performUndo() override;
67
69 void performRedo() override;
70
71private: // Data
77};
78
79/*******************************************************************************
80 * End of File
81 ******************************************************************************/
82
83} // namespace editor
84} // namespace librepcb
85
86#endif
The BI_NetLine class.
Definition: bi_netline.h:71
The Layer class provides all supported geometry layers.
Definition: layer.h:40
The CmdBoardNetLineEdit class.
Definition: cmdboardnetlineedit.h:48
void performRedo() override
Redo the command.
Definition: cmdboardnetlineedit.cpp:78
CmdBoardNetLineEdit(BI_NetLine &netline) noexcept
Definition: cmdboardnetlineedit.cpp:37
BI_NetLine & getObj() const noexcept
Definition: cmdboardnetlineedit.h:55
void setLayer(const Layer &layer) noexcept
Definition: cmdboardnetlineedit.cpp:53
void performUndo() override
Undo the command.
Definition: cmdboardnetlineedit.cpp:73
void setWidth(const PositiveLength &width) noexcept
Definition: cmdboardnetlineedit.cpp:58
PositiveLength mNewWidth
Definition: cmdboardnetlineedit.h:76
const Layer * mNewLayer
Definition: cmdboardnetlineedit.h:74
PositiveLength mOldWidth
Definition: cmdboardnetlineedit.h:75
BI_NetLine & mNetLine
Definition: cmdboardnetlineedit.h:72
bool performExecute() override
Execute the command the first time.
Definition: cmdboardnetlineedit.cpp:67
~CmdBoardNetLineEdit() noexcept
Definition: cmdboardnetlineedit.cpp:46
const Layer * mOldLayer
Definition: cmdboardnetlineedit.h:73
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