LibrePCB Developers Documentation
Loading...
Searching...
No Matches
symbolpainter.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_SYMBOLPAINTER_H
21#define LIBREPCB_CORE_SYMBOLPAINTER_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 ******************************************************************************/
34namespace librepcb {
35
36class Circle;
37class Image;
38class Polygon;
39class Symbol;
40class SymbolPin;
41class Text;
42
43/*******************************************************************************
44 * Class SymbolPainter
45 ******************************************************************************/
46
52class SymbolPainter final : public GraphicsPagePainter {
53public:
54 // Constructors / Destructor
55 SymbolPainter() = delete;
56 explicit SymbolPainter(const Symbol& symbol, QStringList* errors) noexcept;
57 SymbolPainter(const SymbolPainter& other) = delete;
58 ~SymbolPainter() noexcept;
59
60 // General Methods
61 void paint(QPainter& painter,
62 const GraphicsExportSettings& settings) const noexcept override;
63
64 // Operator Overloadings
65 SymbolPainter& operator=(const SymbolPainter& rhs) = delete;
66
67private: // Data
72 QList<Text> mTexts;
73 QList<Image> mImages;
74 // Note: QPixmap is only allowed in the GUI thread so we have to use QImage.
75 QHash<QString, QImage> mImageFiles;
76};
77
78/*******************************************************************************
79 * End of File
80 ******************************************************************************/
81
82} // namespace librepcb
83
84#endif
The Circle class.
Definition circle.h:46
Settings for librepcb::GraphicsExport.
Definition graphicsexportsettings.h:51
Base class for printing a page for librepcb::GraphicsExport.
Definition graphicsexport.h:56
The Image class.
Definition image.h:49
The Polygon class.
Definition polygon.h:45
The Symbol class represents the part of a component which is added to schematics.
Definition symbol.h:56
Paints a librepcb::Symbol to a QPainter.
Definition symbolpainter.h:52
QFont mDefaultFont
Definition symbolpainter.h:68
~SymbolPainter() noexcept
Definition symbolpainter.cpp:81
SymbolPainter(const SymbolPainter &other)=delete
QList< Polygon > mPolygons
Definition symbolpainter.h:70
QList< Text > mTexts
Definition symbolpainter.h:72
QList< SymbolPin > mPins
Definition symbolpainter.h:69
QList< Image > mImages
Definition symbolpainter.h:73
void paint(QPainter &painter, const GraphicsExportSettings &settings) const noexcept override
Draw page content on a QPainter.
Definition symbolpainter.cpp:88
QList< Circle > mCircles
Definition symbolpainter.h:71
QHash< QString, QImage > mImageFiles
Definition symbolpainter.h:75
The SymbolPin class represents one pin of a symbol.
Definition symbolpin.h:51
The Text class.
Definition text.h:48
Definition occmodel.cpp:77