LibrePCB Developers Documentation
Loading...
Searching...
No Matches
footprintpadgraphicsitem.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_FOOTPRINTPADGRAPHICSITEM_H
21
#define LIBREPCB_EDITOR_FOOTPRINTPADGRAPHICSITEM_H
22
23
/*******************************************************************************
24
* Includes
25
******************************************************************************/
26
#include <
librepcb/core/library/pkg/footprintpad.h
>
27
#include <
librepcb/core/library/pkg/packagepad.h
>
28
29
#include <QtCore>
30
#include <QtWidgets>
31
32
#include <memory>
33
34
/*******************************************************************************
35
* Namespace / Forward Declarations
36
******************************************************************************/
37
namespace
librepcb
{
38
namespace
editor {
39
40
class
GraphicsLayerList;
41
class
PrimitiveFootprintPadGraphicsItem;
42
43
/*******************************************************************************
44
* Class FootprintPadGraphicsItem
45
******************************************************************************/
46
50
class
FootprintPadGraphicsItem
final :
public
QGraphicsItemGroup {
51
public
:
52
// Constructors / Destructor
53
FootprintPadGraphicsItem
() =
delete
;
54
FootprintPadGraphicsItem
(
const
FootprintPadGraphicsItem
& other) =
delete
;
55
FootprintPadGraphicsItem
(std::shared_ptr<FootprintPad> pad,
56
const
GraphicsLayerList
& layers,
57
const
PackagePadList
* packagePadList,
58
QGraphicsItem* parent =
nullptr
) noexcept;
59
~
FootprintPadGraphicsItem
() noexcept;
60
61
// Getters
62
FootprintPad
&
getObj
() noexcept {
return
*
mPad
; }
63
64
// General Methods
65
void
updateText
() noexcept;
66
67
// Inherited from QGraphicsItem
68
QPainterPath
shape
() const noexcept override;
69
70
// Operator Overloadings
71
FootprintPadGraphicsItem
& operator=(const
FootprintPadGraphicsItem
& rhs) =
72
delete;
73
74
private:
// Methods
75
void
padEdited
(const
FootprintPad
& pad,
FootprintPad
::Event event) noexcept;
76
void
packagePadListEdited
(const
PackagePadList
& list,
int
index,
77
const
std
::shared_ptr<const
PackagePad
>& pad,
78
PackagePadList
::Event event) noexcept;
79
virtual QVariant
itemChange
(GraphicsItemChange change,
80
const QVariant& value) noexcept override;
81
void
updateLayer
() noexcept;
82
void
updateGeometries
() noexcept;
83
84
private:
// Data
85
std
::shared_ptr<
FootprintPad
>
mPad
;
86
const
PackagePadList
*
mPackagePadList
;
87
QScopedPointer<
PrimitiveFootprintPadGraphicsItem
>
mGraphicsItem
;
88
89
// Slots
90
FootprintPad
::OnEditedSlot
mOnPadEditedSlot
;
91
PackagePadList
::OnEditedSlot
mOnPackagePadsEditedSlot
;
92
};
93
94
/*******************************************************************************
95
* End of File
96
******************************************************************************/
97
98
}
// namespace editor
99
}
// namespace librepcb
100
101
#endif
librepcb::FootprintPad
The FootprintPad class represents a pad of a footprint.
Definition
footprintpad.h:54
librepcb::PackagePad
The PackagePad class represents one logical pad of a package.
Definition
packagepad.h:47
librepcb::SerializableObjectList< PackagePad, PackagePadListNameProvider, PackagePad::Event >
librepcb::editor::FootprintPadGraphicsItem
The FootprintPadGraphicsItem class.
Definition
footprintpadgraphicsitem.h:50
librepcb::editor::FootprintPadGraphicsItem::updateText
void updateText() noexcept
Definition
footprintpadgraphicsitem.cpp:79
librepcb::editor::FootprintPadGraphicsItem::itemChange
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) noexcept override
Definition
footprintpadgraphicsitem.cpp:100
librepcb::editor::FootprintPadGraphicsItem::mPackagePadList
const PackagePadList * mPackagePadList
Definition
footprintpadgraphicsitem.h:86
librepcb::editor::FootprintPadGraphicsItem::padEdited
void padEdited(const FootprintPad &pad, FootprintPad::Event event) noexcept
Definition
footprintpadgraphicsitem.cpp:112
librepcb::editor::FootprintPadGraphicsItem::packagePadListEdited
void packagePadListEdited(const PackagePadList &list, int index, const std::shared_ptr< const PackagePad > &pad, PackagePadList::Event event) noexcept
Definition
footprintpadgraphicsitem.cpp:150
librepcb::editor::FootprintPadGraphicsItem::FootprintPadGraphicsItem
FootprintPadGraphicsItem(const FootprintPadGraphicsItem &other)=delete
librepcb::editor::FootprintPadGraphicsItem::mPad
std::shared_ptr< FootprintPad > mPad
Definition
footprintpadgraphicsitem.h:85
librepcb::editor::FootprintPadGraphicsItem::FootprintPadGraphicsItem
FootprintPadGraphicsItem()=delete
librepcb::editor::FootprintPadGraphicsItem::shape
QPainterPath shape() const noexcept override
Definition
footprintpadgraphicsitem.cpp:95
librepcb::editor::FootprintPadGraphicsItem::getObj
FootprintPad & getObj() noexcept
Definition
footprintpadgraphicsitem.h:62
librepcb::editor::FootprintPadGraphicsItem::mGraphicsItem
QScopedPointer< PrimitiveFootprintPadGraphicsItem > mGraphicsItem
Definition
footprintpadgraphicsitem.h:87
librepcb::editor::FootprintPadGraphicsItem::mOnPackagePadsEditedSlot
PackagePadList::OnEditedSlot mOnPackagePadsEditedSlot
Definition
footprintpadgraphicsitem.h:91
librepcb::editor::FootprintPadGraphicsItem::updateGeometries
void updateGeometries() noexcept
Definition
footprintpadgraphicsitem.cpp:166
librepcb::editor::FootprintPadGraphicsItem::updateLayer
void updateLayer() noexcept
Definition
footprintpadgraphicsitem.cpp:161
librepcb::editor::FootprintPadGraphicsItem::mOnPadEditedSlot
FootprintPad::OnEditedSlot mOnPadEditedSlot
Definition
footprintpadgraphicsitem.h:90
librepcb::editor::GraphicsLayerList
The GraphicsLayerList class.
Definition
graphicslayerlist.h:48
librepcb::editor::PrimitiveFootprintPadGraphicsItem
The PrimitiveFootprintPadGraphicsItem class.
Definition
primitivefootprintpadgraphicsitem.h:57
footprintpad.h
librepcb
Definition
occmodel.cpp:77
std
Definition
uuid.h:186
packagepad.h
libs
librepcb
editor
library
pkg
footprintpadgraphicsitem.h
Generated on Wed Jul 16 2025 14:19:25 for LibrePCB Developers Documentation by
1.9.8