LibrePCB Developers Documentation
Layer Class Referencefinal

The Layer class provides all supported geometry layers. More...

#include <layer.h>

+ Collaboration diagram for Layer:

Public Types

enum class  Flag : quint32
 

Public Member Functions

 Layer ()=delete
 
 Layer (const Layer &other) noexcept
 
 ~Layer () noexcept
 
const QString & getId () const noexcept
 Get the identifier used for serialization. More...
 
const QString & getNameTr () const noexcept
 Get the name of the Layer (human readable and translated) More...
 
const QString & getThemeColor () const noexcept
 Get the name of the corresponding theme color. More...
 
bool isSchematic () const noexcept
 Check if this is a schematic layer. More...
 
bool isBoard () const noexcept
 Check if this is a board layer. More...
 
bool isTop () const noexcept
 Check if this is a top board layer. More...
 
bool isInner () const noexcept
 Check if this is an inner board layer. More...
 
bool isBottom () const noexcept
 Check if this is a bottom board layer. More...
 
bool isCopper () const noexcept
 Check if this is a copper layer. More...
 
bool isStopMask () const noexcept
 Check if this is a stop mask layer. More...
 
bool isSolderPaste () const noexcept
 Check if this is a solder paste layer. More...
 
bool isBoardEdge () const noexcept
 Check if this is a layer defining the board edge. More...
 
bool isPackageOutline () const noexcept
 Check if this is a package outline layer. More...
 
bool isPackageCourtyard () const noexcept
 Check if this is a package courtyard layer. More...
 
bool getPolygonsRepresentAreas () const noexcept
 Check if polygons on this layers always represent areas. More...
 
int getCopperNumber () const noexcept
 Get the copper layer number. More...
 
const Layermirrored (int innerLayers=-1) const noexcept
 Mirror this layer to the other board side. More...
 
Layeroperator= (const Layer &rhs) noexcept=delete
 
bool operator== (const Layer &rhs) const noexcept
 
bool operator!= (const Layer &rhs) const noexcept
 

Static Public Member Functions

static const LayerschematicSheetFrames () noexcept
 
static const LayerschematicDocumentation () noexcept
 
static const LayerschematicComments () noexcept
 
static const LayerschematicGuide () noexcept
 
static const LayersymbolOutlines () noexcept
 
static const LayersymbolHiddenGrabAreas () noexcept
 
static const LayersymbolNames () noexcept
 
static const LayersymbolValues () noexcept
 
static const LayersymbolPinNames () noexcept
 
static const LayerboardSheetFrames () noexcept
 
static const LayerboardOutlines () noexcept
 
static const LayerboardCutouts () noexcept
 
static const LayerboardPlatedCutouts () noexcept
 
static const LayerboardMeasures () noexcept
 
static const LayerboardAlignment () noexcept
 
static const LayerboardDocumentation () noexcept
 
static const LayerboardComments () noexcept
 
static const LayerboardGuide () noexcept
 
static const LayertopNames () noexcept
 
static const LayerbotNames () noexcept
 
static const LayertopValues () noexcept
 
static const LayerbotValues () noexcept
 
static const LayertopLegend () noexcept
 
static const LayerbotLegend () noexcept
 
static const LayertopDocumentation () noexcept
 
static const LayerbotDocumentation () noexcept
 
static const LayertopPackageOutlines () noexcept
 
static const LayerbotPackageOutlines () noexcept
 
static const LayertopCourtyard () noexcept
 
static const LayerbotCourtyard () noexcept
 
static const LayertopHiddenGrabAreas () noexcept
 
static const LayerbotHiddenGrabAreas () noexcept
 
static const LayertopStopMask () noexcept
 
static const LayerbotStopMask () noexcept
 
static const LayertopSolderPaste () noexcept
 
static const LayerbotSolderPaste () noexcept
 
static const LayertopFinish () noexcept
 
static const LayerbotFinish () noexcept
 
static const LayertopGlue () noexcept
 
static const LayerbotGlue () noexcept
 
static const LayertopCopper () noexcept
 
static const LayerbotCopper () noexcept
 
static const QVector< const Layer * > & innerCopper () noexcept
 
static const LayerinnerCopper (int number) noexcept
 
static int innerCopperCount () noexcept
 
static const Layercopper (int number) noexcept
 
static const QVector< const Layer * > & all () noexcept
 Get a list of all available layers. More...
 
static const Layerget (const QString &id)
 Get a layer by its identifier. More...
 
static bool lessThan (const Layer *a, const Layer *b) noexcept
 Comparison for sorting layers by function. More...
 

Private Member Functions

 Layer (const QString &id, const QString &nameTr, const QString &themeColor, Flags flags) noexcept
 

Private Attributes

const QString mId
 
const QString mNameTr
 
const QString mThemeColor
 
const Flags mFlags
 

Detailed Description

The Layer class provides all supported geometry layers.

Note
All methods of this class are thread-safe.

Member Enumeration Documentation

◆ Flag

enum class Flag : quint32
strong
Enumerator
NumberMask 

Copper layer number (0 = top, 64 = bottom)..

Schematic 
Board 
Top 
Inner 
Bottom 
Copper 
StopMask 
SolderPaste 
BoardEdge 
PackageOutline 
PackageCourtyard 
PolygonsRepresentAreas 

Constructor & Destructor Documentation

◆ Layer() [1/3]

Layer ( )
delete
+ Here is the caller graph for this function:

◆ Layer() [2/3]

Layer ( const Layer other)
noexcept

◆ ~Layer()

~Layer ( )
noexcept

◆ Layer() [3/3]

Layer ( const QString &  id,
const QString &  nameTr,
const QString &  themeColor,
Flags  flags 
)
privatenoexcept

Member Function Documentation

◆ getId()

const QString & getId ( ) const
inlinenoexcept

Get the identifier used for serialization.

Returns
Identifier string (lower_snake_case)
+ Here is the caller graph for this function:

◆ getNameTr()

const QString & getNameTr ( ) const
inlinenoexcept

Get the name of the Layer (human readable and translated)

Returns
The name of the Layer
+ Here is the caller graph for this function:

◆ getThemeColor()

const QString & getThemeColor ( ) const
inlinenoexcept

Get the name of the corresponding theme color.

Returns
The name of the corresponding theme color
See also
librepcb::Theme::Color
+ Here is the caller graph for this function:

◆ isSchematic()

bool isSchematic ( ) const
inlinenoexcept

Check if this is a schematic layer.

Returns
Whether this is a schematic layer or not

◆ isBoard()

bool isBoard ( ) const
inlinenoexcept

Check if this is a board layer.

Returns
Whether this is a board layer or not

◆ isTop()

bool isTop ( ) const
inlinenoexcept

Check if this is a top board layer.

Returns
Whether this is a top board layer or not
+ Here is the caller graph for this function:

◆ isInner()

bool isInner ( ) const
inlinenoexcept

Check if this is an inner board layer.

Returns
Whether this is an inner board layer or not
+ Here is the caller graph for this function:

◆ isBottom()

bool isBottom ( ) const
inlinenoexcept

Check if this is a bottom board layer.

Returns
Whether this is a bottom board layer or not
+ Here is the caller graph for this function:

◆ isCopper()

bool isCopper ( ) const
inlinenoexcept

Check if this is a copper layer.

Returns
Whether this is a copper layer or not
+ Here is the caller graph for this function:

◆ isStopMask()

bool isStopMask ( ) const
inlinenoexcept

Check if this is a stop mask layer.

Returns
Whether this is a stop mask layer or not
+ Here is the caller graph for this function:

◆ isSolderPaste()

bool isSolderPaste ( ) const
inlinenoexcept

Check if this is a solder paste layer.

Returns
Whether this is a solder paste layer or not

◆ isBoardEdge()

bool isBoardEdge ( ) const
inlinenoexcept

Check if this is a layer defining the board edge.

This is true for boardOutlines(), boardCutouts() and boardPlatedCutouts().

Returns
Whether this is a board edge layer or not
+ Here is the caller graph for this function:

◆ isPackageOutline()

bool isPackageOutline ( ) const
inlinenoexcept

Check if this is a package outline layer.

Returns
Whether this is a package outline layer or not

◆ isPackageCourtyard()

bool isPackageCourtyard ( ) const
inlinenoexcept

Check if this is a package courtyard layer.

Returns
Whether this is a package courtyard layer or not

◆ getPolygonsRepresentAreas()

bool getPolygonsRepresentAreas ( ) const
inlinenoexcept

Check if polygons on this layers always represent areas.

Returns
Whether this is an area polygon or not
+ Here is the caller graph for this function:

◆ getCopperNumber()

int getCopperNumber ( ) const
inlinenoexcept

Get the copper layer number.

Returns
Copper layer number (0 = top, 1 = first inner, 63 = bottom)
+ Here is the caller graph for this function:

◆ mirrored()

const Layer & mirrored ( int  innerLayers = -1) const
noexcept

Mirror this layer to the other board side.

Parameters
innerLayersIf specified, inner copper layers will be mirrored within this layer count as well. Otherwise, inner layers are not mirrored.
Returns
Mirrored layer, or this layer if not mirrorable.
+ Here is the caller graph for this function:

◆ operator=()

Layer & operator= ( const Layer rhs)
deletenoexcept

◆ operator==()

bool operator== ( const Layer rhs) const
inlinenoexcept

◆ operator!=()

bool operator!= ( const Layer rhs) const
inlinenoexcept

◆ schematicSheetFrames()

const Layer & schematicSheetFrames ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ schematicDocumentation()

const Layer & schematicDocumentation ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ schematicComments()

const Layer & schematicComments ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ schematicGuide()

const Layer & schematicGuide ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ symbolOutlines()

const Layer & symbolOutlines ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ symbolHiddenGrabAreas()

const Layer & symbolHiddenGrabAreas ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ symbolNames()

const Layer & symbolNames ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ symbolValues()

const Layer & symbolValues ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ symbolPinNames()

const Layer & symbolPinNames ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardSheetFrames()

const Layer & boardSheetFrames ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardOutlines()

const Layer & boardOutlines ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardCutouts()

const Layer & boardCutouts ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardPlatedCutouts()

const Layer & boardPlatedCutouts ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardMeasures()

const Layer & boardMeasures ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardAlignment()

const Layer & boardAlignment ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardDocumentation()

const Layer & boardDocumentation ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardComments()

const Layer & boardComments ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ boardGuide()

const Layer & boardGuide ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topNames()

const Layer & topNames ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botNames()

const Layer & botNames ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topValues()

const Layer & topValues ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botValues()

const Layer & botValues ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topLegend()

const Layer & topLegend ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botLegend()

const Layer & botLegend ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topDocumentation()

const Layer & topDocumentation ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botDocumentation()

const Layer & botDocumentation ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topPackageOutlines()

const Layer & topPackageOutlines ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botPackageOutlines()

const Layer & botPackageOutlines ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topCourtyard()

const Layer & topCourtyard ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botCourtyard()

const Layer & botCourtyard ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topHiddenGrabAreas()

const Layer & topHiddenGrabAreas ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botHiddenGrabAreas()

const Layer & botHiddenGrabAreas ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topStopMask()

const Layer & topStopMask ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botStopMask()

const Layer & botStopMask ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topSolderPaste()

const Layer & topSolderPaste ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botSolderPaste()

const Layer & botSolderPaste ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topFinish()

const Layer & topFinish ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botFinish()

const Layer & botFinish ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topGlue()

const Layer & topGlue ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botGlue()

const Layer & botGlue ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ topCopper()

const Layer & topCopper ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ botCopper()

const Layer & botCopper ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ innerCopper() [1/2]

const QVector< const Layer * > & innerCopper ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ innerCopper() [2/2]

const Layer * innerCopper ( int  number)
staticnoexcept

◆ innerCopperCount()

int innerCopperCount ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ copper()

const Layer * copper ( int  number)
staticnoexcept

◆ all()

const QVector< const Layer * > & all ( )
staticnoexcept

Get a list of all available layers.

Returns
A hash table of all layers
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get()

const Layer & get ( const QString &  id)
static

Get a layer by its identifier.

Parameters
idLayer identifier.
Returns
Layer object.
Exceptions
Exceptionif the layer was not found.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lessThan()

bool lessThan ( const Layer a,
const Layer b 
)
staticnoexcept

Comparison for sorting layers by function.

Parameters
aFirst layer to compare.
bSecond layer to compare.
Returns
Whether a is considered as less than b.
+ Here is the caller graph for this function:

Member Data Documentation

◆ mId

const QString mId
private

◆ mNameTr

const QString mNameTr
private

◆ mThemeColor

const QString mThemeColor
private

◆ mFlags

const Flags mFlags
private

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