LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
polygongraphicsitem.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_POLYGONGRAPHICSITEM_H
21 #define LIBREPCB_POLYGONGRAPHICSITEM_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../geometry/polygon.h"
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 class IF_GraphicsLayerProvider;
38 
39 /*******************************************************************************
40  * Class PolygonGraphicsItem
41  ******************************************************************************/
42 
47 public:
48  // Constructors / Destructor
49  PolygonGraphicsItem() = delete;
50  PolygonGraphicsItem(const PolygonGraphicsItem& other) = delete;
52  QGraphicsItem* parent = nullptr) noexcept;
53  ~PolygonGraphicsItem() noexcept;
54 
55  // Getters
56  Polygon& getPolygon() noexcept { return mPolygon; }
57 
58  // Operator Overloadings
60 
61 private: // Methods
62  void polygonEdited(const Polygon& polygon, Polygon::Event event) noexcept;
63  void updateFillLayer() noexcept;
64 
65 private: // Data
68 
69  // Slots
70  Polygon::OnEditedSlot mOnEditedSlot;
71 };
72 
73 /*******************************************************************************
74  * End of File
75  ******************************************************************************/
76 
77 } // namespace librepcb
78 
79 #endif // LIBREPCB_POLYGONGRAPHICSITEM_H
PolygonGraphicsItem & operator=(const PolygonGraphicsItem &rhs)=delete
The PolygonGraphicsItem class.
Definition: polygongraphicsitem.h:46
~PolygonGraphicsItem() noexcept
Definition: polygongraphicsitem.cpp:56
Polygon & getPolygon() noexcept
Definition: polygongraphicsitem.h:56
const IF_GraphicsLayerProvider & mLayerProvider
Definition: polygongraphicsitem.h:67
Event
Definition: polygon.h:54
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers...
Definition: graphicslayer.h:227
The PrimitivePathGraphicsItem class.
Definition: primitivepathgraphicsitem.h:44
void polygonEdited(const Polygon &polygon, Polygon::Event event) noexcept
Definition: polygongraphicsitem.cpp:63
Polygon::OnEditedSlot mOnEditedSlot
Definition: polygongraphicsitem.h:70
The Polygon class.
Definition: polygon.h:49
Polygon & mPolygon
Definition: polygongraphicsitem.h:66
void updateFillLayer() noexcept
Definition: polygongraphicsitem.cpp:87