LibrePCB Developers Documentation
Loading...
Searching...
No Matches
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
32
33#include <QtCore>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39
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;
63 const Board::PreferredFootprintTags& tags) noexcept;
64 void setInnerLayerCount(int count) noexcept;
65 void setPcbThickness(const PositiveLength& thickness) noexcept;
66 void setSolderResist(const PcbColor* c) noexcept;
67 void setSilkscreenColor(const PcbColor& c) noexcept;
68 void setSilkscreenLayersTop(const QVector<const Layer*>& l) noexcept;
69 void setSilkscreenLayersBot(const QVector<const Layer*>& l) noexcept;
70 void setDesignRules(const BoardDesignRules& rules) noexcept;
71 void setDrcSettings(const BoardDesignRuleCheckSettings& settings) noexcept;
72
73private: // Methods
75 bool performExecute() override;
76
78 void performUndo() override;
79
81 void performRedo() override;
82
83private: // Data
85
88 Board::PreferredFootprintTags mOldPreferredFootprintTags;
89 Board::PreferredFootprintTags mNewPreferredFootprintTags;
106};
107
108/*******************************************************************************
109 * End of File
110 ******************************************************************************/
111
112} // namespace editor
113} // namespace librepcb
114
115#endif
The BoardDesignRuleCheckSettings class.
Definition boarddesignrulechecksettings.h:50
The BoardDesignRules class.
Definition boarddesignrules.h:46
The Board class represents a PCB of a project and is always part of a circuit.
Definition board.h:74
The Layer class provides all supported geometry layers.
Definition layer.h:42
Predefined colors relevant for PCB fabrication.
Definition pcbcolor.h:41
The CmdBoardEdit class.
Definition cmdboardedit.h:52
QVector< const Layer * > mNewSilkscreenLayersBot
Definition cmdboardedit.h:101
void performRedo() override
Redo the command.
Definition cmdboardedit.cpp:157
void setSilkscreenColor(const PcbColor &c) noexcept
Definition cmdboardedit.cpp:96
void setName(const ElementName &name) noexcept
Definition cmdboardedit.cpp:71
CmdBoardEdit(const CmdBoardEdit &other)=delete
BoardDesignRules mOldDesignRules
Definition cmdboardedit.h:102
Board::PreferredFootprintTags mNewPreferredFootprintTags
Definition cmdboardedit.h:89
const PcbColor * mNewSilkscreenColor
Definition cmdboardedit.h:97
QVector< const Layer * > mOldSilkscreenLayersTop
Definition cmdboardedit.h:98
BoardDesignRuleCheckSettings mNewDrcSettings
Definition cmdboardedit.h:105
Board::PreferredFootprintTags mOldPreferredFootprintTags
Definition cmdboardedit.h:88
PositiveLength mNewPcbThickness
Definition cmdboardedit.h:93
void setInnerLayerCount(int count) noexcept
Definition cmdboardedit.cpp:82
void setDrcSettings(const BoardDesignRuleCheckSettings &settings) noexcept
Definition cmdboardedit.cpp:118
void performUndo() override
Undo the command.
Definition cmdboardedit.cpp:144
void setDesignRules(const BoardDesignRules &rules) noexcept
Definition cmdboardedit.cpp:113
~CmdBoardEdit() noexcept
Definition cmdboardedit.cpp:64
ElementName mNewName
Definition cmdboardedit.h:87
Board & mBoard
Definition cmdboardedit.h:84
const PcbColor * mOldSolderResist
Definition cmdboardedit.h:94
int mOldInnerLayerCount
Definition cmdboardedit.h:90
const PcbColor * mOldSilkscreenColor
Definition cmdboardedit.h:96
void setPreferredFootprintTags(const Board::PreferredFootprintTags &tags) noexcept
Definition cmdboardedit.cpp:76
QVector< const Layer * > mOldSilkscreenLayersBot
Definition cmdboardedit.h:100
const PcbColor * mNewSolderResist
Definition cmdboardedit.h:95
ElementName mOldName
Definition cmdboardedit.h:86
BoardDesignRules mNewDesignRules
Definition cmdboardedit.h:103
void setSilkscreenLayersTop(const QVector< const Layer * > &l) noexcept
Definition cmdboardedit.cpp:101
void setSilkscreenLayersBot(const QVector< const Layer * > &l) noexcept
Definition cmdboardedit.cpp:107
int mNewInnerLayerCount
Definition cmdboardedit.h:91
BoardDesignRuleCheckSettings mOldDrcSettings
Definition cmdboardedit.h:104
bool performExecute() override
Execute the command the first time.
Definition cmdboardedit.cpp:128
void setSolderResist(const PcbColor *c) noexcept
Definition cmdboardedit.cpp:92
PositiveLength mOldPcbThickness
Definition cmdboardedit.h:92
void setPcbThickness(const PositiveLength &thickness) noexcept
Definition cmdboardedit.cpp:87
QVector< const Layer * > mNewSilkscreenLayersTop
Definition cmdboardedit.h:99
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:810
type_safe::constrained_type< QString, ElementNameConstraint, ElementNameVerifier > ElementName
Definition elementname.h:84