Krita Source Code Documentation
Loading...
Searching...
No Matches
KisToolTransform Class Reference

#include <kis_tool_transform.h>

+ Inheritance diagram for KisToolTransform:

Public Types

enum  TransformToolMode {
  FreeTransformMode , WarpTransformMode , CageTransformMode , LiquifyTransformMode ,
  PerspectiveTransformMode , MeshTransformMode
}
 
enum  WarpType { RigidWarpType , AffineWarpType , SimilitudeWarpType }
 
- 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 applyTransform ()
 
void canvasUpdateRequested ()
 
void convexHullCalculationRequested ()
 
void cursorOutlineUpdateRequested (const QPointF &imagePos)
 
void deactivate () override
 
void imageTooBigRequested (bool value)
 
void requestImageRecalculation ()
 
void requestRedoDuringStroke () override
 
void requestStrokeCancellation () override
 
void requestStrokeEnd () override
 
void requestUndoDuringStroke () override
 
void resetRotationCenterButtonsRequested ()
 
void setRotateX (double rotation)
 
void setRotateY (double rotation)
 
void setRotateZ (double rotation)
 
void setScaleX (double scaleX)
 
void setScaleY (double scaleY)
 
void setShearX (double shearX)
 
void setShearY (double shearY)
 
void setTransformMode (KisToolTransform::TransformToolMode newMode)
 
void setTranslateX (double translateX)
 
void setTranslateY (double translateY)
 
void setWarpFlexibility (double flexibility)
 
void setWarpPointDensity (int density)
 
void setWarpType (WarpType type)
 
void slotConvexHullCalculated (QPolygon hull, void *strokeStrategyCookie)
 
void updateOptionWidget ()
 
- 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 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 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
 
KoCanvasBasecanvas () 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.
 
KoToolFactoryBasefactory () 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 KisPopupWidgetInterfacepopupWidget ()
 
virtual bool selectAll ()
 selectAll select all data the tool can select.
 
virtual KoToolSelectionselection ()
 
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 Slots

void slotApplyTransform ()
 
void slotCancelTransform ()
 
void slotEditingFinished ()
 
void slotMoveDiscreteDown ()
 
void slotMoveDiscreteDownMore ()
 
void slotMoveDiscreteLeft ()
 
void slotMoveDiscreteLeftMore ()
 
void slotMoveDiscreteRight ()
 
void slotMoveDiscreteRightMore ()
 
void slotMoveDiscreteUp ()
 
void slotMoveDiscreteUpMore ()
 
void slotPreviewDeviceGenerated (KisPaintDeviceSP device)
 
void slotResetTransform (ToolTransformArgs::TransformMode mode)
 
void slotRestartAndContinueTransform ()
 
void slotRestartTransform ()
 
void slotTrackerChangedConfig (KisToolChangesTrackerDataSP status)
 
void slotTransactionGenerated (TransformTransactionProperties transaction, ToolTransformArgs args, void *strokeStrategyCookie)
 
void slotUiChangedConfig (bool needsPreviewRecalculation)
 
void slotUpdateToCageType ()
 
void slotUpdateToFreeTransformType ()
 
void slotUpdateToLiquifyType ()
 
void slotUpdateToMeshType ()
 
void slotUpdateToPerspectiveType ()
 
void slotUpdateToWarpType ()
 

Private Member Functions

void cancelStroke ()
 
void commitChanges ()
 
KisTransformStrategyBasecurrentStrategy () 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 ()
 

Private Attributes

KisActionapplyTransformation {0}
 
KisActioncageAction {0}
 
KisActionfreeTransformAction {0}
 
KisActionkeepAspectRatioAction {0}
 
KisActionliquifyAction {0}
 
KisSignalAutoConnectionsStore m_actionConnections
 
bool m_actuallyMoveWhileSelected {false}
 
KisAsynchronousStrokeUpdateHelper m_asyncUpdateHelper
 
QScopedPointer< KisCageTransformStrategym_cageStrategy
 
QPointer< KisCanvas2m_canvas
 
KisToolChangesTracker m_changesTracker
 
QScopedPointer< QMenu > m_contextMenu
 
ToolTransformArgs m_currentArgs
 
bool m_currentlyUsingOverlayPreviewStyle {false}
 
QPainterPath m_cursorOutline
 
KisPaintDeviceSP m_externalSourceForNextActivation
 
bool m_forceLodMode {false}
 
QScopedPointer< KisFreeTransformStrategym_freeStrategy
 
QScopedPointer< KisLiquifyTransformStrategym_liquifyStrategy
 
QScopedPointer< KisMeshTransformStrategym_meshStrategy
 
KisToolUtils::MoveShortcutsHelper m_moveShortcutsHelper
 
KisToolTransformConfigWidgetm_optionsWidget {0}
 
QScopedPointer< KisPerspectiveTransformStrategym_perspectiveStrategy
 
bool m_preferOverlayPreviewStyle {false}
 
QRectF m_refRect
 
KisPaintDeviceSP m_selectedPortionCache
 
QPainterPath m_selectionPath
 
KisStrokeId m_strokeId
 
voidm_strokeStrategyCookie {0}
 
TransformTransactionProperties m_transaction
 
QScopedPointer< KisWarpTransformStrategym_warpStrategy
 
KisActionmeshAction {0}
 
KisActionmirrorHorizontalAction {0}
 
KisActionmirrorVerticalAction {0}
 
TransformToolMode nextActivationTransformMode {FreeTransformMode}
 
KisActionperspectiveAction {0}
 
KisActionresetTransformation {0}
 
KisActionrotateNinetyCCWAction {0}
 
KisActionrotateNinetyCWAction {0}
 
KisActionwarpAction {0}
 actions for the context click menu
 

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
KisCanvas2canvas
 
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)
 
KoPointerEventlastDeliveredPointerEvent () const
 
void setAbstractResource (KoAbstractCanvasResourceInterfaceSP abstractResource)
 
void setConverter (KoDerivedResourceConverterSP converter)
 
void setIsOpacityPresetMode (bool value)
 
void setMaskSyntheticEvents (bool value)
 
void setTextMode (bool value)
 
QHash< int, KoAbstractCanvasResourceInterfaceSPtoolAbstractResources ()
 
QHash< int, KoDerivedResourceConverterSPtoolConverters ()
 
void useCursor (const QCursor &cursor)
 
- Protected Attributes inherited from KoToolBase
KoToolBasePrivated_ptr
 

Detailed Description

Transform tool This tool offers several modes.

  • Free Transform mode allows the user to translate, scale, shear, rotate and apply a perspective transformation to a selection or the whole canvas.
  • Warp mode allows the user to warp the selection of the canvas by grabbing and moving control points placed on the image. The user can either work with default control points, like a grid whose density can be modified, or place the control points manually. The modifications made on the selected pixels are applied only when the user clicks the Apply button : the semi-transparent image displayed until the user click that button is only a preview.
  • Cage transform is similar to warp transform with control points exactly placed on the outer boundary. The user draws a boundary polygon, the vertices of which become control points.
  • Perspective transform applies a two-point perspective transformation. The user can manipulate the corners of the selection. If the vanishing points of the resulting quadrilateral are on screen, the user can manipulate those as well.
  • Liquify transform transforms the selection by painting motions, as if the user was finger painting.

Definition at line 79 of file kis_tool_transform.h.

Member Enumeration Documentation

◆ TransformToolMode

Enumerator
FreeTransformMode 
WarpTransformMode 
CageTransformMode 
LiquifyTransformMode 
PerspectiveTransformMode 
MeshTransformMode 

Definition at line 106 of file kis_tool_transform.h.

◆ WarpType

Enumerator
RigidWarpType 
AffineWarpType 
SimilitudeWarpType 

Definition at line 116 of file kis_tool_transform.h.

Constructor & Destructor Documentation

◆ KisToolTransform()

KisToolTransform::KisToolTransform ( KoCanvasBase * canvas)

Definition at line 84 of file kis_tool_transform.cc.

88 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
89 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
93 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
94 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
98 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
102 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
103 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
107 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
108 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
112 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
113 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
116{
117 m_canvas = dynamic_cast<KisCanvas2*>(canvas);
118 Q_ASSERT(m_canvas);
119
120 setObjectName("tool_transform");
121 m_optionsWidget = 0;
122
123 warpAction = new KisAction(i18nc("Warp Transform Tab Label", "Warp"));
124 liquifyAction = new KisAction(i18nc("Liquify Transform Tab Label", "Liquify"));
125 meshAction = new KisAction(i18nc("Mesh Transform Tab Label", "Mesh"));
126 cageAction = new KisAction(i18nc("Cage Transform Tab Label", "Cage"));
127 freeTransformAction = new KisAction(i18nc("Free Transform Tab Label", "Free"));
128 perspectiveAction = new KisAction(i18nc("Perspective Transform Tab Label", "Perspective"));
129
130 // extra actions for free transform that are in the tool options
131 mirrorHorizontalAction = new KisAction(i18n("Mirror Horizontal"));
132 mirrorVerticalAction = new KisAction(i18n("Mirror Vertical"));
133 rotateNinetyCWAction = new KisAction(i18n("Rotate 90 degrees Clockwise"));
134 rotateNinetyCCWAction = new KisAction(i18n("Rotate 90 degrees CounterClockwise"));
135
136 keepAspectRatioAction = new KisAction(i18n("Keep Aspect Ratio"));
137 keepAspectRatioAction->setCheckable(true);
138 keepAspectRatioAction->setChecked(false);
139
140 applyTransformation = new KisAction(i18n("Apply"));
141 resetTransformation = new KisAction(i18n("Reset"));
142
143 m_contextMenu.reset(new QMenu());
144
145 connect(m_warpStrategy.data(), SIGNAL(requestCanvasUpdate()), SLOT(canvasUpdateRequested()));
146 connect(m_warpStrategy.data(), SIGNAL(requestImageRecalculation()), SLOT(requestImageRecalculation()));
147 connect(m_cageStrategy.data(), SIGNAL(requestCanvasUpdate()), SLOT(canvasUpdateRequested()));
148 connect(m_cageStrategy.data(), SIGNAL(requestImageRecalculation()), SLOT(requestImageRecalculation()));
149 connect(m_liquifyStrategy.data(), SIGNAL(requestCanvasUpdate()), SLOT(canvasUpdateRequested()));
150 connect(m_liquifyStrategy.data(), SIGNAL(requestCursorOutlineUpdate(QPointF)), SLOT(cursorOutlineUpdateRequested(QPointF)));
151 connect(m_liquifyStrategy.data(), SIGNAL(requestUpdateOptionWidget()), SLOT(updateOptionWidget()));
153 connect(m_freeStrategy.data(), SIGNAL(requestCanvasUpdate()), SLOT(canvasUpdateRequested()));
154 connect(m_freeStrategy.data(), SIGNAL(requestResetRotationCenterButtons()), SLOT(resetRotationCenterButtonsRequested()));
155 connect(m_freeStrategy.data(), SIGNAL(requestShowImageTooBig(bool)), SLOT(imageTooBigRequested(bool)));
156 connect(m_freeStrategy.data(), SIGNAL(requestImageRecalculation()), SLOT(requestImageRecalculation()));
157 connect(m_freeStrategy.data(), SIGNAL(requestConvexHullCalculation()), SLOT(convexHullCalculationRequested()));
158 connect(m_perspectiveStrategy.data(), SIGNAL(requestCanvasUpdate()), SLOT(canvasUpdateRequested()));
159 connect(m_perspectiveStrategy.data(), SIGNAL(requestShowImageTooBig(bool)), SLOT(imageTooBigRequested(bool)));
161 connect(m_meshStrategy.data(), SIGNAL(requestCanvasUpdate()), SLOT(canvasUpdateRequested()));
162 connect(m_meshStrategy.data(), SIGNAL(requestImageRecalculation()), SLOT(requestImageRecalculation()));
163
164 connect(&m_changesTracker, SIGNAL(sigConfigChanged(KisToolChangesTrackerDataSP)),
166
167 connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(slotGlobalConfigChanged()));
168}
static KisConfigNotifier * instance()
static QCursor rotateCursor()
KisAction * perspectiveAction
KisAction * resetTransformation
KisAction * applyTransformation
KisToolTransformConfigWidget * m_optionsWidget
KisToolChangesTracker m_changesTracker
KisAction * keepAspectRatioAction
QScopedPointer< KisMeshTransformStrategy > m_meshStrategy
void slotTrackerChangedConfig(KisToolChangesTrackerDataSP status)
QScopedPointer< KisFreeTransformStrategy > m_freeStrategy
void cursorOutlineUpdateRequested(const QPointF &imagePos)
void imageTooBigRequested(bool value)
ToolTransformArgs m_currentArgs
QPointer< KisCanvas2 > m_canvas
QScopedPointer< KisCageTransformStrategy > m_cageStrategy
QScopedPointer< QMenu > m_contextMenu
KisAction * mirrorVerticalAction
QScopedPointer< KisPerspectiveTransformStrategy > m_perspectiveStrategy
KisAction * mirrorHorizontalAction
KisAction * rotateNinetyCWAction
TransformTransactionProperties m_transaction
KisAction * warpAction
actions for the context click menu
void resetRotationCenterButtonsRequested()
KisToolUtils::MoveShortcutsHelper m_moveShortcutsHelper
KisAction * freeTransformAction
KisAction * rotateNinetyCCWAction
QScopedPointer< KisWarpTransformStrategy > m_warpStrategy
QScopedPointer< KisLiquifyTransformStrategy > m_liquifyStrategy
QPointer< KoCanvasResourceProvider > resourceManager
KisTool(KoCanvasBase *canvas, const QCursor &cursor)
Definition kis_tool.cc:78
KisCanvas2 * canvas

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.

◆ ~KisToolTransform()

Member Function Documentation

◆ activate

void KisToolTransform::activate ( const QSet< KoShape * > & shapes)
overrideslot

we cannot initialize the setting in the constructor, because factory() is not yet initialized, so we cannot get toolId()

Definition at line 818 of file kis_tool_transform.cc.

819{
820 KisTool::activate(shapes);
821
825
827
828 m_actionConnections.addConnection(action("movetool-move-up"), SIGNAL(triggered(bool)),
829 this, SLOT(slotMoveDiscreteUp()));
830 m_actionConnections.addConnection(action("movetool-move-up-more"), SIGNAL(triggered(bool)),
831 this, SLOT(slotMoveDiscreteUpMore()));
832 m_actionConnections.addConnection(action("movetool-move-down"), SIGNAL(triggered(bool)),
833 this, SLOT(slotMoveDiscreteDown()));
834 m_actionConnections.addConnection(action("movetool-move-down-more"), SIGNAL(triggered(bool)),
835 this, SLOT(slotMoveDiscreteDownMore()));
836 m_actionConnections.addConnection(action("movetool-move-left"), SIGNAL(triggered(bool)),
837 this, SLOT(slotMoveDiscreteLeft()));
838 m_actionConnections.addConnection(action("movetool-move-left-more"), SIGNAL(triggered(bool)),
839 this, SLOT(slotMoveDiscreteLeftMore()));
840 m_actionConnections.addConnection(action("movetool-move-right"), SIGNAL(triggered(bool)),
841 this, SLOT(slotMoveDiscreteRight()));
842 m_actionConnections.addConnection(action("movetool-move-right-more"), SIGNAL(triggered(bool)),
843 this, SLOT(slotMoveDiscreteRightMore()));
844
845 if (currentNode()) {
847 }
848
851}
void addConnection(Sender sender, Signal signal, Receiver receiver, Method method, Qt::ConnectionType type=Qt::AutoConnection)
static ToolTransformArgs::TransformMode toArgsMode(KisToolTransform::TransformToolMode toolMode)
TransformToolMode nextActivationTransformMode
void startStroke(ToolTransformArgs::TransformMode mode, bool forceReset)
KisSignalAutoConnectionsStore m_actionConnections
QAction * action(const QString &name) const
QList< KisNodeSP > KisNodeList
Definition kis_types.h:264
KisNodeSP currentNode() const
Definition kis_tool.cc:370
void activate(const QSet< KoShape * > &shapes) override
Definition kis_tool.cc:93

References KoToolBase::action(), KisToolUtils::MoveShortcutsHelper::activate(), KisTool::activate(), KisSignalAutoConnectionsStore::addConnection(), KisTool::currentNode(), FreeTransformMode, m_actionConnections, m_currentArgs, m_moveShortcutsHelper, m_transaction, nextActivationTransformMode, slotGlobalConfigChanged(), slotMoveDiscreteDown(), slotMoveDiscreteDownMore(), slotMoveDiscreteLeft(), slotMoveDiscreteLeftMore(), slotMoveDiscreteRight(), slotMoveDiscreteRightMore(), slotMoveDiscreteUp(), slotMoveDiscreteUpMore(), startStroke(), and toArgsMode().

◆ activateAlternateAction()

void KisToolTransform::activateAlternateAction ( AlternateAction action)
overridevirtual

Reimplemented from KisTool.

Definition at line 482 of file kis_tool_transform.cc.

483{
486}
KisTransformStrategyBase * currentStrategy() const
virtual void activateAlternateAction(KisTool::AlternateAction action)

References KoToolBase::action(), KisTransformStrategyBase::activateAlternateAction(), currentStrategy(), and setFunctionalCursor().

◆ activatePrimaryAction()

void KisToolTransform::activatePrimaryAction ( )
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 471 of file kis_tool_transform.cc.

References KisTransformStrategyBase::activatePrimaryAction(), currentStrategy(), and setFunctionalCursor().

◆ applyTransform

void KisToolTransform::applyTransform ( )
slot

Definition at line 540 of file kis_tool_transform.cc.

541{
543}

References slotApplyTransform().

◆ beginActionImpl()

void KisToolTransform::beginActionImpl ( KoPointerEvent * event,
bool usePrimaryAction,
KisTool::AlternateAction action )

Definition at line 348 of file kis_tool_transform.cc.

349{
350 if (!nodeEditable()) {
351 event->ignore();
352 return;
353 }
354
355 if (!m_strokeId) {
357 } else if (!m_transaction.rootNodes().isEmpty()) {
358 bool result = false;
359
360 if (usePrimaryAction) {
361 result = currentStrategy()->beginPrimaryAction(event);
362 } else {
363 result = currentStrategy()->beginAlternateAction(event, action);
364 }
365
366 if (result) {
368 }
369 }
370
372
374}
virtual bool beginAlternateAction(KoPointerEvent *event, KisTool::AlternateAction action)
virtual bool beginPrimaryAction(KoPointerEvent *event)=0
TransformMode mode() const
bool nodeEditable()
Checks checks if the current node is editable.
Definition kis_tool.cc:651
@ PAINT_MODE
Definition kis_tool.h:300
@ ChangeSize
Definition kis_tool.h:135
virtual void setMode(ToolMode mode)
Definition kis_tool.cc:403

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().

◆ beginAlternateAction()

void KisToolTransform::beginAlternateAction ( KoPointerEvent * event,
AlternateAction action )
overridevirtual

Reimplemented from KisTool.

Definition at line 493 of file kis_tool_transform.cc.

494{
495 beginActionImpl(event, false, action);
496}
void beginActionImpl(KoPointerEvent *event, bool usePrimaryAction, KisTool::AlternateAction action)

References KoToolBase::action(), and beginActionImpl().

◆ beginPrimaryAction()

void KisToolTransform::beginPrimaryAction ( KoPointerEvent * event)
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 456 of file kis_tool_transform.cc.

457{
458 beginActionImpl(event, true, KisTool::NONE);
459}

References beginActionImpl(), and KisTool::NONE.

◆ cancelStroke()

void KisToolTransform::cancelStroke ( )
private

Definition at line 1137 of file kis_tool_transform.cc.

References KisToolUtils::MoveShortcutsHelper::cancelMoveAction(), KisImage::cancelStroke(), KisAsynchronousStrokeUpdateHelper::cancelUpdateStream(), KisTool::image(), KisAsynchronousStrokeUpdateHelper::isActive(), m_asyncUpdateHelper, m_changesTracker, m_currentArgs, m_moveShortcutsHelper, m_strokeId, m_strokeStrategyCookie, m_transaction, outlineChanged(), and KisToolChangesTracker::reset().

◆ canvasUpdateRequested

void KisToolTransform::canvasUpdateRequested ( )
slot

Definition at line 195 of file kis_tool_transform.cc.

196{
197 m_canvas->updateCanvas();
198}

References m_canvas.

◆ commitChanges()

void KisToolTransform::commitChanges ( )
private

Definition at line 1154 of file kis_tool_transform.cc.

1155{
1156 if (!m_strokeId || m_transaction.rootNodes().isEmpty()) return;
1157
1159}
void commitConfig(KisToolChangesTrackerDataSP state)
KisToolChangesTrackerData * clone() const override
QSharedPointer< T > toQShared(T *ptr)

References ToolTransformArgs::clone(), KisToolChangesTracker::commitConfig(), m_changesTracker, m_currentArgs, m_strokeId, m_transaction, TransformTransactionProperties::rootNodes(), and toQShared().

◆ continueActionImpl()

void KisToolTransform::continueActionImpl ( KoPointerEvent * event,
bool usePrimaryAction,
KisTool::AlternateAction action )

Definition at line 376 of file kis_tool_transform.cc.

377{
378 if (mode() != KisTool::PAINT_MODE) return;
379 if (m_transaction.rootNodes().isEmpty()) return;
380
382
383 if (usePrimaryAction) {
385 } else {
387 }
388
391}
virtual void continuePrimaryAction(KoPointerEvent *event)=0
virtual void continueAlternateAction(KoPointerEvent *event, KisTool::AlternateAction action)
virtual ToolMode mode() const
Definition kis_tool.cc:407

References KoToolBase::action(), KisTransformStrategyBase::continueAlternateAction(), KisTransformStrategyBase::continuePrimaryAction(), currentStrategy(), m_actuallyMoveWhileSelected, m_transaction, KisTool::mode(), outlineChanged(), KisTool::PAINT_MODE, TransformTransactionProperties::rootNodes(), and updateOptionWidget().

◆ continueAlternateAction()

void KisToolTransform::continueAlternateAction ( KoPointerEvent * event,
AlternateAction action )
overridevirtual

Reimplemented from KisTool.

Definition at line 498 of file kis_tool_transform.cc.

499{
500 continueActionImpl(event, false, action);
501}
void continueActionImpl(KoPointerEvent *event, bool usePrimaryAction, KisTool::AlternateAction action)

References KoToolBase::action(), and continueActionImpl().

◆ continuePrimaryAction()

void KisToolTransform::continuePrimaryAction ( KoPointerEvent * event)
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 461 of file kis_tool_transform.cc.

462{
463 continueActionImpl(event, true, KisTool::NONE);
464}

References continueActionImpl(), and KisTool::NONE.

◆ convexHullCalculationRequested

void KisToolTransform::convexHullCalculationRequested ( )
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().

◆ createOptionWidget()

QWidget * KisToolTransform::createOptionWidget ( )
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 1172 of file kis_tool_transform.cc.

1173{
1174 if (!m_canvas) return 0;
1175
1177 Q_CHECK_PTR(m_optionsWidget);
1178 m_optionsWidget->setObjectName(toolId() + " option widget");
1179
1180 // See https://bugs.kde.org/show_bug.cgi?id=316896
1181 QWidget *specialSpacer = new QWidget(m_optionsWidget);
1182 specialSpacer->setObjectName("SpecialSpacer");
1183 specialSpacer->setFixedSize(0, 0);
1184 m_optionsWidget->layout()->addWidget(specialSpacer);
1185
1186
1187 connect(m_optionsWidget, SIGNAL(sigConfigChanged(bool)),
1188 this, SLOT(slotUiChangedConfig(bool)));
1189
1190 connect(m_optionsWidget, SIGNAL(sigApplyTransform()),
1191 this, SLOT(slotApplyTransform()));
1192
1193 connect(m_optionsWidget, SIGNAL(sigResetTransform(ToolTransformArgs::TransformMode)),
1195
1196 connect(m_optionsWidget, SIGNAL(sigCancelTransform()),
1197 this, SLOT(slotCancelTransform()));
1198
1199 connect(m_optionsWidget, SIGNAL(sigRestartTransform()),
1200 this, SLOT(slotRestartTransform()));
1201
1202 connect(m_optionsWidget, SIGNAL(sigUpdateGlobalConfig()),
1203 this, SLOT(slotGlobalConfigChanged()));
1204
1205 connect(m_optionsWidget, SIGNAL(sigRestartAndContinueTransform()),
1206 this, SLOT(slotRestartAndContinueTransform()));
1207
1208 connect(m_optionsWidget, SIGNAL(sigEditingFinished()),
1209 this, SLOT(slotEditingFinished()));
1210
1211
1212 connect(mirrorHorizontalAction, SIGNAL(triggered(bool)), m_optionsWidget, SLOT(slotFlipX()));
1213 connect(mirrorVerticalAction, SIGNAL(triggered(bool)), m_optionsWidget, SLOT(slotFlipY()));
1214 connect(rotateNinetyCWAction, SIGNAL(triggered(bool)), m_optionsWidget, SLOT(slotRotateCW()));
1215 connect(rotateNinetyCCWAction, SIGNAL(triggered(bool)), m_optionsWidget, SLOT(slotRotateCCW()));
1216
1217 connect(keepAspectRatioAction, SIGNAL(triggered(bool)), m_optionsWidget, SLOT(slotSetKeepAspectRatio(bool)));
1218
1219
1220 connect(warpAction, SIGNAL(triggered(bool)), this, SLOT(slotUpdateToWarpType()));
1221 connect(perspectiveAction, SIGNAL(triggered(bool)), this, SLOT(slotUpdateToPerspectiveType()));
1222 connect(freeTransformAction, SIGNAL(triggered(bool)), this, SLOT(slotUpdateToFreeTransformType()));
1223 connect(liquifyAction, SIGNAL(triggered(bool)), this, SLOT(slotUpdateToLiquifyType()));
1224 connect(meshAction, SIGNAL(triggered(bool)), this, SLOT(slotUpdateToMeshType()));
1225 connect(cageAction, SIGNAL(triggered(bool)), this, SLOT(slotUpdateToCageType()));
1226
1227 connect(applyTransformation, SIGNAL(triggered(bool)), this, SLOT(slotApplyTransform()));
1228 connect(resetTransformation, SIGNAL(triggered(bool)), this, SLOT(slotCancelTransform()));
1229
1230
1232
1233 return m_optionsWidget;
1234}
void slotUiChangedConfig(bool needsPreviewRecalculation)
void slotResetTransform(ToolTransformArgs::TransformMode mode)
Q_INVOKABLE QString toolId() const

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.

◆ currentStrategy()

◆ cursorOutlineUpdateRequested

void KisToolTransform::cursorOutlineUpdateRequested ( const QPointF & imagePos)
slot

Definition at line 323 of file kis_tool_transform.cc.

324{
325 QRect canvasUpdateRect;
326
327 if (!m_cursorOutline.isEmpty()) {
328 canvasUpdateRect = m_canvas->coordinatesConverter()->
329 imageToDocument(m_cursorOutline.boundingRect()).toAlignedRect();
330 }
331
333 getCursorOutline().translated(imagePos);
334
335 if (!m_cursorOutline.isEmpty()) {
336 canvasUpdateRect |=
337 m_canvas->coordinatesConverter()->
338 imageToDocument(m_cursorOutline.boundingRect()).toAlignedRect();
339 }
340
341 if (!canvasUpdateRect.isEmpty()) {
342 // grow rect a bit to follow interpolation fuzziness
343 canvasUpdateRect = kisGrowRect(canvasUpdateRect, 2);
344 m_canvas->updateCanvas(canvasUpdateRect);
345 }
346}
QPainterPath m_cursorOutline
T kisGrowRect(const T &rect, U offset)
Definition kis_global.h:186

References currentStrategy(), kisGrowRect(), m_canvas, and m_cursorOutline.

◆ deactivate

◆ deactivateAlternateAction()

void KisToolTransform::deactivateAlternateAction ( AlternateAction action)
overridevirtual

Reimplemented from KisTool.

Definition at line 488 of file kis_tool_transform.cc.

489{
491}
virtual void deactivateAlternateAction(KisTool::AlternateAction action)

References KoToolBase::action(), currentStrategy(), and KisTransformStrategyBase::deactivateAlternateAction().

◆ deactivatePrimaryAction()

void KisToolTransform::deactivatePrimaryAction ( )
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 477 of file kis_tool_transform.cc.

References currentStrategy(), and KisTransformStrategyBase::deactivatePrimaryAction().

◆ endActionImpl()

void KisToolTransform::endActionImpl ( KoPointerEvent * event,
bool usePrimaryAction,
KisTool::AlternateAction action )

Definition at line 393 of file kis_tool_transform.cc.

394{
395 if (mode() != KisTool::PAINT_MODE) return;
396
398
400 currentStrategy()->acceptsClicks()) {
401
402 bool result = false;
403
404 if (usePrimaryAction) {
405 result = currentStrategy()->endPrimaryAction(event);
406 } else {
407 result = currentStrategy()->endAlternateAction(event, action);
408 }
409
410 if (result) {
412 }
413
415 }
416
419}
virtual bool endPrimaryAction(KoPointerEvent *event)=0
virtual bool endAlternateAction(KoPointerEvent *event, KisTool::AlternateAction action)
@ HOVER_MODE
Definition kis_tool.h:299

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().

◆ endAlternateAction()

void KisToolTransform::endAlternateAction ( KoPointerEvent * event,
AlternateAction action )
overridevirtual

Reimplemented from KisTool.

Definition at line 503 of file kis_tool_transform.cc.

504{
505 endActionImpl(event, false, action);
506}
void endActionImpl(KoPointerEvent *event, bool usePrimaryAction, KisTool::AlternateAction action)

References KoToolBase::action(), and endActionImpl().

◆ endPrimaryAction()

void KisToolTransform::endPrimaryAction ( KoPointerEvent * event)
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 466 of file kis_tool_transform.cc.

467{
468 endActionImpl(event, true, KisTool::NONE);
469}

References endActionImpl(), and KisTool::NONE.

◆ endStroke()

void KisToolTransform::endStroke ( )
private

Definition at line 1050 of file kis_tool_transform.cc.

References KisImage::addJob(), KisToolUtils::MoveShortcutsHelper::endMoveAction(), KisImage::endStroke(), KisAsynchronousStrokeUpdateHelper::endUpdateStream(), KisTool::image(), KisAsynchronousStrokeUpdateHelper::isActive(), ToolTransformArgs::isUnchanging(), m_asyncUpdateHelper, m_changesTracker, m_currentArgs, m_currentlyUsingOverlayPreviewStyle, m_moveShortcutsHelper, m_strokeId, m_strokeStrategyCookie, m_transaction, outlineChanged(), KisToolChangesTracker::reset(), and TransformTransactionProperties::rootNodes().

◆ freeTransformChanged

void KisToolTransform::freeTransformChanged ( )
signal

◆ imageTooBigRequested

void KisToolTransform::imageTooBigRequested ( bool value)
slot

Definition at line 218 of file kis_tool_transform.cc.

219{
220 if (!m_optionsWidget) return;
222}
float value(const T *src, size_t ch)

References m_optionsWidget, KisToolTransformConfigWidget::setTooBigLabelVisible(), and value().

◆ initGuiAfterTransformMode()

◆ initThumbnailImage()

void KisToolTransform::initThumbnailImage ( KisPaintDeviceSP previewDevice)
private

Definition at line 760 of file kis_tool_transform.cc.

761{
762 QImage origImg;
763 m_selectedPortionCache = previewDevice;
764
765 QTransform thumbToImageTransform;
766
767 const int maxSize = 2000;
768
769 QRect srcRect(m_transaction.originalRect().toAlignedRect());
770 int x, y, w, h;
771 srcRect.getRect(&x, &y, &w, &h);
772
774 if (w > maxSize || h > maxSize) {
775 qreal scale = qreal(maxSize) / (w > h ? w : h);
776 QTransform scaleTransform = QTransform::fromScale(scale, scale);
777
778 QRect thumbRect = scaleTransform.mapRect(m_transaction.originalRect()).toAlignedRect();
779
780 origImg = m_selectedPortionCache->
781 createThumbnailUncached(thumbRect.width(),
782 thumbRect.height(),
783 srcRect, 1,
786 thumbToImageTransform = scaleTransform.inverted();
787
788 } else {
789 origImg = m_selectedPortionCache->convertToQImage(0, x, y, w, h,
792 thumbToImageTransform = QTransform();
793 }
794 }
795
796 // init both strokes since the thumbnail is initialized only once
797 // during the stroke
798 m_freeStrategy->setThumbnailImage(origImg, thumbToImageTransform);
799 m_perspectiveStrategy->setThumbnailImage(origImg, thumbToImageTransform);
800 m_warpStrategy->setThumbnailImage(origImg, thumbToImageTransform);
801 m_cageStrategy->setThumbnailImage(origImg, thumbToImageTransform);
802 m_liquifyStrategy->setThumbnailImage(origImg, thumbToImageTransform);
803 m_meshStrategy->setThumbnailImage(origImg, thumbToImageTransform);
804}
QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags()) const
KisPaintDeviceSP m_selectedPortionCache

References KisPaintDevice::convertToQImage(), KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), m_cageStrategy, m_freeStrategy, m_liquifyStrategy, m_meshStrategy, m_perspectiveStrategy, m_selectedPortionCache, m_transaction, m_warpStrategy, and TransformTransactionProperties::originalRect().

◆ initTransformMode()

void KisToolTransform::initTransformMode ( ToolTransformArgs::TransformMode mode)
private

Definition at line 745 of file kis_tool_transform.cc.

746{
749}
static ToolTransformArgs resetArgsForMode(ToolTransformArgs::TransformMode mode, const QString &filterId, const TransformTransactionProperties &transaction, KisPaintDeviceSP externalSource)
QString filterId() const
KisPaintDeviceSP externalSource() const

References ToolTransformArgs::externalSource(), ToolTransformArgs::filterId(), initGuiAfterTransformMode(), m_currentArgs, m_transaction, KisTool::mode(), and KisTransformUtils::resetArgsForMode().

◆ mouseMoveEvent()

void KisToolTransform::mouseMoveEvent ( KoPointerEvent * event)
overridevirtual

Called when the mouse or stylus moved over the canvas. Implementors should call event->ignore() if they do not actually use the event.

Parameters
eventstate and reason of this mouse or stylus move

Reimplemented from KisTool.

Definition at line 521 of file kis_tool_transform.cc.

522{
523 QPointF mousePos = m_canvas->coordinatesConverter()->documentToImage(event->point);
524
526
527 if (this->mode() != KisTool::PAINT_MODE) {
531 return;
532 }
533}
virtual void hoverActionCommon(KoPointerEvent *event)=0
QPointF point
The point in document coordinates.
void mouseMoveEvent(KoPointerEvent *event) override
Definition kis_tool.cc:520

References currentStrategy(), cursorOutlineUpdateRequested(), KisTransformStrategyBase::hoverActionCommon(), m_canvas, KisTool::mode(), KisTool::mouseMoveEvent(), KisTool::PAINT_MODE, KoPointerEvent::point, and setFunctionalCursor().

◆ mousePressEvent()

void KisToolTransform::mousePressEvent ( KoPointerEvent * event)
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.

Parameters
eventstate and reason of this mouse or stylus press

Reimplemented from KisTool.

Definition at line 508 of file kis_tool_transform.cc.

509{
510 // When using touch drawing, we only ever receive move events after the
511 // finger has pressed down. This confuses the strategies greatly, since they
512 // expect to receive a hover to tell which anchor the user wants to
513 // manipulate or similar. So in this case, we send an artificial hover.
514 if (event->isTouchEvent() && this->mode() != KisTool::PAINT_MODE) {
517 }
519}
bool isTouchEvent() const
void mousePressEvent(KoPointerEvent *event) override
Definition kis_tool.cc:510

References currentStrategy(), KisTransformStrategyBase::hoverActionCommon(), KoPointerEvent::isTouchEvent(), KisTool::mousePressEvent(), KisTool::PAINT_MODE, and setFunctionalCursor().

◆ mouseReleaseEvent()

void KisToolTransform::mouseReleaseEvent ( KoPointerEvent * event)
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.

Parameters
eventstate and reason of this mouse or stylus release

Reimplemented from KisTool.

Definition at line 535 of file kis_tool_transform.cc.

536{
538}
void mouseReleaseEvent(KoPointerEvent *event) override
Definition kis_tool.cc:515

References KisTool::mouseReleaseEvent().

◆ newActivationWithExternalSource()

void KisToolTransform::newActivationWithExternalSource ( KisPaintDeviceSP externalSource)
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 806 of file kis_tool_transform.cc.

807{
808 m_externalSourceForNextActivation = externalSource;
809 if (isActive()) {
810 QSet<KoShape*> dummy;
811 deactivate();
812 activate(dummy);
813 } else {
814 KoToolManager::instance()->switchToolRequested("KisToolTransform");
815 }
816}
void deactivate() override
KisPaintDeviceSP m_externalSourceForNextActivation
void activate(const QSet< KoShape * > &shapes) override
void switchToolRequested(const QString &id)
static KoToolManager * instance()
Return the toolmanager singleton.
bool isActive
Definition kis_tool.h:44

References activate(), deactivate(), KoToolManager::instance(), KisTool::isActive, m_externalSourceForNextActivation, and KoToolManager::switchToolRequested().

◆ outlineChanged()

void KisToolTransform::outlineChanged ( )
private

Definition at line 189 of file kis_tool_transform.cc.

190{
191 Q_EMIT freeTransformChanged();
192 m_canvas->updateCanvas();
193}
void freeTransformChanged()

References freeTransformChanged(), and m_canvas.

◆ paint()

void KisToolTransform::paint ( QPainter & painter,
const KoViewConverter & converter )
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.

Parameters
painterused for painting the shape
converterto convert between internal and view coordinates.

Implements KoToolBase.

Definition at line 284 of file kis_tool_transform.cc.

285{
286 Q_UNUSED(converter);
287
288 if (!m_strokeId || m_transaction.rootNodes().isEmpty()) return;
289
290 QRectF newRefRect = KisTransformUtils::imageToFlake(m_canvas->coordinatesConverter(), QRectF(0.0,0.0,1.0,1.0));
291 if (m_refRect != newRefRect) {
292 m_refRect = newRefRect;
294 }
296 currentStrategy()->paint(gc);
297
298
299 if (!m_cursorOutline.isEmpty()) {
300 QPainterPath mappedOutline =
302 m_canvas->coordinatesConverter()).map(m_cursorOutline);
303 paintToolOutline(&gc, mappedOutline);
304 }
305}
virtual void paint(QPainter &gc)=0
virtual void setDecorationThickness(int thickness)
static T imageToFlake(const KisCoordinatesConverter *converter, T object)
static QTransform imageToFlakeTransform(const KisCoordinatesConverter *converter)
int decorationThickness() const
decorationThickness The minimum thickness for tool decoration lines, this is derived from the screen ...
void paintToolOutline(QPainter *painter, const KisOptimizedBrushOutline &path)
Definition kis_tool.cc:589

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().

◆ popupActionsMenu()

QMenu * KisToolTransform::popupActionsMenu ( )
overridevirtual
Returns
a menu with context-aware actions for the current selection. If the returned value is null, no context menu is shown.

Reimplemented from KoToolBase.

Definition at line 421 of file kis_tool_transform.cc.

422{
423 if (m_contextMenu) {
424 m_contextMenu->clear();
425
426 m_contextMenu->addSection(i18n("Transform Tool Actions"));
427 // add a quick switch to different transform types
430 m_contextMenu->addAction(warpAction);
431 m_contextMenu->addAction(cageAction);
432 m_contextMenu->addAction(liquifyAction);
433 m_contextMenu->addAction(meshAction);
434
435 // extra options if free transform is selected
437 m_contextMenu->addSeparator();
442
443 m_contextMenu->addSeparator();
446 }
447
448 m_contextMenu->addSeparator();
451 }
452
453 return m_contextMenu.data();
454}
TransformToolMode transformMode

References applyTransformation, cageAction, freeTransformAction, FreeTransformMode, ToolTransformArgs::keepAspectRatio(), keepAspectRatioAction, liquifyAction, m_contextMenu, m_currentArgs, meshAction, mirrorHorizontalAction, mirrorVerticalAction, perspectiveAction, resetTransformation, rotateNinetyCCWAction, rotateNinetyCWAction, transformMode, and warpAction.

◆ requestImageRecalculation

◆ requestRedoDuringStroke

void KisToolTransform::requestRedoDuringStroke ( )
overrideslot

◆ requestStrokeCancellation

void KisToolTransform::requestStrokeCancellation ( )
overrideslot

◆ requestStrokeEnd

void KisToolTransform::requestStrokeEnd ( )
overrideslot

Definition at line 882 of file kis_tool_transform.cc.

883{
884 endStroke();
885}

References endStroke().

◆ requestUndoDuringStroke

◆ resetCursorStyle

void KisToolTransform::resetCursorStyle ( )
overrideprotectedslot

Definition at line 200 of file kis_tool_transform.cc.

201{
203}

References setFunctionalCursor().

◆ resetRotationCenterButtonsRequested

void KisToolTransform::resetRotationCenterButtonsRequested ( )
slot

◆ rotateX()

double KisToolTransform::rotateX ( ) const

Definition at line 591 of file kis_tool_transform.cc.

592{
593 return m_currentArgs.aX();
594}

References ToolTransformArgs::aX(), and m_currentArgs.

◆ rotateY()

double KisToolTransform::rotateY ( ) const

Definition at line 596 of file kis_tool_transform.cc.

597{
598 return m_currentArgs.aY();
599}

References ToolTransformArgs::aY(), and m_currentArgs.

◆ rotateZ()

double KisToolTransform::rotateZ ( ) const

Definition at line 601 of file kis_tool_transform.cc.

602{
603 return m_currentArgs.aZ();
604}

References ToolTransformArgs::aZ(), and m_currentArgs.

◆ scaleX()

double KisToolTransform::scaleX ( ) const

Definition at line 606 of file kis_tool_transform.cc.

607{
608 return m_currentArgs.scaleX();
609}

References m_currentArgs, and ToolTransformArgs::scaleX().

◆ scaleY()

double KisToolTransform::scaleY ( ) const

Definition at line 611 of file kis_tool_transform.cc.

612{
613 return m_currentArgs.scaleY();
614}

References m_currentArgs, and ToolTransformArgs::scaleY().

◆ setFunctionalCursor()

void KisToolTransform::setFunctionalCursor ( )
private

Definition at line 307 of file kis_tool_transform.cc.

308{
310 return;
311 }
312
313 if (!m_strokeId) {
315 } else if (m_strokeId && m_transaction.rootNodes().isEmpty()) {
316 // we are in the middle of stroke initialization
318 } else {
319 useCursor(currentStrategy()->getCurrentCursor());
320 }
321}
static QCursor waitCursor()
Definition kis_cursor.cc:54
static QCursor pointingHandCursor()
void useCursor(const QCursor &cursor)
bool overrideCursorIfNotEditable()
Override the cursor appropriately if current node is not editable.
Definition kis_tool.cc:618

References currentStrategy(), m_strokeId, m_transaction, KisTool::overrideCursorIfNotEditable(), KisCursor::pointingHandCursor(), TransformTransactionProperties::rootNodes(), KoToolBase::useCursor(), and KisCursor::waitCursor().

◆ setNextActivationTransformMode()

void KisToolTransform::setNextActivationTransformMode ( KisToolTransform::TransformToolMode mode)

Definition at line 545 of file kis_tool_transform.cc.

References KisTool::mode(), and nextActivationTransformMode.

◆ setRotateX

void KisToolTransform::setRotateX ( double rotation)
slot

Definition at line 703 of file kis_tool_transform.cc.

704{
705 m_currentArgs.setAX( rotation );
706}

References m_currentArgs, and ToolTransformArgs::setAX().

◆ setRotateY

void KisToolTransform::setRotateY ( double rotation)
slot

Definition at line 708 of file kis_tool_transform.cc.

709{
710 m_currentArgs.setAY( rotation );
711}

References m_currentArgs, and ToolTransformArgs::setAY().

◆ setRotateZ

void KisToolTransform::setRotateZ ( double rotation)
slot

Definition at line 713 of file kis_tool_transform.cc.

714{
715 m_currentArgs.setAZ( rotation );
716}

References m_currentArgs, and ToolTransformArgs::setAZ().

◆ setScaleX

void KisToolTransform::setScaleX ( double scaleX)
slot

◆ setScaleY

void KisToolTransform::setScaleY ( double scaleY)
slot

◆ setShearX

void KisToolTransform::setShearX ( double shearX)
slot

◆ setShearY

void KisToolTransform::setShearY ( double shearY)
slot

◆ setTransformFunction()

void KisToolTransform::setTransformFunction ( QPointF mousePos,
Qt::KeyboardModifiers modifiers )
private

◆ setTransformMode

void KisToolTransform::setTransformMode ( KisToolTransform::TransformToolMode newMode)
slot

Definition at line 680 of file kis_tool_transform.cc.

681{
683
684 if( mode != m_currentArgs.mode() ) {
685 if( newMode == FreeTransformMode ) {
687 } else if( newMode == WarpTransformMode ) {
689 } else if( newMode == CageTransformMode ) {
691 } else if( newMode == LiquifyTransformMode ) {
693 } else if( newMode == PerspectiveTransformMode ) {
695 } else if( newMode == MeshTransformMode ) {
697 }
698
699 Q_EMIT transformModeChanged();
700 }
701}
void transformModeChanged()

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.

◆ setTranslateX

◆ setTranslateY

◆ setWarpFlexibility

void KisToolTransform::setWarpFlexibility ( double flexibility)
slot

Definition at line 735 of file kis_tool_transform.cc.

736{
737 m_currentArgs.setAlpha( flexibility );
738}
void setAlpha(double alpha)

References m_currentArgs, and ToolTransformArgs::setAlpha().

◆ setWarpPointDensity

void KisToolTransform::setWarpPointDensity ( int density)
slot

◆ setWarpType

◆ shearX()

double KisToolTransform::shearX ( ) const

Definition at line 616 of file kis_tool_transform.cc.

617{
618 return m_currentArgs.shearX();
619}

References m_currentArgs, and ToolTransformArgs::shearX().

◆ shearY()

double KisToolTransform::shearY ( ) const

Definition at line 621 of file kis_tool_transform.cc.

622{
623 return m_currentArgs.shearY();
624}

References m_currentArgs, and ToolTransformArgs::shearY().

◆ slotApplyTransform

void KisToolTransform::slotApplyTransform ( )
privateslot

Definition at line 1273 of file kis_tool_transform.cc.

1274{
1275 KisCursorOverrideLock cursorLock(KisCursor::waitCursor());
1276 endStroke();
1277}

References endStroke(), and KisCursor::waitCursor().

◆ slotCancelTransform

void KisToolTransform::slotCancelTransform ( )
privateslot

◆ slotConvexHullCalculated

void KisToolTransform::slotConvexHullCalculated ( QPolygon hull,
void * strokeStrategyCookie )
slot

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.

247{
248 if (!m_strokeId || strokeStrategyCookie != m_strokeStrategyCookie) return;
249 QPolygonF hullF = hull;
256 if (hullF.boundingRect() == m_transaction.originalRect()) {
260 } else {
261 warnTools << "WARNING: KisToolTransform: calculated convex hull's bounds "
262 "differ from the bounding rect of the source clip. It shouldn't "
263 "have happened";
264 }
265}
#define warnTools
Definition kis_debug.h:90

References canvasUpdateRequested(), currentStrategy(), KisTransformStrategyBase::externalConfigChanged(), m_strokeId, m_strokeStrategyCookie, m_transaction, TransformTransactionProperties::originalRect(), TransformTransactionProperties::setConvexHull(), and warnTools.

◆ slotEditingFinished

void KisToolTransform::slotEditingFinished ( )
privateslot

Definition at line 1362 of file kis_tool_transform.cc.

1363{
1364 commitChanges();
1365}

References commitChanges().

◆ slotGlobalConfigChanged

void KisToolTransform::slotGlobalConfigChanged ( )
protectedslot

Definition at line 205 of file kis_tool_transform.cc.

206{
207 KConfigGroup group = KSharedConfig::openConfig()->group(toolId());
208 m_preferOverlayPreviewStyle = group.readEntry("useOverlayPreviewStyle", false);
209 m_forceLodMode = group.readEntry("forceLodMode", true);
210}

References m_forceLodMode, m_preferOverlayPreviewStyle, and KoToolBase::toolId().

◆ slotMoveDiscreteDown

void KisToolTransform::slotMoveDiscreteDown ( )
privateslot

Definition at line 1377 of file kis_tool_transform.cc.

1378{
1380}
void setTranslateY(double translateY)

References setTranslateY(), and translateY.

◆ slotMoveDiscreteDownMore

void KisToolTransform::slotMoveDiscreteDownMore ( )
privateslot

Definition at line 1382 of file kis_tool_transform.cc.

1383{
1384 setTranslateY(translateY()+10.0);
1385}

References setTranslateY(), and translateY.

◆ slotMoveDiscreteLeft

void KisToolTransform::slotMoveDiscreteLeft ( )
privateslot

Definition at line 1387 of file kis_tool_transform.cc.

1388{
1390}
void setTranslateX(double translateX)

References setTranslateX(), and translateX.

◆ slotMoveDiscreteLeftMore

void KisToolTransform::slotMoveDiscreteLeftMore ( )
privateslot

Definition at line 1392 of file kis_tool_transform.cc.

1393{
1394 setTranslateX(translateX()-10.0);
1395}

References setTranslateX(), and translateX.

◆ slotMoveDiscreteRight

void KisToolTransform::slotMoveDiscreteRight ( )
privateslot

Definition at line 1397 of file kis_tool_transform.cc.

1398{
1400}

References setTranslateX(), and translateX.

◆ slotMoveDiscreteRightMore

void KisToolTransform::slotMoveDiscreteRightMore ( )
privateslot

Definition at line 1402 of file kis_tool_transform.cc.

1403{
1404 setTranslateX(translateX()+10.0);
1405}

References setTranslateX(), and translateX.

◆ slotMoveDiscreteUp

void KisToolTransform::slotMoveDiscreteUp ( )
privateslot

Definition at line 1367 of file kis_tool_transform.cc.

1368{
1370}

References setTranslateY(), and translateY.

◆ slotMoveDiscreteUpMore

void KisToolTransform::slotMoveDiscreteUpMore ( )
privateslot

Definition at line 1372 of file kis_tool_transform.cc.

1373{
1374 setTranslateY(translateY()-10.0);
1375}

References setTranslateY(), and translateY.

◆ slotPreviewDeviceGenerated

void KisToolTransform::slotPreviewDeviceGenerated ( KisPaintDeviceSP device)
privateslot

Definition at line 1119 of file kis_tool_transform.cc.

1120{
1121 if (device && device->exactBounds().isEmpty()) {
1122 KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
1123 KIS_SAFE_ASSERT_RECOVER(kisCanvas) { cancelStroke(); return; }
1124 kisCanvas->viewManager()->
1125 showFloatingMessage(
1126 i18nc("floating message in transformation tool",
1127 "Cannot transform empty layer "),
1128 QIcon(), 1000, KisFloatingMessage::Medium);
1129
1130 cancelStroke();
1131 } else {
1132 initThumbnailImage(device);
1134 }
1135}
KisViewManager * viewManager() const
QRect exactBounds() const
void initThumbnailImage(KisPaintDeviceSP previewDevice)
#define KIS_SAFE_ASSERT_RECOVER(cond)
Definition kis_assert.h:126

References cancelStroke(), Private::canvas, KisPaintDevice::exactBounds(), initGuiAfterTransformMode(), initThumbnailImage(), KIS_SAFE_ASSERT_RECOVER, KisFloatingMessage::Medium, and KisCanvas2::viewManager().

◆ slotResetTransform

void KisToolTransform::slotResetTransform ( ToolTransformArgs::TransformMode mode)
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 1279 of file kis_tool_transform.cc.

1280{
1282 const ToolTransformArgs::TransformMode previousMode = config->mode();
1283 config->setMode(mode);
1284
1286 config->setWarpCalculation(KisWarpTransformWorker::WarpCalculation::GRID);
1287 }
1288
1289 if (!m_strokeId || m_transaction.rootNodes().isEmpty()) return;
1290
1293
1303 const bool transformDiffers = !m_currentArgs.continuedTransform()->isSameMode(m_currentArgs);
1304
1305 if (transformDiffers &&
1306 m_currentArgs.continuedTransform()->mode() == savedMode) {
1307
1311
1312 } else {
1313 cancelStroke();
1314 startStroke(savedMode, true);
1315
1317 }
1318 } else {
1324
1325 } else {
1326 cancelStroke();
1328
1329 }
1330 }
1331}
void initTransformMode(ToolTransformArgs::TransformMode mode)
static bool shouldRestartStrokeOnModeChange(ToolTransformArgs::TransformMode oldMode, ToolTransformArgs::TransformMode newMode, KisNodeList processedNodes)
void setWarpCalculation(KisWarpTransformWorker::WarpCalculation warpCalc)
void setMode(TransformMode mode)
bool isSameMode(const ToolTransformArgs &other) const
const ToolTransformArgs * continuedTransform() const
#define KIS_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:97

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.

◆ slotRestartAndContinueTransform

void KisToolTransform::slotRestartAndContinueTransform ( )
privateslot

Definition at line 1350 of file kis_tool_transform.cc.

1351{
1352 if (!m_strokeId || m_transaction.rootNodes().isEmpty()) return;
1353
1354 KisNodeSP root = m_transaction.rootNodes()[0];
1355 KIS_ASSERT_RECOVER_RETURN(root); // the stroke is guaranteed to be started by an 'if' above
1356
1358 endStroke();
1359 startStroke(savedArgs.mode(), false);
1360}
#define KIS_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:75

References endStroke(), KIS_ASSERT_RECOVER_RETURN, m_currentArgs, m_strokeId, m_transaction, ToolTransformArgs::mode(), TransformTransactionProperties::rootNodes(), and startStroke().

◆ slotRestartTransform

void KisToolTransform::slotRestartTransform ( )
privateslot

Definition at line 1338 of file kis_tool_transform.cc.

1339{
1340 if (!m_strokeId || m_transaction.rootNodes().isEmpty()) return;
1341
1342 KisNodeSP root = m_transaction.rootNodes()[0];
1343 KIS_ASSERT_RECOVER_RETURN(root); // the stroke is guaranteed to be started by an 'if' above
1344
1346 cancelStroke();
1347 startStroke(savedArgs.mode(), true);
1348}

References cancelStroke(), KIS_ASSERT_RECOVER_RETURN, m_currentArgs, m_strokeId, m_transaction, ToolTransformArgs::mode(), TransformTransactionProperties::rootNodes(), and startStroke().

◆ slotTrackerChangedConfig

void KisToolTransform::slotTrackerChangedConfig ( KisToolChangesTrackerDataSP status)
privateslot

Definition at line 1161 of file kis_tool_transform.cc.

1162{
1163 const ToolTransformArgs *newArgs = dynamic_cast<const ToolTransformArgs*>(status.data());
1165
1166 *m_transaction.currentConfig() = *newArgs;
1167
1168 slotUiChangedConfig(true);
1170}
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128

References TransformTransactionProperties::currentConfig(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_transaction, slotUiChangedConfig(), and updateOptionWidget().

◆ slotTransactionGenerated

void KisToolTransform::slotTransactionGenerated ( TransformTransactionProperties transaction,
ToolTransformArgs args,
void * strokeStrategyCookie )
privateslot

Definition at line 1076 of file kis_tool_transform.cc.

1077{
1078 if (!m_strokeId || strokeStrategyCookie != m_strokeStrategyCookie) return;
1079
1080 if (transaction.transformedNodes().isEmpty() ||
1081 transaction.originalRect().isEmpty()) {
1082
1083 KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
1084 KIS_ASSERT(kisCanvas);
1085 kisCanvas->viewManager()->
1086 showFloatingMessage(
1087 i18nc("floating message in transformation tool",
1088 "Cannot transform empty layer "),
1089 QIcon(), 1000, KisFloatingMessage::Medium);
1090
1091 cancelStroke();
1092 return;
1093 }
1094
1095 m_transaction = transaction;
1096 m_currentArgs = args;
1098
1101 }
1102
1104 commitChanges();
1105
1107
1109 KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
1110 KIS_ASSERT(kisCanvas);
1111 kisCanvas->viewManager()->
1112 showFloatingMessage(
1113 i18nc("floating message in transformation tool",
1114 "Invisible sublayers will also be transformed. Lock layers if you do not want them to be transformed "),
1115 QIcon(), 4000, KisFloatingMessage::Low);
1116 }
1117}
void setCurrentConfigLocation(ToolTransformArgs *config)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130
#define KIS_ASSERT(cond)
Definition kis_assert.h:33

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().

◆ slotUiChangedConfig

void KisToolTransform::slotUiChangedConfig ( bool needsPreviewRecalculation)
privateslot

◆ slotUpdateToCageType

void KisToolTransform::slotUpdateToCageType ( )
privateslot

Definition at line 1432 of file kis_tool_transform.cc.

1433{
1435}
void setTransformMode(KisToolTransform::TransformToolMode newMode)

References CageTransformMode, and setTransformMode().

◆ slotUpdateToFreeTransformType

void KisToolTransform::slotUpdateToFreeTransformType ( )
privateslot

◆ slotUpdateToLiquifyType

void KisToolTransform::slotUpdateToLiquifyType ( )
privateslot

◆ slotUpdateToMeshType

void KisToolTransform::slotUpdateToMeshType ( )
privateslot

◆ slotUpdateToPerspectiveType

void KisToolTransform::slotUpdateToPerspectiveType ( )
privateslot

◆ slotUpdateToWarpType

void KisToolTransform::slotUpdateToWarpType ( )
privateslot

◆ startStroke()

void KisToolTransform::startStroke ( ToolTransformArgs::TransformMode mode,
bool forceReset )
private

When working with transform mask, selections are not taken into account.

Definition at line 907 of file kis_tool_transform.cc.

908{
909 Q_ASSERT(!m_strokeId);
910
913
914 // set up and null checks before we do anything
915 KisResourcesSnapshotSP resources =
916 new KisResourcesSnapshot(image(), currentNode(), this->canvas()->resourceManager(), 0, selectedNodes(), 0);
917 KisNodeList rootNodes = resources->selectedNodes();
918 //Filter out any nodes that might be children of other selected nodes so they aren't used twice
921
924
925 Q_FOREACH (KisNodeSP currentNode, resources->selectedNodes()) {
926 KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
927 KIS_ASSERT(kisCanvas);
928
929 if (!currentNode || !currentNode->isEditable()) {
931 kisCanvas->viewManager()->
932 showFloatingMessage(
933 i18nc("floating message in transformation tool",
934 "Cannot transform locked layers"),
935 koIcon("object-locked"), 4000, KisFloatingMessage::High);
936 } else if (currentNode && !currentNode->visible()) {
937 kisCanvas->viewManager()->
938 showFloatingMessage(
939 i18nc("floating message in transformation tool",
940 "Cannot transform hidden layers"),
941 koIcon("object-locked"), 4000, KisFloatingMessage::High);
942 } else {
943 kisCanvas->viewManager()->
944 showFloatingMessage(
945 i18nc("floating message in transformation tool",
946 "Cannot use transform tool on this set of layers"),
947 koIcon("object-locked"), 4000, KisFloatingMessage::High);
948 }
949
950 return;
951 }
952
953 // some layer types cannot be transformed. Give a message and return if a user tries it
954 if (currentNode->inherits("KisColorizeMask") ||
955 currentNode->inherits("KisFileLayer") ||
956 currentNode->inherits("KisCloneLayer")) {
957
958 if(currentNode->inherits("KisColorizeMask")){
959 kisCanvas->viewManager()->
960 showFloatingMessage(
961 i18nc("floating message in transformation tool",
962 "Layer type cannot use the transform tool"),
963 koIcon("object-locked"), 4000, KisFloatingMessage::High);
964 }
965 else{
966 kisCanvas->viewManager()->
967 showFloatingMessage(
968 i18nc("floating message in transformation tool",
969 "Layer type cannot use the transform tool. Use transform mask instead."),
970 koIcon("object-locked"), 4000, KisFloatingMessage::High);
971 }
972 return;
973 }
974
975 KisNodeSP impossibleMask =
977 [currentNode] (KisNodeSP node) {
978 // we can process transform masks of the first level
979 if (node == currentNode || node->parent() == currentNode) return false;
980
981 return node->inherits("KisTransformMask") && node->visible(true);
982 });
983
984 if (impossibleMask) {
985 kisCanvas->viewManager()->
986 showFloatingMessage(
987 i18nc("floating message in transformation tool",
988 "Layer has children with transform masks. Please disable them before doing transformation."),
989 koIcon("object-locked"), 8000, KisFloatingMessage::High);
990 return;
991 }
992
997 if (selection && dynamic_cast<KisTransformMask*>(currentNode.data())) {
998 kisCanvas->viewManager()->
999 showFloatingMessage(
1000 i18nc("floating message in transformation tool",
1001 "Selections are not used when editing transform masks "),
1002 QIcon(), 4000, KisFloatingMessage::Low);
1003
1004 selection = 0;
1005 }
1006 }
1007 // Overlay preview is never used when transforming an externally provided image
1009
1010 KisStrokeStrategy *strategy = 0;
1011
1013 TransformStrokeStrategy *transformStrategy = new TransformStrokeStrategy(mode, m_currentArgs.filterId(), forceReset, rootNodes, selection, image().data(), image().data());
1014 connect(transformStrategy, SIGNAL(sigPreviewDeviceReady(KisPaintDeviceSP)), SLOT(slotPreviewDeviceGenerated(KisPaintDeviceSP)));
1015 connect(transformStrategy, SIGNAL(sigTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)), SLOT(slotTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)));
1016 connect(transformStrategy, SIGNAL(sigConvexHullCalculated(QPolygon, void*)), SLOT(slotConvexHullCalculated(QPolygon, void*)));
1017 strategy = transformStrategy;
1018
1019 // save unique identifier of the stroke so we could
1020 // recognize it when sigTransactionGenerated() is
1021 // received (theoretically, the user can start two
1022 // strokes at the same time, if he is quick enough)
1023 m_strokeStrategyCookie = transformStrategy;
1024
1025 } else {
1026 InplaceTransformStrokeStrategy *transformStrategy = new InplaceTransformStrokeStrategy(mode, m_currentArgs.filterId(), forceReset, rootNodes, selection, externalSource, image().data(), image().data(), image()->root(), m_forceLodMode);
1027 connect(transformStrategy, SIGNAL(sigTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)), SLOT(slotTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)));
1028 connect(transformStrategy, SIGNAL(sigConvexHullCalculated(QPolygon, void*)), SLOT(slotConvexHullCalculated(QPolygon, void*)));
1029 strategy = transformStrategy;
1030
1031 // save unique identifier of the stroke so we could
1032 // recognize it when sigTransactionGenerated() is
1033 // received (theoretically, the user can start two
1034 // strokes at the same time, if he is quick enough)
1035 m_strokeStrategyCookie = transformStrategy;
1036 }
1037
1038 m_strokeId = image()->startStroke(strategy);
1040
1043 }
1044
1046
1048}
void initUpdateStreamLowLevel(KisStrokesFacade *strokesFacade, KisStrokeId strokeId)
KisStrokeId startStroke(KisStrokeStrategy *strokeStrategy) override
The KisResourcesSnapshot class takes a snapshot of the various resources like colors and settings use...
KisNodeList selectedNodes() const
KisSelectionSP activeSelection() const
void slotConvexHullCalculated(QPolygon hull, void *strokeStrategyCookie)
void slotPreviewDeviceGenerated(KisPaintDeviceSP device)
void slotTransactionGenerated(TransformTransactionProperties transaction, ToolTransformArgs args, void *strokeStrategyCookie)
virtual KoToolSelection * selection()
#define koIcon(name)
Use these macros for icons without any issues.
Definition kis_icon.h:25
KisNodeSP recursiveFindNode(KisNodeSP node, std::function< bool(KisNodeSP)> func)
void filterMergeableNodes(KisNodeList &nodes, bool allowMasks)
bool isEditable(bool checkVisibility=true) const
bool userLocked() const
virtual bool visible(bool recursive=false) const
KisNodeWSP parent
Definition kis_node.cpp:86
KisNodeList selectedNodes() const
Definition kis_tool.cc:376

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_moveShortcutsHelper, m_preferOverlayPreviewStyle, m_strokeId, m_strokeStrategyCookie, m_transaction, KisTool::mode(), KisNode::parent, KisLayerUtils::recursiveFindNode(), KisResourcesSnapshot::selectedNodes(), KisTool::selectedNodes(), KoToolBase::selection(), slotConvexHullCalculated(), slotPreviewDeviceGenerated(), slotTransactionGenerated(), KisToolUtils::MoveShortcutsHelper::startMoveAction(), KisImage::startStroke(), KisBaseNode::userLocked(), KisCanvas2::viewManager(), and KisBaseNode::visible().

◆ toArgsMode()

◆ transformMode()

◆ transformModeChanged

void KisToolTransform::transformModeChanged ( )
signal

◆ translateX()

double KisToolTransform::translateX ( ) const

Definition at line 581 of file kis_tool_transform.cc.

582{
583 return m_currentArgs.transformedCenter().x();
584}
QPointF transformedCenter() const

References m_currentArgs, and ToolTransformArgs::transformedCenter().

◆ translateY()

double KisToolTransform::translateY ( ) const

Definition at line 586 of file kis_tool_transform.cc.

587{
588 return m_currentArgs.transformedCenter().y();
589}

References m_currentArgs, and ToolTransformArgs::transformedCenter().

◆ updateApplyResetAvailability()

void KisToolTransform::updateApplyResetAvailability ( )
private

◆ updateOptionWidget

void KisToolTransform::updateOptionWidget ( )
slot

Definition at line 1236 of file kis_tool_transform.cc.

1237{
1238 if (!m_optionsWidget) return;
1239
1240 if (!currentNode()) {
1241 m_optionsWidget->setEnabled(false);
1242 return;
1243 }
1244 else {
1245 m_optionsWidget->setEnabled(true);
1247 }
1248}
void updateConfig(const ToolTransformArgs &config)

References KisTool::currentNode(), m_currentArgs, m_optionsWidget, and KisToolTransformConfigWidget::updateConfig().

◆ wantsAutoScroll()

bool KisToolTransform::wantsAutoScroll ( ) const
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

Returns
false

Reimplemented from KoToolBase.

Definition at line 134 of file kis_tool_transform.h.

134 {
135 return false;
136 }

◆ warpFlexibility()

double KisToolTransform::warpFlexibility ( ) const

Definition at line 640 of file kis_tool_transform.cc.

641{
642 return m_currentArgs.alpha();
643}

References ToolTransformArgs::alpha(), and m_currentArgs.

◆ warpPointDensity()

int KisToolTransform::warpPointDensity ( ) const

Definition at line 645 of file kis_tool_transform.cc.

646{
647 return m_currentArgs.numPoints();
648}

References m_currentArgs, and ToolTransformArgs::numPoints().

◆ warpTransformChanged

void KisToolTransform::warpTransformChanged ( )
signal

◆ warpType()

Member Data Documentation

◆ applyTransformation

KisAction* KisToolTransform::applyTransformation {0}
private

Definition at line 295 of file kis_tool_transform.h.

295{0};

◆ cageAction

KisAction* KisToolTransform::cageAction {0}
private

Definition at line 292 of file kis_tool_transform.h.

292{0};

◆ freeTransformAction

KisAction* KisToolTransform::freeTransformAction {0}
private

Definition at line 293 of file kis_tool_transform.h.

293{0};

◆ keepAspectRatioAction

KisAction* KisToolTransform::keepAspectRatioAction {0}
private

Definition at line 303 of file kis_tool_transform.h.

303{0};

◆ liquifyAction

KisAction* KisToolTransform::liquifyAction {0}
private

Definition at line 291 of file kis_tool_transform.h.

291{0};

◆ m_actionConnections

KisSignalAutoConnectionsStore KisToolTransform::m_actionConnections
private

Definition at line 284 of file kis_tool_transform.h.

◆ m_actuallyMoveWhileSelected

bool KisToolTransform::m_actuallyMoveWhileSelected {false}
private

Definition at line 267 of file kis_tool_transform.h.

267{false}; // true <=> selection has been moved while clicked

◆ m_asyncUpdateHelper

KisAsynchronousStrokeUpdateHelper KisToolTransform::m_asyncUpdateHelper
private

Definition at line 325 of file kis_tool_transform.h.

◆ m_cageStrategy

QScopedPointer<KisCageTransformStrategy> KisToolTransform::m_cageStrategy
private

Definition at line 316 of file kis_tool_transform.h.

◆ m_canvas

QPointer<KisCanvas2> KisToolTransform::m_canvas
private

Definition at line 280 of file kis_tool_transform.h.

◆ m_changesTracker

KisToolChangesTracker KisToolTransform::m_changesTracker
private

Definition at line 283 of file kis_tool_transform.h.

◆ m_contextMenu

QScopedPointer<QMenu> KisToolTransform::m_contextMenu
private

Definition at line 239 of file kis_tool_transform.h.

◆ m_currentArgs

ToolTransformArgs KisToolTransform::m_currentArgs
private

Definition at line 261 of file kis_tool_transform.h.

◆ m_currentlyUsingOverlayPreviewStyle

bool KisToolTransform::m_currentlyUsingOverlayPreviewStyle {false}
private

Definition at line 272 of file kis_tool_transform.h.

272{false};

◆ m_cursorOutline

QPainterPath KisToolTransform::m_cursorOutline
private

Definition at line 323 of file kis_tool_transform.h.

◆ m_externalSourceForNextActivation

KisPaintDeviceSP KisToolTransform::m_externalSourceForNextActivation
private

Definition at line 265 of file kis_tool_transform.h.

◆ m_forceLodMode

bool KisToolTransform::m_forceLodMode {false}
private

Definition at line 274 of file kis_tool_transform.h.

274{false};

◆ m_freeStrategy

QScopedPointer<KisFreeTransformStrategy> KisToolTransform::m_freeStrategy
private

Definition at line 319 of file kis_tool_transform.h.

◆ m_liquifyStrategy

QScopedPointer<KisLiquifyTransformStrategy> KisToolTransform::m_liquifyStrategy
private

Definition at line 317 of file kis_tool_transform.h.

◆ m_meshStrategy

QScopedPointer<KisMeshTransformStrategy> KisToolTransform::m_meshStrategy
private

Definition at line 318 of file kis_tool_transform.h.

◆ m_moveShortcutsHelper

KisToolUtils::MoveShortcutsHelper KisToolTransform::m_moveShortcutsHelper
private

Definition at line 327 of file kis_tool_transform.h.

◆ m_optionsWidget

KisToolTransformConfigWidget* KisToolTransform::m_optionsWidget {0}
private

Definition at line 279 of file kis_tool_transform.h.

279{0};

◆ m_perspectiveStrategy

QScopedPointer<KisPerspectiveTransformStrategy> KisToolTransform::m_perspectiveStrategy
private

Definition at line 320 of file kis_tool_transform.h.

◆ m_preferOverlayPreviewStyle

bool KisToolTransform::m_preferOverlayPreviewStyle {false}
private

Definition at line 273 of file kis_tool_transform.h.

273{false};

◆ m_refRect

QRectF KisToolTransform::m_refRect
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 313 of file kis_tool_transform.h.

◆ m_selectedPortionCache

KisPaintDeviceSP KisToolTransform::m_selectedPortionCache
private

Definition at line 269 of file kis_tool_transform.h.

◆ m_selectionPath

QPainterPath KisToolTransform::m_selectionPath
private

Definition at line 277 of file kis_tool_transform.h.

◆ m_strokeId

KisStrokeId KisToolTransform::m_strokeId
private

Definition at line 270 of file kis_tool_transform.h.

◆ m_strokeStrategyCookie

void* KisToolTransform::m_strokeStrategyCookie {0}
private

Definition at line 271 of file kis_tool_transform.h.

271{0};

◆ m_transaction

TransformTransactionProperties KisToolTransform::m_transaction
private

Definition at line 282 of file kis_tool_transform.h.

◆ m_warpStrategy

QScopedPointer<KisWarpTransformStrategy> KisToolTransform::m_warpStrategy
private

Definition at line 315 of file kis_tool_transform.h.

◆ meshAction

KisAction* KisToolTransform::meshAction {0}
private

Definition at line 290 of file kis_tool_transform.h.

290{0};

◆ mirrorHorizontalAction

KisAction* KisToolTransform::mirrorHorizontalAction {0}
private

Definition at line 299 of file kis_tool_transform.h.

299{0};

◆ mirrorVerticalAction

KisAction* KisToolTransform::mirrorVerticalAction {0}
private

Definition at line 300 of file kis_tool_transform.h.

300{0};

◆ nextActivationTransformMode

TransformToolMode KisToolTransform::nextActivationTransformMode {FreeTransformMode}
private

Definition at line 286 of file kis_tool_transform.h.

◆ perspectiveAction

KisAction* KisToolTransform::perspectiveAction {0}
private

Definition at line 294 of file kis_tool_transform.h.

294{0};

◆ resetTransformation

KisAction* KisToolTransform::resetTransformation {0}
private

Definition at line 296 of file kis_tool_transform.h.

296{0};

◆ rotateNinetyCCWAction

KisAction* KisToolTransform::rotateNinetyCCWAction {0}
private

Definition at line 302 of file kis_tool_transform.h.

302{0};

◆ rotateNinetyCWAction

KisAction* KisToolTransform::rotateNinetyCWAction {0}
private

Definition at line 301 of file kis_tool_transform.h.

301{0};

◆ warpAction

KisAction* KisToolTransform::warpAction {0}
private

actions for the context click menu

Definition at line 289 of file kis_tool_transform.h.

289{0};

Property Documentation

◆ rotateX

double KisToolTransform::rotateX
readwrite

Definition at line 89 of file kis_tool_transform.h.

◆ rotateY

double KisToolTransform::rotateY
readwrite

Definition at line 90 of file kis_tool_transform.h.

◆ rotateZ

double KisToolTransform::rotateZ
readwrite

Definition at line 91 of file kis_tool_transform.h.

◆ scaleX

double KisToolTransform::scaleX
readwrite

Definition at line 93 of file kis_tool_transform.h.

◆ scaleY

double KisToolTransform::scaleY
readwrite

Definition at line 94 of file kis_tool_transform.h.

◆ shearX

double KisToolTransform::shearX
readwrite

Definition at line 96 of file kis_tool_transform.h.

◆ shearY

double KisToolTransform::shearY
readwrite

Definition at line 97 of file kis_tool_transform.h.

◆ transformMode

TransformToolMode KisToolTransform::transformMode
readwrite

Definition at line 84 of file kis_tool_transform.h.

◆ translateX

double KisToolTransform::translateX
readwrite

Definition at line 86 of file kis_tool_transform.h.

◆ translateY

double KisToolTransform::translateY
readwrite

Definition at line 87 of file kis_tool_transform.h.

◆ warpFlexibility

double KisToolTransform::warpFlexibility
readwrite

Definition at line 100 of file kis_tool_transform.h.

◆ warpPointDensity

int KisToolTransform::warpPointDensity
readwrite

Definition at line 101 of file kis_tool_transform.h.

◆ warpType

WarpType KisToolTransform::warpType
readwrite

Definition at line 99 of file kis_tool_transform.h.


The documentation for this class was generated from the following files: