LibrePCB Developers Documentation
Loading...
Searching...
No Matches
BoardGraphicsScene Class Referencefinal

The BoardGraphicsScene class. More...

#include <boardgraphicsscene.h>

+ Inheritance diagram for BoardGraphicsScene:
+ Collaboration diagram for BoardGraphicsScene:

Public Types

enum  ItemZValue
 Z Values of all items in a board scene (to define the stacking order) More...
 

Public Member Functions

 BoardGraphicsScene ()=delete
 
 BoardGraphicsScene (const BoardGraphicsScene &other)=delete
 
 BoardGraphicsScene (Board &board, const IF_GraphicsLayerProvider &lp, std::shared_ptr< const QSet< const NetSignal * > > highlightedNetSignals, QObject *parent=nullptr) noexcept
 
virtual ~BoardGraphicsScene () noexcept
 
BoardgetBoard () noexcept
 
const QHash< BI_Device *, std::shared_ptr< BGI_Device > > & getDevices () noexcept
 
const QHash< BI_FootprintPad *, std::shared_ptr< BGI_FootprintPad > > & getFootprintPads () noexcept
 
const QHash< BI_Via *, std::shared_ptr< BGI_Via > > & getVias () noexcept
 
const QHash< BI_NetPoint *, std::shared_ptr< BGI_NetPoint > > & getNetPoints () noexcept
 
const QHash< BI_NetLine *, std::shared_ptr< BGI_NetLine > > & getNetLines () noexcept
 
const QHash< BI_Plane *, std::shared_ptr< BGI_Plane > > & getPlanes () noexcept
 
const QHash< BI_Zone *, std::shared_ptr< BGI_Zone > > & getZones () noexcept
 
const QHash< BI_Polygon *, std::shared_ptr< BGI_Polygon > > & getPolygons () noexcept
 
const QHash< BI_StrokeText *, std::shared_ptr< BGI_StrokeText > > & getStrokeTexts () noexcept
 
const QHash< BI_Hole *, std::shared_ptr< BGI_Hole > > & getHoles () noexcept
 
const QHash< BI_AirWire *, std::shared_ptr< BGI_AirWire > > & getAirWires () noexcept
 
void selectAll () noexcept
 
void selectItemsInRect (const Point &p1, const Point &p2) noexcept
 
void selectNetSegment (BI_NetSegment &netSegment) noexcept
 
void clearSelection () noexcept
 
void updateHighlightedNetSignals () noexcept
 
BoardGraphicsSceneoperator= (const BoardGraphicsScene &rhs)=delete
 
- Public Member Functions inherited from GraphicsScene
 GraphicsScene (QObject *parent=nullptr) noexcept
 
virtual ~GraphicsScene () noexcept
 
void addItem (QGraphicsItem &item) noexcept
 
void removeItem (QGraphicsItem &item) noexcept
 
void setSelectionRectColors (const QColor &line, const QColor &fill) noexcept
 
void setSelectionRect (const Point &p1, const Point &p2) noexcept
 
void clearSelectionRect () noexcept
 
QPixmap toPixmap (int dpi, const QColor &background=Qt::transparent) noexcept
 
QPixmap toPixmap (const QSize &size, const QColor &background=Qt::transparent) noexcept
 

Static Public Member Functions

static qreal getZValueOfCopperLayer (const Layer &layer) noexcept
 

Private Member Functions

void addDevice (BI_Device &device) noexcept
 
void removeDevice (BI_Device &device) noexcept
 
void addFootprintPad (BI_FootprintPad &pad, std::weak_ptr< BGI_Device > device) noexcept
 
void removeFootprintPad (BI_FootprintPad &pad) noexcept
 
void addNetSegment (BI_NetSegment &netSegment) noexcept
 
void removeNetSegment (BI_NetSegment &netSegment) noexcept
 
void addNetSegmentElements (const QList< BI_Via * > &vias, const QList< BI_NetPoint * > &netPoints, const QList< BI_NetLine * > &netLines) noexcept
 
void removeNetSegmentElements (const QList< BI_Via * > &vias, const QList< BI_NetPoint * > &netPoints, const QList< BI_NetLine * > &netLines) noexcept
 
void addVia (BI_Via &via) noexcept
 
void removeVia (BI_Via &via) noexcept
 
void addNetPoint (BI_NetPoint &netPoint) noexcept
 
void removeNetPoint (BI_NetPoint &netPoint) noexcept
 
void addNetLine (BI_NetLine &netLine) noexcept
 
void removeNetLine (BI_NetLine &netLine) noexcept
 
void addPlane (BI_Plane &plane) noexcept
 
void removePlane (BI_Plane &plane) noexcept
 
void addZone (BI_Zone &zone) noexcept
 
void removeZone (BI_Zone &zone) noexcept
 
void addPolygon (BI_Polygon &polygon) noexcept
 
void removePolygon (BI_Polygon &polygon) noexcept
 
void addStrokeText (BI_StrokeText &text) noexcept
 
void removeStrokeText (BI_StrokeText &text) noexcept
 
void addHole (BI_Hole &hole) noexcept
 
void removeHole (BI_Hole &hole) noexcept
 
void addAirWire (BI_AirWire &airWire) noexcept
 
void removeAirWire (BI_AirWire &airWire) noexcept
 

Private Attributes

BoardmBoard
 
const IF_GraphicsLayerProvidermLayerProvider
 
std::shared_ptr< const QSet< const NetSignal * > > mHighlightedNetSignals
 
QHash< BI_Device *, std::shared_ptr< BGI_Device > > mDevices
 
QHash< BI_FootprintPad *, std::shared_ptr< BGI_FootprintPad > > mFootprintPads
 
QHash< BI_Via *, std::shared_ptr< BGI_Via > > mVias
 
QHash< BI_NetPoint *, std::shared_ptr< BGI_NetPoint > > mNetPoints
 
QHash< BI_NetLine *, std::shared_ptr< BGI_NetLine > > mNetLines
 
QHash< BI_Plane *, std::shared_ptr< BGI_Plane > > mPlanes
 
QHash< BI_Zone *, std::shared_ptr< BGI_Zone > > mZones
 
QHash< BI_Polygon *, std::shared_ptr< BGI_Polygon > > mPolygons
 
QHash< BI_StrokeText *, std::shared_ptr< BGI_StrokeText > > mStrokeTexts
 
QHash< BI_Hole *, std::shared_ptr< BGI_Hole > > mHoles
 
QHash< BI_AirWire *, std::shared_ptr< BGI_AirWire > > mAirWires
 

Detailed Description

The BoardGraphicsScene class.

Member Enumeration Documentation

◆ ItemZValue

enum ItemZValue

Z Values of all items in a board scene (to define the stacking order)

These values are used for QGraphicsItem::setZValue() to define the stacking order of all items in a board QGraphicsScene. We use integer values, even if the z-value of QGraphicsItem is a qreal attribute...

Low number = background, high number = foreground

Enumerator
ZValue_Default 

this is the default value (behind all other items)

ZValue_TextsBottom 

For librepcb::BI_StrokeText items.

ZValue_PolygonsBottom 

For librepcb::BI_Polygon items.

ZValue_DevicesBottom 

For librepcb::BI_Device items.

ZValue_CopperBottom 
ZValue_FootprintPadsBottom 

For librepcb::BI_FootprintPad items.

ZValue_ZonesBottom 

For librepcb::BI_Zone items.

ZValue_PlanesBottom 

For librepcb::BI_Plane items.

ZValue_InnerBottom 
ZValue_InnerTop 
ZValue_PlanesTop 

For librepcb::BI_Plane items.

ZValue_ZonesTop 

For librepcb::BI_Zone items.

ZValue_FootprintPadsTop 

For librepcb::BI_FootprintPad items.

ZValue_CopperTop 
ZValue_DevicesTop 

For librepcb::BI_Device items.

ZValue_PolygonsTop 

For librepcb::BI_Polygon items.

ZValue_TextsTop 

For librepcb::BI_StrokeText items.

ZValue_Holes 

For librepcb::BI_Hole items.

ZValue_Vias 

For librepcb::BI_Via items.

ZValue_Texts 

For librepcb::BI_StrokeText items.

ZValue_AirWires 

For librepcb::BI_AirWire items.

Constructor & Destructor Documentation

◆ BoardGraphicsScene() [1/3]

BoardGraphicsScene ( )
delete

◆ BoardGraphicsScene() [2/3]

BoardGraphicsScene ( const BoardGraphicsScene other)
delete

◆ BoardGraphicsScene() [3/3]

BoardGraphicsScene ( Board board,
const IF_GraphicsLayerProvider lp,
std::shared_ptr< const QSet< const NetSignal * > >  highlightedNetSignals,
QObject *  parent = nullptr 
)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~BoardGraphicsScene()

~BoardGraphicsScene ( )
virtualnoexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ getBoard()

Board & getBoard ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getDevices()

const QHash< BI_Device *, std::shared_ptr< BGI_Device > > & getDevices ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getFootprintPads()

const QHash< BI_FootprintPad *, std::shared_ptr< BGI_FootprintPad > > & getFootprintPads ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getVias()

const QHash< BI_Via *, std::shared_ptr< BGI_Via > > & getVias ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNetPoints()

const QHash< BI_NetPoint *, std::shared_ptr< BGI_NetPoint > > & getNetPoints ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNetLines()

const QHash< BI_NetLine *, std::shared_ptr< BGI_NetLine > > & getNetLines ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getPlanes()

const QHash< BI_Plane *, std::shared_ptr< BGI_Plane > > & getPlanes ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getZones()

const QHash< BI_Zone *, std::shared_ptr< BGI_Zone > > & getZones ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getPolygons()

const QHash< BI_Polygon *, std::shared_ptr< BGI_Polygon > > & getPolygons ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getStrokeTexts()

const QHash< BI_StrokeText *, std::shared_ptr< BGI_StrokeText > > & getStrokeTexts ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getHoles()

const QHash< BI_Hole *, std::shared_ptr< BGI_Hole > > & getHoles ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getAirWires()

const QHash< BI_AirWire *, std::shared_ptr< BGI_AirWire > > & getAirWires ( )
inlinenoexcept

◆ selectAll()

void selectAll ( )
noexcept

◆ selectItemsInRect()

void selectItemsInRect ( const Point p1,
const Point p2 
)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectNetSegment()

void selectNetSegment ( BI_NetSegment netSegment)
noexcept
+ Here is the call graph for this function:

◆ clearSelection()

void clearSelection ( )
noexcept
+ Here is the caller graph for this function:

◆ updateHighlightedNetSignals()

void updateHighlightedNetSignals ( )
noexcept

◆ getZValueOfCopperLayer()

qreal getZValueOfCopperLayer ( const Layer layer)
staticnoexcept
+ Here is the caller graph for this function:

◆ operator=()

BoardGraphicsScene & operator= ( const BoardGraphicsScene rhs)
delete

◆ addDevice()

void addDevice ( BI_Device device)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeDevice()

void removeDevice ( BI_Device device)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addFootprintPad()

void addFootprintPad ( BI_FootprintPad pad,
std::weak_ptr< BGI_Device device 
)
privatenoexcept

◆ removeFootprintPad()

void removeFootprintPad ( BI_FootprintPad pad)
privatenoexcept
+ Here is the caller graph for this function:

◆ addNetSegment()

void addNetSegment ( BI_NetSegment netSegment)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeNetSegment()

void removeNetSegment ( BI_NetSegment netSegment)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addNetSegmentElements()

void addNetSegmentElements ( const QList< BI_Via * > &  vias,
const QList< BI_NetPoint * > &  netPoints,
const QList< BI_NetLine * > &  netLines 
)
privatenoexcept
+ Here is the caller graph for this function:

◆ removeNetSegmentElements()

void removeNetSegmentElements ( const QList< BI_Via * > &  vias,
const QList< BI_NetPoint * > &  netPoints,
const QList< BI_NetLine * > &  netLines 
)
privatenoexcept
+ Here is the caller graph for this function:

◆ addVia()

void addVia ( BI_Via via)
privatenoexcept

◆ removeVia()

void removeVia ( BI_Via via)
privatenoexcept
+ Here is the caller graph for this function:

◆ addNetPoint()

void addNetPoint ( BI_NetPoint netPoint)
privatenoexcept

◆ removeNetPoint()

void removeNetPoint ( BI_NetPoint netPoint)
privatenoexcept
+ Here is the caller graph for this function:

◆ addNetLine()

void addNetLine ( BI_NetLine netLine)
privatenoexcept

◆ removeNetLine()

void removeNetLine ( BI_NetLine netLine)
privatenoexcept
+ Here is the caller graph for this function:

◆ addPlane()

void addPlane ( BI_Plane plane)
privatenoexcept
+ Here is the caller graph for this function:

◆ removePlane()

void removePlane ( BI_Plane plane)
privatenoexcept
+ Here is the caller graph for this function:

◆ addZone()

void addZone ( BI_Zone zone)
privatenoexcept
+ Here is the caller graph for this function:

◆ removeZone()

void removeZone ( BI_Zone zone)
privatenoexcept
+ Here is the caller graph for this function:

◆ addPolygon()

void addPolygon ( BI_Polygon polygon)
privatenoexcept
+ Here is the caller graph for this function:

◆ removePolygon()

void removePolygon ( BI_Polygon polygon)
privatenoexcept
+ Here is the caller graph for this function:

◆ addStrokeText()

void addStrokeText ( BI_StrokeText text)
privatenoexcept
+ Here is the caller graph for this function:

◆ removeStrokeText()

void removeStrokeText ( BI_StrokeText text)
privatenoexcept
+ Here is the caller graph for this function:

◆ addHole()

void addHole ( BI_Hole hole)
privatenoexcept
+ Here is the caller graph for this function:

◆ removeHole()

void removeHole ( BI_Hole hole)
privatenoexcept
+ Here is the caller graph for this function:

◆ addAirWire()

void addAirWire ( BI_AirWire airWire)
privatenoexcept
+ Here is the caller graph for this function:

◆ removeAirWire()

void removeAirWire ( BI_AirWire airWire)
privatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ mBoard

Board& mBoard
private

◆ mLayerProvider

const IF_GraphicsLayerProvider& mLayerProvider
private

◆ mHighlightedNetSignals

std::shared_ptr<const QSet<const NetSignal*> > mHighlightedNetSignals
private

◆ mDevices

QHash<BI_Device*, std::shared_ptr<BGI_Device> > mDevices
private

◆ mFootprintPads

QHash<BI_FootprintPad*, std::shared_ptr<BGI_FootprintPad> > mFootprintPads
private

◆ mVias

QHash<BI_Via*, std::shared_ptr<BGI_Via> > mVias
private

◆ mNetPoints

QHash<BI_NetPoint*, std::shared_ptr<BGI_NetPoint> > mNetPoints
private

◆ mNetLines

QHash<BI_NetLine*, std::shared_ptr<BGI_NetLine> > mNetLines
private

◆ mPlanes

QHash<BI_Plane*, std::shared_ptr<BGI_Plane> > mPlanes
private

◆ mZones

QHash<BI_Zone*, std::shared_ptr<BGI_Zone> > mZones
private

◆ mPolygons

QHash<BI_Polygon*, std::shared_ptr<BGI_Polygon> > mPolygons
private

◆ mStrokeTexts

QHash<BI_StrokeText*, std::shared_ptr<BGI_StrokeText> > mStrokeTexts
private

◆ mHoles

QHash<BI_Hole*, std::shared_ptr<BGI_Hole> > mHoles
private

◆ mAirWires

QHash<BI_AirWire*, std::shared_ptr<BGI_AirWire> > mAirWires
private

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