LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_PROJECT_SGI_NETPOINT_H
21 #define LIBREPCB_PROJECT_SGI_NETPOINT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "sgi_base.h"
27 
28 #include <QtCore>
29 #include <QtWidgets>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 
36 class GraphicsLayer;
37 
38 namespace project {
39 
40 class SI_NetPoint;
41 
42 /*******************************************************************************
43  * Class SGI_NetPoint
44  ******************************************************************************/
45 
49 class SGI_NetPoint final : public SGI_Base {
50 public:
51  // Constructors / Destructor
52  explicit SGI_NetPoint(SI_NetPoint& netpoint) noexcept;
53  ~SGI_NetPoint() noexcept;
54 
55  // General Methods
56  void updateCacheAndRepaint() noexcept;
57 
58  // Inherited from QGraphicsItem
59  QRectF boundingRect() const { return sBoundingRect; }
60  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
61  QWidget* widget);
62 
63 private:
64  // make some methods inaccessible...
65  SGI_NetPoint() = delete;
66  SGI_NetPoint(const SGI_NetPoint& other) = delete;
67  SGI_NetPoint& operator=(const SGI_NetPoint& rhs) = delete;
68 
69  // Private Methods
70  GraphicsLayer* getLayer(const QString& name) const noexcept;
71 
72  // General Attributes
75 
76  // Cached Attributes
79 
80  // Static Stuff
81  static QRectF sBoundingRect;
82 };
83 
84 /*******************************************************************************
85  * End of File
86  ******************************************************************************/
87 
88 } // namespace project
89 } // namespace librepcb
90 
91 #endif // LIBREPCB_PROJECT_SGI_NETPOINT_H
The GraphicsLayer class represents a graphical layer used in schematics and boards.
Definition: graphicslayer.h:54
SGI_NetPoint & operator=(const SGI_NetPoint &rhs)=delete
static QRectF sBoundingRect
Definition: sgi_netpoint.h:81
The SI_NetPoint class.
Definition: si_netpoint.h:48
bool mIsVisibleJunction
Definition: sgi_netpoint.h:77
The SGI_NetPoint class.
Definition: sgi_netpoint.h:49
The Schematic Graphics Item Base (SGI_Base) class.
Definition: sgi_base.h:44
SI_NetPoint & mNetPoint
Definition: sgi_netpoint.h:73
~SGI_NetPoint() noexcept
Definition: sgi_netpoint.cpp:62
void updateCacheAndRepaint() noexcept
Definition: sgi_netpoint.cpp:69
QRectF boundingRect() const
Definition: sgi_netpoint.h:59
GraphicsLayer * getLayer(const QString &name) const noexcept
Definition: sgi_netpoint.cpp:132
bool mIsOpenLineEnd
Definition: sgi_netpoint.h:78
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: sgi_netpoint.cpp:84
GraphicsLayer * mLayer
Definition: sgi_netpoint.h:74