|
Krita Source Code Documentation
|
#include <KoCreatePathTool.h>
Inheritance diagram for KoCreatePathTool:Public Slots | |
| void | activate (const QSet< KoShape * > &shapes) override |
| reimplemented | |
| void | canvasResourceChanged (int key, const QVariant &res) override |
| reimplemented | |
| void | deactivate () override |
| reimplemented | |
Public Slots inherited from KoToolBase | |
| virtual void | activate (const QSet< KoShape * > &shapes) |
| virtual void | canvasResourceChanged (int key, const QVariant &res) |
| virtual void | deactivate () |
| virtual void | documentResourceChanged (int key, const QVariant &res) |
| virtual void | repaintDecorations () |
| virtual void | requestRedoDuringStroke () |
| virtual void | requestStrokeCancellation () |
| virtual void | requestStrokeEnd () |
| virtual void | requestUndoDuringStroke () |
| void | setStatusText (const QString &statusText) |
| void | updateOptionsWidgetIcons () |
Signals | |
| void | sigUpdateAutoSmoothCurvesGUI (bool value) |
Signals inherited from KoToolBase | |
| void | activateTool (const QString &id) |
| void | cursorChanged (const QCursor &cursor) |
| void | selectionChanged (bool hasSelection) |
| void | statusTextChanged (const QString &statusText) |
| void | textModeChanged (bool inTextMode) |
Public Member Functions | |
| QRectF | decorationsRect () const override |
| KoCreatePathTool (KoCanvasBase *canvas) | |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| reimplemented | |
| void | mouseMoveEvent (KoPointerEvent *event) override |
| reimplemented | |
| void | mousePressEvent (KoPointerEvent *event) override |
| reimplemented | |
| void | mouseReleaseEvent (KoPointerEvent *event) override |
| reimplemented | |
| void | paint (QPainter &painter, const KoViewConverter &converter) override |
| reimplemented | |
| bool | pathStarted () const |
| void | setEnableClosePathShortcut (bool value) |
| bool | tryMergeInPathShape (KoPathShape *pathShape) |
| ~KoCreatePathTool () override | |
Public Member Functions inherited from KoToolBase | |
| QAction * | action (const QString &name) const |
| KoCanvasBase * | canvas () const |
| Returns the canvas the tool is working on. | |
| virtual void | copy () const |
| QCursor | cursor () const |
| return the last emitted cursor | |
| virtual void | customMoveEvent (KoPointerEvent *event) |
| virtual void | customPressEvent (KoPointerEvent *event) |
| virtual void | customReleaseEvent (KoPointerEvent *event) |
| virtual void | cut () |
| int | decorationThickness () const |
| decorationThickness The minimum thickness for tool decoration lines, this is derived from the screen magnification, thus the HiDPI settings. Note: to use this effectively, also set the pen to isCosmetic(true); | |
| virtual void | deleteSelection () |
| virtual void | deselect () |
| deselect the tool should clear the selection if it has one. | |
| virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
| virtual void | dragMoveEvent (QDragMoveEvent *event, const QPointF &point) |
| virtual void | dropEvent (QDropEvent *event, const QPointF &point) |
| virtual void | explicitUserStrokeEndRequest () |
| explicitUserStrokeEndRequest is called by the input manager when the user presses Enter key or any equivalent. This callback comes before requestStrokeEnd(), which comes from a different source. | |
| KoToolFactoryBase * | factory () const |
| virtual void | focusInEvent (QFocusEvent *event) |
| virtual void | focusOutEvent (QFocusEvent *event) |
| virtual bool | hasSelection () |
| virtual void | inputMethodEvent (QInputMethodEvent *event) |
| virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
| bool | isInTextMode () const |
| bool | isOpacityPresetMode () const |
| virtual void | keyPressEvent (QKeyEvent *event) |
| virtual void | keyReleaseEvent (QKeyEvent *event) |
| KoToolBase (KoCanvasBase *canvas) | |
| bool | maskSyntheticEvents () const |
| virtual void | mouseTripleClickEvent (KoPointerEvent *event) |
| QList< QPointer< QWidget > > | optionWidgets () |
| virtual bool | paste () |
| virtual QMenu * | popupActionsMenu () |
| virtual KisPopupWidgetInterface * | popupWidget () |
| virtual bool | selectAll () |
| selectAll select all data the tool can select. | |
| virtual KoToolSelection * | selection () |
| Q_INVOKABLE QString | toolId () const |
| virtual bool | wantsAutoScroll () const |
| ~KoToolBase () override | |
Protected Member Functions | |
| virtual void | addPathShape (KoPathShape *pathShape) |
| bool | addPathShapeImpl (KoPathShape *pathShape, bool tryMergeOnly) |
| virtual void | beginShape () |
| void | cancelPath () |
| QList< QPointer< QWidget > > | createOptionWidgets () override |
| reimplemented | |
| void | endPath () |
| void | endPathWithoutLastPoint () |
| virtual void | endShape () |
| void | handleMouseMove (const KoPointerEvent *event, bool considerDrag) |
| virtual void | paintPath (KoPathShape &pathShape, QPainter &painter, const KoViewConverter &converter) |
| void | removeLastPoint () |
Protected Member Functions inherited from KoToolBase | |
| virtual QWidget * | createOptionWidget () |
| int | grabSensitivity () const |
| Convenience function to get the current grab sensitivity. | |
| qreal | handleDocRadius () const |
| QRectF | handleGrabRect (const QPointF &position) const |
| QRectF | handlePaintRect (const QPointF &position) const |
| int | handleRadius () const |
| Convenience function to get the current handle radius. | |
| bool | isActivated () const |
| KoToolBase (KoToolBasePrivate &dd) | |
| KoPointerEvent * | lastDeliveredPointerEvent () const |
| void | setAbstractResource (KoAbstractCanvasResourceInterfaceSP abstractResource) |
| void | setConverter (KoDerivedResourceConverterSP converter) |
| void | setIsOpacityPresetMode (bool value) |
| void | setMaskSyntheticEvents (bool value) |
| void | setTextMode (bool value) |
| QHash< int, KoAbstractCanvasResourceInterfaceSP > | toolAbstractResources () |
| QHash< int, KoDerivedResourceConverterSP > | toolConverters () |
| void | useCursor (const QCursor &cursor) |
Private Member Functions | |
| void | angleSnapChanged (int)) Q_PRIVATE_SLOT(d_func() |
| Q_PRIVATE_SLOT (d_func(), void angleDeltaChanged(qreal)) Q_PRIVATE_SLOT(d_func() | |
Additional Inherited Members | |
Protected Attributes inherited from KoToolBase | |
| KoToolBasePrivate * | d_ptr |
Tool for creating path shapes.
Definition at line 28 of file KoCreatePathTool.h.
|
explicit |
Constructor for the tool that allows you to create new paths by hand.
| canvas | the canvas this tool will be working for. |
Definition at line 34 of file KoCreatePathTool.cpp.
|
override |
Definition at line 39 of file KoCreatePathTool.cpp.
reimplemented
Definition at line 452 of file KoCreatePathTool.cpp.
References KoToolBase::activate(), KoToolBase::canvas(), KoToolBase::decorationThickness(), KoToolBase::handleRadius(), KoToolBase::repaintDecorations(), KoSnapGuide::reset(), KoCanvasBase::snapGuide, and KoToolBase::useCursor().
|
protectedvirtual |
Add path shape to document. This method can be overridden and change the behaviour of the tool. In that case the subclass takes ownership of pathShape. It gets only called if there are two or more points in the path.
Reimplemented in __KisToolPathLocalTool, __KisToolSelectPathLocalTool, and KisToolPathLocalTool.
Definition at line 550 of file KoCreatePathTool.cpp.
References addPathShapeImpl().
|
protected |
Definition at line 493 of file KoCreatePathTool.cpp.
References KoCanvasBase::addCommand(), KoShape::background(), KoPathShape::boundingRect(), KoToolBase::canvas(), endShape(), KIS_SAFE_ASSERT_RECOVER, KoPathShape::normalize(), KoShapeManager::selection, KoToolBase::selection(), KoShape::setBackground(), KoShape::setStroke(), KoCanvasBase::shapeController, KoCanvasBase::shapeManager(), KoShape::stroke(), and KoCanvasBase::updateCanvas().
|
private |
|
inlineprotectedvirtual |
Use these methods in subclassed to notify when the user starts and finishes making a shape, and override to be notified
Reimplemented in __KisToolSelectPathLocalTool, and KisToolPathLocalTool.
Definition at line 85 of file KoCreatePathTool.h.
|
protected |
Definition at line 420 of file KoCreatePathTool.cpp.
References endShape(), and KoToolBase::repaintDecorations().
|
overrideslot |
reimplemented
Definition at line 475 of file KoCreatePathTool.cpp.
References KoCanvasResource::DecorationThickness, and KoCanvasResource::HandleRadius.
reimplemented
Reimplemented from KoToolBase.
Definition at line 555 of file KoCreatePathTool.cpp.
References angleSnapChanged(), connect(), KisAngleSelector::FlipOptionsMode_MenuButton, KisAngleSelector::setAngle(), KisAngleSelector::setDecimals(), KisAngleSelector::setFlipOptionsMode(), KisAngleSelector::setRange(), and sigUpdateAutoSmoothCurvesGUI().
|
overrideslot |
reimplemented
Definition at line 469 of file KoCreatePathTool.cpp.
References cancelPath(), and KoToolBase::deactivate().
|
overridevirtual |
Reimplemented from KoToolBase.
Definition at line 43 of file KoCreatePathTool.cpp.
References KoSnapGuide::boundingRect(), KoToolBase::canvas(), KoToolBase::handleDocRadius(), KoToolBase::handlePaintRect(), kisGrowRect(), pathStarted(), and KoCanvasBase::snapGuide.
|
protected |
Definition at line 394 of file KoCreatePathTool.cpp.
References endShape(), and KoToolBase::repaintDecorations().
|
protected |
Definition at line 406 of file KoCreatePathTool.cpp.
References endShape(), and KoToolBase::repaintDecorations().
|
inlineprotectedvirtual |
Reimplemented in __KisToolSelectPathLocalTool, and KisToolPathLocalTool.
Definition at line 86 of file KoCreatePathTool.h.
|
protected |
Definition at line 277 of file KoCreatePathTool.cpp.
References KoPointerEvent::buttons(), KoToolBase::canvas(), KoToolBase::handleGrabRect(), KoPathPointTypeCommand::makeCubicPointSmooth(), KoPointerEvent::modifiers(), pathStarted(), KoPathPoint::point, KoPointerEvent::point, KoToolBase::repaintDecorations(), KoPathPoint::setControlPoint1(), KoPathPoint::setControlPoint2(), KoSnapGuide::snap(), and KoCanvasBase::snapGuide.
|
overridevirtual |
reimplemented
Reimplemented from KoToolBase.
Definition at line 264 of file KoCreatePathTool.cpp.
References KoToolBase::canvas(), endPathWithoutLastPoint(), KoToolBase::handlePaintRect(), KoPointerEvent::point, and KoCanvasBase::updateCanvas().
|
overridevirtual |
reimplemented
Implements KoToolBase.
Definition at line 272 of file KoCreatePathTool.cpp.
References handleMouseMove().
|
overridevirtual |
reimplemented
Implements KoToolBase.
Definition at line 142 of file KoCreatePathTool.cpp.
References KoSnapGuide::addCustomSnapStrategy(), beginShape(), KoPointerEvent::button(), KoToolBase::canvas(), endPath(), endPathWithoutLastPoint(), KoToolBase::handleGrabRect(), handleMouseMove(), KoPointerEvent::isTouchEvent(), KoPathShapeId, KoPointerEvent::modifiers(), KoPathShape::moveTo(), pathStarted(), KoPointerEvent::point, removeLastPoint(), KoToolBase::repaintDecorations(), KoCanvasBase::resourceManager, KoSnapGuide::setAdditionalEditedShape(), KoShape::setShapeId(), KoShape::setStroke(), KoCanvasResource::Size, KoSnapGuide::snap(), KoCanvasBase::snapGuide, and KoCanvasBase::updateCanvas().
|
overridevirtual |
reimplemented
Implements KoToolBase.
Definition at line 346 of file KoCreatePathTool.cpp.
References KoPathPoint::activeControlPoint1, KoPathPoint::activeControlPoint2, KoPointerEvent::buttons(), KoToolBase::canvas(), KoPathPoint::controlPoint1, KoPathPoint::controlPoint2, endPath(), KoPathPoint::IsSymmetric, KoPathPointTypeCommand::makeCubicPointSmooth(), KoPathPoint::point, KoPointerEvent::point, qFuzzyCompare(), KoToolBase::repaintDecorations(), KoSnapGuide::setIgnoredPathPoints(), KoPathPoint::setProperty(), and KoCanvasBase::snapGuide.
|
overridevirtual |
reimplemented
Implements KoToolBase.
Definition at line 77 of file KoCreatePathTool.cpp.
References KoPathPoint::ControlPoint2, KoShape::createHandlePainterHelperView(), paintPath(), and pathStarted().
|
protectedvirtual |
This method is called to paint the path. Decorations are drawn by KoCreatePathTool afterwards.
Reimplemented in __KisToolPathLocalTool, __KisToolSelectPathLocalTool, and KisToolPathLocalTool.
Definition at line 124 of file KoCreatePathTool.cpp.
References KoShape::absoluteTransformation(), KoViewConverter::documentToView(), KoPathShape::paint(), and KoShape::stroke().
| bool KoCreatePathTool::pathStarted | ( | ) | const |
Returns true if path has been started
Definition at line 247 of file KoCreatePathTool.cpp.
|
private |
|
protected |
Definition at line 434 of file KoCreatePathTool.cpp.
References KoToolBase::repaintDecorations().
| void KoCreatePathTool::setEnableClosePathShortcut | ( | bool | value | ) |
Definition at line 258 of file KoCreatePathTool.cpp.
References value().
|
signal |
| bool KoCreatePathTool::tryMergeInPathShape | ( | KoPathShape * | pathShape | ) |
Definition at line 253 of file KoCreatePathTool.cpp.
References addPathShapeImpl().