LibrePCB Developers Documentation
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  ******************************************************************************/
34 namespace librepcb {
35 namespace editor {
36 
37 class IF_GraphicsLayerProvider;
38 class PrimitiveHoleGraphicsItem;
39 
40 /*******************************************************************************
41  * Class BGI_Hole
42  ******************************************************************************/
43 
47 class BGI_Hole final : public QGraphicsItemGroup {
48 public:
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 
64 private: // 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 
70 private: // Data
72  QScopedPointer<PrimitiveHoleGraphicsItem> mGraphicsItem;
73 
74  // Slots
76 };
77 
78 /*******************************************************************************
79  * End of File
80  ******************************************************************************/
81 
82 } // namespace editor
83 } // namespace librepcb
84 
85 #endif
BGI_Hole & operator=(const BGI_Hole &rhs)=delete
BI_Hole & mHole
Definition: bgi_hole.h:71
Definition: occmodel.cpp:76
The BI_Hole class.
Definition: bi_hole.h:46
void holeEdited(const BI_Hole &obj, BI_Hole::Event event) noexcept
Definition: bgi_hole.cpp:78
virtual ~BGI_Hole() noexcept
Definition: bgi_hole.cpp:55
QScopedPointer< PrimitiveHoleGraphicsItem > mGraphicsItem
Definition: bgi_hole.h:72
BI_Hole::OnEditedSlot mOnEditedSlot
Definition: bgi_hole.h:75
QPainterPath shape() const noexcept override
Definition: bgi_hole.cpp:62
Event
Definition: bi_hole.h:51
The BGI_Hole class.
Definition: bgi_hole.h:47
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers...
Definition: graphicslayer.h:111
void updateHole() noexcept
Definition: bgi_hole.cpp:93
QVariant itemChange(GraphicsItemChange change, const QVariant &value) noexcept override
Definition: bgi_hole.cpp:66
BI_Hole & getHole() noexcept
Definition: bgi_hole.h:56