LibrePCB Developers Documentation
BoardPainter Class Referencefinal

Paints a librepcb::Board to a QPainter. More...

#include <boardpainter.h>

+ Inheritance diagram for BoardPainter:
+ Collaboration diagram for BoardPainter:

Classes

struct  ColorContent
 
struct  Footprint
 
struct  HoleData
 
struct  Pad
 
struct  Plane
 
struct  PolygonData
 
struct  StrokeTextData
 
struct  TextData
 
struct  Trace
 
struct  ViaData
 

Public Member Functions

 BoardPainter ()=delete
 
 BoardPainter (const Board &board)
 
 BoardPainter (const BoardPainter &other)=delete
 
 ~BoardPainter () noexcept
 
void paint (QPainter &painter, const GraphicsExportSettings &settings) const noexcept override
 Draw page content on a QPainter. More...
 
BoardPainteroperator= (const BoardPainter &rhs)=delete
 
virtual void paint (QPainter &painter, const GraphicsExportSettings &settings) const noexcept=0
 Draw page content on a QPainter. More...
 

Private Member Functions

void initContentByColor () const noexcept
 

Private Attributes

QFont mMonospaceFont
 
QSet< const Layer * > mCopperLayers
 
QList< FootprintmFootprints
 
QList< ViaDatamVias
 
QList< TracemTraces
 
QList< PlanemPlanes
 
QList< PolygonDatamPolygons
 
QList< StrokeTextDatamStrokeTexts
 
QList< HoleDatamHoles
 
QMutex mMutex
 
QHash< QString, ColorContentmContentByColor
 

Detailed Description

Paints a librepcb::Board to a QPainter.

Used for librepcb::GraphicsExport.

Constructor & Destructor Documentation

◆ BoardPainter() [1/3]

BoardPainter ( )
delete

◆ BoardPainter() [2/3]

BoardPainter ( const Board board)
explicit
+ Here is the call graph for this function:

◆ BoardPainter() [3/3]

BoardPainter ( const BoardPainter other)
delete

◆ ~BoardPainter()

~BoardPainter ( )
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.

+ Here is the call graph for this function:

◆ operator=()

BoardPainter & operator= ( const BoardPainter rhs)
delete

◆ initContentByColor()

void initContentByColor ( ) const
privatenoexcept
+ Here is the call graph for this function:

Member Data Documentation

◆ mMonospaceFont

QFont mMonospaceFont
private

◆ mCopperLayers

QSet<const Layer*> mCopperLayers
private

◆ mFootprints

QList<Footprint> mFootprints
private

◆ mVias

QList<ViaData> mVias
private

◆ mTraces

QList<Trace> mTraces
private

◆ mPlanes

QList<Plane> mPlanes
private

◆ mPolygons

QList<PolygonData> mPolygons
private

◆ mStrokeTexts

QList<StrokeTextData> mStrokeTexts
private

◆ mHoles

QList<HoleData> mHoles
private

◆ mMutex

QMutex mMutex
mutableprivate

◆ mContentByColor

QHash<QString, ColorContent> mContentByColor
mutableprivate

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