LibrePCB Developers Documentation
primitiveholegraphicsitem.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_PRIMITIVEHOLEGRAPHICSITEM_H
21#define LIBREPCB_EDITOR_PRIMITIVEHOLEGRAPHICSITEM_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
28#include <optional/tl/optional.hpp>
29
30#include <QtCore>
31#include <QtWidgets>
32
33#include <memory>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39namespace editor {
40
41class GraphicsLayer;
42class IF_GraphicsLayerProvider;
43class OriginCrossGraphicsItem;
44class PrimitivePathGraphicsItem;
45
46/*******************************************************************************
47 * Class PrimitiveHoleGraphicsItem
48 ******************************************************************************/
49
53class PrimitiveHoleGraphicsItem final : public QGraphicsItemGroup {
54public:
55 // Constructors / Destructor
59 bool originCrossesVisible,
60 QGraphicsItem* parent = nullptr) noexcept;
61 virtual ~PrimitiveHoleGraphicsItem() noexcept;
62
63 // Setters
64 void setHole(const NonEmptyPath& path, const PositiveLength& diameter,
65 const tl::optional<Length>& stopMaskOffset) noexcept;
66
67 // Inherited from QGraphicsItem
68 QPainterPath shape() const noexcept override;
69
70 // Operator Overloadings
72 delete;
73
74private: // Methods
75 QVariant itemChange(GraphicsItemChange change,
76 const QVariant& value) noexcept override;
77
78private: // Data
79 std::shared_ptr<GraphicsLayer> mHoleLayer;
85};
86
87/*******************************************************************************
88 * End of File
89 ******************************************************************************/
90
91} // namespace editor
92} // namespace librepcb
93
94#endif
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:83
The GraphicsLayer class represents a graphical layer used in schematics and boards.
Definition: graphicslayer.h:53
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers.
Definition: graphicslayer.h:111
The OriginCrossGraphicsItem class.
Definition: origincrossgraphicsitem.h:50
Independent graphical representation of a librepcb::Hole.
Definition: primitiveholegraphicsitem.h:53
QScopedPointer< PrimitivePathGraphicsItem > mStopMaskGraphicsItemTop
Definition: primitiveholegraphicsitem.h:82
QVariant itemChange(GraphicsItemChange change, const QVariant &value) noexcept override
Definition: primitiveholegraphicsitem.cpp:137
QPainterPath shape() const noexcept override
Definition: primitiveholegraphicsitem.cpp:133
std::shared_ptr< GraphicsLayer > mHoleLayer
Definition: primitiveholegraphicsitem.h:79
PrimitiveHoleGraphicsItem(const PrimitiveHoleGraphicsItem &other)=delete
void setHole(const NonEmptyPath &path, const PositiveLength &diameter, const tl::optional< Length > &stopMaskOffset) noexcept
Definition: primitiveholegraphicsitem.cpp:91
QScopedPointer< PrimitivePathGraphicsItem > mHoleGraphicsItem
Definition: primitiveholegraphicsitem.h:80
QScopedPointer< OriginCrossGraphicsItem > mOriginCrossGraphicsItemEnd
Definition: primitiveholegraphicsitem.h:84
QScopedPointer< OriginCrossGraphicsItem > mOriginCrossGraphicsItemStart
Definition: primitiveholegraphicsitem.h:83
QScopedPointer< PrimitivePathGraphicsItem > mStopMaskGraphicsItemBot
Definition: primitiveholegraphicsitem.h:81
The PrimitivePathGraphicsItem class.
Definition: primitivepathgraphicsitem.h:50
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
type_safe::constrained_type< Path, NonEmptyPathConstraint, NonEmptyPathVerifier > NonEmptyPath
Definition: path.h:221
Definition: uuid.h:183