LibrePCB Developers Documentation
RealisticBoardPainter Class Referencefinal

Paints a librepcb::Board in realistic mode to a QPainter. More...

#include <realisticboardpainter.h>

+ Inheritance diagram for RealisticBoardPainter:
+ Collaboration diagram for RealisticBoardPainter:

Classes

struct  Content
 

Public Member Functions

 RealisticBoardPainter ()=delete
 
 RealisticBoardPainter (std::shared_ptr< SceneData3D > data)
 
 RealisticBoardPainter (const RealisticBoardPainter &other)=delete
 
 ~RealisticBoardPainter () noexcept
 
void paint (QPainter &painter, const GraphicsExportSettings &settings) const noexcept override
 Draw page content on a QPainter. More...
 
RealisticBoardPainteroperator= (const RealisticBoardPainter &rhs)=delete
 
virtual void paint (QPainter &painter, const GraphicsExportSettings &settings) const noexcept=0
 Draw page content on a QPainter. More...
 

Private Member Functions

const ContentgetContent (bool mirrored) const noexcept
 

Private Attributes

const PositiveLength mMaxArcTolerance
 
std::shared_ptr< SceneData3DmData
 
bool mDrawSolderPaste
 
QMutex mMutex
 
bool mDataPreprocessed
 
Content mContentTop
 
Content mContentBot
 

Detailed Description

Paints a librepcb::Board in realistic mode to a QPainter.

Similar to librepcb::BoardPainter, but rendering physical layers instead of logical layers, i.e. the output will be a realistic PCB with gray body, golden copper, (typically) green solder resist and (typically) white silkscreen instead of just rendering all objects the same way as on screen.

Used in conjuction with librepcb::GraphicsExport. Colors are obtained from librepcb::SceneData3D and whether the top or the bottom side is rendered is controlled by librepcb::GraphicsExportSettings::getMirror().

See also
librepcb::GraphicsPagePainter
librepcb::GraphicsExport
librepcb::SceneData3D

Constructor & Destructor Documentation

◆ RealisticBoardPainter() [1/3]

◆ RealisticBoardPainter() [2/3]

RealisticBoardPainter ( std::shared_ptr< SceneData3D data)
explicit

◆ RealisticBoardPainter() [3/3]

RealisticBoardPainter ( const RealisticBoardPainter other)
delete

◆ ~RealisticBoardPainter()

~RealisticBoardPainter ( )
noexcept

Member Function Documentation

◆ paint()

void paint ( QPainter &  painter,
const GraphicsExportSettings settings 
) const
overridevirtualnoexcept

Draw page content on a QPainter.

Attention
This method must be thread-safe as it might be called from multiple threads at the same time!
Note
Most settings are already handled by librepcb::GraphicsExport and should not be taken into account when implementing this method. In particular, any page layout or coordinate transformations do not need to be respected by this implementation. And for layer colors, just use librepcb::GraphicsExportSettings::getColor() and librepcb::GraphicsExportSettings::getFillColor().
Parameters
painterWhere to paint the content to.
settingsHelper class to fetch layer colors depending on the current export settings.

Implements GraphicsPagePainter.

◆ operator=()

RealisticBoardPainter & operator= ( const RealisticBoardPainter rhs)
delete

◆ getContent()

const RealisticBoardPainter::Content & getContent ( bool  mirrored) const
privatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mMaxArcTolerance

const PositiveLength mMaxArcTolerance
private

◆ mData

std::shared_ptr<SceneData3D> mData
private

◆ mDrawSolderPaste

bool mDrawSolderPaste
private

◆ mMutex

QMutex mMutex
mutableprivate

◆ mDataPreprocessed

bool mDataPreprocessed
mutableprivate

◆ mContentTop

Content mContentTop
mutableprivate

◆ mContentBot

Content mContentBot
mutableprivate

The documentation for this class was generated from the following files: