LibrePCB Developers Documentation
Loading...
Searching...
No Matches
sgi_busjunction.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_BUSJUNCTION_H
21#define LIBREPCB_EDITOR_SGI_BUSJUNCTION_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 {
37namespace editor {
38
39class GraphicsLayer;
40class GraphicsLayerList;
41
42/*******************************************************************************
43 * Class SGI_BusJunction
44 ******************************************************************************/
45
49class SGI_BusJunction final : public QGraphicsItem {
50public:
51 // Constructors / Destructor
52 SGI_BusJunction() = delete;
53 SGI_BusJunction(const SGI_BusJunction& other) = delete;
55 const GraphicsLayerList& layers) noexcept;
56 virtual ~SGI_BusJunction() noexcept;
57
58 // General Methods
60
61 // Inherited from QGraphicsItem
62 QRectF boundingRect() const { return sBoundingRect; }
63 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
64 QWidget* widget);
65
66 // Operator Overloadings
68
69private: // Methods
70 void busJunctionEdited(const SI_BusJunction& obj,
71 SI_BusJunction::Event event) noexcept;
72 void updatePosition() noexcept;
73 void updateJunction() noexcept;
74 void updateToolTip() noexcept;
75
76private: // Data
78 std::shared_ptr<const GraphicsLayer> mLayer;
79
80 // Cached Attributes
83
84 // Slots
86
87 // Static Stuff
88 static QRectF sBoundingRect;
89};
90
91/*******************************************************************************
92 * End of File
93 ******************************************************************************/
94
95} // namespace editor
96} // namespace librepcb
97
98#endif
The SI_BusJunction class.
Definition si_busjunction.h:45
Event
Definition si_busjunction.h:50
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_BusJunction class.
Definition sgi_busjunction.h:49
void updatePosition() noexcept
Definition sgi_busjunction.cpp:121
void updateToolTip() noexcept
Definition sgi_busjunction.cpp:135
SI_BusJunction::OnEditedSlot mOnEditedSlot
Definition sgi_busjunction.h:85
SI_BusJunction & mBusJunction
Definition sgi_busjunction.h:77
bool mIsOpenLineEnd
Definition sgi_busjunction.h:82
void busJunctionEdited(const SI_BusJunction &obj, SI_BusJunction::Event event) noexcept
Definition sgi_busjunction.cpp:100
void updateJunction() noexcept
Definition sgi_busjunction.cpp:125
std::shared_ptr< const GraphicsLayer > mLayer
Definition sgi_busjunction.h:78
SI_BusJunction & getBusJunction() noexcept
Definition sgi_busjunction.h:59
virtual ~SGI_BusJunction() noexcept
Definition sgi_busjunction.cpp:68
SGI_BusJunction & operator=(const SGI_BusJunction &rhs)=delete
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition sgi_busjunction.cpp:75
static QRectF sBoundingRect
Definition sgi_busjunction.h:88
QRectF boundingRect() const
Definition sgi_busjunction.h:62
bool mIsVisibleJunction
Definition sgi_busjunction.h:81
SGI_BusJunction(const SGI_BusJunction &other)=delete
Definition occmodel.cpp:77
Definition uuid.h:186