LibrePCB Developers Documentation
PrimitivePathGraphicsItem Class Reference

The PrimitivePathGraphicsItem class. More...

#include <primitivepathgraphicsitem.h>

+ Inheritance diagram for PrimitivePathGraphicsItem:
+ Collaboration diagram for PrimitivePathGraphicsItem:

Public Types

enum  ShapeMode
 

Public Member Functions

 PrimitivePathGraphicsItem (const PrimitivePathGraphicsItem &other)=delete
 
 PrimitivePathGraphicsItem (QGraphicsItem *parent=nullptr) noexcept
 
virtual ~PrimitivePathGraphicsItem () noexcept
 
void setPosition (const Point &pos) noexcept
 
void setRotation (const Angle &rot) noexcept
 
void setPath (const QPainterPath &path) noexcept
 
void setLineWidth (const UnsignedLength &width) noexcept
 
void setLineLayer (const GraphicsLayer *layer) noexcept
 
void setFillLayer (const GraphicsLayer *layer) noexcept
 
void setShapeMode (ShapeMode mode) noexcept
 
QRectF boundingRect () const noexcept override
 
QPainterPath shape () const noexcept override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) noexcept override
 
PrimitivePathGraphicsItemoperator= (const PrimitivePathGraphicsItem &rhs)=delete
 

Protected Attributes

const GraphicsLayermLineLayer
 
const GraphicsLayermFillLayer
 
ShapeMode mShapeMode
 
QPen mPen
 
QPen mPenHighlighted
 
QBrush mBrush
 
QBrush mBrushHighlighted
 
QPainterPath mPainterPath
 
QRectF mBoundingRect
 
QPainterPath mShape
 
GraphicsLayer::OnEditedSlot mOnLayerEditedSlot
 

Private Member Functions

void layerEdited (const GraphicsLayer &layer, GraphicsLayer::Event event) noexcept
 
void updateColors () noexcept
 
void updateBoundingRectAndShape () noexcept
 
void updateVisibility () noexcept
 

Detailed Description

Member Enumeration Documentation

◆ ShapeMode

enum ShapeMode
strong
Enumerator
STROKE_AND_AREA_BY_LAYER 

Both the line stroke (with its specified width) and the filled area are used as shape, if the corresponding layers are set and visible.

FILLED_OUTLINE 

Only the area within the painter path is used as shape.

Constructor & Destructor Documentation

◆ PrimitivePathGraphicsItem() [1/2]

◆ PrimitivePathGraphicsItem() [2/2]

PrimitivePathGraphicsItem ( QGraphicsItem *  parent = nullptr)
explicitnoexcept

◆ ~PrimitivePathGraphicsItem()

~PrimitivePathGraphicsItem ( )
virtualnoexcept

Member Function Documentation

◆ setPosition()

void setPosition ( const Point pos)
noexcept
+ Here is the caller graph for this function:

◆ setRotation()

void setRotation ( const Angle rot)
noexcept

◆ setPath()

void setPath ( const QPainterPath &  path)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLineWidth()

void setLineWidth ( const UnsignedLength width)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLineLayer()

void setLineLayer ( const GraphicsLayer layer)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFillLayer()

void setFillLayer ( const GraphicsLayer layer)
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setShapeMode()

void setShapeMode ( ShapeMode  mode)
noexcept
+ Here is the call graph for this function:

◆ boundingRect()

QRectF boundingRect ( ) const
inlineoverridenoexcept

◆ shape()

QPainterPath shape ( ) const
inlineoverridenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ paint()

void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
overridenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

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

◆ layerEdited()

void layerEdited ( const GraphicsLayer layer,
GraphicsLayer::Event  event 
)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateColors()

void updateColors ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateBoundingRectAndShape()

void updateBoundingRectAndShape ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateVisibility()

void updateVisibility ( )
privatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ mLineLayer

const GraphicsLayer* mLineLayer
protected

◆ mFillLayer

const GraphicsLayer* mFillLayer
protected

◆ mShapeMode

ShapeMode mShapeMode
protected

◆ mPen

QPen mPen
protected

◆ mPenHighlighted

QPen mPenHighlighted
protected

◆ mBrush

QBrush mBrush
protected

◆ mBrushHighlighted

QBrush mBrushHighlighted
protected

◆ mPainterPath

QPainterPath mPainterPath
protected

◆ mBoundingRect

QRectF mBoundingRect
protected

◆ mShape

QPainterPath mShape
protected

◆ mOnLayerEditedSlot

GraphicsLayer::OnEditedSlot mOnLayerEditedSlot
protected

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