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 
50  public IF_PolygonObserver {
51 public:
52  // Constructors / Destructor
53  PolygonGraphicsItem() = delete;
54  PolygonGraphicsItem(const PolygonGraphicsItem& other) = delete;
56  QGraphicsItem* parent = nullptr) noexcept;
57  ~PolygonGraphicsItem() noexcept;
58 
59  // Getters
60  Polygon& getPolygon() noexcept { return mPolygon; }
61 
62  // Operator Overloadings
64 
65 private: // Methods
67  const GraphicsLayerName& newLayerName) noexcept override;
69  const UnsignedLength& newLineWidth) noexcept override;
70  void polygonIsFilledChanged(bool newIsFilled) noexcept override;
71  void polygonIsGrabAreaChanged(bool newIsGrabArea) noexcept override;
72  void polygonPathChanged(const Path& newPath) noexcept override;
73  void updateFillLayer() noexcept;
74 
75 private: // Data
78 };
79 
80 /*******************************************************************************
81  * End of File
82  ******************************************************************************/
83 
84 } // namespace librepcb
85 
86 #endif // LIBREPCB_POLYGONGRAPHICSITEM_H
PolygonGraphicsItem & operator=(const PolygonGraphicsItem &rhs)=delete
The PolygonGraphicsItem class.
Definition: polygongraphicsitem.h:49
~PolygonGraphicsItem() noexcept
Definition: polygongraphicsitem.cpp:53
void polygonLayerNameChanged(const GraphicsLayerName &newLayerName) noexceptoverride
Definition: polygongraphicsitem.cpp:61
type_safe::constrained_type< QString, GraphicsLayerNameConstraint, GraphicsLayerNameVerifier > GraphicsLayerName
Definition: graphicslayername.h:78
void polygonPathChanged(const Path &newPath) noexceptoverride
Definition: polygongraphicsitem.cpp:83
Polygon & getPolygon() noexcept
Definition: polygongraphicsitem.h:60
const IF_GraphicsLayerProvider & mLayerProvider
Definition: polygongraphicsitem.h:77
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers...
Definition: graphicslayer.h:250
void polygonIsGrabAreaChanged(bool newIsGrabArea) noexceptoverride
Definition: polygongraphicsitem.cpp:77
The PrimitivePathGraphicsItem class.
Definition: primitivepathgraphicsitem.h:47
void polygonLineWidthChanged(const UnsignedLength &newLineWidth) noexceptoverride
Definition: polygongraphicsitem.cpp:67
The IF_PolygonObserver class.
Definition: polygon.h:52
The Path class represents a list of vertices connected by straight lines or circular arc segments...
Definition: path.h:53
The Polygon class.
Definition: polygon.h:76
Polygon & mPolygon
Definition: polygongraphicsitem.h:76
void polygonIsFilledChanged(bool newIsFilled) noexceptoverride
Definition: polygongraphicsitem.cpp:72
void updateFillLayer() noexcept
Definition: polygongraphicsitem.cpp:87
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition: length.h:662