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

The SchematicGraphicsScene class. More...

#include <schematicgraphicsscene.h>

+ Inheritance diagram for SchematicGraphicsScene:
+ Collaboration diagram for SchematicGraphicsScene:

Public Types

enum  ZValue : int
 Z-values of all items in a schematic (to define the stacking order) More...
 

Public Member Functions

 SchematicGraphicsScene ()=delete
 
 SchematicGraphicsScene (const SchematicGraphicsScene &other)=delete
 
 SchematicGraphicsScene (Schematic &schematic, const IF_GraphicsLayerProvider &lp, std::shared_ptr< const QSet< const NetSignal * > > highlightedNetSignals, QObject *parent=nullptr) noexcept
 
virtual ~SchematicGraphicsScene () noexcept
 
SchematicgetSchematic () noexcept
 
const QHash< SI_Symbol *, std::shared_ptr< SGI_Symbol > > & getSymbols () noexcept
 
const QHash< SI_SymbolPin *, std::shared_ptr< SGI_SymbolPin > > & getSymbolPins () noexcept
 
const QHash< SI_NetPoint *, std::shared_ptr< SGI_NetPoint > > & getNetPoints () noexcept
 
const QHash< SI_NetLine *, std::shared_ptr< SGI_NetLine > > & getNetLines () noexcept
 
const QHash< SI_NetLabel *, std::shared_ptr< SGI_NetLabel > > & getNetLabels () noexcept
 
const QHash< SI_Polygon *, std::shared_ptr< PolygonGraphicsItem > > & getPolygons () noexcept
 
const QHash< SI_Text *, std::shared_ptr< SGI_Text > > & getTexts () noexcept
 
void selectAll () noexcept
 
void selectItemsInRect (const Point &p1, const Point &p2) noexcept
 
void clearSelection () noexcept
 
void updateHighlightedNetSignals () noexcept
 
SchematicGraphicsSceneoperator= (const SchematicGraphicsScene &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
 

Private Member Functions

void addSymbol (SI_Symbol &symbol) noexcept
 
void removeSymbol (SI_Symbol &symbol) noexcept
 
void addSymbolPin (SI_SymbolPin &pin, std::weak_ptr< SGI_Symbol > symbol) noexcept
 
void removeSymbolPin (SI_SymbolPin &pin) noexcept
 
void addNetSegment (SI_NetSegment &netSegment) noexcept
 
void removeNetSegment (SI_NetSegment &netSegment) noexcept
 
void addNetPointsAndNetLines (const QList< SI_NetPoint * > &netPoints, const QList< SI_NetLine * > &netLines) noexcept
 
void removeNetPointsAndNetLines (const QList< SI_NetPoint * > &netPoints, const QList< SI_NetLine * > &netLines) noexcept
 
void addNetPoint (SI_NetPoint &netPoint) noexcept
 
void removeNetPoint (SI_NetPoint &netPoint) noexcept
 
void addNetLine (SI_NetLine &netLine) noexcept
 
void removeNetLine (SI_NetLine &netLine) noexcept
 
void addNetLabel (SI_NetLabel &netLabel) noexcept
 
void removeNetLabel (SI_NetLabel &netLabel) noexcept
 
void addPolygon (SI_Polygon &polygon) noexcept
 
void removePolygon (SI_Polygon &polygon) noexcept
 
void addText (SI_Text &text) noexcept
 
void removeText (SI_Text &text) noexcept
 

Private Attributes

SchematicmSchematic
 
const IF_GraphicsLayerProvidermLayerProvider
 
std::shared_ptr< const QSet< const NetSignal * > > mHighlightedNetSignals
 
QHash< SI_Symbol *, std::shared_ptr< SGI_Symbol > > mSymbols
 
QHash< SI_SymbolPin *, std::shared_ptr< SGI_SymbolPin > > mSymbolPins
 
QHash< SI_NetPoint *, std::shared_ptr< SGI_NetPoint > > mNetPoints
 
QHash< SI_NetLine *, std::shared_ptr< SGI_NetLine > > mNetLines
 
QHash< SI_NetLabel *, std::shared_ptr< SGI_NetLabel > > mNetLabels
 
QHash< SI_Polygon *, std::shared_ptr< PolygonGraphicsItem > > mPolygons
 
QHash< SI_Text *, std::shared_ptr< SGI_Text > > mTexts
 

Detailed Description

Member Enumeration Documentation

◆ ZValue

enum ZValue : int

Z-values of all items in a schematic (to define the stacking order)

These values are used for QGraphicsItem::setZValue() to define the stacking order of all items in a schematic 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_TextAnchors 

For librepcb::SI_Text anchor lines.

ZValue_Symbols 

For librepcb::SI_Symbol items.

ZValue_SymbolPins 

For librepcb::SI_SymbolPin items.

ZValue_Polygons 

For librepcb::SI_Polygon items.

ZValue_Texts 

For librepcb::SI_Text items.

ZValue_NetLabels 

For librepcb::SI_NetLabel items.

ZValue_NetLines 

For librepcb::SI_NetLine items.

ZValue_HiddenNetPoints 

Foror hidden librepcb::SI_NetPoint items.

ZValue_VisibleNetPoints 

For visible librepcb::SI_NetPoint items.

Constructor & Destructor Documentation

◆ SchematicGraphicsScene() [1/3]

◆ SchematicGraphicsScene() [2/3]

◆ SchematicGraphicsScene() [3/3]

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

◆ ~SchematicGraphicsScene()

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

Member Function Documentation

◆ getSchematic()

Schematic & getSchematic ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getSymbols()

const QHash< SI_Symbol *, std::shared_ptr< SGI_Symbol > > & getSymbols ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getSymbolPins()

const QHash< SI_SymbolPin *, std::shared_ptr< SGI_SymbolPin > > & getSymbolPins ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getNetPoints()

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

◆ getNetLines()

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

◆ getNetLabels()

const QHash< SI_NetLabel *, std::shared_ptr< SGI_NetLabel > > & getNetLabels ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getPolygons()

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

◆ getTexts()

const QHash< SI_Text *, std::shared_ptr< SGI_Text > > & getTexts ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ 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:

◆ clearSelection()

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

◆ updateHighlightedNetSignals()

void updateHighlightedNetSignals ( )
noexcept

◆ operator=()

SchematicGraphicsScene & operator= ( const SchematicGraphicsScene rhs)
delete

◆ addSymbol()

void addSymbol ( SI_Symbol symbol)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeSymbol()

void removeSymbol ( SI_Symbol symbol)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSymbolPin()

void addSymbolPin ( SI_SymbolPin pin,
std::weak_ptr< SGI_Symbol symbol 
)
privatenoexcept

◆ removeSymbolPin()

void removeSymbolPin ( SI_SymbolPin pin)
privatenoexcept
+ Here is the caller graph for this function:

◆ addNetSegment()

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

◆ removeNetSegment()

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

◆ addNetPointsAndNetLines()

void addNetPointsAndNetLines ( const QList< SI_NetPoint * > &  netPoints,
const QList< SI_NetLine * > &  netLines 
)
privatenoexcept
+ Here is the caller graph for this function:

◆ removeNetPointsAndNetLines()

void removeNetPointsAndNetLines ( const QList< SI_NetPoint * > &  netPoints,
const QList< SI_NetLine * > &  netLines 
)
privatenoexcept
+ Here is the caller graph for this function:

◆ addNetPoint()

void addNetPoint ( SI_NetPoint netPoint)
privatenoexcept

◆ removeNetPoint()

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

◆ addNetLine()

void addNetLine ( SI_NetLine netLine)
privatenoexcept

◆ removeNetLine()

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

◆ addNetLabel()

void addNetLabel ( SI_NetLabel netLabel)
privatenoexcept
+ Here is the caller graph for this function:

◆ removeNetLabel()

void removeNetLabel ( SI_NetLabel netLabel)
privatenoexcept
+ Here is the caller graph for this function:

◆ addPolygon()

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

◆ removePolygon()

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

◆ addText()

void addText ( SI_Text text)
privatenoexcept
+ Here is the caller graph for this function:

◆ removeText()

void removeText ( SI_Text text)
privatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ mSchematic

Schematic& mSchematic
private

◆ mLayerProvider

const IF_GraphicsLayerProvider& mLayerProvider
private

◆ mHighlightedNetSignals

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

◆ mSymbols

QHash<SI_Symbol*, std::shared_ptr<SGI_Symbol> > mSymbols
private

◆ mSymbolPins

QHash<SI_SymbolPin*, std::shared_ptr<SGI_SymbolPin> > mSymbolPins
private

◆ mNetPoints

QHash<SI_NetPoint*, std::shared_ptr<SGI_NetPoint> > mNetPoints
private

◆ mNetLines

QHash<SI_NetLine*, std::shared_ptr<SGI_NetLine> > mNetLines
private

◆ mNetLabels

QHash<SI_NetLabel*, std::shared_ptr<SGI_NetLabel> > mNetLabels
private

◆ mPolygons

QHash<SI_Polygon*, std::shared_ptr<PolygonGraphicsItem> > mPolygons
private

◆ mTexts

QHash<SI_Text*, std::shared_ptr<SGI_Text> > mTexts
private

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