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 slotDecreaseBrushSize ()
 
void slotEditingFinished ()
 
void slotIncreaseBrushSize ()
 
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
 
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 78 of file kis_tool_transform.h.

Member Enumeration Documentation

◆ TransformToolMode

Enumerator
FreeTransformMode 
WarpTransformMode 
CageTransformMode 
LiquifyTransformMode 
PerspectiveTransformMode 
MeshTransformMode 

Definition at line 105 of file kis_tool_transform.h.

◆ WarpType

Enumerator
RigidWarpType 
AffineWarpType 
SimilitudeWarpType 

Definition at line 115 of file kis_tool_transform.h.

Constructor & Destructor Documentation

◆ KisToolTransform()

KisToolTransform::KisToolTransform ( KoCanvasBase * canvas)

Definition at line 85 of file kis_tool_transform.cc.

89 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
90 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
94 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
95 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
99 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
103 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
104 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
108 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
109 dynamic_cast<KisCanvas2*>(canvas)->snapGuide(),
113 dynamic_cast<KisCanvas2*>(canvas)->coordinatesConverter(),
114 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()
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 817 of file kis_tool_transform.cc.

818{
819 KisTool::activate(shapes);
820
824
825 m_actionConnections.addConnection(action("movetool-move-up"), SIGNAL(triggered(bool)),
826 this, SLOT(slotMoveDiscreteUp()));
827 m_actionConnections.addConnection(action("movetool-move-up-more"), SIGNAL(triggered(bool)),
828 this, SLOT(slotMoveDiscreteUpMore()));
829 m_actionConnections.addConnection(action("movetool-move-down"), SIGNAL(triggered(bool)),
830 this, SLOT(slotMoveDiscreteDown()));
831 m_actionConnections.addConnection(action("movetool-move-down-more"), SIGNAL(triggered(bool)),
832 this, SLOT(slotMoveDiscreteDownMore()));
833 m_actionConnections.addConnection(action("movetool-move-left"), SIGNAL(triggered(bool)),
834 this, SLOT(slotMoveDiscreteLeft()));
835 m_actionConnections.addConnection(action("movetool-move-left-more"), SIGNAL(triggered(bool)),
836 this, SLOT(slotMoveDiscreteLeftMore()));
837 m_actionConnections.addConnection(action("movetool-move-right"), SIGNAL(triggered(bool)),
838 this, SLOT(slotMoveDiscreteRight()));
839 m_actionConnections.addConnection(action("movetool-move-right-more"), SIGNAL(triggered(bool)),
840 this, SLOT(slotMoveDiscreteRightMore()));
841 m_actionConnections.addConnection(action("increase_brush_size"),
842 SIGNAL(triggered()),
843 this,
844 SLOT(slotIncreaseBrushSize()));
845 m_actionConnections.addConnection(action("decrease_brush_size"),
846 SIGNAL(triggered()),
847 this,
848 SLOT(slotDecreaseBrushSize()));
849
850 if (currentNode()) {
852 }
853
856}
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(), 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().

◆ activateAlternateAction()

void KisToolTransform::activateAlternateAction ( AlternateAction action)
overridevirtual

Reimplemented from KisTool.

Definition at line 483 of file kis_tool_transform.cc.

484{
487}
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 472 of file kis_tool_transform.cc.

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

◆ applyTransform

void KisToolTransform::applyTransform ( )
slot

Definition at line 541 of file kis_tool_transform.cc.

542{
544}

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 494 of file kis_tool_transform.cc.

495{
496 beginActionImpl(event, false, action);
497}
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 457 of file kis_tool_transform.cc.

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

References beginActionImpl(), and KisTool::NONE.

◆ cancelStroke()

void KisToolTransform::cancelStroke ( )
private

◆ 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 1155 of file kis_tool_transform.cc.

1156{
1157 if (!m_strokeId || m_transaction.rootNodes().isEmpty()) return;
1158
1160}
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
392}
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(), setFunctionalCursor(), and updateOptionWidget().

◆ continueAlternateAction()

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

Reimplemented from KisTool.

Definition at line 499 of file kis_tool_transform.cc.

500{
501 continueActionImpl(event, false, action);
502}
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 462 of file kis_tool_transform.cc.

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

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 1173 of file kis_tool_transform.cc.

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

void KisToolTransform::deactivate ( )
overrideslot

◆ deactivateAlternateAction()

void KisToolTransform::deactivateAlternateAction ( AlternateAction action)
overridevirtual

Reimplemented from KisTool.

Definition at line 489 of file kis_tool_transform.cc.

490{
492}
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 478 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 394 of file kis_tool_transform.cc.

395{
396 if (mode() != KisTool::PAINT_MODE) return;
397
399
401 currentStrategy()->acceptsClicks()) {
402
403 bool result = false;
404
405 if (usePrimaryAction) {
406 result = currentStrategy()->endPrimaryAction(event);
407 } else {
408 result = currentStrategy()->endAlternateAction(event, action);
409 }
410
411 if (result) {
413 }
414
416 }
417
420}
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 504 of file kis_tool_transform.cc.

505{
506 endActionImpl(event, false, action);
507}
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 467 of file kis_tool_transform.cc.

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

References endActionImpl(), and KisTool::NONE.

◆ endStroke()

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

◆ 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 761 of file kis_tool_transform.cc.

762{
763 QImage origImg;
764 m_selectedPortionCache = previewDevice;
765
766 QTransform thumbToImageTransform;
767
768 const int maxSize = 2000;
769
770 QRect srcRect(m_transaction.originalRect().toAlignedRect());
771 int x, y, w, h;
772 srcRect.getRect(&x, &y, &w, &h);
773
775 if (w > maxSize || h > maxSize) {
776 qreal scale = qreal(maxSize) / (w > h ? w : h);
777 QTransform scaleTransform = QTransform::fromScale(scale, scale);
778
779 QRect thumbRect = scaleTransform.mapRect(m_transaction.originalRect()).toAlignedRect();
780
781 QSize size = thumbRect.size();
782 if (size.width() < 1) size.setWidth(1);
783 if (size.height() < 1) size.setHeight(1);
785 origImg = m_canvas->displayColorConverter()->convertImageToDisplayColorSpace(dev, QRect(QPoint(0, 0), size), true);
786
787 thumbToImageTransform = scaleTransform.inverted();
788
789 } else {
790 origImg = m_canvas->displayColorConverter()->convertImageToDisplayColorSpace(m_selectedPortionCache, QRect(x, y, w, h), true);
791 thumbToImageTransform = QTransform();
792 }
793 }
794
795 // init both strokes since the thumbnail is initialized only once
796 // during the stroke
797 m_freeStrategy->setThumbnailImage(origImg, thumbToImageTransform);
798 m_perspectiveStrategy->setThumbnailImage(origImg, thumbToImageTransform);
799 m_warpStrategy->setThumbnailImage(origImg, thumbToImageTransform);
800 m_cageStrategy->setThumbnailImage(origImg, thumbToImageTransform);
801 m_liquifyStrategy->setThumbnailImage(origImg, thumbToImageTransform);
802 m_meshStrategy->setThumbnailImage(origImg, thumbToImageTransform);
803}
KisPaintDeviceSP createThumbnailDeviceOversampled(qint32 w, qint32 h, qreal oversample, QRect rect=QRect(), QRect outputRect=QRect()) const
KisPaintDeviceSP m_selectedPortionCache
int size(const Forest< T > &forest)
Definition KisForest.h:1232

References KisPaintDevice::createThumbnailDeviceOversampled(), m_cageStrategy, m_canvas, 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 746 of file kis_tool_transform.cc.

747{
750}
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 522 of file kis_tool_transform.cc.

523{
524 QPointF mousePos = m_canvas->coordinatesConverter()->documentToImage(event->point);
525
527
528 if (this->mode() != KisTool::PAINT_MODE) {
532 return;
533 }
534}
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 509 of file kis_tool_transform.cc.

510{
511 // When using touch drawing, we only ever receive move events after the
512 // finger has pressed down. This confuses the strategies greatly, since they
513 // expect to receive a hover to tell which anchor the user wants to
514 // manipulate or similar. So in this case, we send an artificial hover.
515 if (event->isTouchEvent() && this->mode() != KisTool::PAINT_MODE) {
518 }
520}
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 536 of file kis_tool_transform.cc.

537{
539}
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 805 of file kis_tool_transform.cc.

806{
807 m_externalSourceForNextActivation = externalSource;
808 if (isActive()) {
809 QSet<KoShape*> dummy;
810 deactivate();
811 activate(dummy);
812 } else {
813 KoToolManager::instance()->switchToolRequested("KisToolTransform");
814 }
815}
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, m_canvas->displayRendererInterface());
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, const KoColorDisplayRendererInterface *displayRendererInterface)=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 422 of file kis_tool_transform.cc.

423{
424 if (m_contextMenu) {
425 m_contextMenu->clear();
426
427 m_contextMenu->addSection(i18n("Transform Tool Actions"));
428 // add a quick switch to different transform types
431 m_contextMenu->addAction(warpAction);
432 m_contextMenu->addAction(cageAction);
433 m_contextMenu->addAction(liquifyAction);
434 m_contextMenu->addAction(meshAction);
435
436 // extra options if free transform is selected
438 m_contextMenu->addSeparator();
443
444 m_contextMenu->addSeparator();
447 }
448
449 m_contextMenu->addSeparator();
452 }
453
454 return m_contextMenu.data();
455}
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 886 of file kis_tool_transform.cc.

887{
888 endStroke();
889}

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 592 of file kis_tool_transform.cc.

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

References ToolTransformArgs::aX(), and m_currentArgs.

◆ rotateY()

double KisToolTransform::rotateY ( ) const

Definition at line 597 of file kis_tool_transform.cc.

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

References ToolTransformArgs::aY(), and m_currentArgs.

◆ rotateZ()

double KisToolTransform::rotateZ ( ) const

Definition at line 602 of file kis_tool_transform.cc.

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

References ToolTransformArgs::aZ(), and m_currentArgs.

◆ scaleX()

double KisToolTransform::scaleX ( ) const

Definition at line 607 of file kis_tool_transform.cc.

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

References m_currentArgs, and ToolTransformArgs::scaleX().

◆ scaleY()

double KisToolTransform::scaleY ( ) const

Definition at line 612 of file kis_tool_transform.cc.

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

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 546 of file kis_tool_transform.cc.

References KisTool::mode(), and nextActivationTransformMode.

◆ setRotateX

void KisToolTransform::setRotateX ( double rotation)
slot

Definition at line 704 of file kis_tool_transform.cc.

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

References m_currentArgs, and ToolTransformArgs::setAX().

◆ setRotateY

void KisToolTransform::setRotateY ( double rotation)
slot

Definition at line 709 of file kis_tool_transform.cc.

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

References m_currentArgs, and ToolTransformArgs::setAY().

◆ setRotateZ

void KisToolTransform::setRotateZ ( double rotation)
slot

Definition at line 714 of file kis_tool_transform.cc.

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

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 681 of file kis_tool_transform.cc.

682{
684
685 if( mode != m_currentArgs.mode() ) {
686 if( newMode == FreeTransformMode ) {
688 } else if( newMode == WarpTransformMode ) {
690 } else if( newMode == CageTransformMode ) {
692 } else if( newMode == LiquifyTransformMode ) {
694 } else if( newMode == PerspectiveTransformMode ) {
696 } else if( newMode == MeshTransformMode ) {
698 }
699
700 Q_EMIT transformModeChanged();
701 }
702}
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 736 of file kis_tool_transform.cc.

737{
738 m_currentArgs.setAlpha( flexibility );
739}
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 617 of file kis_tool_transform.cc.

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

References m_currentArgs, and ToolTransformArgs::shearX().

◆ shearY()

double KisToolTransform::shearY ( ) const

Definition at line 622 of file kis_tool_transform.cc.

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

References m_currentArgs, and ToolTransformArgs::shearY().

◆ slotApplyTransform

void KisToolTransform::slotApplyTransform ( )
privateslot

Definition at line 1274 of file kis_tool_transform.cc.

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

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.

◆ slotDecreaseBrushSize

void KisToolTransform::slotDecreaseBrushSize ( )
privateslot

◆ slotEditingFinished

void KisToolTransform::slotEditingFinished ( )
privateslot

Definition at line 1363 of file kis_tool_transform.cc.

1364{
1365 commitChanges();
1366}

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

◆ slotIncreaseBrushSize

void KisToolTransform::slotIncreaseBrushSize ( )
privateslot

◆ slotMoveDiscreteDown

void KisToolTransform::slotMoveDiscreteDown ( )
privateslot

Definition at line 1378 of file kis_tool_transform.cc.

1379{
1381}
void setTranslateY(double translateY)

References setTranslateY(), and translateY.

◆ slotMoveDiscreteDownMore

void KisToolTransform::slotMoveDiscreteDownMore ( )
privateslot

Definition at line 1383 of file kis_tool_transform.cc.

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

References setTranslateY(), and translateY.

◆ slotMoveDiscreteLeft

void KisToolTransform::slotMoveDiscreteLeft ( )
privateslot

Definition at line 1388 of file kis_tool_transform.cc.

1389{
1391}
void setTranslateX(double translateX)

References setTranslateX(), and translateX.

◆ slotMoveDiscreteLeftMore

void KisToolTransform::slotMoveDiscreteLeftMore ( )
privateslot

Definition at line 1393 of file kis_tool_transform.cc.

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

References setTranslateX(), and translateX.

◆ slotMoveDiscreteRight

void KisToolTransform::slotMoveDiscreteRight ( )
privateslot

Definition at line 1398 of file kis_tool_transform.cc.

1399{
1401}

References setTranslateX(), and translateX.

◆ slotMoveDiscreteRightMore

void KisToolTransform::slotMoveDiscreteRightMore ( )
privateslot

Definition at line 1403 of file kis_tool_transform.cc.

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

References setTranslateX(), and translateX.

◆ slotMoveDiscreteUp

void KisToolTransform::slotMoveDiscreteUp ( )
privateslot

Definition at line 1368 of file kis_tool_transform.cc.

1369{
1371}

References setTranslateY(), and translateY.

◆ slotMoveDiscreteUpMore

void KisToolTransform::slotMoveDiscreteUpMore ( )
privateslot

Definition at line 1373 of file kis_tool_transform.cc.

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

References setTranslateY(), and translateY.

◆ slotPreviewDeviceGenerated

void KisToolTransform::slotPreviewDeviceGenerated ( KisPaintDeviceSP device)
privateslot

Definition at line 1121 of file kis_tool_transform.cc.

1122{
1123 if (device && device->exactBounds().isEmpty()) {
1124 KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
1125 KIS_SAFE_ASSERT_RECOVER(kisCanvas) { cancelStroke(); return; }
1126 kisCanvas->viewManager()->
1127 showFloatingMessage(
1128 i18nc("floating message in transformation tool",
1129 "Cannot transform empty layer "),
1130 QIcon(), 1000, KisFloatingMessage::Medium);
1131
1132 cancelStroke();
1133 } else {
1134 initThumbnailImage(device);
1136 }
1137}
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 1280 of file kis_tool_transform.cc.

1281{
1283 const ToolTransformArgs::TransformMode previousMode = config->mode();
1284 config->setMode(mode);
1285
1287 config->setWarpCalculation(KisWarpTransformWorker::WarpCalculation::GRID);
1288 }
1289
1290 if (!m_strokeId || m_transaction.rootNodes().isEmpty()) return;
1291
1294
1304 const bool transformDiffers = !m_currentArgs.continuedTransform()->isSameMode(m_currentArgs);
1305
1306 if (transformDiffers &&
1307 m_currentArgs.continuedTransform()->mode() == savedMode) {
1308
1312
1313 } else {
1314 cancelStroke();
1315 startStroke(savedMode, true);
1316
1318 }
1319 } else {
1325
1326 } else {
1327 cancelStroke();
1329
1330 }
1331 }
1332}
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 1351 of file kis_tool_transform.cc.

1352{
1353 if (!m_strokeId || m_transaction.rootNodes().isEmpty()) return;
1354
1355 KisNodeSP root = m_transaction.rootNodes()[0];
1356 KIS_ASSERT_RECOVER_RETURN(root); // the stroke is guaranteed to be started by an 'if' above
1357
1359 endStroke();
1360 startStroke(savedArgs.mode(), false);
1361}
#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 1339 of file kis_tool_transform.cc.

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

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 1162 of file kis_tool_transform.cc.

1163{
1164 const ToolTransformArgs *newArgs = dynamic_cast<const ToolTransformArgs*>(status.data());
1166
1167 *m_transaction.currentConfig() = *newArgs;
1168
1169 slotUiChangedConfig(true);
1171}
#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 1078 of file kis_tool_transform.cc.

1079{
1080 if (!m_strokeId || strokeStrategyCookie != m_strokeStrategyCookie) return;
1081
1082 if (transaction.transformedNodes().isEmpty() ||
1083 transaction.originalRect().isEmpty()) {
1084
1085 KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
1086 KIS_ASSERT(kisCanvas);
1087 kisCanvas->viewManager()->
1088 showFloatingMessage(
1089 i18nc("floating message in transformation tool",
1090 "Cannot transform empty layer "),
1091 QIcon(), 1000, KisFloatingMessage::Medium);
1092
1093 cancelStroke();
1094 return;
1095 }
1096
1097 m_transaction = transaction;
1098 m_currentArgs = args;
1100
1103 }
1104
1106 commitChanges();
1107
1109
1111 KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
1112 KIS_ASSERT(kisCanvas);
1113 kisCanvas->viewManager()->
1114 showFloatingMessage(
1115 i18nc("floating message in transformation tool",
1116 "Invisible sublayers will also be transformed. Lock layers if you do not want them to be transformed "),
1117 QIcon(), 4000, KisFloatingMessage::Low);
1118 }
1119}
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 1443 of file kis_tool_transform.cc.

1444{
1446}
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 911 of file kis_tool_transform.cc.

912{
913 Q_ASSERT(!m_strokeId);
914
917
918 // set up and null checks before we do anything
919 KisResourcesSnapshotSP resources =
920 new KisResourcesSnapshot(image(), currentNode(), this->canvas()->resourceManager(), 0, selectedNodes(), 0);
921 KisNodeList rootNodes = resources->selectedNodes();
922 //Filter out any nodes that might be children of other selected nodes so they aren't used twice
925
928
929 Q_FOREACH (KisNodeSP currentNode, resources->selectedNodes()) {
930 KisCanvas2 *kisCanvas = dynamic_cast<KisCanvas2*>(canvas());
931 KIS_ASSERT(kisCanvas);
932
933 if (!currentNode || !currentNode->isEditable()) {
935 kisCanvas->viewManager()->
936 showFloatingMessage(
937 i18nc("floating message in transformation tool",
938 "Cannot transform locked layers"),
939 koIcon("object-locked"), 4000, KisFloatingMessage::High);
940 } else if (currentNode && !currentNode->visible()) {
941 kisCanvas->viewManager()->
942 showFloatingMessage(
943 i18nc("floating message in transformation tool",
944 "Cannot transform hidden layers"),
945 koIcon("object-locked"), 4000, KisFloatingMessage::High);
946 } else {
947 kisCanvas->viewManager()->
948 showFloatingMessage(
949 i18nc("floating message in transformation tool",
950 "Cannot use transform tool on this set of layers"),
951 koIcon("object-locked"), 4000, KisFloatingMessage::High);
952 }
953
954 return;
955 }
956
957 // some layer types cannot be transformed. Give a message and return if a user tries it
958 if (currentNode->inherits("KisColorizeMask") ||
959 currentNode->inherits("KisFileLayer") ||
960 currentNode->inherits("KisCloneLayer")) {
961
962 if(currentNode->inherits("KisColorizeMask")){
963 kisCanvas->viewManager()->
964 showFloatingMessage(
965 i18nc("floating message in transformation tool",
966 "Layer type cannot use the transform tool"),
967 koIcon("object-locked"), 4000, KisFloatingMessage::High);
968 }
969 else{
970 kisCanvas->viewManager()->
971 showFloatingMessage(
972 i18nc("floating message in transformation tool",
973 "Layer type cannot use the transform tool. Use transform mask instead."),
974 koIcon("object-locked"), 4000, KisFloatingMessage::High);
975 }
976 return;
977 }
978
979 KisNodeSP impossibleMask =
981 [currentNode] (KisNodeSP node) {
982 // we can process transform masks of the first level
983 if (node == currentNode || node->parent() == currentNode) return false;
984
985 return node->inherits("KisTransformMask") && node->visible(true);
986 });
987
988 if (impossibleMask) {
989 kisCanvas->viewManager()->
990 showFloatingMessage(
991 i18nc("floating message in transformation tool",
992 "Layer has children with transform masks. Please disable them before doing transformation."),
993 koIcon("object-locked"), 8000, KisFloatingMessage::High);
994 return;
995 }
996
1001 if (selection && dynamic_cast<KisTransformMask*>(currentNode.data())) {
1002 kisCanvas->viewManager()->
1003 showFloatingMessage(
1004 i18nc("floating message in transformation tool",
1005 "Selections are not used when editing transform masks "),
1006 QIcon(), 4000, KisFloatingMessage::Low);
1007
1008 selection = 0;
1009 }
1010 }
1011 // Overlay preview is never used when transforming an externally provided image
1013
1014 KisStrokeStrategy *strategy = 0;
1015
1017 TransformStrokeStrategy *transformStrategy = new TransformStrokeStrategy(mode, m_currentArgs.filterId(), forceReset, rootNodes, selection, image().data(), image().data());
1018 connect(transformStrategy, SIGNAL(sigPreviewDeviceReady(KisPaintDeviceSP)), SLOT(slotPreviewDeviceGenerated(KisPaintDeviceSP)));
1019 connect(transformStrategy, SIGNAL(sigTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)), SLOT(slotTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)));
1020 connect(transformStrategy, SIGNAL(sigConvexHullCalculated(QPolygon, void*)), SLOT(slotConvexHullCalculated(QPolygon, void*)));
1021 strategy = transformStrategy;
1022
1023 // save unique identifier of the stroke so we could
1024 // recognize it when sigTransactionGenerated() is
1025 // received (theoretically, the user can start two
1026 // strokes at the same time, if he is quick enough)
1027 m_strokeStrategyCookie = transformStrategy;
1028
1029 } else {
1030 InplaceTransformStrokeStrategy *transformStrategy = new InplaceTransformStrokeStrategy(mode, m_currentArgs.filterId(), forceReset, rootNodes, selection, externalSource, image().data(), image().data(), image()->root(), m_forceLodMode);
1031 connect(transformStrategy, SIGNAL(sigTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)), SLOT(slotTransactionGenerated(TransformTransactionProperties, ToolTransformArgs, void*)));
1032 connect(transformStrategy, SIGNAL(sigConvexHullCalculated(QPolygon, void*)), SLOT(slotConvexHullCalculated(QPolygon, void*)));
1033 strategy = transformStrategy;
1034
1035 // save unique identifier of the stroke so we could
1036 // recognize it when sigTransactionGenerated() is
1037 // received (theoretically, the user can start two
1038 // strokes at the same time, if he is quick enough)
1039 m_strokeStrategyCookie = transformStrategy;
1040 }
1041
1042 m_strokeId = image()->startStroke(strategy);
1043
1046 }
1047
1049
1051}
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_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().

◆ toArgsMode()

◆ transformMode()

◆ transformModeChanged

void KisToolTransform::transformModeChanged ( )
signal

◆ translateX()

double KisToolTransform::translateX ( ) const

Definition at line 582 of file kis_tool_transform.cc.

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

References m_currentArgs, and ToolTransformArgs::transformedCenter().

◆ translateY()

double KisToolTransform::translateY ( ) const

Definition at line 587 of file kis_tool_transform.cc.

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

References m_currentArgs, and ToolTransformArgs::transformedCenter().

◆ updateApplyResetAvailability()

void KisToolTransform::updateApplyResetAvailability ( )
private

◆ updateOptionWidget

void KisToolTransform::updateOptionWidget ( )
slot

Definition at line 1237 of file kis_tool_transform.cc.

1238{
1239 if (!m_optionsWidget) return;
1240
1241 if (!currentNode()) {
1242 m_optionsWidget->setEnabled(false);
1243 return;
1244 }
1245 else {
1246 m_optionsWidget->setEnabled(true);
1248 }
1249}
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 133 of file kis_tool_transform.h.

133 {
134 return false;
135 }

◆ warpFlexibility()

double KisToolTransform::warpFlexibility ( ) const

Definition at line 641 of file kis_tool_transform.cc.

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

References ToolTransformArgs::alpha(), and m_currentArgs.

◆ warpPointDensity()

int KisToolTransform::warpPointDensity ( ) const

Definition at line 646 of file kis_tool_transform.cc.

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

References m_currentArgs, and ToolTransformArgs::numPoints().

◆ warpTransformChanged

void KisToolTransform::warpTransformChanged ( )
signal

◆ warpType()

Member Data Documentation

◆ applyTransformation

KisAction* KisToolTransform::applyTransformation {0}
private

Definition at line 294 of file kis_tool_transform.h.

294{0};

◆ cageAction

KisAction* KisToolTransform::cageAction {0}
private

Definition at line 291 of file kis_tool_transform.h.

291{0};

◆ freeTransformAction

KisAction* KisToolTransform::freeTransformAction {0}
private

Definition at line 292 of file kis_tool_transform.h.

292{0};

◆ keepAspectRatioAction

KisAction* KisToolTransform::keepAspectRatioAction {0}
private

Definition at line 302 of file kis_tool_transform.h.

302{0};

◆ liquifyAction

KisAction* KisToolTransform::liquifyAction {0}
private

Definition at line 290 of file kis_tool_transform.h.

290{0};

◆ m_actionConnections

KisSignalAutoConnectionsStore KisToolTransform::m_actionConnections
private

Definition at line 283 of file kis_tool_transform.h.

◆ m_actuallyMoveWhileSelected

bool KisToolTransform::m_actuallyMoveWhileSelected {false}
private

Definition at line 266 of file kis_tool_transform.h.

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

◆ m_asyncUpdateHelper

KisAsynchronousStrokeUpdateHelper KisToolTransform::m_asyncUpdateHelper
private

Definition at line 324 of file kis_tool_transform.h.

◆ m_cageStrategy

QScopedPointer<KisCageTransformStrategy> KisToolTransform::m_cageStrategy
private

Definition at line 315 of file kis_tool_transform.h.

◆ m_canvas

QPointer<KisCanvas2> KisToolTransform::m_canvas
private

Definition at line 279 of file kis_tool_transform.h.

◆ m_changesTracker

KisToolChangesTracker KisToolTransform::m_changesTracker
private

Definition at line 282 of file kis_tool_transform.h.

◆ m_contextMenu

QScopedPointer<QMenu> KisToolTransform::m_contextMenu
private

Definition at line 238 of file kis_tool_transform.h.

◆ m_currentArgs

ToolTransformArgs KisToolTransform::m_currentArgs
private

Definition at line 260 of file kis_tool_transform.h.

◆ m_currentlyUsingOverlayPreviewStyle

bool KisToolTransform::m_currentlyUsingOverlayPreviewStyle {false}
private

Definition at line 271 of file kis_tool_transform.h.

271{false};

◆ m_cursorOutline

QPainterPath KisToolTransform::m_cursorOutline
private

Definition at line 322 of file kis_tool_transform.h.

◆ m_externalSourceForNextActivation

KisPaintDeviceSP KisToolTransform::m_externalSourceForNextActivation
private

Definition at line 264 of file kis_tool_transform.h.

◆ m_forceLodMode

bool KisToolTransform::m_forceLodMode {false}
private

Definition at line 273 of file kis_tool_transform.h.

273{false};

◆ m_freeStrategy

QScopedPointer<KisFreeTransformStrategy> KisToolTransform::m_freeStrategy
private

Definition at line 318 of file kis_tool_transform.h.

◆ m_liquifyStrategy

QScopedPointer<KisLiquifyTransformStrategy> KisToolTransform::m_liquifyStrategy
private

Definition at line 316 of file kis_tool_transform.h.

◆ m_meshStrategy

QScopedPointer<KisMeshTransformStrategy> KisToolTransform::m_meshStrategy
private

Definition at line 317 of file kis_tool_transform.h.

◆ m_optionsWidget

KisToolTransformConfigWidget* KisToolTransform::m_optionsWidget {0}
private

Definition at line 278 of file kis_tool_transform.h.

278{0};

◆ m_perspectiveStrategy

QScopedPointer<KisPerspectiveTransformStrategy> KisToolTransform::m_perspectiveStrategy
private

Definition at line 319 of file kis_tool_transform.h.

◆ m_preferOverlayPreviewStyle

bool KisToolTransform::m_preferOverlayPreviewStyle {false}
private

Definition at line 272 of file kis_tool_transform.h.

272{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 312 of file kis_tool_transform.h.

◆ m_selectedPortionCache

KisPaintDeviceSP KisToolTransform::m_selectedPortionCache
private

Definition at line 268 of file kis_tool_transform.h.

◆ m_selectionPath

QPainterPath KisToolTransform::m_selectionPath
private

Definition at line 276 of file kis_tool_transform.h.

◆ m_strokeId

KisStrokeId KisToolTransform::m_strokeId
private

Definition at line 269 of file kis_tool_transform.h.

◆ m_strokeStrategyCookie

void* KisToolTransform::m_strokeStrategyCookie {0}
private

Definition at line 270 of file kis_tool_transform.h.

270{0};

◆ m_transaction

TransformTransactionProperties KisToolTransform::m_transaction
private

Definition at line 281 of file kis_tool_transform.h.

◆ m_warpStrategy

QScopedPointer<KisWarpTransformStrategy> KisToolTransform::m_warpStrategy
private

Definition at line 314 of file kis_tool_transform.h.

◆ meshAction

KisAction* KisToolTransform::meshAction {0}
private

Definition at line 289 of file kis_tool_transform.h.

289{0};

◆ mirrorHorizontalAction

KisAction* KisToolTransform::mirrorHorizontalAction {0}
private

Definition at line 298 of file kis_tool_transform.h.

298{0};

◆ mirrorVerticalAction

KisAction* KisToolTransform::mirrorVerticalAction {0}
private

Definition at line 299 of file kis_tool_transform.h.

299{0};

◆ nextActivationTransformMode

TransformToolMode KisToolTransform::nextActivationTransformMode {FreeTransformMode}
private

Definition at line 285 of file kis_tool_transform.h.

◆ perspectiveAction

KisAction* KisToolTransform::perspectiveAction {0}
private

Definition at line 293 of file kis_tool_transform.h.

293{0};

◆ resetTransformation

KisAction* KisToolTransform::resetTransformation {0}
private

Definition at line 295 of file kis_tool_transform.h.

295{0};

◆ rotateNinetyCCWAction

KisAction* KisToolTransform::rotateNinetyCCWAction {0}
private

Definition at line 301 of file kis_tool_transform.h.

301{0};

◆ rotateNinetyCWAction

KisAction* KisToolTransform::rotateNinetyCWAction {0}
private

Definition at line 300 of file kis_tool_transform.h.

300{0};

◆ warpAction

KisAction* KisToolTransform::warpAction {0}
private

actions for the context click menu

Definition at line 288 of file kis_tool_transform.h.

288{0};

Property Documentation

◆ rotateX

double KisToolTransform::rotateX
readwrite

Definition at line 88 of file kis_tool_transform.h.

◆ rotateY

double KisToolTransform::rotateY
readwrite

Definition at line 89 of file kis_tool_transform.h.

◆ rotateZ

double KisToolTransform::rotateZ
readwrite

Definition at line 90 of file kis_tool_transform.h.

◆ scaleX

double KisToolTransform::scaleX
readwrite

Definition at line 92 of file kis_tool_transform.h.

◆ scaleY

double KisToolTransform::scaleY
readwrite

Definition at line 93 of file kis_tool_transform.h.

◆ shearX

double KisToolTransform::shearX
readwrite

Definition at line 95 of file kis_tool_transform.h.

◆ shearY

double KisToolTransform::shearY
readwrite

Definition at line 96 of file kis_tool_transform.h.

◆ transformMode

TransformToolMode KisToolTransform::transformMode
readwrite

Definition at line 83 of file kis_tool_transform.h.

◆ translateX

double KisToolTransform::translateX
readwrite

Definition at line 85 of file kis_tool_transform.h.

◆ translateY

double KisToolTransform::translateY
readwrite

Definition at line 86 of file kis_tool_transform.h.

◆ warpFlexibility

double KisToolTransform::warpFlexibility
readwrite

Definition at line 99 of file kis_tool_transform.h.

◆ warpPointDensity

int KisToolTransform::warpPointDensity
readwrite

Definition at line 100 of file kis_tool_transform.h.

◆ warpType

WarpType KisToolTransform::warpType
readwrite

Definition at line 98 of file kis_tool_transform.h.


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