LibrePCB Developers Documentation
|
The PolygonGraphicsItem class. More...
#include <polygongraphicsitem.h>
Classes | |
struct | VertexHandle |
Public Member Functions | |
PolygonGraphicsItem ()=delete | |
PolygonGraphicsItem (const PolygonGraphicsItem &other)=delete | |
PolygonGraphicsItem (Polygon &polygon, const IF_GraphicsLayerProvider &lp, QGraphicsItem *parent=nullptr) noexcept | |
virtual | ~PolygonGraphicsItem () noexcept |
Polygon & | getObj () noexcept |
int | getLineIndexAtPosition (const Point &pos) const noexcept |
QVector< int > | getVertexIndicesAtPosition (const Point &pos) const noexcept |
void | setEditable (bool editable) noexcept |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) noexcept override |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) noexcept override |
PolygonGraphicsItem & | operator= (const PolygonGraphicsItem &rhs)=delete |
Public Member Functions inherited from PrimitivePathGraphicsItem | |
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 | setMirrored (bool mirrored) noexcept |
void | setPath (const QPainterPath &path) 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 | setLighterColors (bool lighter) 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 |
PrimitivePathGraphicsItem & | operator= (const PrimitivePathGraphicsItem &rhs)=delete |
Private Member Functions | |
void | polygonEdited (const Polygon &polygon, Polygon::Event event) noexcept |
void | updateFillLayer () noexcept |
void | updatePath () noexcept |
void | updateZValue () noexcept |
void | updateBoundingRectMargin () noexcept |
Private Attributes | |
Polygon & | mPolygon |
const IF_GraphicsLayerProvider & | mLayerProvider |
bool | mEditable |
qreal | mVertexHandleRadiusPx |
QVector< VertexHandle > | mVertexHandles |
Polygon::OnEditedSlot | mOnEditedSlot |
Additional Inherited Members | |
Public Types inherited from PrimitivePathGraphicsItem | |
enum class | ShapeMode |
Protected Attributes inherited from PrimitivePathGraphicsItem | |
bool | mMirror |
std::shared_ptr< GraphicsLayer > | mLineLayer |
std::shared_ptr< GraphicsLayer > | mFillLayer |
bool | mLighterColors |
ShapeMode | mShapeMode |
QPen | mPen |
QPen | mPenHighlighted |
QBrush | mBrush |
QBrush | mBrushHighlighted |
QPainterPath | mPainterPath |
QRectF | mBoundingRect |
qreal | mBoundingRectMarginPx |
QPainterPath | mShape |
GraphicsLayer::OnEditedSlot | mOnLayerEditedSlot |
The PolygonGraphicsItem class.
|
delete |
|
delete |
|
noexcept |
|
virtualnoexcept |
|
inlinenoexcept |
|
noexcept |
Get the line segment at a specific position
pos | The position to check for lines. |
|
noexcept |
Get the vertices at a specific position
pos | The position to check for vertices. |
|
noexcept |
Enable/disable editing mode when selected
If the item is editable and selected, vertex handles will be shown to indicate that they can be moved. If not editable, handles will not be shown.
editable | Whether the polygon is (visually) editable or not. |
|
overridenoexcept |
|
overridenoexcept |
|
delete |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
privatenoexcept |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |