LibrePCB Developers Documentation
cmdboardedit.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_CMDBOARDEDIT_H
21#define LIBREPCB_EDITOR_CMDBOARDEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommand.h"
27
31
32#include <QtCore>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class Board;
40class Layer;
41class PcbColor;
42
43namespace editor {
44
45/*******************************************************************************
46 * Class CmdBoardEdit
47 ******************************************************************************/
48
52class CmdBoardEdit final : public UndoCommand {
53public:
54 // Constructors / Destructor
55 CmdBoardEdit() = delete;
56 CmdBoardEdit(const CmdBoardEdit& other) = delete;
57 explicit CmdBoardEdit(Board& board) noexcept;
58 ~CmdBoardEdit() noexcept;
59
60 // Setters
61 void setName(const ElementName& name) noexcept;
62 void setInnerLayerCount(int count) noexcept;
63 void setPcbThickness(const PositiveLength& thickness) noexcept;
64 void setSolderResist(const PcbColor* c) noexcept;
65 void setSilkscreenColor(const PcbColor& c) noexcept;
66 void setSilkscreenLayersTop(const QVector<const Layer*>& l) noexcept;
67 void setSilkscreenLayersBot(const QVector<const Layer*>& l) noexcept;
68 void setDesignRules(const BoardDesignRules& rules) noexcept;
69 void setDrcSettings(const BoardDesignRuleCheckSettings& settings) noexcept;
70
71private: // Methods
73 bool performExecute() override;
74
76 void performUndo() override;
77
79 void performRedo() override;
80
81private: // Data
83
102};
103
104/*******************************************************************************
105 * End of File
106 ******************************************************************************/
107
108} // namespace editor
109} // namespace librepcb
110
111#endif
The BoardDesignRuleCheckSettings class.
Definition: boarddesignrulechecksettings.h:44
The BoardDesignRules class.
Definition: boarddesignrules.h:45
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:73
The Layer class provides all supported geometry layers.
Definition: layer.h:40
Predefined colors relevant for PCB fabrication.
Definition: pcbcolor.h:41
The CmdBoardEdit class.
Definition: cmdboardedit.h:52
QVector< const Layer * > mNewSilkscreenLayersBot
Definition: cmdboardedit.h:97
void performRedo() override
Redo the command.
Definition: cmdboardedit.cpp:147
void setSilkscreenColor(const PcbColor &c) noexcept
Definition: cmdboardedit.cpp:88
void setName(const ElementName &name) noexcept
Definition: cmdboardedit.cpp:69
CmdBoardEdit(const CmdBoardEdit &other)=delete
BoardDesignRules mOldDesignRules
Definition: cmdboardedit.h:98
const PcbColor * mNewSilkscreenColor
Definition: cmdboardedit.h:93
QVector< const Layer * > mOldSilkscreenLayersTop
Definition: cmdboardedit.h:94
BoardDesignRuleCheckSettings mNewDrcSettings
Definition: cmdboardedit.h:101
PositiveLength mNewPcbThickness
Definition: cmdboardedit.h:89
void setInnerLayerCount(int count) noexcept
Definition: cmdboardedit.cpp:74
void setDrcSettings(const BoardDesignRuleCheckSettings &settings) noexcept
Definition: cmdboardedit.cpp:110
void performUndo() override
Undo the command.
Definition: cmdboardedit.cpp:135
void setDesignRules(const BoardDesignRules &rules) noexcept
Definition: cmdboardedit.cpp:105
~CmdBoardEdit() noexcept
Definition: cmdboardedit.cpp:62
ElementName mNewName
Definition: cmdboardedit.h:85
Board & mBoard
Definition: cmdboardedit.h:82
const PcbColor * mOldSolderResist
Definition: cmdboardedit.h:90
int mOldInnerLayerCount
Definition: cmdboardedit.h:86
const PcbColor * mOldSilkscreenColor
Definition: cmdboardedit.h:92
QVector< const Layer * > mOldSilkscreenLayersBot
Definition: cmdboardedit.h:96
const PcbColor * mNewSolderResist
Definition: cmdboardedit.h:91
ElementName mOldName
Definition: cmdboardedit.h:84
BoardDesignRules mNewDesignRules
Definition: cmdboardedit.h:99
void setSilkscreenLayersTop(const QVector< const Layer * > &l) noexcept
Definition: cmdboardedit.cpp:93
void setSilkscreenLayersBot(const QVector< const Layer * > &l) noexcept
Definition: cmdboardedit.cpp:99
int mNewInnerLayerCount
Definition: cmdboardedit.h:87
BoardDesignRuleCheckSettings mOldDrcSettings
Definition: cmdboardedit.h:100
bool performExecute() override
Execute the command the first time.
Definition: cmdboardedit.cpp:120
void setSolderResist(const PcbColor *c) noexcept
Definition: cmdboardedit.cpp:84
PositiveLength mOldPcbThickness
Definition: cmdboardedit.h:88
void setPcbThickness(const PositiveLength &thickness) noexcept
Definition: cmdboardedit.cpp:79
QVector< const Layer * > mNewSilkscreenLayersTop
Definition: cmdboardedit.h:95
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< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition: elementname.h:84