LibrePCB Developers Documentation
GraphicsPainter Class Referencefinal

Draw LibrePCB graphics elements on a QPainter. More...

#include <graphicspainter.h>

+ Collaboration diagram for GraphicsPainter:

Public Member Functions

 GraphicsPainter ()=delete
 
 GraphicsPainter (QPainter &painter) noexcept
 
 GraphicsPainter (const GraphicsPainter &other)=delete
 
 ~GraphicsPainter () noexcept
 
void setMinLineWidth (const UnsignedLength &width) noexcept
 
void drawLine (const Point &p1, const Point &p2, const Length &width, const QColor &color) noexcept
 
void drawPath (const QPainterPath &path, const Length &lineWidth, const QColor &lineColor, const QColor &fillColor) noexcept
 
void drawPolygon (const Path &path, const Length &lineWidth, const QColor &lineColor, const QColor &fillColor) noexcept
 
void drawCircle (const Point &center, const Length &diameter, const Length &lineWidth, const QColor &lineColor, const QColor &fillColor) noexcept
 
void drawSlot (const Path &path, const PositiveLength &diameter, const Length &lineWidth, const QColor &lineColor, const QColor &fillColor) noexcept
 
void drawText (const Point &position, const Angle &rotation, const Length &height, const Alignment &alignment, const QString &text, QFont font, const QColor &color, bool autoRotate, bool mirrorInPlace, bool parseOverlines, int fontPixelSize=0) noexcept
 
void drawSymbolPin (const Point &position, const Angle &rotation, const Length &length, const QColor &lineColor, const QColor &circleColor) noexcept
 
void drawNetJunction (const Point &position, const QColor &color) noexcept
 
void drawNetLabel (const Point &position, const Angle &rotation, bool mirror, const QString &text, const QFont &font, const QColor &color) noexcept
 
GraphicsPainteroperator= (const GraphicsPainter &rhs)=delete
 

Private Member Functions

qreal getPenWidthPx (const Length &width) const noexcept
 

Private Attributes

QPainter & mPainter
 
UnsignedLength mMinLineWidth
 

Detailed Description

Draw LibrePCB graphics elements on a QPainter.

Constructor & Destructor Documentation

◆ GraphicsPainter() [1/3]

GraphicsPainter ( )
delete

◆ GraphicsPainter() [2/3]

GraphicsPainter ( QPainter &  painter)
explicitnoexcept

◆ GraphicsPainter() [3/3]

GraphicsPainter ( const GraphicsPainter other)
delete

◆ ~GraphicsPainter()

~GraphicsPainter ( )
noexcept

Member Function Documentation

◆ setMinLineWidth()

void setMinLineWidth ( const UnsignedLength width)
inlinenoexcept
+ Here is the caller graph for this function:

◆ drawLine()

void drawLine ( const Point p1,
const Point p2,
const Length width,
const QColor &  color 
)
noexcept
+ Here is the caller graph for this function:

◆ drawPath()

void drawPath ( const QPainterPath &  path,
const Length lineWidth,
const QColor &  lineColor,
const QColor &  fillColor 
)
noexcept
+ Here is the caller graph for this function:

◆ drawPolygon()

void drawPolygon ( const Path path,
const Length lineWidth,
const QColor &  lineColor,
const QColor &  fillColor 
)
noexcept
+ Here is the caller graph for this function:

◆ drawCircle()

void drawCircle ( const Point center,
const Length diameter,
const Length lineWidth,
const QColor &  lineColor,
const QColor &  fillColor 
)
noexcept
+ Here is the caller graph for this function:

◆ drawSlot()

void drawSlot ( const Path path,
const PositiveLength diameter,
const Length lineWidth,
const QColor &  lineColor,
const QColor &  fillColor 
)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawText()

void drawText ( const Point position,
const Angle rotation,
const Length height,
const Alignment alignment,
const QString &  text,
QFont  font,
const QColor &  color,
bool  autoRotate,
bool  mirrorInPlace,
bool  parseOverlines,
int  fontPixelSize = 0 
)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawSymbolPin()

void drawSymbolPin ( const Point position,
const Angle rotation,
const Length length,
const QColor &  lineColor,
const QColor &  circleColor 
)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawNetJunction()

void drawNetJunction ( const Point position,
const QColor &  color 
)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawNetLabel()

void drawNetLabel ( const Point position,
const Angle rotation,
bool  mirror,
const QString &  text,
const QFont &  font,
const QColor &  color 
)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

GraphicsPainter & operator= ( const GraphicsPainter rhs)
delete

◆ getPenWidthPx()

qreal getPenWidthPx ( const Length width) const
privatenoexcept

Member Data Documentation

◆ mPainter

QPainter& mPainter
private

◆ mMinLineWidth

UnsignedLength mMinLineWidth
private

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