|
Krita Source Code Documentation
|
#include <CutThroughShapeStrategy.h>
Inheritance diagram for CutThroughShapeStrategy:Public Member Functions | |
| KUndo2Command * | createCommand () override |
| CutThroughShapeStrategy (KoToolBase *tool, KoSelection *selection, const QList< KoShape * > &allShapes, QPointF startPoint, const GutterWidthsConfig &width) | |
| void | finishInteraction (Qt::KeyboardModifiers modifiers) override |
| void | handleMouseMove (const QPointF &mouseLocation, Qt::KeyboardModifiers modifiers) override |
| void | paint (QPainter &painter, const KoViewConverter &converter) override |
| ~CutThroughShapeStrategy () override | |
Public Member Functions inherited from KoInteractionStrategy | |
| virtual void | cancelInteraction () |
| KoInteractionStrategy (KoToolBase *parent) | |
| constructor | |
| KoToolBase * | tool () const |
| virtual | ~KoInteractionStrategy () |
| Destructor. | |
Private Member Functions | |
| qreal | calculateLineAngle (QPointF start, QPointF end) |
| qreal | gutterWidthInDocumentCoordinates (qreal lineAngle) |
Private Attributes | |
| QList< KoShape * > | m_allShapes |
| QPointF | m_endPoint = QPointF() |
| QRectF | m_previousLineDirtyRect = QRectF() |
| QList< KoShape * > | m_selectedShapes |
| QPointF | m_startPoint = QPointF() |
| GutterWidthsConfig | m_width |
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 |
Definition at line 23 of file CutThroughShapeStrategy.h.
| CutThroughShapeStrategy::CutThroughShapeStrategy | ( | KoToolBase * | tool, |
| KoSelection * | selection, | ||
| const QList< KoShape * > & | allShapes, | ||
| QPointF | startPoint, | ||
| const GutterWidthsConfig & | width ) |
Definition at line 29 of file CutThroughShapeStrategy.cpp.
References m_allShapes, m_selectedShapes, and KoSelection::selectedEditableShapes().
|
override |
Definition at line 39 of file CutThroughShapeStrategy.cpp.
|
private |
Definition at line 356 of file CutThroughShapeStrategy.cpp.
References kisRadiansToDegrees(), and KisAlgebra2D::wrapValue().
|
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 44 of file CutThroughShapeStrategy.cpp.
|
overridevirtual |
Override to make final changes to the data on the end of an interaction.
Implements KoInteractionStrategy.
Definition at line 87 of file CutThroughShapeStrategy.cpp.
References KoShape::absoluteTransformation(), KoCanvasBase::addCommand(), KoShape::background(), KoPathShape::boundingRect(), calculateLineAngle(), KoToolBase::canvas(), KisAlgebra2D::createRectFromCorners(), KoPathShape::createShapeFromPainterPath(), KisAlgebra2D::cropLineToRect(), eps, KisAlgebra2D::getLineSegmentCrossingLineIndexes(), KisAlgebra2D::getParallelLines(), KisAlgebra2D::getPathsFromRectangleCutThrough(), gutterWidthInDocumentCoordinates(), KisCanvas2::image(), KIS_SAFE_ASSERT_RECOVER_RETURN, kisGrowRect(), kundo2_i18n(), m_allShapes, m_endPoint, m_previousLineDirtyRect, m_selectedShapes, m_startPoint, KoShape::outline(), KoShape::parent(), KritaUtils::pathShapeBooleanSpaceWorkaround(), KoCanvasBase::selectedShapesProxy(), KisCanvas2::selectedShapesProxy, KoShape::setBackground(), KoShape::setStroke(), KoShape::setZIndex(), KoCanvasBase::shapeController, KoShape::stroke(), KoInteractionStrategy::tool(), KoCanvasBase::updateCanvas(), and KoShape::zIndex().
|
private |
Definition at line 347 of file CutThroughShapeStrategy.cpp.
References KoToolBase::canvas(), KisCanvas2::coordinatesConverter, KisCoordinatesConverter::imageToDocument(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, m_width, KoInteractionStrategy::tool(), and GutterWidthsConfig::widthForAngleInPixels().
|
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 72 of file CutThroughShapeStrategy.cpp.
References KisAlgebra2D::accumulateBounds(), calculateLineAngle(), KoToolBase::canvas(), gutterWidthInDocumentCoordinates(), kisGrowRect(), m_endPoint, m_previousLineDirtyRect, m_startPoint, snapEndPoint(), KoInteractionStrategy::tool(), and KoCanvasBase::updateCanvas().
|
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 280 of file CutThroughShapeStrategy.cpp.
References calculateLineAngle(), KisAlgebra2D::directionBetweenPoints(), KoViewConverter::documentToView(), KisAlgebra2D::getParallelLines(), gutterWidthInDocumentCoordinates(), kisRadiansToDegrees(), m_endPoint, and m_startPoint.
Definition at line 49 of file CutThroughShapeStrategy.h.
|
private |
Definition at line 46 of file CutThroughShapeStrategy.h.
|
private |
Definition at line 47 of file CutThroughShapeStrategy.h.
Definition at line 48 of file CutThroughShapeStrategy.h.
|
private |
Definition at line 45 of file CutThroughShapeStrategy.h.
|
private |
Definition at line 50 of file CutThroughShapeStrategy.h.