21#include "../QetGraphicsItemModeler/qetgraphicshandleritem.h"
64 enum {
Type = UserType + 1008 };
68 QPointF = QPointF(0,0),
70 QGraphicsItem *parent =
nullptr);
84 virtual bool fromXml (
const QDomElement &);
85 virtual QDomElement
toXml (QDomDocument &document)
const;
86 virtual bool toDXF (
const QString &filepath,
const QPen &
pen);
89 QString
name()
const override;
91 void setP2 (
const QPointF &P2);
111 QPainterPath
shape()
const override;
116 const QStyleOptionGraphicsItem *option,
117 QWidget *widget)
override;
122 GraphicsItemChange change,
123 const QVariant &value)
override;
125 QGraphicsItem *watched,
126 QEvent *event)
override;
128 QGraphicsSceneContextMenuEvent *event)
override;
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition qetgraphicshandleritem.h:37
Definition qetgraphicsitem.h:28
The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a dia...
Definition qetshapeitem.h:37
virtual QDomElement toXml(QDomDocument &document) const
QetShapeItem::toXml Save this item to xml element.
Definition qetshapeitem.cpp:888
bool close
Definition qetshapeitem.h:45
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
QetShapeItem::paint Paint this item.
Definition qetshapeitem.cpp:303
QPolygonF polygon() const
Definition qetshapeitem.h:96
QBrush m_brush
Definition qetshapeitem.h:145
void removePoints(int number=1)
QetShapeItem::removePoints Number of point to remove on the polygon If number is superior to number o...
Definition qetshapeitem.cpp:231
bool m_modifie_radius_equaly
Definition qetshapeitem.h:155
QPointF m_context_menu_pos
Definition qetshapeitem.h:150
qreal xRadius
Definition qetshapeitem.h:46
@ Type
Definition qetshapeitem.h:64
QPointF m_P1
Definition qetshapeitem.h:146
QPolygonF m_polygon
Definition qetshapeitem.h:151
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
QetShapeItem::hoverEnterEvent Handle hover enter event.
Definition qetshapeitem.cpp:347
int pointsCount() const
QetShapeItem::pointCount.
Definition qetshapeitem.cpp:208
void setYRadius(qreal Y)
Definition qetshapeitem.cpp:196
void editProperty() override
QetShapeItem::editProperty Edit the property of this item.
Definition qetshapeitem.cpp:987
qreal m_yRadius
Definition qetshapeitem.h:161
QPen pen
Definition qetshapeitem.h:40
virtual bool fromXml(const QDomElement &)
QetShapeItem::fromXml Build this item from the xml description.
Definition qetshapeitem.cpp:846
QPointF m_P2
Definition qetshapeitem.h:147
QAction * m_insert_point
Definition qetshapeitem.h:158
int m_resize_mode
Definition qetshapeitem.h:156
void handlerMouseReleaseEvent()
QetShapeItem::handlerMouseReleaseEvent.
Definition qetshapeitem.cpp:790
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
QetShapeItem::itemChange.
Definition qetshapeitem.cpp:381
QRectF boundingRect() const override
QetShapeItem::boundingRect.
Definition qetshapeitem.cpp:252
bool setLine(const QLineF &line)
QetShapeItem::setLine Set item geometry to line (only available for line shape)
Definition qetshapeitem.cpp:126
ShapeType
Definition qetshapeitem.h:58
@ Polygon
Definition qetshapeitem.h:61
@ Ellipse
Definition qetshapeitem.h:60
@ Rectangle
Definition qetshapeitem.h:59
@ Line
Definition qetshapeitem.h:58
void switchResizeMode()
QetShapeItem::switchResizeMode.
Definition qetshapeitem.cpp:516
QAction * m_remove_point
Definition qetshapeitem.h:159
~QetShapeItem() override
Definition qetshapeitem.cpp:67
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
QetShapeItem::sceneEventFilter.
Definition qetshapeitem.cpp:420
bool setPolygon(const QPolygonF &polygon)
QetShapeItem::setPolygon Set this item geometry to polygon (only available if shape is a polyline)
Definition qetshapeitem.cpp:162
qreal yRadius
Definition qetshapeitem.h:47
bool m_closed
Definition qetshapeitem.h:154
void handlerMousePressEvent()
QetShapeItem::handlerMousePressEvent.
Definition qetshapeitem.cpp:712
void handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event)
QetShapeItem::handlerMouseMoveEvent.
Definition qetshapeitem.cpp:728
void removePoint()
Definition qetshapeitem.cpp:674
bool m_hovered
Definition qetshapeitem.h:152
int type() const override
Definition qetshapeitem.h:75
ShapeType shapeType() const
Definition qetshapeitem.h:82
QLineF line
Definition qetshapeitem.h:43
QPolygonF polygon
Definition qetshapeitem.h:44
QString name() const override
QetShapeItem::name.
Definition qetshapeitem.cpp:999
QPen m_pen
Definition qetshapeitem.h:144
void insertPoint()
Definition qetshapeitem.cpp:658
void setNextPoint(QPointF P)
QetShapeItem::setNextPoint Add a new point to the current polygon.
Definition qetshapeitem.cpp:218
QPointF m_old_P2
Definition qetshapeitem.h:149
void adjusteHandlerPos()
QetShapeItem::adjusteHandlerPos Adjust the position of the handler item.
Definition qetshapeitem.cpp:612
bool isClosed() const
Definition qetshapeitem.h:98
qreal m_old_yRadius
Definition qetshapeitem.h:163
int m_vector_index
Definition qetshapeitem.h:153
QPointF m_old_P1
Definition qetshapeitem.h:148
void setClosed(bool close)
QetShapeItem::setClosed Close this item, have effect only if this item is a polygon.
Definition qetshapeitem.cpp:178
QRectF rect() const
Definition qetshapeitem.h:94
QRectF rect
Definition qetshapeitem.h:42
QBrush brush
Definition qetshapeitem.h:41
void setP2(const QPointF &P2)
QetShapeItem::setP2 Set the second point of this item. If this item is a polyline,...
Definition qetshapeitem.cpp:106
ShapeType m_shapeType
ATTRIBUTES.
Definition qetshapeitem.h:143
QLineF line() const
Definition qetshapeitem.h:92
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
Definition qetshapeitem.cpp:364
virtual bool toDXF(const QString &filepath, const QPen &pen)
QetShapeItem::toDXF Draw this element to the dxf document.
Definition qetshapeitem.cpp:949
QPainterPath shape() const override
QetShapeItem::shape.
Definition qetshapeitem.cpp:261
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override
QetShapeItem::contextMenuEvent.
Definition qetshapeitem.cpp:458
qreal m_old_xRadius
Definition qetshapeitem.h:162
QPen pen() const
METHODS.
Definition qetshapeitem.h:78
qreal YRadius() const
Definition qetshapeitem.h:102
QPolygonF m_old_polygon
Definition qetshapeitem.h:151
bool setRect(const QRectF &rect)
QetShapeItem::setRect Set this item geometry to rect (only available if shape is a rectangle or an el...
Definition qetshapeitem.cpp:142
void setXRadius(qreal X)
Definition qetshapeitem.cpp:188
void setPen(const QPen &pen)
QetShapeItem::setPen Set the pen to use for draw the shape.
Definition qetshapeitem.cpp:78
void addHandler()
Definition qetshapeitem.cpp:567
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition qetshapeitem.h:157
qreal m_xRadius
Definition qetshapeitem.h:160
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
QetShapeItem::hoverLeaveEvent Handle hover leave event.
Definition qetshapeitem.cpp:358
qreal XRadius() const
Definition qetshapeitem.h:100
void setBrush(const QBrush &brush)
QetShapeItem::setBrush Set the brush to use for the fill the shape.
Definition qetshapeitem.cpp:91
QBrush brush() const
Definition qetshapeitem.h:80