LibrePCB Developers Documentation
Loading...
Searching...
No Matches
PrimitiveCircleGraphicsItem Class Reference

The PrimitiveCircleGraphicsItem class. More...

#include <primitivecirclegraphicsitem.h>

+ Inheritance diagram for PrimitiveCircleGraphicsItem:
+ Collaboration diagram for PrimitiveCircleGraphicsItem:

Public Types

enum class  ShapeMode
 

Public Member Functions

 PrimitiveCircleGraphicsItem (const PrimitiveCircleGraphicsItem &other)=delete
 
 PrimitiveCircleGraphicsItem (QGraphicsItem *parent=nullptr) noexcept
 
virtual ~PrimitiveCircleGraphicsItem () noexcept
 
void setPosition (const Point &pos) noexcept
 
void setDiameter (const UnsignedLength &dia) noexcept
 
void setLineWidth (const UnsignedLength &width) noexcept
 
void setLineLayer (const std::shared_ptr< GraphicsLayer > &layer) noexcept
 
void setFillLayer (const std::shared_ptr< GraphicsLayer > &layer) noexcept
 
void setShapeMode (ShapeMode mode) noexcept
 
virtual QRectF boundingRect () const noexcept override
 
virtual QPainterPath shape () const noexcept override
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) noexcept override
 
PrimitiveCircleGraphicsItemoperator= (const PrimitiveCircleGraphicsItem &rhs)=delete
 

Private Member Functions

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

Private Attributes

std::shared_ptr< GraphicsLayermLineLayer
 
std::shared_ptr< GraphicsLayermFillLayer
 
ShapeMode mShapeMode
 
QPen mPen
 
QPen mPenHighlighted
 
QBrush mBrush
 
QBrush mBrushHighlighted
 
QRectF mCircleRect
 
QRectF mBoundingRect
 
QPainterPath mShape
 
GraphicsLayer::OnEditedSlot mOnLayerEditedSlot
 

Detailed Description

Member Enumeration Documentation

◆ ShapeMode

enum class ShapeMode
strong
Enumerator
StrokeAndAreaByLayer 

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

FilledOutline 

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

Constructor & Destructor Documentation

◆ PrimitiveCircleGraphicsItem() [1/2]

◆ PrimitiveCircleGraphicsItem() [2/2]

PrimitiveCircleGraphicsItem ( QGraphicsItem *  parent = nullptr)
explicitnoexcept

◆ ~PrimitiveCircleGraphicsItem()

~PrimitiveCircleGraphicsItem ( )
virtualnoexcept

Member Function Documentation

◆ setPosition()

void setPosition ( const Point pos)
noexcept

◆ setDiameter()

void setDiameter ( const UnsignedLength dia)
noexcept
+ Here is the call graph for this function:

◆ setLineWidth()

void setLineWidth ( const UnsignedLength width)
noexcept

◆ setLineLayer()

void setLineLayer ( const std::shared_ptr< GraphicsLayer > &  layer)
noexcept

◆ setFillLayer()

void setFillLayer ( const std::shared_ptr< GraphicsLayer > &  layer)
noexcept
+ Here is the caller graph for this function:

◆ setShapeMode()

void setShapeMode ( ShapeMode  mode)
noexcept

◆ boundingRect()

virtual QRectF boundingRect ( ) const
inlineoverridevirtualnoexcept

◆ shape()

QPainterPath shape ( ) const
overridevirtualnoexcept

◆ paint()

void paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
overridevirtualnoexcept

◆ operator=()

PrimitiveCircleGraphicsItem & operator= ( const PrimitiveCircleGraphicsItem rhs)
delete

◆ layerEdited()

void layerEdited ( const GraphicsLayer layer,
GraphicsLayer::Event  event 
)
privatenoexcept

◆ updateColors()

void updateColors ( )
privatenoexcept

◆ updateBoundingRectAndShape()

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

◆ updateVisibility()

void updateVisibility ( )
privatenoexcept

Member Data Documentation

◆ mLineLayer

std::shared_ptr<GraphicsLayer> mLineLayer
private

◆ mFillLayer

std::shared_ptr<GraphicsLayer> mFillLayer
private

◆ mShapeMode

ShapeMode mShapeMode
private

◆ mPen

QPen mPen
private

◆ mPenHighlighted

QPen mPenHighlighted
private

◆ mBrush

QBrush mBrush
private

◆ mBrushHighlighted

QBrush mBrushHighlighted
private

◆ mCircleRect

QRectF mCircleRect
private

◆ mBoundingRect

QRectF mBoundingRect
private

◆ mShape

QPainterPath mShape
private

◆ mOnLayerEditedSlot

GraphicsLayer::OnEditedSlot mOnLayerEditedSlot
private

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