18#ifndef ELEMENTPRIMITIVEDECORATOR_H
19#define ELEMENTPRIMITIVEDECORATOR_H
23#include <QGraphicsObject>
49 enum {
Type = UserType + 2200 };
54 void paint(QPainter *,
55 const QStyleOptionGraphicsItem *,
56 QWidget * =
nullptr)
override;
58 void setItems(
const QList<QGraphicsItem *> &);
59 void setItems(
const QList<CustomElementPart *> &);
60 QList<CustomElementPart *>
items()
const;
80 QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
override;
91 void scaleItems(
const QRectF &,
const QRectF &);
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition customelementpart.h:40
The ElementEditionCommand class ElementEditionCommand is the base class for all commands classes invo...
Definition editorcommands.h:47
Definition elementprimitivedecorator.h:42
void setItems(const QList< QGraphicsItem * > &)
Definition elementprimitivedecorator.cpp:129
QList< CustomElementPart * > decorated_items_
Definition elementprimitivedecorator.h:108
void applyMovementToRect(int, const QPointF &, QRectF &)
Definition elementprimitivedecorator.cpp:377
void adjusteHandlerPos()
ElementPrimitiveDecorator::adjusteHandlerPos.
Definition elementprimitivedecorator.cpp:497
void keyPressEvent(QKeyEvent *) override
ElementPrimitiveDecorator::keyPressEvent.
Definition elementprimitivedecorator.cpp:262
bool mustSnapToGrid(QGraphicsSceneMouseEvent *)
Definition elementprimitivedecorator.cpp:692
void saveOriginalBoundingRect()
Definition elementprimitivedecorator.cpp:345
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
ElementPrimitiveDecorator::itemChange.
Definition elementprimitivedecorator.cpp:718
QPointF first_pos_
First point involved within the current resizing operation.
Definition elementprimitivedecorator.h:120
QPointF deltaForRoundScaling(const QRectF &, const QRectF &, qreal)
Definition elementprimitivedecorator.cpp:650
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
ElementPrimitiveDecorator::handlerMousePressEvent.
Definition elementprimitivedecorator.cpp:509
QVector< QPointF > getResizingsPoints() const
Definition elementprimitivedecorator.cpp:468
void adjustEffectiveBoundingRect()
Definition elementprimitivedecorator.cpp:354
int grid_step_x_
Grid horizontal step.
Definition elementprimitivedecorator.h:118
void init()
Definition elementprimitivedecorator.cpp:335
void startMovement()
Definition elementprimitivedecorator.cpp:365
QRectF modified_bounding_rect_
new bounding rect, after the user moved or resized items
Definition elementprimitivedecorator.h:111
QRectF boundingRect() const override
Definition elementprimitivedecorator.cpp:73
QRectF effective_bounding_rect_
actual, effective bounding rect – never shrinks
Definition elementprimitivedecorator.h:109
~ElementPrimitiveDecorator() override
Definition elementprimitivedecorator.cpp:44
QET::ScalingMethod scalingMethod(QGraphicsSceneMouseEvent *)
Definition elementprimitivedecorator.cpp:702
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
ElementPrimitiveDecorator::handlerMouseMoveEvent.
Definition elementprimitivedecorator.cpp:526
void snapPointToGrid(QPointF &) const
Definition elementprimitivedecorator.cpp:682
QPointF keys_movement_
Movement applied to our decorated items using the arrow keys.
Definition elementprimitivedecorator.h:124
int current_operation_square_
Definition elementprimitivedecorator.h:117
QPointF mouse_offset_
Offset between the mouse position and the point to be snapped to grid when moving selection.
Definition elementprimitivedecorator.h:122
void adjust()
Definition elementprimitivedecorator.cpp:168
QList< QGraphicsItem * > graphicsItems() const
Definition elementprimitivedecorator.cpp:153
void addHandler()
ElementPrimitiveDecorator::addHandler Add handlers for this item.
Definition elementprimitivedecorator.cpp:611
CustomElementPart * singleItem() const
Definition elementprimitivedecorator.cpp:420
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
ElementPrimitiveDecorator::sceneEventFilter.
Definition elementprimitivedecorator.cpp:748
void keyReleaseEvent(QKeyEvent *) override
ElementPrimitiveDecorator::keyReleaseEvent.
Definition elementprimitivedecorator.cpp:315
int grid_step_y_
Grid horizontal step.
Definition elementprimitivedecorator.h:119
void actionFinished(ElementEditionCommand *)
void mouseMoveEvent(QGraphicsSceneMouseEvent *) override
Definition elementprimitivedecorator.cpp:200
QRectF original_bounding_rect_
original bounding rect
Definition elementprimitivedecorator.h:110
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
ElementPrimitiveDecorator::paint Paint the contents of an item in local coordinates,...
Definition elementprimitivedecorator.cpp:91
bool moving_by_keys_
Whether we are currently moving our decorated items using the arrow keys.
Definition elementprimitivedecorator.h:123
void mousePressEvent(QGraphicsSceneMouseEvent *) override
Definition elementprimitivedecorator.cpp:179
QRectF internalBoundingRect() const
Definition elementprimitivedecorator.cpp:53
int m_vector_index
Definition elementprimitivedecorator.h:126
QList< CustomElementPart * > items() const
Definition elementprimitivedecorator.cpp:145
QPointF latest_pos_
Latest point involved within the current resizing operation.
Definition elementprimitivedecorator.h:121
void scaleItems(const QRectF &, const QRectF &)
Definition elementprimitivedecorator.cpp:446
@ Type
Definition elementprimitivedecorator.h:49
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
ElementPrimitiveDecorator::handlerMouseReleaseEvent.
Definition elementprimitivedecorator.cpp:581
QPointF snapConstPointToGrid(const QPointF &) const
Definition elementprimitivedecorator.cpp:668
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition elementprimitivedecorator.h:125
QRectF getSceneBoundingRect(QGraphicsItem *) const
Definition elementprimitivedecorator.cpp:462
void translateItems(const QPointF &)
Definition elementprimitivedecorator.cpp:431
int type() const override
Definition elementprimitivedecorator.h:57
void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override
Definition elementprimitivedecorator.cpp:232
void removeHandler()
ElementPrimitiveDecorator::removeHandler Remove the handlers of this item.
Definition elementprimitivedecorator.cpp:631
The ElementScene class This class is the canvas allowing the visual edition of an electrical element....
Definition elementscene.h:46
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:77