|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef ELEMENTPRIMITIVEDECORATOR_H
19 #define ELEMENTPRIMITIVEDECORATOR_H
21 #include <QGraphicsObject>
48 enum {
Type = UserType + 2200 };
53 void paint(QPainter *,
54 const QStyleOptionGraphicsItem *,
55 QWidget * =
nullptr)
override;
57 void setItems(
const QList<QGraphicsItem *> &);
58 void setItems(
const QList<CustomElementPart *> &);
59 QList<CustomElementPart *>
items()
const;
79 QVariant
itemChange(GraphicsItemChange change,
const QVariant &value)
override;
90 void scaleItems(
const QRectF &,
const QRectF &);
QList< CustomElementPart * > items() const
Definition: elementprimitivedecorator.cpp:142
@ NoOperation
Definition: qet.h:69
int grid_step_x_
Grid horizontal step.
Definition: elementprimitivedecorator.h:117
Definition: elementprimitivedecorator.h:41
void saveOriginalBoundingRect()
Definition: elementprimitivedecorator.cpp:340
@ Type
Definition: qetgraphicshandleritem.h:42
QList< QGraphicsItem * > graphicsItems() const
Definition: elementprimitivedecorator.cpp:149
void removeHandler()
ElementPrimitiveDecorator::removeHandler Remove the handlers of this item.
Definition: elementprimitivedecorator.cpp:621
void adjusteHandlerPos()
ElementPrimitiveDecorator::adjusteHandlerPos.
Definition: elementprimitivedecorator.cpp:487
int m_vector_index
Definition: elementprimitivedecorator.h:125
void adjustEffectiveBoundingRect()
Definition: elementprimitivedecorator.cpp:348
ElementPrimitiveDecorator(QGraphicsItem *=nullptr)
Definition: elementprimitivedecorator.cpp:33
void handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
ElementPrimitiveDecorator::handlerMouseMoveEvent.
Definition: elementprimitivedecorator.cpp:516
qreal round(qreal, qreal)
Definition: qet.cpp:537
CustomElementPart * singleItem() const
Definition: elementprimitivedecorator.cpp:412
~ElementPrimitiveDecorator() override
Definition: elementprimitivedecorator.cpp:42
QPointF latest_pos_
Latest point involved within the current resizing operation.
Definition: elementprimitivedecorator.h:120
void keyPressEvent(QKeyEvent *) override
ElementPrimitiveDecorator::keyPressEvent.
Definition: elementprimitivedecorator.cpp:257
@ ResizeFromBottomRightCorner
Definition: qet.h:77
QRectF effective_bounding_rect_
actual, effective bounding rect – never shrinks
Definition: elementprimitivedecorator.h:108
QRectF getSceneBoundingRect(QGraphicsItem *) const
Definition: elementprimitivedecorator.cpp:453
@ SnapScalingPointToGrid
snap the point used to define the new bounding rectangle to the grid
Definition: qet.h:83
@ FreeScaling
do not interfer with the default scaling process
Definition: qet.h:82
void actionFinished(ElementEditionCommand *)
void applyMovementToRect(int, const QPointF &, QRectF &)
Definition: elementprimitivedecorator.cpp:369
QPointF snapConstPointToGrid(const QPointF &) const
Definition: elementprimitivedecorator.cpp:658
QRectF modified_bounding_rect_
new bounding rect, after the user moved or resized items
Definition: elementprimitivedecorator.h:110
bool mustSnapToGrid(QGraphicsSceneMouseEvent *)
Definition: elementprimitivedecorator.cpp:680
QPointF first_pos_
First point involved within the current resizing operation.
Definition: elementprimitivedecorator.h:119
int type() const override
Definition: elementprimitivedecorator.h:56
void mouseMoveEvent(QGraphicsSceneMouseEvent *) override
Definition: elementprimitivedecorator.cpp:195
The ElementEditionCommand class ElementEditionCommand is the base class for all commands classes invo...
Definition: editorcommands.h:33
QPointF mouse_offset_
Offset between the mouse position and the point to be snapped to grid when moving selection.
Definition: elementprimitivedecorator.h:121
void adjust()
Definition: elementprimitivedecorator.cpp:163
QRectF original_bounding_rect_
original bounding rect
Definition: elementprimitivedecorator.h:109
void handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
ElementPrimitiveDecorator::handlerMouseReleaseEvent.
Definition: elementprimitivedecorator.cpp:571
@ ResizeFromTopLeftCorner
Definition: qet.h:70
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
ElementPrimitiveDecorator::sceneEventFilter.
Definition: elementprimitivedecorator.cpp:736
@ ResizeFromTopCenterCorner
Definition: qet.h:71
void init()
Definition: elementprimitivedecorator.cpp:330
QPointF deltaForRoundScaling(const QRectF &, const QRectF &, qreal)
Definition: elementprimitivedecorator.cpp:640
void scaleItems(const QRectF &, const QRectF &)
Definition: elementprimitivedecorator.cpp:437
void mousePressEvent(QGraphicsSceneMouseEvent *) override
Definition: elementprimitivedecorator.cpp:174
QList< CustomElementPart * > decorated_items_
Definition: elementprimitivedecorator.h:107
@ Type
Definition: elementprimitivedecorator.h:48
int current_operation_square_
Definition: elementprimitivedecorator.h:116
@ ResizeFromBottomCenterCorner
Definition: qet.h:76
@ ResizeFromTopRightCorner
Definition: qet.h:72
QET::ScalingMethod scalingMethod(QGraphicsSceneMouseEvent *)
Definition: elementprimitivedecorator.cpp:690
The QetGraphicsHandlerItem class This graphics item represents a point, destined to be used as an han...
Definition: qetgraphicshandleritem.h:37
Definition: editorcommands.h:99
void addHandler()
ElementPrimitiveDecorator::addHandler Add handlers for this item.
Definition: elementprimitivedecorator.cpp:601
@ MoveArea
Definition: qet.h:68
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *=nullptr) override
ElementPrimitiveDecorator::paint Paint the contents of an item in local coordinates,...
Definition: elementprimitivedecorator.cpp:88
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override
ElementPrimitiveDecorator::itemChange.
Definition: elementprimitivedecorator.cpp:706
void keyReleaseEvent(QKeyEvent *) override
ElementPrimitiveDecorator::keyReleaseEvent.
Definition: elementprimitivedecorator.cpp:310
bool moving_by_keys_
Whether we are currently moving our decorated items using the arrow keys.
Definition: elementprimitivedecorator.h:122
@ ResizeFromMiddleLeftCorner
Definition: qet.h:73
void handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
ElementPrimitiveDecorator::handlerMousePressEvent.
Definition: elementprimitivedecorator.cpp:499
void startMovement()
Definition: elementprimitivedecorator.cpp:358
int grid_step_y_
Grid horizontal step.
Definition: elementprimitivedecorator.h:118
QVector< QPointF > getResizingsPoints() const
Definition: elementprimitivedecorator.cpp:458
The CustomElementPart class This abstract class represents a primitive of the visual representation o...
Definition: customelementpart.h:40
QVector< QetGraphicsHandlerItem * > m_handler_vector
Definition: elementprimitivedecorator.h:124
void snapPointToGrid(QPointF &) const
Definition: elementprimitivedecorator.cpp:671
@ ResizeFromBottomLeftCorner
Definition: qet.h:75
ScalingMethod
Supported types of interactive scaling, typically for a single element primitive.
Definition: qet.h:81
@ RoundScaleRatios
adjust the scaling movement so that the induced scaling ratios are rounded
Definition: qet.h:84
@ ResizeFromMiddleRightCorner
Definition: qet.h:74
QRectF boundingRect() const override
Definition: elementprimitivedecorator.cpp:70
The ElementScene class This class is the canvas allowing the visual edition of an electrial element....
Definition: elementscene.h:40
static QVector< QetGraphicsHandlerItem * > handlerForPoint(const QVector< QPointF > &points, int size=10)
QetGraphicsHandlerItem::handlerForPoint.
Definition: qetgraphicshandleritem.cpp:87
void setItems(const QList< QGraphicsItem * > &)
Definition: elementprimitivedecorator.cpp:126
QRectF internalBoundingRect() const
Definition: elementprimitivedecorator.cpp:51
void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override
Definition: elementprimitivedecorator.cpp:227
void translateItems(const QPointF &)
Definition: elementprimitivedecorator.cpp:422
Definition: editorcommands.h:231
QPointF keys_movement_
Movement applied to our decorated items using the arrow keys.
Definition: elementprimitivedecorator.h:123