|
Krita Source Code Documentation
|
#include <KisToolOutlineBase.h>
Inheritance diagram for KisToolOutlineBase:Public Types | |
| enum | ToolType { PAINT , SELECT } |
Public Types inherited from KisTool | |
| enum | { FLAG_USES_CUSTOM_PRESET =0x01 , FLAG_USES_CUSTOM_COMPOSITEOP =0x02 , FLAG_USES_CUSTOM_SIZE =0x04 } |
| enum | AlternateAction { ChangeSize = AlternateChangeSize , ChangeSizeSnap = AlternateChangeSizeSnap , SampleFgNode = AlternateSampleFgNode , SampleBgNode = AlternateSampleBgNode , SampleFgImage = AlternateSampleFgImage , SampleBgImage = AlternateSampleBgImage , Secondary = AlternateSecondary , Third = AlternateThird , Fourth = AlternateFourth , Fifth = AlternateFifth , NONE = 10000 } |
| enum | NodePaintAbility { VECTOR , CLONE , PAINT , UNPAINTABLE , MYPAINTBRUSH_UNPAINTABLE } |
| enum | ToolAction { Primary , AlternateChangeSize , AlternateChangeSizeSnap , AlternateSampleFgNode , AlternateSampleBgNode , AlternateSampleFgImage , AlternateSampleBgImage , AlternateSecondary , AlternateThird , AlternateFourth , AlternateFifth , Alternate_NONE = 10000 } |
Public Slots | |
| void | activate (const QSet< KoShape * > &shapes) override |
| void | deactivate () override |
| void | requestStrokeCancellation () override |
| void | requestStrokeEnd () override |
| void | undoLastPoint () |
Public Slots inherited from KisToolShape | |
| void | activate (const QSet< KoShape * > &shapes) override |
| virtual void | fillSettingChanged (int value) |
| virtual void | outlineSettingChanged (int value) |
| virtual void | patternRotationSettingChanged (qreal value) |
| virtual void | patternScaleSettingChanged (qreal value) |
Public Slots inherited from KisToolPaint | |
| void | activate (const QSet< KoShape * > &shapes) override |
| void | deactivate () override |
Public Slots inherited from KisTool | |
| void | activate (const QSet< KoShape * > &shapes) override |
| void | canvasResourceChanged (int key, const QVariant &res) override |
| void | deactivate () override |
| virtual void | updateSettingsViews () |
Public Slots inherited from KoToolBase | |
| virtual void | activate (const QSet< KoShape * > &shapes) |
| 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 () |
Public Member Functions | |
| void | beginPrimaryAction (KoPointerEvent *event) override |
| void | continuePrimaryAction (KoPointerEvent *event) override |
| void | endPrimaryAction (KoPointerEvent *event) override |
| bool | eventFilter (QObject *obj, QEvent *event) override |
| bool | hasUserInteractionRunning () const |
| void | keyPressEvent (QKeyEvent *event) override |
| void | keyReleaseEvent (QKeyEvent *event) override |
| KisToolOutlineBase (KoCanvasBase *canvas, ToolType type, const QCursor &cursor=KisCursor::load("tool_outline_selection_cursor.png", 6, 6)) | |
| void | mouseMoveEvent (KoPointerEvent *event) override |
| void | paint (QPainter &gc, const KoViewConverter &converter) override |
| KisPopupWidgetInterface * | popupWidget () override |
| ~KisToolOutlineBase () override | |
Public Member Functions inherited from KisToolShape | |
| int | flags () const override |
| KisToolShape (KoCanvasBase *canvas, const QCursor &cursor) | |
| ~KisToolShape () override | |
Public Member Functions inherited from KisToolPaint | |
| KisToolPaint (KoCanvasBase *canvas, const QCursor &cursor) | |
| void | mouseMoveEvent (KoPointerEvent *event) override |
| void | mousePressEvent (KoPointerEvent *event) override |
| void | mouseReleaseEvent (KoPointerEvent *event) override |
| KisPopupWidgetInterface * | popupWidget () override |
| ~KisToolPaint () override | |
Public Member Functions inherited from KisTool | |
| virtual bool | alternateActionSupportsHiResEvents (AlternateAction action) const |
| virtual void | beginAlternateDoubleClickAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | beginPrimaryDoubleClickAction (KoPointerEvent *event) |
| void | deleteSelection () override |
| bool | isActive () const |
| KisTool (KoCanvasBase *canvas, const QCursor &cursor) | |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| void | mouseTripleClickEvent (KoPointerEvent *event) override |
| virtual void | newActivationWithExternalSource (KisPaintDeviceSP externalSource) |
| newActivationWithExternalSource Makes sure that the tool is active and starts a new stroke, which will be able to access the pixels from the specified external source. | |
| KisTool::NodePaintAbility | nodePaintAbility () |
| virtual bool | primaryActionSupportsHiResEvents () const |
| virtual bool | supportsPaintingAssistants () const |
| ~KisTool () override | |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
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 () |
| virtual QRectF | decorationsRect () const |
| 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 | 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 |
| KoToolBase (KoCanvasBase *canvas) | |
| bool | maskSyntheticEvents () const |
| QList< QPointer< QWidget > > | optionWidgets () |
| virtual bool | paste () |
| virtual QMenu * | popupActionsMenu () |
| 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 | finishOutline (const QVector< QPointF > &points)=0 |
Protected Member Functions inherited from KisToolShape | |
| void | addPathShape (KoPathShape *pathShape, const KUndo2MagicString &name) |
| void | addShape (KoShape *shape) |
| virtual void | beginShape () |
| QWidget * | createOptionWidget () override |
| qreal | currentStrokeWidth () const |
| virtual void | endShape () |
| KisToolShapeUtils::FillStyle | fillStyle () |
| QTransform | fillTransform () |
| ShapeAddInfo | shouldAddShape (KisNodeSP currentNode) const |
| KisToolShapeUtils::StrokeStyle | strokeStyle () |
Protected Member Functions inherited from KisToolPaint | |
| void | activateAlternateAction (AlternateAction action) override |
| void | activatePrimaryAction () override |
| void | addOptionWidgetLayout (QLayout *layout) |
| Add the tool-specific layout to the default option widget layout. | |
| virtual void | addOptionWidgetOption (QWidget *control, QWidget *label=nullptr) |
| Add a widget and a label to the current option widget layout. | |
| void | beginAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| void | canvasResourceChanged (int key, const QVariant &v) override |
| void | continueAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| void | deactivateAlternateAction (AlternateAction action) override |
| void | deactivatePrimaryAction () override |
| void | enableControl (QWidget *control, bool value) |
| void | endAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| virtual KisOptimizedBrushOutline | getOutlinePath (const QPointF &documentPos, const KoPointerEvent *event, KisPaintOpSettings::OutlineMode outlineMode) |
| bool | isEraser () const |
| bool | isOutlineEnabled () const |
| bool | isOutlineVisible () const |
| void | paint (QPainter &gc, const KoViewConverter &converter) override |
| virtual QString | quickHelp () const |
| virtual void | requestUpdateOutline (const QPointF &outlineDocPoint, const KoPointerEvent *event) |
| void | setMode (ToolMode mode) override |
| void | setOutlineEnabled (bool enabled) |
| void | setOutlineVisible (bool visible) |
| void | setSupportOutline (bool supportOutline) |
| void | showControl (QWidget *control, bool value) |
Protected Member Functions inherited from KisTool | |
| bool | blockUntilOperationsFinished () |
| void | blockUntilOperationsFinishedForced () |
| QPointF | convertDocumentToWidget (const QPointF &pt) |
| QPoint | convertToImagePixelCoordFloored (KoPointerEvent *e) |
| QPointF | convertToPixelCoord (const QPointF &pt) |
| QPointF | convertToPixelCoord (KoPointerEvent *e) |
| QPointF | convertToPixelCoordAndAlignOnWidget (const QPointF &pt) |
| QPointF | convertToPixelCoordAndSnap (const QPointF &pt, const QPointF &offset=QPointF()) |
| QPointF | convertToPixelCoordAndSnap (KoPointerEvent *e, const QPointF &offset=QPointF(), bool useModifiers=true) |
| QRectF | convertToPt (const QRectF &rect) |
| qreal | convertToPt (qreal value) |
| KoColor | currentBgColor () |
| KoColor | currentFgColor () |
| KisFilterConfigurationSP | currentGenerator () |
| KoAbstractGradientSP | currentGradient () |
| KisImageWSP | currentImage () |
| KisNodeSP | currentNode () const |
| KisPaintOpPresetSP | currentPaintOpPreset () |
| KoPatternSP | currentPattern () |
| QCursor | cursor () const |
| KisImageWSP | image () const |
| virtual bool | listeningToModifiers () |
| virtual void | listenToModifiers (bool listen) |
| virtual ToolMode | mode () const |
| bool | nodeEditable () |
| Checks checks if the current node is editable. | |
| bool | overrideCursorIfNotEditable () |
| Override the cursor appropriately if current node is not editable. | |
| void | paintToolOutline (QPainter *painter, const KisOptimizedBrushOutline &path) |
| KisOptimizedBrushOutline | pixelToView (const KisOptimizedBrushOutline &path) const |
| QPainterPath | pixelToView (const QPainterPath &pixelPath) const |
| Convert a pixel path into a view path. | |
| QPointF | pixelToView (const QPoint &pixelCoord) const |
| QPointF | pixelToView (const QPointF &pixelCoord) const |
| Convert a floating point pixel coordinate into a view coordinate. | |
| QPolygonF | pixelToView (const QPolygonF &pixelPolygon) const |
| Convert a pixel polygon into a view path. | |
| QRectF | pixelToView (const QRectF &pixelRect) const |
| Convert a pixel rectangle into a view rectangle. | |
| KisNodeList | selectedNodes () const |
| bool | selectionEditable () |
| Checks checks if the selection is editable, only applies to local selection as global selection is always editable. | |
| void | setCursor (const QCursor &cursor) |
| void | updateCanvasPixelRect (const QRectF &pixelRect) |
| Update the canvas for the given rectangle in image pixel coordinates. | |
| void | updateCanvasViewRect (const QRectF &viewRect) |
| Update the canvas for the given rectangle in view coordinates. | |
| QPointF | viewToPixel (const QPointF &viewCoord) const |
| QPointF | widgetCenterInWidgetPixels () |
Protected Member Functions inherited from KoToolBase | |
| virtual QList< QPointer< QWidget > > | createOptionWidgets () |
| 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 | cancelStroke () |
| QRectF | dragBoundingRect () |
| void | endStroke () |
| void | installBlockActionGuard () |
| void | uninstallBlockActionGuard () |
| void | updateCanvas () |
| void | updateContinuedMode () |
| void | updateFeedback () |
Private Attributes | |
| QScopedPointer< KisInputActionGroupsMaskGuard > | m_blockModifyingActionsGuard |
| bool | m_continuedMode |
| bool | m_hasUserInteractionRunning |
| QPointF | m_lastCursorPos |
| int | m_numberOfContinuedModePoints |
| QPainterPath | m_paintPath |
| QVector< QPointF > | m_points |
| ToolType | m_type |
Static Private Attributes | |
| static constexpr int | FEEDBACK_LINE_WIDTH {2} |
Definition at line 18 of file KisToolOutlineBase.h.
| Enumerator | |
|---|---|
| PAINT | |
| SELECT | |
Definition at line 23 of file KisToolOutlineBase.h.
| KisToolOutlineBase::KisToolOutlineBase | ( | KoCanvasBase * | canvas, |
| ToolType | type, | ||
| const QCursor & | cursor = KisCursor::load("tool_outline_selection_cursor.png", 6, 6) ) |
Definition at line 25 of file KisToolOutlineBase.cpp.
|
override |
Definition at line 33 of file KisToolOutlineBase.cpp.
Definition at line 73 of file KisToolOutlineBase.cpp.
References KoToolBase::action(), KisToolShape::activate(), KisInputManager::attachPriorityEventFilter(), Private::canvas, connect(), and undoLastPoint().
|
overridevirtual |
Called by KisToolProxy when a primary action for the tool is started. The event stores the original event that started the stroke. The event is accepted by default. If the tool decides to ignore this particular action (e.g. when the node is not editable), it should call event->ignore(). Then no further continuePrimaryAction() or endPrimaryAction() will be called until the next user action.
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectOutlineLocal >.
Definition at line 156 of file KisToolOutlineBase.cpp.
References KisToolShape::beginShape(), Private::canvas, KisTool::CLONE, KisTool::convertToPixelCoord(), KisTool::convertToPixelCoordAndSnap(), koIcon, m_continuedMode, m_hasUserInteractionRunning, m_numberOfContinuedModePoints, m_points, m_type, KisTool::MYPAINTBRUSH_UNPAINTABLE, KisTool::nodeEditable(), KisTool::nodePaintAbility(), PAINT, KisTool::PAINT_MODE, SELECT, KisTool::selectionEditable(), KisToolPaint::setMode(), KisViewManager::showFloatingMessage(), KisTool::UNPAINTABLE, and KisCanvas2::viewManager().
|
private |
Definition at line 282 of file KisToolOutlineBase.cpp.
References KisToolShape::endShape(), hasUserInteractionRunning(), KisTool::HOVER_MODE, m_hasUserInteractionRunning, m_points, KisToolPaint::setMode(), and uninstallBlockActionGuard().
|
overridevirtual |
Called by KisToolProxy when the primary action is in progress of pointer movement. If the tool has ignored the event in beginPrimaryAction(), this method will not be called.
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectOutlineLocal >.
Definition at line 193 of file KisToolOutlineBase.cpp.
References CHECK_MODE_SANITY_OR_RETURN, KisTool::convertToPixelCoord(), m_points, KisTool::PAINT_MODE, and updateFeedback().
|
overrideslot |
Definition at line 84 of file KisToolOutlineBase.cpp.
References cancelStroke(), Private::canvas, KoToolBase::deactivate(), KisInputManager::detachPriorityEventFilter(), KisCanvas2::globalInputManager(), KIS_ASSERT_RECOVER_RETURN, m_continuedMode, and KisCanvas2::updateCanvas().
|
private |
Definition at line 249 of file KisToolOutlineBase.cpp.
References FEEDBACK_LINE_WIDTH, kisGrowRect(), m_lastCursorPos, m_points, and KisTool::pixelToView().
|
overridevirtual |
Called by KisToolProxy when the primary action is being finished, that is while mouseRelease or tabletRelease event. If the tool has ignored the event in beginPrimaryAction(), this method will not be called.
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectOutlineLocal >.
Definition at line 202 of file KisToolOutlineBase.cpp.
References cancelStroke(), CHECK_MODE_SANITY_OR_RETURN, endStroke(), KisTool::HOVER_MODE, m_continuedMode, KisTool::PAINT_MODE, KisToolPaint::setMode(), and KoPointerEvent::spontaneous().
|
private |
Definition at line 268 of file KisToolOutlineBase.cpp.
References KisToolShape::endShape(), finishOutline(), hasUserInteractionRunning(), KisTool::HOVER_MODE, m_hasUserInteractionRunning, m_points, KisToolPaint::setMode(), and uninstallBlockActionGuard().
|
override |
Definition at line 109 of file KisToolOutlineBase.cpp.
References m_points, and undoLastPoint().
|
protectedpure virtual |
Implemented in KisToolSelectOutline, and KisLassoEnclosingProducer.
| bool KisToolOutlineBase::hasUserInteractionRunning | ( | ) | const |
Definition at line 263 of file KisToolOutlineBase.cpp.
References m_hasUserInteractionRunning.
|
private |
Definition at line 305 of file KisToolOutlineBase.cpp.
References Private::canvas, m_blockModifyingActionsGuard, ToolInvoactionActionGroup, and ViewTransformActionGroup.
|
overridevirtual |
Called when a key is pressed. Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
| event | state and reason of this key press |
Reimplemented from KoToolBase.
Reimplemented in KisToolSelectBase< __KisToolSelectOutlineLocal >.
Definition at line 36 of file KisToolOutlineBase.cpp.
References installBlockActionGuard(), KoToolBase::keyPressEvent(), m_continuedMode, KisTool::mode(), and KisTool::PAINT_MODE.
|
overridevirtual |
Called when a key is released Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
| event | state and reason of this key release |
Reimplemented from KoToolBase.
Reimplemented in KisToolSelectBase< __KisToolSelectOutlineLocal >.
Definition at line 46 of file KisToolOutlineBase.cpp.
References endStroke(), KoToolBase::keyReleaseEvent(), m_continuedMode, KisTool::mode(), and KisTool::PAINT_MODE.
|
overridevirtual |
Called when the mouse or stylus moved over the canvas. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus move |
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectOutlineLocal >.
Definition at line 58 of file KisToolOutlineBase.cpp.
References KisTool::convertToPixelCoord(), KisTool::convertToPixelCoordAndSnap(), m_continuedMode, m_lastCursorPos, KisTool::mode(), KoToolBase::mouseMoveEvent(), KisTool::PAINT_MODE, KoPointerEvent::point, KisToolPaint::requestUpdateOutline(), and updateContinuedMode().
|
overridevirtual |
Called by the canvas to paint any decorations that the tool deems needed. The painter has the top left of the canvas as its origin.
| painter | used for painting the shape |
| converter | to convert between internal and view coordinates. |
Implements KoToolBase.
Definition at line 220 of file KisToolOutlineBase.cpp.
References m_continuedMode, m_lastCursorPos, m_points, KisTool::mode(), KoToolBase::paint(), KisTool::PAINT_MODE, KisTool::paintToolOutline(), and KisTool::pixelToView().
|
overridevirtual |
popupActionsMenu() does not return null. Reimplemented from KoToolBase.
Reimplemented in KisToolSelectBase< __KisToolSelectOutlineLocal >.
Definition at line 102 of file KisToolOutlineBase.cpp.
References m_points, m_type, KoToolBase::popupWidget(), and SELECT.
|
overrideslot |
Definition at line 300 of file KisToolOutlineBase.cpp.
References cancelStroke().
|
overrideslot |
Definition at line 295 of file KisToolOutlineBase.cpp.
References endStroke().
|
slot |
Definition at line 133 of file KisToolOutlineBase.cpp.
References dragBoundingRect(), FEEDBACK_LINE_WIDTH, m_continuedMode, m_numberOfContinuedModePoints, m_points, KisTool::mode(), KisTool::PAINT_MODE, KisTool::pixelToView(), and KisTool::updateCanvasViewRect().
|
private |
Definition at line 315 of file KisToolOutlineBase.cpp.
References m_blockModifyingActionsGuard.
|
private |
|
private |
Definition at line 256 of file KisToolOutlineBase.cpp.
References dragBoundingRect(), m_points, and KisTool::updateCanvasViewRect().
|
private |
Definition at line 237 of file KisToolOutlineBase.cpp.
References FEEDBACK_LINE_WIDTH, kisGrowRect(), m_points, and KisTool::updateCanvasPixelRect().
|
staticconstexprprivate |
Definition at line 58 of file KisToolOutlineBase.h.
|
private |
Definition at line 67 of file KisToolOutlineBase.h.
|
private |
Definition at line 62 of file KisToolOutlineBase.h.
|
private |
Definition at line 66 of file KisToolOutlineBase.h.
|
private |
Definition at line 63 of file KisToolOutlineBase.h.
|
private |
Definition at line 65 of file KisToolOutlineBase.h.
|
private |
Definition at line 60 of file KisToolOutlineBase.h.
|
private |
Definition at line 61 of file KisToolOutlineBase.h.
|
private |
Definition at line 64 of file KisToolOutlineBase.h.