LibrePCB Developers Documentation
bgi_footprintpad.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_BGI_FOOTPRINTPAD_H
21#define LIBREPCB_EDITOR_BGI_FOOTPRINTPAD_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "bgi_device.h"
27
29
30#include <QtCore>
31#include <QtWidgets>
32
33#include <memory>
34
35/*******************************************************************************
36 * Namespace / Forward Declarations
37 ******************************************************************************/
38namespace librepcb {
39
40class NetSignal;
41
42namespace editor {
43
44class IF_GraphicsLayerProvider;
45class PrimitiveFootprintPadGraphicsItem;
46
47/*******************************************************************************
48 * Class BGI_FootprintPad
49 ******************************************************************************/
50
54class BGI_FootprintPad final : public QGraphicsItemGroup {
55 Q_DECLARE_TR_FUNCTIONS(BGI_FootprintPad)
56
57public:
58 // Constructors / Destructor
59 BGI_FootprintPad() = delete;
60 BGI_FootprintPad(const BGI_FootprintPad& other) = delete;
61 BGI_FootprintPad(BI_FootprintPad& pad, std::weak_ptr<BGI_Device> deviceItem,
63 std::shared_ptr<const QSet<const NetSignal*>>
64 highlightedNetSignals) noexcept;
65 virtual ~BGI_FootprintPad() noexcept;
66
67 // General Methods
68 BI_FootprintPad& getPad() noexcept { return mPad; }
69 const std::weak_ptr<BGI_Device>& getDeviceGraphicsItem() noexcept {
71 }
72 void updateHighlightedNetSignals() noexcept;
73
74 // Inherited from QGraphicsItem
75 QPainterPath shape() const noexcept override;
76
77 // Operator Overloadings
78 BGI_FootprintPad& operator=(const BGI_FootprintPad& rhs) = delete;
79
80private: // Methods
81 void padEdited(const BI_FootprintPad& obj,
82 BI_FootprintPad::Event event) noexcept;
84 BGI_Device::Event event) noexcept;
85 virtual QVariant itemChange(GraphicsItemChange change,
86 const QVariant& value) noexcept override;
87 void updateLayer() noexcept;
88 void updateToolTip() noexcept;
89 void updateHightlighted(bool selected) noexcept;
90
91private: // Data
94 std::shared_ptr<const QSet<const NetSignal*>> mHighlightedNetSignals;
96
97 // Slots
100};
101
102/*******************************************************************************
103 * End of File
104 ******************************************************************************/
105
106} // namespace editor
107} // namespace librepcb
108
109#endif
The BI_FootprintPad class.
Definition: bi_footprintpad.h:48
The NetSignal class.
Definition: netsignal.h:50
The BGI_Device class.
Definition: bgi_device.h:57
The BGI_FootprintPad class.
Definition: bgi_footprintpad.h:54
BI_FootprintPad & mPad
Definition: bgi_footprintpad.h:92
std::shared_ptr< const QSet< const NetSignal * > > mHighlightedNetSignals
Definition: bgi_footprintpad.h:94
void updateHightlighted(bool selected) noexcept
Definition: bgi_footprintpad.cpp:185
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) noexcept override
Definition: bgi_footprintpad.cpp:100
void deviceGraphicsItemEdited(const BGI_Device &obj, BGI_Device::Event event) noexcept
Definition: bgi_footprintpad.cpp:141
void updateToolTip() noexcept
Definition: bgi_footprintpad.cpp:161
const std::weak_ptr< BGI_Device > & getDeviceGraphicsItem() noexcept
Definition: bgi_footprintpad.h:69
QPainterPath shape() const noexcept override
Definition: bgi_footprintpad.cpp:95
BI_FootprintPad & getPad() noexcept
Definition: bgi_footprintpad.h:68
void padEdited(const BI_FootprintPad &obj, BI_FootprintPad::Event event) noexcept
Definition: bgi_footprintpad.cpp:112
std::weak_ptr< BGI_Device > mDeviceGraphicsItem
Definition: bgi_footprintpad.h:93
virtual ~BGI_FootprintPad() noexcept
Definition: bgi_footprintpad.cpp:80
BI_FootprintPad::OnEditedSlot mOnPadEditedSlot
Definition: bgi_footprintpad.h:98
QScopedPointer< PrimitiveFootprintPadGraphicsItem > mGraphicsItem
Definition: bgi_footprintpad.h:95
BGI_FootprintPad(const BGI_FootprintPad &other)=delete
BGI_Device::OnEditedSlot mOnDeviceEditedSlot
Definition: bgi_footprintpad.h:99
void updateLayer() noexcept
Definition: bgi_footprintpad.cpp:148
void updateHighlightedNetSignals() noexcept
Definition: bgi_footprintpad.cpp:87
The IF_GraphicsLayerProvider class defines an interface for classes which provide layers.
Definition: graphicslayer.h:111
The PrimitiveFootprintPadGraphicsItem class.
Definition: primitivefootprintpadgraphicsitem.h:56
Definition: occmodel.cpp:77