18 #ifndef PART_POLYGON_H 19 #define PART_POLYGON_H 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);
88 QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
override;
int type() const override
void fromXml(const QDomElement &) override
PartPolygon::fromXml Import the properties of this polygon from a xml element.
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
QPolygonF polygon() const
void addPoint(const QPointF &point)
PartPolygon::addPoint Add new point to polygon.
void adjusteHandlerPos()
PartPolygon::adjusteHandlerPos.
void removeHandler()
PartPolygon::removeHandler Remove the handlers of this item.
void removePoint()
PartPolygon::removePoint remove a point on this polygon.
QVector< QetGraphicsHandlerItem * > m_handler_vector
void sceneSelectionChanged()
PartPolygon::sceneSelectionChanged When the scene selection change, if there are several primitive se...
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartPolygon::handlerMouseReleaseEvent.
QPainterPath shape() const override
PartPolygon::shape.
void setLastPoint(const QPointF &point)
PartPolygon::setLastPoint Set the last point of polygon to .
QString name() const override
void setClosed(bool close)
void addHandler()
PartPolygon::addHandler Add handlers for this item.
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
PartPolygon::paint Draw this polygon.
The CustomElementGraphicPart class This class is the base for all home-made primitive like line...
void insertPoint()
PartPolygon::insertPoint Insert a point in this polygone.
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartPolygon::handlerMousePressEvent.
QET::ScalingMethod preferredScalingMethod() const override
PartPolygon::preferredScalingMethod This method is called by the decorator when it needs to determine...
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override
void startUserTransformation(const QRectF &) override
PartPolygon::startUserTransformation Start the user-induced transformation, provided this primitive i...
QString xmlName() const override
void removeLastPoint()
PartPolygon::removeLastPoint Remove the last point of polygon.
QPointF m_context_menu_pos
QRectF boundingRect() const override
PartPolygon::boundingRect.
void handleUserTransformation(const QRectF &, const QRectF &) override
PartPolygon::handleUserTransformation Handle the user-induced transformation from initial_selection_r...
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
PartPolygon::sceneEventFilter.
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
PartPolygon::itemChange.
QPainterPath shadowShape() const override
ScalingMethod
Supported types of interactive scaling, typically for a single element primitive. ...
bool isUseless() const override
PartPolygon::isUseless.
The PartPolygon class This class represents a polygon primitive which may be used to compose the draw...
QRectF sceneGeometricRect() const override
PartPolygon::sceneGeometricRect.
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
PartPolygon::handlerMouseMoveEvent.
void setPolygon(const QPolygonF &polygon)
PartPolygon::setPolygon Sets the item's polygon to be the given polygon.
const QDomElement toXml(QDomDocument &) const override
PartPolygon::toXml Export this polygin in xml.
QPropertyUndoCommand * m_undo_command
QList< QPointF > saved_points_