LibrePCB Developers Documentation
Loading...
Searching...
No Matches
footprintpainter.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_CORE_FOOTPRINTPAINTER_H
21
#define LIBREPCB_CORE_FOOTPRINTPAINTER_H
22
23
/*******************************************************************************
24
* Includes
25
******************************************************************************/
26
#include "../../export/graphicsexport.h"
27
28
#include <QtCore>
29
#include <QtGui>
30
31
/*******************************************************************************
32
* Namespace / Forward Declarations
33
******************************************************************************/
34
namespace
librepcb
{
35
36
class
Circle
;
37
class
Footprint;
38
class
FootprintPad;
39
class
Hole;
40
class
Polygon;
41
class
StrokeFont;
42
class
StrokeText;
43
class
Text;
44
45
/*******************************************************************************
46
* Class FootprintPainter
47
******************************************************************************/
48
54
class
FootprintPainter
final :
public
GraphicsPagePainter
{
55
struct
ColorContent
{
56
QList<QPainterPath>
areas
;
57
QList<Polygon>
polygons
;
58
QList<Circle>
circles
;
59
QList<Hole>
holes
;
60
QList<Hole>
padHoles
;
61
QList<Text>
texts
;
62
};
63
64
public
:
65
// Constructors / Destructor
66
FootprintPainter
() =
delete
;
67
explicit
FootprintPainter
(
const
Footprint
& footprint)
noexcept
;
68
FootprintPainter
(
const
FootprintPainter
& other) =
delete
;
69
~FootprintPainter
() noexcept;
70
71
// General Methods
72
void
paint
(QPainter& painter,
73
const
GraphicsExportSettings
& settings) const noexcept override;
74
75
// Operator Overloadings
76
FootprintPainter
& operator=(const
FootprintPainter
& rhs) = delete;
77
78
private:
// Methods
79
void
initContentByColor
() const noexcept;
80
81
private:
// Data
82
QFont
mMonospaceFont
;
83
const
StrokeFont
&
mStrokeFont
;
84
85
QList<
FootprintPad
>
mPads
;
86
QList<
Polygon
>
mPolygons
;
87
QList<
Circle
>
mCircles
;
88
QList<
StrokeText
>
mStrokeTexts
;
89
QList<
Hole
>
mHoles
;
90
91
mutable QMutex
mMutex
;
92
mutable QHash<QString,
ColorContent
>
mContentByColor
;
93
};
94
95
/*******************************************************************************
96
* End of File
97
******************************************************************************/
98
99
}
// namespace librepcb
100
101
#endif
librepcb::Circle
The Circle class.
Definition
circle.h:46
librepcb::Footprint
The Footprint class represents one footprint variant of a package.
Definition
footprint.h:55
librepcb::FootprintPad
The FootprintPad class represents a pad of a footprint.
Definition
footprintpad.h:54
librepcb::FootprintPainter
Paints a librepcb::Footprint to a QPainter.
Definition
footprintpainter.h:54
librepcb::FootprintPainter::FootprintPainter
FootprintPainter(const FootprintPainter &other)=delete
librepcb::FootprintPainter::mMutex
QMutex mMutex
Definition
footprintpainter.h:91
librepcb::FootprintPainter::mContentByColor
QHash< QString, ColorContent > mContentByColor
Definition
footprintpainter.h:92
librepcb::FootprintPainter::mPolygons
QList< Polygon > mPolygons
Definition
footprintpainter.h:86
librepcb::FootprintPainter::mStrokeFont
const StrokeFont & mStrokeFont
Definition
footprintpainter.h:83
librepcb::FootprintPainter::mHoles
QList< Hole > mHoles
Definition
footprintpainter.h:89
librepcb::FootprintPainter::initContentByColor
void initContentByColor() const noexcept
Definition
footprintpainter.cpp:137
librepcb::FootprintPainter::FootprintPainter
FootprintPainter()=delete
librepcb::FootprintPainter::mPads
QList< FootprintPad > mPads
Definition
footprintpainter.h:85
librepcb::FootprintPainter::paint
void paint(QPainter &painter, const GraphicsExportSettings &settings) const noexcept override
Draw page content on a QPainter.
Definition
footprintpainter.cpp:72
librepcb::FootprintPainter::mCircles
QList< Circle > mCircles
Definition
footprintpainter.h:87
librepcb::FootprintPainter::mStrokeTexts
QList< StrokeText > mStrokeTexts
Definition
footprintpainter.h:88
librepcb::FootprintPainter::mMonospaceFont
QFont mMonospaceFont
Definition
footprintpainter.h:82
librepcb::FootprintPainter::~FootprintPainter
~FootprintPainter() noexcept
Definition
footprintpainter.cpp:65
librepcb::GraphicsExportSettings
Settings for librepcb::GraphicsExport.
Definition
graphicsexportsettings.h:51
librepcb::GraphicsPagePainter
Base class for printing a page for librepcb::GraphicsExport.
Definition
graphicsexport.h:56
librepcb::Hole
The Hole class.
Definition
hole.h:45
librepcb::Polygon
The Polygon class.
Definition
polygon.h:45
librepcb::StrokeFont
The StrokeFont class.
Definition
strokefont.h:56
librepcb::StrokeText
The StrokeText class.
Definition
stroketext.h:51
librepcb::kicadimport::KiCadPadShape::Circle
@ Circle
librepcb
Definition
occmodel.cpp:76
librepcb::FootprintPainter::ColorContent
Definition
footprintpainter.h:55
librepcb::FootprintPainter::ColorContent::polygons
QList< Polygon > polygons
Definition
footprintpainter.h:57
librepcb::FootprintPainter::ColorContent::circles
QList< Circle > circles
Definition
footprintpainter.h:58
librepcb::FootprintPainter::ColorContent::areas
QList< QPainterPath > areas
Definition
footprintpainter.h:56
librepcb::FootprintPainter::ColorContent::holes
QList< Hole > holes
Definition
footprintpainter.h:59
librepcb::FootprintPainter::ColorContent::texts
QList< Text > texts
Definition
footprintpainter.h:61
librepcb::FootprintPainter::ColorContent::padHoles
QList< Hole > padHoles
Definition
footprintpainter.h:60
libs
librepcb
core
library
pkg
footprintpainter.h
Generated on Wed Dec 18 2024 20:12:47 for LibrePCB Developers Documentation by
1.9.8