|
Krita Source Code Documentation
|
#include <kis_tool_transform.h>
Inheritance diagram for KisToolTransform:Signals | |
| void | freeTransformChanged () |
| void | transformModeChanged () |
| void | warpTransformChanged () |
Signals inherited from KisTool | |
| void | isActiveChanged (bool isActivated) |
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 | |
| void | activateAlternateAction (AlternateAction action) override |
| void | activatePrimaryAction () override |
| void | beginActionImpl (KoPointerEvent *event, bool usePrimaryAction, KisTool::AlternateAction action) |
| void | beginAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| void | beginPrimaryAction (KoPointerEvent *event) override |
| void | continueActionImpl (KoPointerEvent *event, bool usePrimaryAction, KisTool::AlternateAction action) |
| void | continueAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| void | continuePrimaryAction (KoPointerEvent *event) override |
| QWidget * | createOptionWidget () override |
| void | deactivateAlternateAction (AlternateAction action) override |
| void | deactivatePrimaryAction () override |
| void | endActionImpl (KoPointerEvent *event, bool usePrimaryAction, KisTool::AlternateAction action) |
| void | endAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| void | endPrimaryAction (KoPointerEvent *event) override |
| KisToolTransform (KoCanvasBase *canvas) | |
| void | mouseMoveEvent (KoPointerEvent *e) override |
| void | mousePressEvent (KoPointerEvent *e) override |
| void | mouseReleaseEvent (KoPointerEvent *e) override |
| void | newActivationWithExternalSource (KisPaintDeviceSP externalSource) override |
| 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. | |
| void | paint (QPainter &gc, const KoViewConverter &converter) override |
| QMenu * | popupActionsMenu () override |
| double | rotateX () const |
| double | rotateY () const |
| double | rotateZ () const |
| double | scaleX () const |
| double | scaleY () const |
| void | setNextActivationTransformMode (TransformToolMode mode) |
| double | shearX () const |
| double | shearY () const |
| TransformToolMode | transformMode () const |
| double | translateX () const |
| double | translateY () const |
| bool | wantsAutoScroll () const override |
| wantsAutoScroll reimplemented from KoToolBase there's an issue where autoscrolling with this tool never makes the stroke end, so we return false here so that users don't get stuck with the tool. See bug 362659 | |
| double | warpFlexibility () const |
| int | warpPointDensity () const |
| WarpType | warpType () const |
| ~KisToolTransform () 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 |
| virtual int | flags () const |
| bool | isActive () const |
| KisTool (KoCanvasBase *canvas, const QCursor &cursor) | |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| void | mouseTripleClickEvent (KoPointerEvent *event) override |
| 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 |
| virtual void | keyPressEvent (QKeyEvent *event) |
| virtual void | keyReleaseEvent (QKeyEvent *event) |
| KoToolBase (KoCanvasBase *canvas) | |
| bool | maskSyntheticEvents () const |
| QList< QPointer< QWidget > > | optionWidgets () |
| virtual bool | paste () |
| virtual KisPopupWidgetInterface * | popupWidget () |
| virtual bool | selectAll () |
| selectAll select all data the tool can select. | |
| virtual KoToolSelection * | selection () |
| Q_INVOKABLE QString | toolId () const |
| ~KoToolBase () override | |
Static Public Member Functions | |
| static ToolTransformArgs::TransformMode | toArgsMode (KisToolTransform::TransformToolMode toolMode) |
Static Public Member Functions inherited from KisTool | |
| static AlternateAction | actionToAlternateAction (ToolAction action) |
Protected Slots | |
| void | resetCursorStyle () override |
| void | slotGlobalConfigChanged () |
Protected Slots inherited from KisTool | |
| virtual void | resetCursorStyle () |
Properties | |
| double | rotateX |
| double | rotateY |
| double | rotateZ |
| double | scaleX |
| double | scaleY |
| double | shearX |
| double | shearY |
| TransformToolMode | transformMode |
| double | translateX |
| double | translateY |
| double | warpFlexibility |
| int | warpPointDensity |
| WarpType | warpType |
Properties inherited from KisTool | |
| bool | isActive |
Private Member Functions | |
| void | cancelStroke () |
| void | commitChanges () |
| KisTransformStrategyBase * | currentStrategy () const |
| void | endStroke () |
| void | initGuiAfterTransformMode () |
| void | initThumbnailImage (KisPaintDeviceSP previewDevice) |
| void | initTransformMode (ToolTransformArgs::TransformMode mode) |
| void | outlineChanged () |
| void | setFunctionalCursor () |
| void | setTransformFunction (QPointF mousePos, Qt::KeyboardModifiers modifiers) |
| void | startStroke (ToolTransformArgs::TransformMode mode, bool forceReset) |
| void | updateApplyResetAvailability () |
Additional Inherited Members | |
Public Attributes inherited from KisTool | |
| KoColor | currentBgColor |
| float | currentExposure {1.0} |
| KoColor | currentFgColor |
| KisFilterConfigurationSP | currentGenerator |
| KoAbstractGradientSP | currentGradient |
| KoPatternSP | currentPattern |
| QCursor | cursor |
| bool | m_isActive {false} |
| ToolMode | m_mode {HOVER_MODE} |
| QWidget * | optionWidget {0} |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Protected Types inherited from KisTool | |
| enum | ToolMode : int { HOVER_MODE , PAINT_MODE , SECONDARY_PAINT_MODE , MIRROR_AXIS_SETUP_MODE , GESTURE_MODE , PAN_MODE , OTHER , OTHER_1 } |
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) |
| virtual void | setMode (ToolMode mode) |
| 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) |
Protected Attributes inherited from KoToolBase | |
| KoToolBasePrivate * | d_ptr |
Transform tool This tool offers several modes.
Definition at line 78 of file kis_tool_transform.h.
| Enumerator | |
|---|---|
| FreeTransformMode | |
| WarpTransformMode | |
| CageTransformMode | |
| LiquifyTransformMode | |
| PerspectiveTransformMode | |
| MeshTransformMode | |
Definition at line 105 of file kis_tool_transform.h.
| Enumerator | |
|---|---|
| RigidWarpType | |
| AffineWarpType | |
| SimilitudeWarpType | |
Definition at line 115 of file kis_tool_transform.h.
| KisToolTransform::KisToolTransform | ( | KoCanvasBase * | canvas | ) |
Definition at line 85 of file kis_tool_transform.cc.
References applyTransformation, cageAction, Private::canvas, canvasUpdateRequested(), convexHullCalculationRequested(), cursorOutlineUpdateRequested(), freeTransformAction, imageTooBigRequested(), KisConfigNotifier::instance(), keepAspectRatioAction, liquifyAction, m_cageStrategy, m_canvas, m_changesTracker, m_contextMenu, m_freeStrategy, m_liquifyStrategy, m_meshStrategy, m_optionsWidget, m_perspectiveStrategy, m_warpStrategy, meshAction, mirrorHorizontalAction, mirrorVerticalAction, perspectiveAction, requestImageRecalculation(), resetRotationCenterButtonsRequested(), resetTransformation, rotateNinetyCCWAction, rotateNinetyCWAction, slotGlobalConfigChanged(), slotTrackerChangedConfig(), updateOptionWidget(), and warpAction.
|
override |
Definition at line 170 of file kis_tool_transform.cc.
References applyTransformation, cageAction, cancelStroke(), freeTransformAction, keepAspectRatioAction, liquifyAction, meshAction, mirrorHorizontalAction, mirrorVerticalAction, perspectiveAction, resetTransformation, rotateNinetyCCWAction, rotateNinetyCWAction, and warpAction.
we cannot initialize the setting in the constructor, because factory() is not yet initialized, so we cannot get toolId()
Definition at line 817 of file kis_tool_transform.cc.
References KoToolBase::action(), KisTool::activate(), KisSignalAutoConnectionsStore::addConnection(), KisTool::currentNode(), FreeTransformMode, m_actionConnections, m_currentArgs, m_transaction, nextActivationTransformMode, slotDecreaseBrushSize(), slotGlobalConfigChanged(), slotIncreaseBrushSize(), slotMoveDiscreteDown(), slotMoveDiscreteDownMore(), slotMoveDiscreteLeft(), slotMoveDiscreteLeftMore(), slotMoveDiscreteRight(), slotMoveDiscreteRightMore(), slotMoveDiscreteUp(), slotMoveDiscreteUpMore(), startStroke(), and toArgsMode().
|
overridevirtual |
Reimplemented from KisTool.
Definition at line 483 of file kis_tool_transform.cc.
References KoToolBase::action(), KisTransformStrategyBase::activateAlternateAction(), currentStrategy(), and setFunctionalCursor().
|
overridevirtual |
Called by KisToolProxy when the primary action of the tool is going to be started now, that is when all the modifiers are pressed and the only thing left is just to press the mouse button. On coming of this callback the tool is supposed to prepare the cursor and/or the outline to show the user shat is going to happen next
Reimplemented from KisTool.
Definition at line 472 of file kis_tool_transform.cc.
References KisTransformStrategyBase::activatePrimaryAction(), currentStrategy(), and setFunctionalCursor().
|
slot |
Definition at line 541 of file kis_tool_transform.cc.
References slotApplyTransform().
| void KisToolTransform::beginActionImpl | ( | KoPointerEvent * | event, |
| bool | usePrimaryAction, | ||
| KisTool::AlternateAction | action ) |
Definition at line 348 of file kis_tool_transform.cc.
References KoToolBase::action(), KisTransformStrategyBase::beginAlternateAction(), KisTransformStrategyBase::beginPrimaryAction(), KisTool::ChangeSize, currentStrategy(), m_actuallyMoveWhileSelected, m_currentArgs, m_strokeId, m_transaction, ToolTransformArgs::mode(), KisTool::nodeEditable(), outlineChanged(), KisTool::PAINT_MODE, TransformTransactionProperties::rootNodes(), KisTool::setMode(), and startStroke().
|
overridevirtual |
Reimplemented from KisTool.
Definition at line 494 of file kis_tool_transform.cc.
References KoToolBase::action(), and beginActionImpl().
|
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.
Definition at line 457 of file kis_tool_transform.cc.
References beginActionImpl(), and KisTool::NONE.
|
private |
Definition at line 1139 of file kis_tool_transform.cc.
References KisImage::cancelStroke(), KisAsynchronousStrokeUpdateHelper::cancelUpdateStream(), KisTool::image(), KisAsynchronousStrokeUpdateHelper::isActive(), m_asyncUpdateHelper, m_changesTracker, m_currentArgs, m_strokeId, m_strokeStrategyCookie, m_transaction, outlineChanged(), and KisToolChangesTracker::reset().
|
slot |
Definition at line 195 of file kis_tool_transform.cc.
References m_canvas.
|
private |
Definition at line 1155 of file kis_tool_transform.cc.
References ToolTransformArgs::clone(), KisToolChangesTracker::commitConfig(), m_changesTracker, m_currentArgs, m_strokeId, m_transaction, TransformTransactionProperties::rootNodes(), and toQShared().
| void KisToolTransform::continueActionImpl | ( | KoPointerEvent * | event, |
| bool | usePrimaryAction, | ||
| KisTool::AlternateAction | action ) |
Definition at line 376 of file kis_tool_transform.cc.
References KoToolBase::action(), KisTransformStrategyBase::continueAlternateAction(), KisTransformStrategyBase::continuePrimaryAction(), currentStrategy(), m_actuallyMoveWhileSelected, m_transaction, KisTool::mode(), outlineChanged(), KisTool::PAINT_MODE, TransformTransactionProperties::rootNodes(), setFunctionalCursor(), and updateOptionWidget().
|
overridevirtual |
Reimplemented from KisTool.
Definition at line 499 of file kis_tool_transform.cc.
References KoToolBase::action(), and continueActionImpl().
|
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.
Definition at line 462 of file kis_tool_transform.cc.
References continueActionImpl(), and KisTool::NONE.
|
slot |
Free transform strategy issues the recalculation request every time the user performs a bounds rotation action, so we should skip actual recalculation, when it is not necessary anymore
Definition at line 224 of file kis_tool_transform.cc.
References KisImage::addJob(), TransformTransactionProperties::convexHullHasBeenRequested(), KisTool::image(), m_currentlyUsingOverlayPreviewStyle, m_strokeId, m_transaction, TransformTransactionProperties::rootNodes(), and TransformTransactionProperties::setConvexHullHasBeenRequested().
|
overridevirtual |
Reimplement this if your tool actually has an option widget. Sets the option widget to 0 by default.
Reimplemented from KisTool.
Definition at line 1173 of file kis_tool_transform.cc.
References applyTransformation, cageAction, freeTransformAction, keepAspectRatioAction, liquifyAction, m_canvas, m_optionsWidget, m_transaction, meshAction, mirrorHorizontalAction, mirrorVerticalAction, perspectiveAction, resetTransformation, rotateNinetyCCWAction, rotateNinetyCWAction, slotApplyTransform(), slotCancelTransform(), slotEditingFinished(), slotGlobalConfigChanged(), slotResetTransform(), slotRestartAndContinueTransform(), slotRestartTransform(), slotUiChangedConfig(), slotUpdateToCageType(), slotUpdateToFreeTransformType(), slotUpdateToLiquifyType(), slotUpdateToMeshType(), slotUpdateToPerspectiveType(), slotUpdateToWarpType(), KoToolBase::toolId(), updateOptionWidget(), and warpAction.
|
private |
Definition at line 267 of file kis_tool_transform.cc.
References ToolTransformArgs::CAGE, ToolTransformArgs::FREE_TRANSFORM, ToolTransformArgs::LIQUIFY, m_cageStrategy, m_currentArgs, m_freeStrategy, m_liquifyStrategy, m_meshStrategy, m_perspectiveStrategy, m_warpStrategy, ToolTransformArgs::MESH, ToolTransformArgs::mode(), and ToolTransformArgs::WARP.
|
slot |
Definition at line 323 of file kis_tool_transform.cc.
References currentStrategy(), kisGrowRect(), m_canvas, and m_cursorOutline.
|
overrideslot |
Definition at line 858 of file kis_tool_transform.cc.
References KisSignalAutoConnectionsStore::clear(), KisTool::deactivate(), endStroke(), m_actionConnections, and m_canvas.
|
overridevirtual |
Reimplemented from KisTool.
Definition at line 489 of file kis_tool_transform.cc.
References KoToolBase::action(), currentStrategy(), and KisTransformStrategyBase::deactivateAlternateAction().
|
overridevirtual |
Called by KisToolProxy when the primary is no longer possible to be started now, e.g. when its modifiers and released. The tool is supposed to revert all the preparations it has done in activatePrimaryAction().
Reimplemented from KisTool.
Definition at line 478 of file kis_tool_transform.cc.
References currentStrategy(), and KisTransformStrategyBase::deactivatePrimaryAction().
| void KisToolTransform::endActionImpl | ( | KoPointerEvent * | event, |
| bool | usePrimaryAction, | ||
| KisTool::AlternateAction | action ) |
Definition at line 394 of file kis_tool_transform.cc.
References KoToolBase::action(), commitChanges(), currentStrategy(), KisTransformStrategyBase::endAlternateAction(), KisTransformStrategyBase::endPrimaryAction(), KisTool::HOVER_MODE, m_actuallyMoveWhileSelected, KisTool::mode(), outlineChanged(), KisTool::PAINT_MODE, KisTool::setMode(), updateApplyResetAvailability(), and updateOptionWidget().
|
overridevirtual |
Reimplemented from KisTool.
Definition at line 504 of file kis_tool_transform.cc.
References KoToolBase::action(), and endActionImpl().
|
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.
Definition at line 467 of file kis_tool_transform.cc.
References endActionImpl(), and KisTool::NONE.
|
private |
Definition at line 1053 of file kis_tool_transform.cc.
References KisImage::addJob(), KisImage::endStroke(), KisAsynchronousStrokeUpdateHelper::endUpdateStream(), KisTool::image(), KisAsynchronousStrokeUpdateHelper::isActive(), ToolTransformArgs::isUnchanging(), m_asyncUpdateHelper, m_changesTracker, m_currentArgs, m_currentlyUsingOverlayPreviewStyle, m_strokeId, m_strokeStrategyCookie, m_transaction, outlineChanged(), KisToolChangesTracker::reset(), and TransformTransactionProperties::rootNodes().
|
signal |
|
slot |
Definition at line 218 of file kis_tool_transform.cc.
References m_optionsWidget, KisToolTransformConfigWidget::setTooBigLabelVisible(), and value().
|
private |
Definition at line 752 of file kis_tool_transform.cc.
References currentStrategy(), KisTransformStrategyBase::externalConfigChanged(), outlineChanged(), setFunctionalCursor(), updateApplyResetAvailability(), and updateOptionWidget().
|
private |
Definition at line 761 of file kis_tool_transform.cc.
References KisPaintDevice::createThumbnailDeviceOversampled(), m_cageStrategy, m_canvas, m_freeStrategy, m_liquifyStrategy, m_meshStrategy, m_perspectiveStrategy, m_selectedPortionCache, m_transaction, m_warpStrategy, and TransformTransactionProperties::originalRect().
|
private |
Definition at line 746 of file kis_tool_transform.cc.
References ToolTransformArgs::externalSource(), ToolTransformArgs::filterId(), initGuiAfterTransformMode(), m_currentArgs, m_transaction, KisTool::mode(), and KisTransformUtils::resetArgsForMode().
|
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.
Definition at line 522 of file kis_tool_transform.cc.
References currentStrategy(), cursorOutlineUpdateRequested(), KisTransformStrategyBase::hoverActionCommon(), m_canvas, KisTool::mode(), KisTool::mouseMoveEvent(), KisTool::PAINT_MODE, KoPointerEvent::point, and setFunctionalCursor().
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is pressed. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus press |
Reimplemented from KisTool.
Definition at line 509 of file kis_tool_transform.cc.
References currentStrategy(), KisTransformStrategyBase::hoverActionCommon(), KoPointerEvent::isTouchEvent(), KisTool::mousePressEvent(), KisTool::PAINT_MODE, and setFunctionalCursor().
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is released. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus release |
Reimplemented from KisTool.
Definition at line 536 of file kis_tool_transform.cc.
References KisTool::mouseReleaseEvent().
|
overridevirtual |
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.
This is currently implemented by the Transform tool to paste an image into the current layer and transform it.
Reimplemented from KisTool.
Definition at line 805 of file kis_tool_transform.cc.
References activate(), deactivate(), KoToolManager::instance(), KisTool::isActive, m_externalSourceForNextActivation, and KoToolManager::switchToolRequested().
|
private |
Definition at line 189 of file kis_tool_transform.cc.
References freeTransformChanged(), and m_canvas.
|
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 284 of file kis_tool_transform.cc.
References currentStrategy(), KoToolBase::decorationThickness(), KisTransformStrategyBase::externalConfigChanged(), KisTransformUtils::imageToFlake(), KisTransformUtils::imageToFlakeTransform(), m_canvas, m_cursorOutline, m_refRect, m_strokeId, m_transaction, KisTransformStrategyBase::paint(), KisTool::paintToolOutline(), TransformTransactionProperties::rootNodes(), and KisTransformStrategyBase::setDecorationThickness().
|
overridevirtual |
Reimplemented from KoToolBase.
Definition at line 422 of file kis_tool_transform.cc.
References applyTransformation, cageAction, freeTransformAction, FreeTransformMode, ToolTransformArgs::keepAspectRatio(), keepAspectRatioAction, liquifyAction, m_contextMenu, m_currentArgs, meshAction, mirrorHorizontalAction, mirrorVerticalAction, perspectiveAction, resetTransformation, rotateNinetyCCWAction, rotateNinetyCWAction, transformMode, and warpAction.
|
slot |
Definition at line 900 of file kis_tool_transform.cc.
References KisImage::addJob(), KisTool::image(), m_currentArgs, m_currentlyUsingOverlayPreviewStyle, m_strokeId, m_transaction, InplaceTransformStrokeStrategy::UpdateTransformData::PAINT_DEVICE, and TransformTransactionProperties::rootNodes().
|
overrideslot |
Definition at line 877 of file kis_tool_transform.cc.
References KisToolChangesTracker::canRedo(), m_changesTracker, m_strokeId, m_transaction, KisToolChangesTracker::requestRedo(), and TransformTransactionProperties::rootNodes().
|
overrideslot |
Definition at line 891 of file kis_tool_transform.cc.
References cancelStroke(), ToolTransformArgs::isIdentity(), m_currentArgs, m_transaction, TransformTransactionProperties::rootNodes(), and slotCancelTransform().
|
overrideslot |
Definition at line 886 of file kis_tool_transform.cc.
References endStroke().
|
overrideslot |
Definition at line 866 of file kis_tool_transform.cc.
References cancelStroke(), KisToolChangesTracker::canUndo(), KisTool::HOVER_MODE, m_changesTracker, m_strokeId, m_transaction, KisTool::mode(), KisToolChangesTracker::requestUndo(), and TransformTransactionProperties::rootNodes().
|
overrideprotectedslot |
Definition at line 200 of file kis_tool_transform.cc.
References setFunctionalCursor().
|
slot |
Definition at line 212 of file kis_tool_transform.cc.
References m_optionsWidget, and KisToolTransformConfigWidget::resetRotationCenterButtons().
| double KisToolTransform::rotateX | ( | ) | const |
Definition at line 592 of file kis_tool_transform.cc.
References ToolTransformArgs::aX(), and m_currentArgs.
| double KisToolTransform::rotateY | ( | ) | const |
Definition at line 597 of file kis_tool_transform.cc.
References ToolTransformArgs::aY(), and m_currentArgs.
| double KisToolTransform::rotateZ | ( | ) | const |
Definition at line 602 of file kis_tool_transform.cc.
References ToolTransformArgs::aZ(), and m_currentArgs.
| double KisToolTransform::scaleX | ( | ) | const |
Definition at line 607 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::scaleX().
| double KisToolTransform::scaleY | ( | ) | const |
Definition at line 612 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::scaleY().
|
private |
Definition at line 307 of file kis_tool_transform.cc.
References currentStrategy(), m_strokeId, m_transaction, KisTool::overrideCursorIfNotEditable(), KisCursor::pointingHandCursor(), TransformTransactionProperties::rootNodes(), KoToolBase::useCursor(), and KisCursor::waitCursor().
| void KisToolTransform::setNextActivationTransformMode | ( | KisToolTransform::TransformToolMode | mode | ) |
Definition at line 546 of file kis_tool_transform.cc.
References KisTool::mode(), and nextActivationTransformMode.
|
slot |
Definition at line 704 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::setAX().
|
slot |
Definition at line 709 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::setAY().
|
slot |
Definition at line 714 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::setAZ().
|
slot |
Definition at line 1463 of file kis_tool_transform.cc.
References m_optionsWidget, and KisToolTransformConfigWidget::slotSetScaleX().
|
slot |
Definition at line 1458 of file kis_tool_transform.cc.
References m_optionsWidget, and KisToolTransformConfigWidget::slotSetScaleY().
|
slot |
Definition at line 1453 of file kis_tool_transform.cc.
References m_optionsWidget, and KisToolTransformConfigWidget::slotSetShearX().
|
slot |
Definition at line 1448 of file kis_tool_transform.cc.
References m_optionsWidget, and KisToolTransformConfigWidget::slotSetShearY().
|
private |
|
slot |
Definition at line 681 of file kis_tool_transform.cc.
References CageTransformMode, FreeTransformMode, LiquifyTransformMode, m_currentArgs, m_optionsWidget, MeshTransformMode, KisTool::mode(), ToolTransformArgs::mode(), PerspectiveTransformMode, KisToolTransformConfigWidget::slotSetCageModeButtonClicked(), KisToolTransformConfigWidget::slotSetFreeTransformModeButtonClicked(), KisToolTransformConfigWidget::slotSetLiquifyModeButtonClicked(), KisToolTransformConfigWidget::slotSetMeshModeButtonClicked(), KisToolTransformConfigWidget::slotSetPerspectiveModeButtonClicked(), KisToolTransformConfigWidget::slotSetWarpModeButtonClicked(), toArgsMode(), transformModeChanged(), and WarpTransformMode.
|
slot |
Definition at line 1480 of file kis_tool_transform.cc.
References currentStrategy(), KisTransformStrategyBase::externalConfigChanged(), FreeTransformMode, m_currentArgs, m_strokeId, KisTool::mode(), outlineChanged(), PerspectiveTransformMode, ToolTransformArgs::setTransformedCenter(), transformMode, translateY, and updateOptionWidget().
|
slot |
Definition at line 1468 of file kis_tool_transform.cc.
References currentStrategy(), KisTransformStrategyBase::externalConfigChanged(), FreeTransformMode, m_currentArgs, m_strokeId, KisTool::mode(), outlineChanged(), PerspectiveTransformMode, ToolTransformArgs::setTransformedCenter(), transformMode, translateX, and updateOptionWidget().
|
slot |
Definition at line 736 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::setAlpha().
|
slot |
Definition at line 741 of file kis_tool_transform.cc.
References m_optionsWidget, and KisToolTransformConfigWidget::slotSetWarpDensity().
|
slot |
Definition at line 719 of file kis_tool_transform.cc.
References KisWarpTransformWorker::AFFINE_TRANSFORM, AffineWarpType, m_currentArgs, KisWarpTransformWorker::RIGID_TRANSFORM, RigidWarpType, ToolTransformArgs::setWarpType(), KisWarpTransformWorker::SIMILITUDE_TRANSFORM, and SimilitudeWarpType.
| double KisToolTransform::shearX | ( | ) | const |
Definition at line 617 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::shearX().
| double KisToolTransform::shearY | ( | ) | const |
Definition at line 622 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::shearY().
|
privateslot |
Definition at line 1274 of file kis_tool_transform.cc.
References endStroke(), and KisCursor::waitCursor().
|
privateslot |
Definition at line 1334 of file kis_tool_transform.cc.
References TransformTransactionProperties::currentConfig(), m_transaction, ToolTransformArgs::mode(), and slotResetTransform().
Only use the convex hull if it matches the original bounding rect. When we skip setConvexHull() call, nothing serious happens, except that rotatted bounds are rotated around the entire clip rect, not actual clip's data.
Definition at line 246 of file kis_tool_transform.cc.
References canvasUpdateRequested(), currentStrategy(), KisTransformStrategyBase::externalConfigChanged(), m_strokeId, m_strokeStrategyCookie, m_transaction, TransformTransactionProperties::originalRect(), TransformTransactionProperties::setConvexHull(), and warnTools.
|
privateslot |
Definition at line 1413 of file kis_tool_transform.cc.
References Private::canvas, currentStrategy(), and KisTransformStrategyBase::decreaseBrushSize().
|
privateslot |
Definition at line 1363 of file kis_tool_transform.cc.
References commitChanges().
|
protectedslot |
Definition at line 205 of file kis_tool_transform.cc.
References m_forceLodMode, m_preferOverlayPreviewStyle, and KoToolBase::toolId().
|
privateslot |
Definition at line 1408 of file kis_tool_transform.cc.
References Private::canvas, currentStrategy(), and KisTransformStrategyBase::increaseBrushSize().
|
privateslot |
Definition at line 1378 of file kis_tool_transform.cc.
References setTranslateY(), and translateY.
|
privateslot |
Definition at line 1383 of file kis_tool_transform.cc.
References setTranslateY(), and translateY.
|
privateslot |
Definition at line 1388 of file kis_tool_transform.cc.
References setTranslateX(), and translateX.
|
privateslot |
Definition at line 1393 of file kis_tool_transform.cc.
References setTranslateX(), and translateX.
|
privateslot |
Definition at line 1398 of file kis_tool_transform.cc.
References setTranslateX(), and translateX.
|
privateslot |
Definition at line 1403 of file kis_tool_transform.cc.
References setTranslateX(), and translateX.
|
privateslot |
Definition at line 1368 of file kis_tool_transform.cc.
References setTranslateY(), and translateY.
|
privateslot |
Definition at line 1373 of file kis_tool_transform.cc.
References setTranslateY(), and translateY.
|
privateslot |
Definition at line 1121 of file kis_tool_transform.cc.
References cancelStroke(), Private::canvas, KisPaintDevice::exactBounds(), initGuiAfterTransformMode(), initThumbnailImage(), KIS_SAFE_ASSERT_RECOVER, KisFloatingMessage::Medium, and KisCanvas2::viewManager().
|
privateslot |
Our reset transform button can be used for two purposes:
1) Reset current transform to the initial one, which was loaded from the previous user action.
2) Reset transform frame to infinity when the frame is unchanged
Definition at line 1280 of file kis_tool_transform.cc.
References cancelStroke(), ToolTransformArgs::continuedTransform(), TransformTransactionProperties::currentConfig(), initGuiAfterTransformMode(), initTransformMode(), ToolTransformArgs::isSameMode(), KIS_ASSERT_RECOVER_NOOP, m_currentArgs, m_strokeId, m_transaction, KisTool::mode(), ToolTransformArgs::mode(), ToolTransformArgs::restoreContinuedState(), TransformTransactionProperties::rootNodes(), ToolTransformArgs::setMode(), ToolTransformArgs::setWarpCalculation(), KisTransformUtils::shouldRestartStrokeOnModeChange(), slotEditingFinished(), startStroke(), TransformTransactionProperties::transformedNodes(), and ToolTransformArgs::WARP.
|
privateslot |
Definition at line 1351 of file kis_tool_transform.cc.
References endStroke(), KIS_ASSERT_RECOVER_RETURN, m_currentArgs, m_strokeId, m_transaction, ToolTransformArgs::mode(), TransformTransactionProperties::rootNodes(), and startStroke().
|
privateslot |
Definition at line 1339 of file kis_tool_transform.cc.
References cancelStroke(), KIS_ASSERT_RECOVER_RETURN, m_currentArgs, m_strokeId, m_transaction, ToolTransformArgs::mode(), TransformTransactionProperties::rootNodes(), and startStroke().
|
privateslot |
Definition at line 1162 of file kis_tool_transform.cc.
References TransformTransactionProperties::currentConfig(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_transaction, slotUiChangedConfig(), and updateOptionWidget().
|
privateslot |
Definition at line 1078 of file kis_tool_transform.cc.
References cancelStroke(), Private::canvas, commitChanges(), TransformTransactionProperties::hasInvisibleNodes(), initGuiAfterTransformMode(), KisToolChangesTracker::isEmpty(), KIS_ASSERT, KIS_SAFE_ASSERT_RECOVER_NOOP, KisFloatingMessage::Low, m_asyncUpdateHelper, m_changesTracker, m_currentArgs, m_currentlyUsingOverlayPreviewStyle, m_strokeId, m_strokeStrategyCookie, m_transaction, KisFloatingMessage::Medium, TransformTransactionProperties::originalRect(), TransformTransactionProperties::setCurrentConfigLocation(), KisAsynchronousStrokeUpdateHelper::startUpdateStreamLowLevel(), TransformTransactionProperties::transformedNodes(), and KisCanvas2::viewManager().
|
privateslot |
Definition at line 1258 of file kis_tool_transform.cc.
References currentStrategy(), KisTransformStrategyBase::externalConfigChanged(), ToolTransformArgs::LIQUIFY, m_currentArgs, KisTool::mode(), ToolTransformArgs::mode(), outlineChanged(), KisTool::PAINT_MODE, ToolTransformArgs::saveLiquifyTransformMode(), and updateApplyResetAvailability().
|
privateslot |
Definition at line 1443 of file kis_tool_transform.cc.
References CageTransformMode, and setTransformMode().
|
privateslot |
Definition at line 1428 of file kis_tool_transform.cc.
References FreeTransformMode, and setTransformMode().
|
privateslot |
Definition at line 1433 of file kis_tool_transform.cc.
References LiquifyTransformMode, and setTransformMode().
|
privateslot |
Definition at line 1438 of file kis_tool_transform.cc.
References MeshTransformMode, and setTransformMode().
|
privateslot |
Definition at line 1423 of file kis_tool_transform.cc.
References PerspectiveTransformMode, and setTransformMode().
|
privateslot |
Definition at line 1418 of file kis_tool_transform.cc.
References setTransformMode(), and WarpTransformMode.
|
private |
When working with transform mask, selections are not taken into account.
Definition at line 911 of file kis_tool_transform.cc.
References KisResourcesSnapshot::activeSelection(), Private::canvas, KisSharedPtr< T >::clear(), KisTool::currentNode(), KisSharedPtr< T >::data(), ToolTransformArgs::filterId(), KisLayerUtils::filterMergeableNodes(), KisFloatingMessage::High, KisTool::image(), KisAsynchronousStrokeUpdateHelper::initUpdateStreamLowLevel(), KisBaseNode::isEditable(), KisToolChangesTracker::isEmpty(), KIS_ASSERT, KIS_SAFE_ASSERT_RECOVER_NOOP, koIcon, KisFloatingMessage::Low, m_asyncUpdateHelper, m_changesTracker, m_currentArgs, m_currentlyUsingOverlayPreviewStyle, m_externalSourceForNextActivation, m_forceLodMode, m_preferOverlayPreviewStyle, m_strokeId, m_strokeStrategyCookie, m_transaction, KisTool::mode(), KisNode::parent, KisLayerUtils::recursiveFindNode(), KisResourcesSnapshot::selectedNodes(), KisTool::selectedNodes(), KoToolBase::selection(), slotConvexHullCalculated(), slotPreviewDeviceGenerated(), slotTransactionGenerated(), KisImage::startStroke(), KisBaseNode::userLocked(), KisCanvas2::viewManager(), and KisBaseNode::visible().
|
static |
Definition at line 651 of file kis_tool_transform.cc.
References ToolTransformArgs::CAGE, CageTransformMode, ToolTransformArgs::FREE_TRANSFORM, FreeTransformMode, KIS_ASSERT_RECOVER_NOOP, ToolTransformArgs::LIQUIFY, LiquifyTransformMode, ToolTransformArgs::MESH, MeshTransformMode, KisTool::mode(), ToolTransformArgs::PERSPECTIVE_4POINT, PerspectiveTransformMode, ToolTransformArgs::WARP, and WarpTransformMode.
| KisToolTransform::TransformToolMode KisToolTransform::transformMode | ( | ) | const |
Definition at line 551 of file kis_tool_transform.cc.
References ToolTransformArgs::CAGE, CageTransformMode, ToolTransformArgs::FREE_TRANSFORM, FreeTransformMode, KIS_ASSERT_RECOVER_NOOP, ToolTransformArgs::LIQUIFY, LiquifyTransformMode, m_currentArgs, ToolTransformArgs::MESH, MeshTransformMode, KisTool::mode(), ToolTransformArgs::mode(), ToolTransformArgs::PERSPECTIVE_4POINT, PerspectiveTransformMode, ToolTransformArgs::WARP, and WarpTransformMode.
|
signal |
| double KisToolTransform::translateX | ( | ) | const |
Definition at line 582 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::transformedCenter().
| double KisToolTransform::translateY | ( | ) | const |
Definition at line 587 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::transformedCenter().
|
private |
Definition at line 1251 of file kis_tool_transform.cc.
References ToolTransformArgs::isIdentity(), m_currentArgs, m_optionsWidget, and KisToolTransformConfigWidget::setApplyResetDisabled().
|
slot |
Definition at line 1237 of file kis_tool_transform.cc.
References KisTool::currentNode(), m_currentArgs, m_optionsWidget, and KisToolTransformConfigWidget::updateConfig().
|
inlineoverridevirtual |
wantsAutoScroll reimplemented from KoToolBase there's an issue where autoscrolling with this tool never makes the stroke end, so we return false here so that users don't get stuck with the tool. See bug 362659
Reimplemented from KoToolBase.
Definition at line 133 of file kis_tool_transform.h.
| double KisToolTransform::warpFlexibility | ( | ) | const |
Definition at line 641 of file kis_tool_transform.cc.
References ToolTransformArgs::alpha(), and m_currentArgs.
| int KisToolTransform::warpPointDensity | ( | ) | const |
Definition at line 646 of file kis_tool_transform.cc.
References m_currentArgs, and ToolTransformArgs::numPoints().
|
signal |
| KisToolTransform::WarpType KisToolTransform::warpType | ( | ) | const |
Definition at line 627 of file kis_tool_transform.cc.
References KisWarpTransformWorker::AFFINE_TRANSFORM, AffineWarpType, m_currentArgs, KisWarpTransformWorker::RIGID_TRANSFORM, RigidWarpType, KisWarpTransformWorker::SIMILITUDE_TRANSFORM, SimilitudeWarpType, and ToolTransformArgs::warpType().
|
private |
Definition at line 294 of file kis_tool_transform.h.
|
private |
Definition at line 291 of file kis_tool_transform.h.
|
private |
Definition at line 292 of file kis_tool_transform.h.
|
private |
Definition at line 302 of file kis_tool_transform.h.
|
private |
Definition at line 290 of file kis_tool_transform.h.
|
private |
Definition at line 283 of file kis_tool_transform.h.
|
private |
Definition at line 266 of file kis_tool_transform.h.
|
private |
Definition at line 324 of file kis_tool_transform.h.
|
private |
Definition at line 315 of file kis_tool_transform.h.
|
private |
Definition at line 279 of file kis_tool_transform.h.
|
private |
Definition at line 282 of file kis_tool_transform.h.
|
private |
Definition at line 238 of file kis_tool_transform.h.
|
private |
Definition at line 260 of file kis_tool_transform.h.
|
private |
Definition at line 271 of file kis_tool_transform.h.
|
private |
Definition at line 322 of file kis_tool_transform.h.
|
private |
Definition at line 264 of file kis_tool_transform.h.
|
private |
Definition at line 273 of file kis_tool_transform.h.
|
private |
Definition at line 318 of file kis_tool_transform.h.
|
private |
Definition at line 316 of file kis_tool_transform.h.
|
private |
Definition at line 317 of file kis_tool_transform.h.
|
private |
Definition at line 278 of file kis_tool_transform.h.
|
private |
Definition at line 319 of file kis_tool_transform.h.
|
private |
Definition at line 272 of file kis_tool_transform.h.
|
private |
This artificial rect is used to store the image to flake transformation. We check against this rect to get to know whether zoom has changed.
Definition at line 312 of file kis_tool_transform.h.
|
private |
Definition at line 268 of file kis_tool_transform.h.
|
private |
Definition at line 276 of file kis_tool_transform.h.
|
private |
Definition at line 269 of file kis_tool_transform.h.
|
private |
Definition at line 270 of file kis_tool_transform.h.
|
private |
Definition at line 281 of file kis_tool_transform.h.
|
private |
Definition at line 314 of file kis_tool_transform.h.
|
private |
Definition at line 289 of file kis_tool_transform.h.
|
private |
Definition at line 298 of file kis_tool_transform.h.
|
private |
Definition at line 299 of file kis_tool_transform.h.
|
private |
Definition at line 285 of file kis_tool_transform.h.
|
private |
Definition at line 293 of file kis_tool_transform.h.
|
private |
Definition at line 295 of file kis_tool_transform.h.
|
private |
Definition at line 301 of file kis_tool_transform.h.
|
private |
Definition at line 300 of file kis_tool_transform.h.
|
private |
|
readwrite |
Definition at line 88 of file kis_tool_transform.h.
|
readwrite |
Definition at line 89 of file kis_tool_transform.h.
|
readwrite |
Definition at line 90 of file kis_tool_transform.h.
|
readwrite |
Definition at line 92 of file kis_tool_transform.h.
|
readwrite |
Definition at line 93 of file kis_tool_transform.h.
|
readwrite |
Definition at line 95 of file kis_tool_transform.h.
|
readwrite |
Definition at line 96 of file kis_tool_transform.h.
|
readwrite |
Definition at line 83 of file kis_tool_transform.h.
|
readwrite |
Definition at line 85 of file kis_tool_transform.h.
|
readwrite |
Definition at line 86 of file kis_tool_transform.h.
|
readwrite |
Definition at line 99 of file kis_tool_transform.h.
|
readwrite |
Definition at line 100 of file kis_tool_transform.h.
|
readwrite |
Definition at line 98 of file kis_tool_transform.h.