LibrePCB Developers Documentation
bi_polygon.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_POLYGON_H
21#define LIBREPCB_CORE_BI_POLYGON_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../../utils/signalslot.h"
27#include "../boardpolygondata.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_Polygon
41 ******************************************************************************/
42
46class BI_Polygon final : public BI_Base {
47 Q_OBJECT
48
49public:
50 // Signals
51 enum class Event {
52 LayerChanged,
53 LineWidthChanged,
54 IsFilledChanged,
55 IsGrabAreaChanged,
56 IsLockedChanged,
57 PathChanged,
58 };
61
62 // Constructors / Destructor
63 BI_Polygon() = delete;
64 BI_Polygon(const BI_Polygon& other) = delete;
65 BI_Polygon(Board& board, const BoardPolygonData& data);
66 ~BI_Polygon() noexcept;
67
68 // Getters
69 const BoardPolygonData& getData() const noexcept { return mData; }
70
71 // Setters
72 bool setLayer(const Layer& layer) noexcept;
73 bool setLineWidth(const UnsignedLength& width) noexcept;
74 bool setPath(const Path& path) noexcept;
75 bool setIsFilled(bool isFilled) noexcept;
76 bool setIsGrabArea(bool isGrabArea) noexcept;
77 bool setLocked(bool locked) noexcept;
78
79 // General Methods
80 void addToBoard() override;
81 void removeFromBoard() override;
82
83 // Operator Overloadings
84 BI_Polygon& operator=(const BI_Polygon& rhs) = delete;
85
86private: // Methods
87 void invalidatePlanes(const Layer& layer) noexcept;
88
89private: // Data
91};
92
93/*******************************************************************************
94 * End of File
95 ******************************************************************************/
96
97} // namespace librepcb
98
99#endif
The Board Item Base (BI_Base) class.
Definition: bi_base.h:45
The BI_Polygon class.
Definition: bi_polygon.h:46
bool setLineWidth(const UnsignedLength &width) noexcept
Definition: bi_polygon.cpp:62
Signal< BI_Polygon, Event > onEdited
Definition: bi_polygon.h:59
BI_Polygon & operator=(const BI_Polygon &rhs)=delete
void removeFromBoard() override
Definition: bi_polygon.cpp:122
BI_Polygon(const BI_Polygon &other)=delete
Event
Definition: bi_polygon.h:51
Slot< BI_Polygon, Event > OnEditedSlot
Definition: bi_polygon.h:60
bool setPath(const Path &path) noexcept
Definition: bi_polygon.cpp:72
bool setIsGrabArea(bool isGrabArea) noexcept
Definition: bi_polygon.cpp:92
bool setLayer(const Layer &layer) noexcept
Definition: bi_polygon.cpp:50
const BoardPolygonData & getData() const noexcept
Definition: bi_polygon.h:69
void addToBoard() override
Definition: bi_polygon.cpp:114
bool setLocked(bool locked) noexcept
Definition: bi_polygon.cpp:101
BoardPolygonData mData
Definition: bi_polygon.h:90
bool setIsFilled(bool isFilled) noexcept
Definition: bi_polygon.cpp:82
void invalidatePlanes(const Layer &layer) noexcept
Definition: bi_polygon.cpp:134
~BI_Polygon() noexcept
Definition: bi_polygon.cpp:43
The Board class represents a PCB of a project and is always part of a circuit.
Definition: board.h:73
The BoardPolygonData class.
Definition: boardpolygondata.h:45
The Layer class provides all supported geometry layers.
Definition: layer.h:40
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
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:696