|
Krita Source Code Documentation
|
#include <ShapeRotateStrategy.h>
Inheritance diagram for ShapeRotateStrategy:Public Member Functions | |
| KUndo2Command * | createCommand () override |
| void | finishInteraction (Qt::KeyboardModifiers modifiers) override |
| void | handleMouseMove (const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override |
| void | paint (QPainter &painter, const KoViewConverter &converter) override |
| ShapeRotateStrategy (KoToolBase *tool, KoSelection *selection, const QPointF &clicked, Qt::MouseButtons buttons) | |
| ~ShapeRotateStrategy () override | |
Public Member Functions inherited from KoInteractionStrategy | |
| virtual void | cancelInteraction () |
| KoInteractionStrategy (KoToolBase *parent) | |
| constructor | |
| KoToolBase * | tool () const |
| virtual | ~KoInteractionStrategy () |
| Destructor. | |
Private Member Functions | |
| void | rotateBy (qreal angle) |
Private Attributes | |
| QList< QTransform > | m_oldTransforms |
| QPointF | m_rotationCenter |
| QTransform | m_rotationMatrix |
| QPointF | m_start |
| QList< KoShape * > | m_transformedShapesAndSelection |
Additional Inherited Members | |
Protected Member Functions inherited from KoInteractionStrategy | |
| uint | decorationThickness () const |
| uint | grabSensitivity () const |
| Convenience function to get the global grab sensitivity. | |
| uint | handleRadius () const |
| Convenience function to get the global handle radius. | |
| KoInteractionStrategy (KoInteractionStrategyPrivate &) | |
| constructor | |
Protected Attributes inherited from KoInteractionStrategy | |
| KoInteractionStrategyPrivate * | d_ptr |
A strategy for the KoInteractionTool. This strategy is invoked when the user starts a rotate of a selection of objects, the strategy will then rotate the objects interactively and provide a command afterwards.
Definition at line 26 of file ShapeRotateStrategy.h.
| ShapeRotateStrategy::ShapeRotateStrategy | ( | KoToolBase * | tool, |
| KoSelection * | selection, | ||
| const QPointF & | clicked, | ||
| Qt::MouseButtons | buttons ) |
Constructor that starts to rotate the objects.
| tool | the parent tool which controls this strategy |
| clicked | the initial point that the user depressed (in pt). |
The outline of the selection should look as if it is also rotated, so we add it to the transformed shapes list.
Definition at line 23 of file ShapeRotateStrategy.cpp.
References KoShape::absolutePosition(), buttons(), KoToolBase::canvas(), KoFlake::Center, KoFlake::HotPosition, m_oldTransforms, m_rotationCenter, m_transformedShapesAndSelection, KoCanvasBase::resourceManager, KoSelection::selectedEditableShapes(), KoToolBase::setStatusText(), KoInteractionStrategy::tool(), and KoShape::transformation().
|
inlineoverride |
Definition at line 35 of file ShapeRotateStrategy.h.
|
overridevirtual |
For interactions that are undo-able this method should be implemented to return such a command. Implementations should return 0 otherwise.
Implements KoInteractionStrategy.
Definition at line 95 of file ShapeRotateStrategy.cpp.
References kundo2_i18n(), m_oldTransforms, m_transformedShapesAndSelection, KUndo2Command::setText(), and KoShape::transformation().
|
inlineoverridevirtual |
Override to make final changes to the data on the end of an interaction.
Implements KoInteractionStrategy.
Definition at line 39 of file ShapeRotateStrategy.h.
|
overridevirtual |
Extending classes should implement this method to update the selectedShapes based on the new mouse position.
| mouseLocation | the new location in pt |
| modifiers | OR-ed set of keys pressed. |
Implements KoInteractionStrategy.
Definition at line 47 of file ShapeRotateStrategy.cpp.
References M_PI, m_rotationCenter, m_start, and rotateBy().
|
overridevirtual |
Reimplement this if the action needs to draw a "blob" on the canvas; that is, a transient decoration like a rubber band.
Reimplemented from KoInteractionStrategy.
Definition at line 84 of file ShapeRotateStrategy.cpp.
References KoViewConverter::documentToView(), KoInteractionStrategy::handleRadius(), and m_rotationCenter.
|
private |
Definition at line 67 of file ShapeRotateStrategy.cpp.
References KoShape::applyAbsoluteTransformation(), KoShape::boundingRect(), m_rotationCenter, m_rotationMatrix, m_transformedShapesAndSelection, and KoShape::updateAbsolute().
|
private |
Definition at line 50 of file ShapeRotateStrategy.h.
|
private |
Definition at line 51 of file ShapeRotateStrategy.h.
|
private |
Definition at line 49 of file ShapeRotateStrategy.h.
|
private |
Definition at line 48 of file ShapeRotateStrategy.h.
Definition at line 52 of file ShapeRotateStrategy.h.