LibrePCB Developers Documentation
GraphicsLayer Class Reference

The GraphicsLayer class represents a graphical layer used in schematics and boards. More...

#include <graphicslayer.h>

Inherits QObject.

+ Collaboration diagram for GraphicsLayer:

Public Types

enum  Event
 
typedef Slot< GraphicsLayer, EventOnEditedSlot
 

Signals

void attributesChanged ()
 

Public Member Functions

 GraphicsLayer ()=delete
 
 GraphicsLayer (const GraphicsLayer &other) noexcept
 
 GraphicsLayer (const QString &name) noexcept
 
virtual ~GraphicsLayer () noexcept
 
const QString & getName () const noexcept
 
const QString & getNameTr () const noexcept
 
const QColor & getColor (bool highlighted=false) const noexcept
 
bool getVisible () const noexcept
 
bool isEnabled () const noexcept
 
bool isVisible () const noexcept
 
bool isTopLayer () const noexcept
 
bool isBottomLayer () const noexcept
 
bool isInnerLayer () const noexcept
 
bool isCopperLayer () const noexcept
 
int getInnerLayerNumber () const noexcept
 
QString getMirroredLayerName () const noexcept
 
QString getGrabAreaLayerName () const noexcept
 
void setColor (const QColor &color) noexcept
 
void setColorHighlighted (const QColor &color) noexcept
 
void setVisible (bool visible) noexcept
 
void setEnabled (bool enable) noexcept
 
GraphicsLayeroperator= (const GraphicsLayer &rhs)=delete
 

Static Public Member Functions

static int getInnerLayerCount () noexcept
 
static bool isTopLayer (const QString &name) noexcept
 
static bool isBottomLayer (const QString &name) noexcept
 
static bool isInnerLayer (const QString &name) noexcept
 
static bool isCopperLayer (const QString &name) noexcept
 
static QString getInnerLayerName (int number) noexcept
 
static int getInnerLayerNumber (const QString &name) noexcept
 
static QString getMirroredLayerName (const QString &name) noexcept
 
static QString getGrabAreaLayerName (const QString &outlineLayerName) noexcept
 
static const QStringList & getSchematicGeometryElementLayerNames () noexcept
 
static const QStringList & getBoardGeometryElementLayerNames () noexcept
 
static void getDefaultValues (const QString &name, QString &nameTr, QColor &color, QColor &colorHl, bool &visible) noexcept
 

Public Attributes

Signal< GraphicsLayer, EventonEdited
 

Static Public Attributes

static constexpr const char * sSchematicReferences = "sch_references"
 origin crosses of symbols, texts, ... More...
 
static constexpr const char * sSchematicSheetFrames = "sch_scheet_frames"
 e.g. A4 sheet frame + text boxes More...
 
static constexpr const char * sSchematicNetLines = "sch_net_lines"
 librepcb::project::SI_NetLine More...
 
static constexpr const char * sSchematicNetLabels = "sch_net_labels"
 librepcb::project::SI_NetLabel More...
 
static constexpr const char * sSchematicNetLabelAnchors = "sch_net_label_anchors"
 anchor line of librepcb::project::SI_NetLabel More...
 
static constexpr const char * sSchematicDocumentation = "sch_documentation"
 for documentation purposes, e.g. text More...
 
static constexpr const char * sSchematicComments = "sch_comments"
 for personal comments, e.g. text More...
 
static constexpr const char * sSchematicGuide = "sch_guide"
 e.g. for boxes around circuits More...
 
static constexpr const char * sSymbolOutlines = "sym_outlines"
 dark red lines of symbols More...
 
static constexpr const char * sSymbolGrabAreas = "sym_grab_areas"
 optional yellow area of symbols More...
 
static constexpr const char * sSymbolHiddenGrabAreas = "sym_hidden_grab_areas"
 hidden grab areas of symbols More...
 
static constexpr const char * sSymbolNames = "sym_names"
 text {{NAME}} More...
 
static constexpr const char * sSymbolValues = "sym_values"
 text {{VALUE}} More...
 
static constexpr const char * sSymbolPinCirclesOpt = "sym_pin_circles_opt"
 green circle of unconnected pins More...
 
static constexpr const char * sSymbolPinCirclesReq = "sym_pin_circles_req"
 red circle of unconnected pins More...
 
static constexpr const char * sSymbolPinNames = "sym_pin_names"
 name of the connected component signal More...
 
static constexpr const char * sSymbolPinNumbers = "sym_pin_numbers"
 number of the connected footprint pad More...
 
static constexpr const char * sBoardSheetFrames = "brd_sheet_frames"
 e.g. A4 sheet frame + text boxes More...
 
static constexpr const char * sBoardOutlines = "brd_outlines"
 incl. non-plated through hole milling More...
 
static constexpr const char * sBoardMillingPth = "brd_milling_pth"
 plated through hole milling More...
 
static constexpr const char * sBoardDrillsNpth = "brd_drills_npth"
 non-plated through hole drills More...
 
static constexpr const char * sBoardPadsTht = "brd_pads_tht"
 plated through hole pads More...
 
static constexpr const char * sBoardViasTht = "brd_vias_tht"
 plated through hole vias More...
 
static constexpr const char * sBoardAirWires = "brd_airwires"
 air wires (unconnected) More...
 
static constexpr const char * sBoardMeasures = "brd_measures"
 measurements documentation More...
 
static constexpr const char * sBoardAlignment = "brd_alignment"
 alignment helpers in devices More...
 
static constexpr const char * sBoardDocumentation = "brd_documentation"
 for documentation purposes, e.g. text More...
 
static constexpr const char * sBoardComments = "brd_comments"
 for personal comments, e.g. text More...
 
static constexpr const char * sBoardGuide = "brd_guide"
 e.g. for boxes around circuits More...
 
static constexpr const char * sTopPlacement = "top_placement"
 placement information (e.g. outline) of devices More...
 
static constexpr const char * sBotPlacement = "bot_placement"
 placement information (e.g. outline) of devices More...
 
static constexpr const char * sTopDocumentation = "top_documentation"
 like placement layers, but not for silk screen More...
 
static constexpr const char * sBotDocumentation = "bot_documentation"
 like placement layers, but not for silk screen More...
 
static constexpr const char * sTopGrabAreas = "top_grab_areas"
 area where devices can be dragged More...
 
static constexpr const char * sBotGrabAreas = "bot_grab_areas"
 area where devices can be dragged More...
 
static constexpr const char * sTopHiddenGrabAreas = "top_hidden_grab_areas"
 hidden area where devices can be dragged More...
 
static constexpr const char * sBotHiddenGrabAreas = "bot_hidden_grab_areas"
 hidden area where devices can be dragged More...
 
static constexpr const char * sTopReferences = "top_references"
 origin crosses of devices More...
 
static constexpr const char * sBotReferences = "bot_references"
 origin crosses of devices More...
 
static constexpr const char * sTopNames = "top_names"
 text, may be used for silk screen More...
 
static constexpr const char * sBotNames = "bot_names"
 text, may be used for silk screen More...
 
static constexpr const char * sTopValues = "top_values"
 text, may be used for silk screen More...
 
static constexpr const char * sBotValues = "bot_values"
 text, may be used for silk screen More...
 
static constexpr const char * sTopCourtyard = "top_courtyard"
 area required to mount devices More...
 
static constexpr const char * sBotCourtyard = "bot_courtyard"
 area required to mount devices More...
 
static constexpr const char * sTopStopMask = "top_stop_mask"
 areas over smt pads More...
 
static constexpr const char * sBotStopMask = "bot_stop_mask"
 areas over smt pads More...
 
static constexpr const char * sTopSolderPaste = "top_solder_paste"
 areas over smt pads More...
 
static constexpr const char * sBotSolderPaste = "bot_solder_paste"
 areas over smt pads More...
 
static constexpr const char * sTopFinish = "top_finish"
 areas of special surface treatments More...
 
static constexpr const char * sBotFinish = "bot_finish"
 areas of special surface treatments More...
 
static constexpr const char * sTopGlue = "top_glue"
 adhesive for fixing devices More...
 
static constexpr const char * sBotGlue = "bot_glue"
 adhesive for fixing devices More...
 
static constexpr const char * sTopCopper = "top_cu"
 
static constexpr const char * sBotCopper = "bot_cu"
 

Protected Attributes

QString mName
 Unique name which is used for serialization. More...
 
QString mNameTr
 Layer name (translated into the user's language) More...
 
QColor mColor
 Color of graphics items on that layer. More...
 
QColor mColorHighlighted
 
bool mIsVisible
 Visibility of graphics items on that layer. More...
 
bool mIsEnabled
 Visibility/availability of the layer itself. More...
 

Detailed Description

The GraphicsLayer class represents a graphical layer used in schematics and boards.

These layers are used in graphics items (QGraphicsItem) to determine their visibility and colors.

Member Typedef Documentation

◆ OnEditedSlot

Member Enumeration Documentation

◆ Event

enum Event
strong
Enumerator
ColorChanged 
HighlightColorChanged 
VisibleChanged 
EnabledChanged 
Destroyed 

Constructor & Destructor Documentation

◆ GraphicsLayer() [1/3]

GraphicsLayer ( )
delete

◆ GraphicsLayer() [2/3]

GraphicsLayer ( const GraphicsLayer other)
noexcept

◆ GraphicsLayer() [3/3]

GraphicsLayer ( const QString &  name)
explicitnoexcept

◆ ~GraphicsLayer()

~GraphicsLayer ( )
virtualnoexcept

Member Function Documentation

◆ getName()

const QString& getName ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNameTr()

const QString& getNameTr ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getColor()

const QColor& getColor ( bool  highlighted = false) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getVisible()

bool getVisible ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ isEnabled()

bool isEnabled ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ isVisible()

bool isVisible ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ isTopLayer() [1/2]

bool isTopLayer ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isBottomLayer() [1/2]

bool isBottomLayer ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInnerLayer() [1/2]

bool isInnerLayer ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCopperLayer() [1/2]

bool isCopperLayer ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInnerLayerNumber() [1/2]

int getInnerLayerNumber ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getMirroredLayerName() [1/2]

QString getMirroredLayerName ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ getGrabAreaLayerName() [1/2]

QString getGrabAreaLayerName ( ) const
inlinenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setColor()

void setColor ( const QColor &  color)
noexcept
+ Here is the caller graph for this function:

◆ setColorHighlighted()

void setColorHighlighted ( const QColor &  color)
noexcept
+ Here is the caller graph for this function:

◆ setVisible()

void setVisible ( bool  visible)
noexcept
+ Here is the caller graph for this function:

◆ setEnabled()

void setEnabled ( bool  enable)
noexcept
+ Here is the caller graph for this function:

◆ operator=()

GraphicsLayer& operator= ( const GraphicsLayer rhs)
delete
+ Here is the caller graph for this function:

◆ getInnerLayerCount()

static int getInnerLayerCount ( )
inlinestaticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isTopLayer() [2/2]

bool isTopLayer ( const QString &  name)
staticnoexcept

◆ isBottomLayer() [2/2]

bool isBottomLayer ( const QString &  name)
staticnoexcept

◆ isInnerLayer() [2/2]

bool isInnerLayer ( const QString &  name)
staticnoexcept

◆ isCopperLayer() [2/2]

bool isCopperLayer ( const QString &  name)
staticnoexcept

◆ getInnerLayerName()

QString getInnerLayerName ( int  number)
staticnoexcept
+ Here is the caller graph for this function:

◆ getInnerLayerNumber() [2/2]

int getInnerLayerNumber ( const QString &  name)
staticnoexcept

◆ getMirroredLayerName() [2/2]

QString getMirroredLayerName ( const QString &  name)
staticnoexcept

◆ getGrabAreaLayerName() [2/2]

QString getGrabAreaLayerName ( const QString &  outlineLayerName)
staticnoexcept

◆ getSchematicGeometryElementLayerNames()

const QStringList & getSchematicGeometryElementLayerNames ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ getBoardGeometryElementLayerNames()

const QStringList & getBoardGeometryElementLayerNames ( )
staticnoexcept
+ Here is the caller graph for this function:

◆ getDefaultValues()

void getDefaultValues ( const QString &  name,
QString &  nameTr,
QColor &  color,
QColor &  colorHl,
bool &  visible 
)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attributesChanged

void attributesChanged ( )
signal
+ Here is the caller graph for this function:

Member Data Documentation

◆ sSchematicReferences

constexpr const char* sSchematicReferences = "sch_references"
static

origin crosses of symbols, texts, ...

◆ sSchematicSheetFrames

constexpr const char* sSchematicSheetFrames = "sch_scheet_frames"
static

e.g. A4 sheet frame + text boxes

◆ sSchematicNetLines

constexpr const char* sSchematicNetLines = "sch_net_lines"
static

◆ sSchematicNetLabels

constexpr const char* sSchematicNetLabels = "sch_net_labels"
static

◆ sSchematicNetLabelAnchors

constexpr const char* sSchematicNetLabelAnchors = "sch_net_label_anchors"
static

◆ sSchematicDocumentation

constexpr const char* sSchematicDocumentation = "sch_documentation"
static

for documentation purposes, e.g. text

◆ sSchematicComments

constexpr const char* sSchematicComments = "sch_comments"
static

for personal comments, e.g. text

◆ sSchematicGuide

constexpr const char* sSchematicGuide = "sch_guide"
static

e.g. for boxes around circuits

◆ sSymbolOutlines

constexpr const char* sSymbolOutlines = "sym_outlines"
static

dark red lines of symbols

◆ sSymbolGrabAreas

constexpr const char* sSymbolGrabAreas = "sym_grab_areas"
static

optional yellow area of symbols

◆ sSymbolHiddenGrabAreas

constexpr const char* sSymbolHiddenGrabAreas = "sym_hidden_grab_areas"
static

hidden grab areas of symbols

◆ sSymbolNames

constexpr const char* sSymbolNames = "sym_names"
static

text {{NAME}}

◆ sSymbolValues

constexpr const char* sSymbolValues = "sym_values"
static

text {{VALUE}}

◆ sSymbolPinCirclesOpt

constexpr const char* sSymbolPinCirclesOpt = "sym_pin_circles_opt"
static

green circle of unconnected pins

◆ sSymbolPinCirclesReq

constexpr const char* sSymbolPinCirclesReq = "sym_pin_circles_req"
static

red circle of unconnected pins

◆ sSymbolPinNames

constexpr const char* sSymbolPinNames = "sym_pin_names"
static

name of the connected component signal

◆ sSymbolPinNumbers

constexpr const char* sSymbolPinNumbers = "sym_pin_numbers"
static

number of the connected footprint pad

◆ sBoardSheetFrames

constexpr const char* sBoardSheetFrames = "brd_sheet_frames"
static

e.g. A4 sheet frame + text boxes

◆ sBoardOutlines

constexpr const char* sBoardOutlines = "brd_outlines"
static

incl. non-plated through hole milling

◆ sBoardMillingPth

constexpr const char* sBoardMillingPth = "brd_milling_pth"
static

plated through hole milling

◆ sBoardDrillsNpth

constexpr const char* sBoardDrillsNpth = "brd_drills_npth"
static

non-plated through hole drills

◆ sBoardPadsTht

constexpr const char* sBoardPadsTht = "brd_pads_tht"
static

plated through hole pads

◆ sBoardViasTht

constexpr const char* sBoardViasTht = "brd_vias_tht"
static

plated through hole vias

◆ sBoardAirWires

constexpr const char* sBoardAirWires = "brd_airwires"
static

air wires (unconnected)

◆ sBoardMeasures

constexpr const char* sBoardMeasures = "brd_measures"
static

measurements documentation

◆ sBoardAlignment

constexpr const char* sBoardAlignment = "brd_alignment"
static

alignment helpers in devices

◆ sBoardDocumentation

constexpr const char* sBoardDocumentation = "brd_documentation"
static

for documentation purposes, e.g. text

◆ sBoardComments

constexpr const char* sBoardComments = "brd_comments"
static

for personal comments, e.g. text

◆ sBoardGuide

constexpr const char* sBoardGuide = "brd_guide"
static

e.g. for boxes around circuits

◆ sTopPlacement

constexpr const char* sTopPlacement = "top_placement"
static

placement information (e.g. outline) of devices

◆ sBotPlacement

constexpr const char* sBotPlacement = "bot_placement"
static

placement information (e.g. outline) of devices

◆ sTopDocumentation

constexpr const char* sTopDocumentation = "top_documentation"
static

like placement layers, but not for silk screen

◆ sBotDocumentation

constexpr const char* sBotDocumentation = "bot_documentation"
static

like placement layers, but not for silk screen

◆ sTopGrabAreas

constexpr const char* sTopGrabAreas = "top_grab_areas"
static

area where devices can be dragged

◆ sBotGrabAreas

constexpr const char* sBotGrabAreas = "bot_grab_areas"
static

area where devices can be dragged

◆ sTopHiddenGrabAreas

constexpr const char* sTopHiddenGrabAreas = "top_hidden_grab_areas"
static

hidden area where devices can be dragged

◆ sBotHiddenGrabAreas

constexpr const char* sBotHiddenGrabAreas = "bot_hidden_grab_areas"
static

hidden area where devices can be dragged

◆ sTopReferences

constexpr const char* sTopReferences = "top_references"
static

origin crosses of devices

◆ sBotReferences

constexpr const char* sBotReferences = "bot_references"
static

origin crosses of devices

◆ sTopNames

constexpr const char* sTopNames = "top_names"
static

text, may be used for silk screen

◆ sBotNames

constexpr const char* sBotNames = "bot_names"
static

text, may be used for silk screen

◆ sTopValues

constexpr const char* sTopValues = "top_values"
static

text, may be used for silk screen

◆ sBotValues

constexpr const char* sBotValues = "bot_values"
static

text, may be used for silk screen

◆ sTopCourtyard

constexpr const char* sTopCourtyard = "top_courtyard"
static

area required to mount devices

◆ sBotCourtyard

constexpr const char* sBotCourtyard = "bot_courtyard"
static

area required to mount devices

◆ sTopStopMask

constexpr const char* sTopStopMask = "top_stop_mask"
static

areas over smt pads

◆ sBotStopMask

constexpr const char* sBotStopMask = "bot_stop_mask"
static

areas over smt pads

◆ sTopSolderPaste

constexpr const char* sTopSolderPaste = "top_solder_paste"
static

areas over smt pads

◆ sBotSolderPaste

constexpr const char* sBotSolderPaste = "bot_solder_paste"
static

areas over smt pads

◆ sTopFinish

constexpr const char* sTopFinish = "top_finish"
static

areas of special surface treatments

◆ sBotFinish

constexpr const char* sBotFinish = "bot_finish"
static

areas of special surface treatments

◆ sTopGlue

constexpr const char* sTopGlue = "top_glue"
static

adhesive for fixing devices

◆ sBotGlue

constexpr const char* sBotGlue = "bot_glue"
static

adhesive for fixing devices

◆ sTopCopper

constexpr const char* sTopCopper = "top_cu"
static

◆ sBotCopper

constexpr const char* sBotCopper = "bot_cu"
static

◆ onEdited

◆ mName

QString mName
protected

Unique name which is used for serialization.

◆ mNameTr

QString mNameTr
protected

Layer name (translated into the user's language)

◆ mColor

QColor mColor
protected

Color of graphics items on that layer.

◆ mColorHighlighted

QColor mColorHighlighted
protected

Color of hightlighted graphics items on that layer

◆ mIsVisible

bool mIsVisible
protected

Visibility of graphics items on that layer.

◆ mIsEnabled

bool mIsEnabled
protected

Visibility/availability of the layer itself.


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