LibrePCB Developers Documentation
Loading...
Searching...
No Matches
schematicpainter.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_SCHEMATICPAINTER_H
21#define LIBREPCB_CORE_SCHEMATICPAINTER_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../export/graphicsexport.h"
27#include "../../types/alignment.h"
28#include "../../types/length.h"
29#include "../../utils/transform.h"
30
31#include <QtCore>
32#include <QtGui>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class Circle;
40class Path;
41class Polygon;
42class Schematic;
43class Text;
44
45/*******************************************************************************
46 * Class SchematicPainter
47 ******************************************************************************/
48
68
74
75 struct Label {
79 QString text;
80 };
81
82 struct Symbol {
84 QList<Pin> pins;
85 QList<Polygon> polygons;
86 QList<Circle> circles;
87 };
88
89public:
90 // Constructors / Destructor
91 SchematicPainter() = delete;
92 explicit SchematicPainter(const Schematic& schematic,
93 bool thumbnail = false) noexcept;
94 SchematicPainter(const SchematicPainter& other) = delete;
95 ~SchematicPainter() noexcept;
96
97 // General Methods
98 void paint(QPainter& painter,
99 const GraphicsExportSettings& settings) const noexcept override;
100
101 // Operator Overloadings
102 SchematicPainter& operator=(const SchematicPainter& rhs) = delete;
103
104private: // Data
112 QList<Text> mTexts;
113};
114
115/*******************************************************************************
116 * End of File
117 ******************************************************************************/
118
119} // namespace librepcb
120
121#endif
The Alignment class.
Definition alignment.h:115
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition angle.h:76
Settings for librepcb::GraphicsExport.
Definition graphicsexportsettings.h:51
Base class for printing a page for librepcb::GraphicsExport.
Definition graphicsexport.h:56
The Point class is used to represent a point/coordinate/vector, for example (1.2mm; 5....
Definition point.h:78
The Polygon class.
Definition polygon.h:45
The Schematic class represents one schematic page of a project and is always part of a circuit.
Definition schematic.h:74
Paints a librepcb::Schematic to a QPainter.
Definition schematicpainter.h:54
QList< Symbol > mSymbols
Definition schematicpainter.h:107
QList< Label > mNetLabels
Definition schematicpainter.h:110
QList< Point > mJunctions
Definition schematicpainter.h:108
QFont mDefaultFont
Definition schematicpainter.h:105
QList< Polygon > mPolygons
Definition schematicpainter.h:111
QList< Line > mNetLines
Definition schematicpainter.h:109
QList< Text > mTexts
Definition schematicpainter.h:112
void paint(QPainter &painter, const GraphicsExportSettings &settings) const noexcept override
Draw page content on a QPainter.
Definition schematicpainter.cpp:133
QFont mNetLabelFont
Definition schematicpainter.h:106
The Text class.
Definition text.h:48
Helper class to perform coordinate transformation with various types.
Definition transform.h:59
Definition occmodel.cpp:76
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition length.h:810
type_safe::constrained_type< Length, UnsignedLengthConstraint, UnsignedLengthVerifier > UnsignedLength
Definition length.h:694
Definition schematicpainter.h:75
QString text
Definition schematicpainter.h:79
Angle rotation
Definition schematicpainter.h:77
bool mirrored
Definition schematicpainter.h:78
Point position
Definition schematicpainter.h:76
Definition schematicpainter.h:69
UnsignedLength width
Definition schematicpainter.h:72
Point endPosition
Definition schematicpainter.h:71
Point startPosition
Definition schematicpainter.h:70
Definition schematicpainter.h:55
Alignment numbersAlignment
Definition schematicpainter.h:66
QString numbers
Definition schematicpainter.h:60
PositiveLength nameHeight
Definition schematicpainter.h:63
UnsignedLength length
Definition schematicpainter.h:58
Angle rotation
Definition schematicpainter.h:57
Angle nameRotation
Definition schematicpainter.h:62
Point numbersPosition
Definition schematicpainter.h:65
Point namePosition
Definition schematicpainter.h:61
Alignment nameAlignment
Definition schematicpainter.h:64
QString name
Definition schematicpainter.h:59
Point position
Definition schematicpainter.h:56
Definition schematicpainter.h:82
Transform transform
Definition schematicpainter.h:83
QList< Pin > pins
Definition schematicpainter.h:84
QList< Polygon > polygons
Definition schematicpainter.h:85
QList< Circle > circles
Definition schematicpainter.h:86