LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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:

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
 
void registerObserver (IF_GraphicsLayerObserver &object) const noexcept
 
void unregisterObserver (IF_GraphicsLayerObserver &object) const 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
 

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...
 
QSet< IF_GraphicsLayerObserver * > mObservers
 A list of all observer objects. 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.

Author
ubruhin
Date
2016-11-04

Constructor & Destructor Documentation

GraphicsLayer ( )
delete
GraphicsLayer ( const GraphicsLayer other)
noexcept
GraphicsLayer ( const QString &  name)
explicitnoexcept
~GraphicsLayer ( )
virtualnoexcept

Member Function Documentation

const QString& getName ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QString& getNameTr ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

const QColor& getColor ( bool  highlighted = false) const
inlinenoexcept

+ Here is the caller graph for this function:

bool getVisible ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

bool isEnabled ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

bool isVisible ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

bool isTopLayer ( ) const
inlinenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool isBottomLayer ( ) const
inlinenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool isInnerLayer ( ) const
inlinenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool isCopperLayer ( ) const
inlinenoexcept

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int getInnerLayerNumber ( ) const
inlinenoexcept
QString getMirroredLayerName ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

QString getGrabAreaLayerName ( ) const
inlinenoexcept

+ Here is the caller graph for this function:

void setColor ( const QColor &  color)
noexcept
void setColorHighlighted ( const QColor &  color)
noexcept
void setVisible ( bool  visible)
noexcept

+ Here is the caller graph for this function:

void setEnabled ( bool  enable)
noexcept
void registerObserver ( IF_GraphicsLayerObserver object) const
noexcept
void unregisterObserver ( IF_GraphicsLayerObserver object) const
noexcept
GraphicsLayer& operator= ( const GraphicsLayer rhs)
delete
static int getInnerLayerCount ( )
inlinestaticnoexcept

+ Here is the caller graph for this function:

bool isTopLayer ( const QString &  name)
staticnoexcept
bool isBottomLayer ( const QString &  name)
staticnoexcept
bool isInnerLayer ( const QString &  name)
staticnoexcept
bool isCopperLayer ( const QString &  name)
staticnoexcept
QString getInnerLayerName ( int  number)
staticnoexcept

+ Here is the caller graph for this function:

int getInnerLayerNumber ( const QString &  name)
staticnoexcept
QString getMirroredLayerName ( const QString &  name)
staticnoexcept
QString getGrabAreaLayerName ( const QString &  outlineLayerName)
staticnoexcept
const QStringList & getSchematicGeometryElementLayerNames ( )
staticnoexcept

+ Here is the caller graph for this function:

const QStringList & getBoardGeometryElementLayerNames ( )
staticnoexcept

+ Here is the caller graph for this function:

void getDefaultValues ( const QString &  name,
QString &  nameTr,
QColor &  color,
QColor &  colorHl,
bool &  visible 
)
staticnoexcept
void attributesChanged ( )
signal

+ Here is the caller graph for this function:

Member Data Documentation

constexpr const char* sSchematicReferences = "sch_references"
static

origin crosses of symbols, texts, ...

constexpr const char* sSchematicSheetFrames = "sch_scheet_frames"
static

e.g. A4 sheet frame + text boxes

constexpr const char* sSchematicNetLines = "sch_net_lines"
static
constexpr const char* sSchematicNetLabels = "sch_net_labels"
static
constexpr const char* sSchematicNetLabelAnchors = "sch_net_label_anchors"
static
constexpr const char* sSchematicDocumentation = "sch_documentation"
static

for documentation purposes, e.g. text

constexpr const char* sSchematicComments = "sch_comments"
static

for personal comments, e.g. text

constexpr const char* sSchematicGuide = "sch_guide"
static

e.g. for boxes around circuits

constexpr const char* sSymbolOutlines = "sym_outlines"
static

dark red lines of symbols

constexpr const char* sSymbolGrabAreas = "sym_grab_areas"
static

optional yellow area of symbols

constexpr const char* sSymbolHiddenGrabAreas = "sym_hidden_grab_areas"
static

hidden grab areas of symbols

constexpr const char* sSymbolNames = "sym_names"
static

text {{NAME}}

constexpr const char* sSymbolValues = "sym_values"
static

text {{VALUE}}

constexpr const char* sSymbolPinCirclesOpt = "sym_pin_circles_opt"
static

green circle of unconnected pins

constexpr const char* sSymbolPinCirclesReq = "sym_pin_circles_req"
static

red circle of unconnected pins

constexpr const char* sSymbolPinNames = "sym_pin_names"
static

name of the connected component signal

constexpr const char* sSymbolPinNumbers = "sym_pin_numbers"
static

number of the connected footprint pad

constexpr const char* sBoardSheetFrames = "brd_sheet_frames"
static

e.g. A4 sheet frame + text boxes

constexpr const char* sBoardOutlines = "brd_outlines"
static

incl. non-plated through hole milling

constexpr const char* sBoardMillingPth = "brd_milling_pth"
static

plated through hole milling

constexpr const char* sBoardDrillsNpth = "brd_drills_npth"
static

non-plated through hole drills

constexpr const char* sBoardPadsTht = "brd_pads_tht"
static

plated through hole pads

constexpr const char* sBoardViasTht = "brd_vias_tht"
static

plated through hole vias

constexpr const char* sBoardAirWires = "brd_airwires"
static

air wires (unconnected)

constexpr const char* sBoardMeasures = "brd_measures"
static

measurements documentation

constexpr const char* sBoardAlignment = "brd_alignment"
static

alignment helpers in devices

constexpr const char* sBoardDocumentation = "brd_documentation"
static

for documentation purposes, e.g. text

constexpr const char* sBoardComments = "brd_comments"
static

for personal comments, e.g. text

constexpr const char* sBoardGuide = "brd_guide"
static

e.g. for boxes around circuits

constexpr const char* sTopPlacement = "top_placement"
static

placement information (e.g. outline) of devices

constexpr const char* sBotPlacement = "bot_placement"
static

placement information (e.g. outline) of devices

constexpr const char* sTopDocumentation = "top_documentation"
static

like placement layers, but not for silk screen

constexpr const char* sBotDocumentation = "bot_documentation"
static

like placement layers, but not for silk screen

constexpr const char* sTopGrabAreas = "top_grab_areas"
static

area where devices can be dragged

constexpr const char* sBotGrabAreas = "bot_grab_areas"
static

area where devices can be dragged

constexpr const char* sTopHiddenGrabAreas = "top_hidden_grab_areas"
static

hidden area where devices can be dragged

constexpr const char* sBotHiddenGrabAreas = "bot_hidden_grab_areas"
static

hidden area where devices can be dragged

constexpr const char* sTopReferences = "top_references"
static

origin crosses of devices

constexpr const char* sBotReferences = "bot_references"
static

origin crosses of devices

constexpr const char* sTopNames = "top_names"
static

text, may be used for silk screen

constexpr const char* sBotNames = "bot_names"
static

text, may be used for silk screen

constexpr const char* sTopValues = "top_values"
static

text, may be used for silk screen

constexpr const char* sBotValues = "bot_values"
static

text, may be used for silk screen

constexpr const char* sTopCourtyard = "top_courtyard"
static

area required to mount devices

constexpr const char* sBotCourtyard = "bot_courtyard"
static

area required to mount devices

constexpr const char* sTopStopMask = "top_stop_mask"
static

areas over smt pads

constexpr const char* sBotStopMask = "bot_stop_mask"
static

areas over smt pads

constexpr const char* sTopSolderPaste = "top_solder_paste"
static

areas over smt pads

constexpr const char* sBotSolderPaste = "bot_solder_paste"
static

areas over smt pads

constexpr const char* sTopFinish = "top_finish"
static

areas of special surface treatments

constexpr const char* sBotFinish = "bot_finish"
static

areas of special surface treatments

constexpr const char* sTopGlue = "top_glue"
static

adhesive for fixing devices

constexpr const char* sBotGlue = "bot_glue"
static

adhesive for fixing devices

constexpr const char* sTopCopper = "top_cu"
static
constexpr const char* sBotCopper = "bot_cu"
static
QString mName
protected

Unique name which is used for serialization.

QString mNameTr
protected

Layer name (translated into the user's language)

QColor mColor
protected

Color of graphics items on that layer.

QColor mColorHighlighted
protected

Color of hightlighted graphics items on that layer

bool mIsVisible
protected

Visibility of graphics items on that layer.

bool mIsEnabled
protected

Visibility/availability of the layer itself.

QSet<IF_GraphicsLayerObserver*> mObservers
mutableprotected

A list of all observer objects.


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