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 {
55public:
56 // Constructors / Destructor
57 BGI_FootprintPad() = delete;
58 BGI_FootprintPad(const BGI_FootprintPad& other) = delete;
59 BGI_FootprintPad(BI_FootprintPad& pad, std::weak_ptr<BGI_Device> deviceItem,
61 std::shared_ptr<const QSet<const NetSignal*>>
62 highlightedNetSignals) noexcept;
63 virtual ~BGI_FootprintPad() noexcept;
64
65 // General Methods
66 BI_FootprintPad& getPad() noexcept { return mPad; }
67 const std::weak_ptr<BGI_Device>& getDeviceGraphicsItem() noexcept {
69 }
70 void updateHighlightedNetSignals() noexcept;
71
72 // Inherited from QGraphicsItem
73 QPainterPath shape() const noexcept override;
74
75 // Operator Overloadings
76 BGI_FootprintPad& operator=(const BGI_FootprintPad& rhs) = delete;
77
78private: // Methods
79 void padEdited(const BI_FootprintPad& obj,
80 BI_FootprintPad::Event event) noexcept;
82 BGI_Device::Event event) noexcept;
83 virtual QVariant itemChange(GraphicsItemChange change,
84 const QVariant& value) noexcept override;
85 void updateLayer() noexcept;
86 void updateHightlighted(bool selected) noexcept;
87
88private: // Data
91 std::shared_ptr<const QSet<const NetSignal*>> mHighlightedNetSignals;
93
94 // Slots
97};
98
99/*******************************************************************************
100 * End of File
101 ******************************************************************************/
102
103} // namespace editor
104} // namespace librepcb
105
106#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:89
std::shared_ptr< const QSet< const NetSignal * > > mHighlightedNetSignals
Definition: bgi_footprintpad.h:91
void updateHightlighted(bool selected) noexcept
Definition: bgi_footprintpad.cpp:155
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) noexcept override
Definition: bgi_footprintpad.cpp:95
void deviceGraphicsItemEdited(const BGI_Device &obj, BGI_Device::Event event) noexcept
Definition: bgi_footprintpad.cpp:135
const std::weak_ptr< BGI_Device > & getDeviceGraphicsItem() noexcept
Definition: bgi_footprintpad.h:67
QPainterPath shape() const noexcept override
Definition: bgi_footprintpad.cpp:90
BI_FootprintPad & getPad() noexcept
Definition: bgi_footprintpad.h:66
void padEdited(const BI_FootprintPad &obj, BI_FootprintPad::Event event) noexcept
Definition: bgi_footprintpad.cpp:107
std::weak_ptr< BGI_Device > mDeviceGraphicsItem
Definition: bgi_footprintpad.h:90
virtual ~BGI_FootprintPad() noexcept
Definition: bgi_footprintpad.cpp:75
BI_FootprintPad::OnEditedSlot mOnPadEditedSlot
Definition: bgi_footprintpad.h:95
QScopedPointer< PrimitiveFootprintPadGraphicsItem > mGraphicsItem
Definition: bgi_footprintpad.h:92
BGI_FootprintPad(const BGI_FootprintPad &other)=delete
BGI_Device::OnEditedSlot mOnDeviceEditedSlot
Definition: bgi_footprintpad.h:96
void updateLayer() noexcept
Definition: bgi_footprintpad.cpp:142
void updateHighlightedNetSignals() noexcept
Definition: bgi_footprintpad.cpp:82
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