LibrePCB Developers Documentation
bi_zone.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_ZONE_H
21#define LIBREPCB_CORE_BI_ZONE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../../utils/signalslot.h"
27#include "../boardzonedata.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_Zone
41 ******************************************************************************/
42
46class BI_Zone final : public BI_Base {
47 Q_OBJECT
48
49public:
50 // Signals
51 enum class Event {
52 BoardLayersChanged,
53 LayersChanged,
54 RulesChanged,
55 OutlineChanged,
56 IsLockedChanged,
57 };
60
61 // Constructors / Destructor
62 BI_Zone() = delete;
63 BI_Zone(const BI_Zone& other) = delete;
64 BI_Zone(Board& board, const BoardZoneData& data);
65 ~BI_Zone() noexcept;
66
67 // Getters
68 const BoardZoneData& getData() const noexcept { return mData; }
69
70 // Setters
71 bool setLayers(const QSet<const Layer*>& layers);
72 bool setRules(Zone::Rules rules) noexcept;
73 bool setOutline(const Path& outline) noexcept;
74 bool setLocked(bool locked) noexcept;
75
76 // General Methods
77 void addToBoard() override;
78 void removeFromBoard() override;
79
80 // Operator Overloadings
81 BI_Zone& operator=(const BI_Zone& rhs) = delete;
82
83private: // Data
85};
86
87/*******************************************************************************
88 * End of File
89 ******************************************************************************/
90
91} // namespace librepcb
92
93#endif
The Board Item Base (BI_Base) class.
Definition: bi_base.h:45
The BI_Zone class.
Definition: bi_zone.h:46
bool setLayers(const QSet< const Layer * > &layers)
Definition: bi_zone.cpp:52
bool setOutline(const Path &outline) noexcept
Definition: bi_zone.cpp:73
Slot< BI_Zone, Event > OnEditedSlot
Definition: bi_zone.h:59
BI_Zone(const BI_Zone &other)=delete
bool setRules(Zone::Rules rules) noexcept
Definition: bi_zone.cpp:63
void removeFromBoard() override
Definition: bi_zone.cpp:104
BI_Zone & operator=(const BI_Zone &rhs)=delete
BoardZoneData mData
Definition: bi_zone.h:84
const BoardZoneData & getData() const noexcept
Definition: bi_zone.h:68
Event
Definition: bi_zone.h:51
~BI_Zone() noexcept
Definition: bi_zone.cpp:45
Signal< BI_Zone, Event > onEdited
Definition: bi_zone.h:58
void addToBoard() override
Definition: bi_zone.cpp:96
bool setLocked(bool locked) noexcept
Definition: bi_zone.cpp:83
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:73
The BoardZoneData class.
Definition: boardzonedata.h:44
The Path class represents a list of vertices connected by straight lines or circular arc segments.
Definition: path.h:58
The Signal class is used to emit signals on non-QObject derived classes.
Definition: signalslot.h:65
Definition: occmodel.cpp:77