LibrePCB Developers Documentation
Loading...
Searching...
No Matches
cmdboardviaedit.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_CMDBOARDVIAEDIT_H
21#define LIBREPCB_EDITOR_CMDBOARDVIAEDIT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../undocommand.h"
27
30
31#include <QtCore>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class NetSignal;
39
40namespace editor {
41
42/*******************************************************************************
43 * Class CmdBoardViaEdit
44 ******************************************************************************/
45
49class CmdBoardViaEdit final : public UndoCommand {
50public:
51 // Constructors / Destructor
52 explicit CmdBoardViaEdit(BI_Via& via) noexcept;
53 ~CmdBoardViaEdit() noexcept;
54
55 // Setters
56 void setLayers(const Layer& startLayer, const Layer& endLayer) noexcept;
57 void setPosition(const Point& pos, bool immediate) noexcept;
58 void translate(const Point& deltaPos, bool immediate) noexcept;
59 void snapToGrid(const PositiveLength& gridInterval, bool immediate) noexcept;
60 void rotate(const Angle& angle, const Point& center, bool immediate) noexcept;
61 void mirrorLayers(int innerLayers) noexcept;
62 void setSize(const PositiveLength& size, bool immediate) noexcept;
63 void setDrillDiameter(const PositiveLength& diameter,
64 bool immediate) noexcept;
65 void setExposureConfig(const MaskConfig& config) noexcept;
66
67private:
68 // Private Methods
69
71 bool performExecute() override;
72
74 void performUndo() override;
75
77 void performRedo() override;
78
79 // Private Member Variables
80
81 // Attributes from the constructor
83
84 // General Attributes
97};
98
99/*******************************************************************************
100 * End of File
101 ******************************************************************************/
102
103} // namespace editor
104} // namespace librepcb
105
106#endif
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
The BI_Via class.
Definition bi_via.h:44
The Layer class provides all supported geometry layers.
Definition layer.h:42
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:78
The CmdBoardViaEdit class.
Definition cmdboardviaedit.h:49
void performRedo() override
Redo the command.
Definition cmdboardviaedit.cpp:151
void setPosition(const Point &pos, bool immediate) noexcept
Definition cmdboardviaedit.cpp:76
const Layer * mNewEndLayer
Definition cmdboardviaedit.h:88
void setLayers(const Layer &startLayer, const Layer &endLayer) noexcept
Definition cmdboardviaedit.cpp:69
void translate(const Point &deltaPos, bool immediate) noexcept
Definition cmdboardviaedit.cpp:82
Point mOldPos
Definition cmdboardviaedit.h:89
const Layer * mNewStartLayer
Definition cmdboardviaedit.h:86
MaskConfig mNewExposureConfig
Definition cmdboardviaedit.h:96
void performUndo() override
Undo the command.
Definition cmdboardviaedit.cpp:143
void setExposureConfig(const MaskConfig &config) noexcept
Definition cmdboardviaedit.cpp:122
void setSize(const PositiveLength &size, bool immediate) noexcept
Definition cmdboardviaedit.cpp:108
Point mNewPos
Definition cmdboardviaedit.h:90
void snapToGrid(const PositiveLength &gridInterval, bool immediate) noexcept
Definition cmdboardviaedit.cpp:89
const Layer * mOldEndLayer
Definition cmdboardviaedit.h:87
void mirrorLayers(int innerLayers) noexcept
Definition cmdboardviaedit.cpp:101
MaskConfig mOldExposureConfig
Definition cmdboardviaedit.h:95
bool performExecute() override
Execute the command the first time.
Definition cmdboardviaedit.cpp:131
PositiveLength mOldSize
Definition cmdboardviaedit.h:91
BI_Via & mVia
Definition cmdboardviaedit.h:82
~CmdBoardViaEdit() noexcept
Definition cmdboardviaedit.cpp:57
void rotate(const Angle &angle, const Point &center, bool immediate) noexcept
Definition cmdboardviaedit.cpp:94
const Layer * mOldStartLayer
Definition cmdboardviaedit.h:85
PositiveLength mNewSize
Definition cmdboardviaedit.h:92
PositiveLength mOldDrillDiameter
Definition cmdboardviaedit.h:93
PositiveLength mNewDrillDiameter
Definition cmdboardviaedit.h:94
void setDrillDiameter(const PositiveLength &diameter, bool immediate) noexcept
Definition cmdboardviaedit.cpp:115
The UndoCommand class represents a command which you can undo/redo.
Definition undocommand.h:46
Definition occmodel.cpp:76
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810