LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
holegraphicsitem.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_HOLEGRAPHICSITEM_H
21 #define LIBREPCB_HOLEGRAPHICSITEM_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../geometry/hole.h"
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 class OriginCrossGraphicsItem;
38 class IF_GraphicsLayerProvider;
39 
40 /*******************************************************************************
41  * Class HoleGraphicsItem
42  ******************************************************************************/
43 
52  public IF_HoleObserver {
53 public:
54  // Constructors / Destructor
55  HoleGraphicsItem() = delete;
56  HoleGraphicsItem(const HoleGraphicsItem& other) = delete;
58  QGraphicsItem* parent = nullptr) noexcept;
59  ~HoleGraphicsItem() noexcept;
60 
61  // Getters
62  Hole& getHole() noexcept { return mHole; }
63 
64  // Inherited from QGraphicsItem
65  QPainterPath shape() const noexcept override;
66 
67  // Operator Overloadings
68  HoleGraphicsItem& operator=(const HoleGraphicsItem& rhs) = delete;
69 
70 private: // Methods
71  void holePositionChanged(const Point& newPos) noexcept override;
72  void holeDiameterChanged(const PositiveLength& newDiameter) noexcept override;
73  QVariant itemChange(GraphicsItemChange change,
74  const QVariant& value) noexcept override;
75 
76 private: // Data
80 };
81 
82 /*******************************************************************************
83  * End of File
84  ******************************************************************************/
85 
86 } // namespace librepcb
87 
88 #endif // LIBREPCB_HOLEGRAPHICSITEM_H
Hole & mHole
Definition: holegraphicsitem.h:77
QScopedPointer< OriginCrossGraphicsItem > mOriginCrossGraphicsItem
Definition: holegraphicsitem.h:79
The Hole class.
Definition: hole.h:69
The IF_HoleObserver class.
Definition: hole.h:49
The HoleGraphicsItem class is the graphical representation of a librepcb::Text.
Definition: holegraphicsitem.h:51
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers...
Definition: graphicslayer.h:250
~HoleGraphicsItem() noexcept
Definition: holegraphicsitem.cpp:62
const IF_GraphicsLayerProvider & mLayerProvider
Definition: holegraphicsitem.h:78
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5...
Definition: point.h:81
QVariant itemChange(GraphicsItemChange change, const QVariant &value) noexceptoverride
Definition: holegraphicsitem.cpp:90
The PrimitiveCircleGraphicsItem class.
Definition: primitivecirclegraphicsitem.h:47
void holePositionChanged(const Point &newPos) noexceptoverride
Definition: holegraphicsitem.cpp:79
Hole & getHole() noexcept
Definition: holegraphicsitem.h:62
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:783
void holeDiameterChanged(const PositiveLength &newDiameter) noexceptoverride
Definition: holegraphicsitem.cpp:83
The OriginCrossGraphicsItem class.
Definition: origincrossgraphicsitem.h:47
QPainterPath shape() const noexceptoverride
Definition: holegraphicsitem.cpp:70