LibrePCB Developers Documentation
bi_hole.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_CORE_BI_HOLE_H
21#define LIBREPCB_CORE_BI_HOLE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../../utils/signalslot.h"
27#include "../boardholedata.h"
28#include "bi_base.h"
29
30#include <QtCore>
31
32/*******************************************************************************
33 * Namespace / Forward Declarations
34 ******************************************************************************/
35namespace librepcb {
36
37class Board;
38
39/*******************************************************************************
40 * Class BI_Hole
41 ******************************************************************************/
42
46class BI_Hole final : public BI_Base {
47 Q_OBJECT
48
49public:
50 // Signals
51 enum class Event {
52 DiameterChanged,
53 PathChanged,
54 StopMaskOffsetChanged,
55 };
58
59 // Constructors / Destructor
60 BI_Hole() = delete;
61 BI_Hole(const BI_Hole& other) = delete;
62 BI_Hole(Board& board, const BoardHoleData& data);
63 ~BI_Hole() noexcept;
64
65 // Getters
66 const BoardHoleData& getData() const noexcept { return mData; }
67 const tl::optional<Length>& getStopMaskOffset() const noexcept {
68 return mStopMaskOffset;
69 }
70
71 // Setters
72 bool setDiameter(const PositiveLength& diameter) noexcept;
73 bool setPath(const NonEmptyPath& path) noexcept;
74 bool setStopMaskConfig(const MaskConfig& config) noexcept;
75 bool setLocked(bool locked) noexcept;
76
77 // General Methods
78 void addToBoard() override;
79 void removeFromBoard() override;
80
81 // Operator Overloadings
82 BI_Hole& operator=(const BI_Hole& rhs) = delete;
83
84private: // Methods
85 void updateStopMaskOffset() noexcept;
86
87private: // Data
89
90 // Cached Attributes
92};
93
94/*******************************************************************************
95 * End of File
96 ******************************************************************************/
97
98} // namespace librepcb
99
100#endif
The Board Item Base (BI_Base) class.
Definition: bi_base.h:45
The BI_Hole class.
Definition: bi_hole.h:46
~BI_Hole() noexcept
Definition: bi_hole.cpp:47
Signal< BI_Hole, Event > onEdited
Definition: bi_hole.h:56
BoardHoleData mData
Definition: bi_hole.h:88
tl::optional< Length > mStopMaskOffset
Definition: bi_hole.h:91
void removeFromBoard() override
Definition: bi_hole.cpp:104
BI_Hole(const BI_Hole &other)=delete
bool setStopMaskConfig(const MaskConfig &config) noexcept
Definition: bi_hole.cpp:75
void updateStopMaskOffset() noexcept
Definition: bi_hole.cpp:116
Event
Definition: bi_hole.h:51
BI_Hole & operator=(const BI_Hole &rhs)=delete
const BoardHoleData & getData() const noexcept
Definition: bi_hole.h:66
const tl::optional< Length > & getStopMaskOffset() const noexcept
Definition: bi_hole.h:67
bool setPath(const NonEmptyPath &path) noexcept
Definition: bi_hole.cpp:65
Slot< BI_Hole, Event > OnEditedSlot
Definition: bi_hole.h:57
void addToBoard() override
Definition: bi_hole.cpp:96
bool setLocked(bool locked) noexcept
Definition: bi_hole.cpp:84
bool setDiameter(const PositiveLength &diameter) noexcept
Definition: bi_hole.cpp:54
The BoardHoleData class.
Definition: boardholedata.h:45
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:73
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:83
The MaskConfig class defines how to add automatic stop mask or solder paste.
Definition: maskconfig.h:45
The Signal class is used to emit signals on non-QObject derived classes.
Definition: signalslot.h:65
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
type_safe::constrained_type< Path, NonEmptyPathConstraint, NonEmptyPathVerifier > NonEmptyPath
Definition: path.h:221
Definition: uuid.h:183