LibrePCB Developers Documentation
Loading...
Searching...
No Matches
sgi_netpoint.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_SGI_NETPOINT_H
21#define LIBREPCB_EDITOR_SGI_NETPOINT_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31#include <memory>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class NetSignal;
39
40namespace editor {
41
42class GraphicsLayer;
43class GraphicsLayerList;
44
45/*******************************************************************************
46 * Class SGI_NetPoint
47 ******************************************************************************/
48
52class SGI_NetPoint final : public QGraphicsItem {
53public:
54 // Constructors / Destructor
55 SGI_NetPoint() = delete;
56 SGI_NetPoint(const SGI_NetPoint& other) = delete;
57 SGI_NetPoint(SI_NetPoint& netpoint, const GraphicsLayerList& layers,
58 std::shared_ptr<const QSet<const NetSignal*>>
59 highlightedNetSignals) noexcept;
60 virtual ~SGI_NetPoint() noexcept;
61
62 // General Methods
63 SI_NetPoint& getNetPoint() noexcept { return mNetPoint; }
64
65 // Inherited from QGraphicsItem
66 QRectF boundingRect() const { return sBoundingRect; }
67 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
68 QWidget* widget);
69
70 // Operator Overloadings
71 SGI_NetPoint& operator=(const SGI_NetPoint& rhs) = delete;
72
73private: // Methods
74 void netPointEdited(const SI_NetPoint& obj,
75 SI_NetPoint::Event event) noexcept;
76 void updatePosition() noexcept;
77 void updateJunction() noexcept;
78 void updateNetName() noexcept;
79
80private: // Data
82 std::shared_ptr<const QSet<const NetSignal*>> mHighlightedNetSignals;
83 std::shared_ptr<const GraphicsLayer> mLayer;
84
85 // Cached Attributes
88
89 // Slots
91
92 // Static Stuff
93 static QRectF sBoundingRect;
94};
95
96/*******************************************************************************
97 * End of File
98 ******************************************************************************/
99
100} // namespace editor
101} // namespace librepcb
102
103#endif
The NetSignal class.
Definition netsignal.h:50
The SI_NetPoint class.
Definition si_netpoint.h:44
Event
Definition si_netpoint.h:49
The GraphicsLayer class represents a graphical layer used in schematics and boards.
Definition graphicslayer.h:53
The GraphicsLayerList class.
Definition graphicslayerlist.h:48
The SGI_NetPoint class.
Definition sgi_netpoint.h:52
SGI_NetPoint(const SGI_NetPoint &other)=delete
std::shared_ptr< const QSet< const NetSignal * > > mHighlightedNetSignals
Definition sgi_netpoint.h:82
void updateNetName() noexcept
Definition sgi_netpoint.cpp:141
void updatePosition() noexcept
Definition sgi_netpoint.cpp:127
void netPointEdited(const SI_NetPoint &obj, SI_NetPoint::Event event) noexcept
Definition sgi_netpoint.cpp:107
SI_NetPoint & mNetPoint
Definition sgi_netpoint.h:81
SGI_NetPoint & operator=(const SGI_NetPoint &rhs)=delete
bool mIsOpenLineEnd
Definition sgi_netpoint.h:87
void updateJunction() noexcept
Definition sgi_netpoint.cpp:131
std::shared_ptr< const GraphicsLayer > mLayer
Definition sgi_netpoint.h:83
virtual ~SGI_NetPoint() noexcept
Definition sgi_netpoint.cpp:73
SI_NetPoint & getNetPoint() noexcept
Definition sgi_netpoint.h:63
SI_NetPoint::OnEditedSlot mOnEditedSlot
Definition sgi_netpoint.h:90
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition sgi_netpoint.cpp:80
static QRectF sBoundingRect
Definition sgi_netpoint.h:93
QRectF boundingRect() const
Definition sgi_netpoint.h:66
bool mIsVisibleJunction
Definition sgi_netpoint.h:86
Definition occmodel.cpp:77
Definition uuid.h:186