LibrePCB Developers Documentation
realisticboardpainter.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_REALISTICBOARDPAINTER_H
21#define LIBREPCB_CORE_REALISTICBOARDPAINTER_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../export/graphicsexport.h"
27
28#include <QtCore>
29#include <QtGui>
30
31#include <memory>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class SceneData3D;
39
40/*******************************************************************************
41 * Class RealisticBoardPainter
42 ******************************************************************************/
43
62 struct Content {
63 bool initialized = false;
64 QPainterPath body;
65 QPainterPath copper;
66 QPainterPath solderResist;
67 QPainterPath silkscreen;
68 QPainterPath solderPaste;
69 };
70
71public:
72 // Constructors / Destructor
74 explicit RealisticBoardPainter(std::shared_ptr<SceneData3D> data);
76 ~RealisticBoardPainter() noexcept;
77
78 // General Methods
79 void paint(QPainter& painter,
80 const GraphicsExportSettings& settings) const noexcept override;
81
82 // Operator Overloadings
83 RealisticBoardPainter& operator=(const RealisticBoardPainter& rhs) = delete;
84
85private: // Methods
86 const Content& getContent(bool mirrored) const noexcept;
87
88private: // Data
90 std::shared_ptr<SceneData3D> mData;
92
93 mutable QMutex mMutex;
94 mutable bool mDataPreprocessed;
97};
98
99/*******************************************************************************
100 * End of File
101 ******************************************************************************/
102
103} // namespace librepcb
104
105#endif
Settings for librepcb::GraphicsExport.
Definition: graphicsexportsettings.h:51
Base class for printing a page for librepcb::GraphicsExport.
Definition: graphicsexport.h:57
Paints a librepcb::Board in realistic mode to a QPainter.
Definition: realisticboardpainter.h:61
QMutex mMutex
Definition: realisticboardpainter.h:93
bool mDrawSolderPaste
Definition: realisticboardpainter.h:91
Content mContentBot
Definition: realisticboardpainter.h:96
RealisticBoardPainter(const RealisticBoardPainter &other)=delete
const Content & getContent(bool mirrored) const noexcept
Definition: realisticboardpainter.cpp:95
~RealisticBoardPainter() noexcept
Definition: realisticboardpainter.cpp:51
std::shared_ptr< SceneData3D > mData
Definition: realisticboardpainter.h:90
void paint(QPainter &painter, const GraphicsExportSettings &settings) const noexcept override
Draw page content on a QPainter.
Definition: realisticboardpainter.cpp:58
bool mDataPreprocessed
Definition: realisticboardpainter.h:94
Content mContentTop
Definition: realisticboardpainter.h:95
const PositiveLength mMaxArcTolerance
Definition: realisticboardpainter.h:89
3D scene data representing a board with package models
Definition: scenedata3d.h:53
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
Definition: realisticboardpainter.h:62
QPainterPath silkscreen
Definition: realisticboardpainter.h:67
QPainterPath solderPaste
Definition: realisticboardpainter.h:68
QPainterPath body
Definition: realisticboardpainter.h:64
QPainterPath copper
Definition: realisticboardpainter.h:65
QPainterPath solderResist
Definition: realisticboardpainter.h:66
bool initialized
Definition: realisticboardpainter.h:63