LibrePCB Developers Documentation
Loading...
Searching...
No Matches
bgi_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_EDITOR_BGI_HOLE_H
21#define LIBREPCB_EDITOR_BGI_HOLE_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35namespace editor {
36
37class IF_GraphicsLayerProvider;
38class PrimitiveHoleGraphicsItem;
39
40/*******************************************************************************
41 * Class BGI_Hole
42 ******************************************************************************/
43
47class BGI_Hole final : public QGraphicsItemGroup {
48public:
49 // Constructors / Destructor
50 BGI_Hole() = delete;
51 BGI_Hole(const BGI_Hole& other) = delete;
52 BGI_Hole(BI_Hole& hole, const IF_GraphicsLayerProvider& lp) noexcept;
53 virtual ~BGI_Hole() noexcept;
54
55 // General Methods
56 BI_Hole& getHole() noexcept { return mHole; }
57
58 // Inherited from QGraphicsItem
59 QPainterPath shape() const noexcept override;
60
61 // Operator Overloadings
62 BGI_Hole& operator=(const BGI_Hole& rhs) = delete;
63
64private: // Methods
65 void holeEdited(const BI_Hole& obj, BI_Hole::Event event) noexcept;
66 QVariant itemChange(GraphicsItemChange change,
67 const QVariant& value) noexcept override;
68 void updateHole() noexcept;
69
70private: // Data
73
74 // Slots
75 BI_Hole::OnEditedSlot mOnEditedSlot;
76};
77
78/*******************************************************************************
79 * End of File
80 ******************************************************************************/
81
82} // namespace editor
83} // namespace librepcb
84
85#endif
The BI_Hole class.
Definition bi_hole.h:46
The BGI_Hole class.
Definition bgi_hole.h:47
BI_Hole & getHole() noexcept
Definition bgi_hole.h:56
QVariant itemChange(GraphicsItemChange change, const QVariant &value) noexcept override
Definition bgi_hole.cpp:66
BI_Hole::OnEditedSlot mOnEditedSlot
Definition bgi_hole.h:75
QPainterPath shape() const noexcept override
Definition bgi_hole.cpp:62
void updateHole() noexcept
Definition bgi_hole.cpp:93
BGI_Hole(const BGI_Hole &other)=delete
QScopedPointer< PrimitiveHoleGraphicsItem > mGraphicsItem
Definition bgi_hole.h:72
virtual ~BGI_Hole() noexcept
Definition bgi_hole.cpp:55
BI_Hole & mHole
Definition bgi_hole.h:71
void holeEdited(const BI_Hole &obj, BI_Hole::Event event) noexcept
Definition bgi_hole.cpp:78
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers.
Definition graphicslayer.h:111
Independent graphical representation of a librepcb::Hole.
Definition primitiveholegraphicsitem.h:53
Definition occmodel.cpp:76