54 enum {
Type = UserType + 1105 };
60 void paint(QPainter *,
const QStyleOptionGraphicsItem *, QWidget *)
override;
62 QString
name()
const override {
return(QObject::tr(
"polygone",
"element part name")); }
63 QString
xmlName()
const override {
return(QString(
"polygon")); }
64 void fromXml(
const QDomElement &)
override;
65 const QDomElement
toXml(QDomDocument &)
const override;
67 QPainterPath
shape ()
const override;
80 void addPoint (
const QPointF &point);
92 void flip(qreal axis_y = 0);
93 void mirror(qreal axis_x = 0);
99 QVariant
itemChange(GraphicsItemChange change, const QVariant &value) override;
Color color
Definition customelementgraphicpart.h:44
CustomElementGraphicPart(QETElementEditor *editor, QGraphicsItem *parent=nullptr)
CustomElementGraphicPart::CustomElementGraphicPart Default constructor. By default,...
Definition customelementgraphicpart.cpp:34
int type() const override
Definition partpolygon.h:59
QPropertyUndoCommand * m_undo_command
Definition partpolygon.h:116
void adjustHandlerPos()
PartPolygon::adjustHandlerPos.
Definition partpolygon.cpp:422
QAction * m_insert_point
Definition partpolygon.h:119
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
PartPolygon::itemChange.
Definition partpolygon.cpp:341
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
PartPolygon::sceneEventFilter.
Definition partpolygon.cpp:361
void setLastPoint(const QPointF &point)
PartPolygon::setLastPoint Set the last point of polygon to point.
Definition partpolygon.cpp:235
void setPolygon(const QPolygonF &polygon)
PartPolygon::setPolygon Sets the item's polygon to be the given polygon.
Definition partpolygon.cpp:210
PartPolygon(QETElementEditor *editor, QGraphicsItem *parent=nullptr)
PartPolygon::PartPolygon Constructor.
Definition partpolygon.cpp:33
bool closed
Definition partpolygon.h:37
void addHandler() override
PartPolygon::addHandler Add handlers for this item.
Definition partpolygon.cpp:495
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartPolygon::handlerMouseReleaseEvent.
Definition partpolygon.cpp:480
void startUserTransformation(const QRectF &) override
PartPolygon::startUserTransformation Start the user-induced transformation, provided this primitive i...
Definition partpolygon.cpp:166
QAction * m_remove_point
Definition partpolygon.h:120
QPainterPath shape() const override
PartPolygon::shape.
Definition partpolygon.cpp:579
bool m_closed
Definition partpolygon.h:113
qreal m_rot
Definition partpolygon.h:122
void mirror(qreal axis_x=0)
Definition partpolygon.cpp:322
void flip(qreal axis_y=0)
Definition partpolygon.cpp:310
QPointF m_context_menu_pos
Definition partpolygon.h:121
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartPolygon::handlerMousePressEvent.
Definition partpolygon.cpp:446
void setRotation(qreal angle)
Definition partpolygon.cpp:292
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override
Definition partpolygon.cpp:395
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition partpolygon.h:118
@ Type
Definition partpolygon.h:54
bool isUseless() const override
PartPolygon::isUseless.
Definition partpolygon.cpp:138
qreal rotation() const
Definition partpolygon.cpp:306
QPolygonF polygon
Definition partpolygon.h:38
void insertPoint()
PartPolygon::insertPoint Insert a point in this polygon.
Definition partpolygon.cpp:528
QPolygonF m_polygon
Definition partpolygon.h:115
QString xmlName() const override
Definition partpolygon.h:63
void removeLastPoint()
PartPolygon::removeLastPoint Remove the last point of polygon.
Definition partpolygon.cpp:248
bool isClosed() const
Definition partpolygon.h:84
void addPoint(const QPointF &point)
PartPolygon::addPoint Add new point to polygon.
Definition partpolygon.cpp:224
void fromXml(const QDomElement &) override
PartPolygon::fromXml Import the properties of this polygon from a xml element.
Definition partpolygon.cpp:85
void setClosed(bool close)
Definition partpolygon.cpp:257
QPainterPath shadowShape() const override
Definition partpolygon.cpp:594
int m_vector_index
Definition partpolygon.h:117
void handleUserTransformation(const QRectF &, const QRectF &) override
PartPolygon::handleUserTransformation Handle the user-induced transformation from initial_selection_r...
Definition partpolygon.cpp:178
const QDomElement toXml(QDomDocument &) const override
PartPolygon::toXml Export this polygon in xml.
Definition partpolygon.cpp:116
void removeHandler() override
PartPolygon::removeHandler Remove the handlers of this item.
Definition partpolygon.cpp:515
void setHandlerColor(QPointF pos, const QColor &color) final
PartPolygon::setHandlerColor Set the handler at pos pos (in polygon coordinate) to color color.
Definition partpolygon.cpp:271
QRectF boundingRect() const override
PartPolygon::boundingRect.
Definition partpolygon.cpp:612
void removePoint()
PartPolygon::removePoint remove a point on this polygon.
Definition partpolygon.cpp:545
QRectF sceneGeometricRect() const override
PartPolygon::sceneGeometricRect.
Definition partpolygon.cpp:155
QString name() const override
Definition partpolygon.h:62
void resetAllHandlerColor() final
PartPolygon::resetAllHandlerColor Reset the color of every handlers.
Definition partpolygon.cpp:284
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartPolygon::handlerMouseMoveEvent.
Definition partpolygon.cpp:460
QList< QPointF > saved_points_
Definition partpolygon.h:114
QET::ScalingMethod preferredScalingMethod() const override
PartPolygon::preferredScalingMethod This method is called by the decorator when it needs to determine...
Definition partpolygon.cpp:191
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
PartPolygon::paint Draw this polygon.
Definition partpolygon.cpp:62
Definition qetelementeditor.h:39
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition qpropertyundocommand.h:34
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition qetgraphicshandleritem.h:37
ScalingMethod
Supported types of interactive scaling, typically for a single element primitive.
Definition qet.h:78