LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bgi_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_BGI_NETPOINT_H
21 #define LIBREPCB_PROJECT_BGI_NETPOINT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "bgi_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 BI_NetPoint;
41 
42 /*******************************************************************************
43  * Class BGI_NetPoint
44  ******************************************************************************/
45 
49 class BGI_NetPoint final : public BGI_Base {
50 public:
51  // Constructors / Destructor
52  explicit BGI_NetPoint(BI_NetPoint& netpoint) noexcept;
53  ~BGI_NetPoint() noexcept;
54 
55  // Getters
56  bool isSelectable() const noexcept;
57 
58  // General Methods
59  void updateCacheAndRepaint() noexcept;
60 
61  // Inherited from QGraphicsItem
62  QRectF boundingRect() const { return mBoundingRect; }
63  void paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
64  QWidget* widget);
65 
66 private:
67  // make some methods inaccessible...
68  BGI_NetPoint() = delete;
69  BGI_NetPoint(const BGI_NetPoint& other) = delete;
70  BGI_NetPoint& operator=(const BGI_NetPoint& rhs) = delete;
71 
72  // Private Methods
73  GraphicsLayer* getLayer(const QString& name) const noexcept;
74 
75  // General Attributes
77 
78  // Cached Attributes
79  QRectF mBoundingRect;
80 };
81 
82 /*******************************************************************************
83  * End of File
84  ******************************************************************************/
85 
86 } // namespace project
87 } // namespace librepcb
88 
89 #endif // LIBREPCB_PROJECT_BGI_NETPOINT_H
The GraphicsLayer class represents a graphical layer used in schematics and boards.
Definition: graphicslayer.h:54
The BI_NetPoint class.
Definition: bi_netpoint.h:48
bool isSelectable() const noexcept
Definition: bgi_netpoint.cpp:57
QRectF mBoundingRect
Definition: bgi_netpoint.h:79
GraphicsLayer * getLayer(const QString &name) const noexcept
Definition: bgi_netpoint.cpp:114
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: bgi_netpoint.cpp:85
QRectF boundingRect() const
Definition: bgi_netpoint.h:62
The Board Graphics Item Base (BGI_Base) class.
Definition: bgi_base.h:44
BGI_NetPoint & operator=(const BGI_NetPoint &rhs)=delete
The BGI_NetPoint class.
Definition: bgi_netpoint.h:49
BI_NetPoint & mNetPoint
Definition: bgi_netpoint.h:76
void updateCacheAndRepaint() noexcept
Definition: bgi_netpoint.cpp:66
~BGI_NetPoint() noexcept
Definition: bgi_netpoint.cpp:50