|
| void | activate (const QSet< KoShape * > &shapes) override |
| |
| void | beginPrimaryAction (KoPointerEvent *event) override |
| |
| void | continuePrimaryAction (KoPointerEvent *event) override |
| |
| QList< QPointer< QWidget > > | createOptionWidgets () override |
| |
| void | deactivate () override |
| |
| void | endPrimaryAction (KoPointerEvent *event) override |
| |
| void | keyPressEvent (QKeyEvent *event) override |
| |
| void | keyReleaseEvent (QKeyEvent *event) override |
| |
| | KisToolRectangleBase (KoCanvasBase *canvas, KisToolRectangleBase::ToolType type, const QCursor &cursor=KisCursor::load("tool_rectangle_cursor.png", 6, 6)) |
| |
| void | paint (QPainter &gc, const KoViewConverter &converter) override |
| |
| void | showSize () |
| |
| int | flags () const override |
| |
| | KisToolShape (KoCanvasBase *canvas, const QCursor &cursor) |
| |
| | ~KisToolShape () override |
| |
| | KisToolPaint (KoCanvasBase *canvas, const QCursor &cursor) |
| |
| void | mouseMoveEvent (KoPointerEvent *event) override |
| |
| void | mousePressEvent (KoPointerEvent *event) override |
| |
| void | mouseReleaseEvent (KoPointerEvent *event) override |
| |
| KisPopupWidgetInterface * | popupWidget () override |
| |
| | ~KisToolPaint () override |
| |
| virtual bool | alternateActionSupportsHiResEvents (AlternateAction action) const |
| |
| virtual void | beginAlternateDoubleClickAction (KoPointerEvent *event, AlternateAction action) |
| |
| virtual void | beginPrimaryDoubleClickAction (KoPointerEvent *event) |
| |
| void | deleteSelection () override |
| |
| bool | isActive () const |
| |
| | KisTool (KoCanvasBase *canvas, const QCursor &cursor) |
| |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| |
| void | mouseTripleClickEvent (KoPointerEvent *event) override |
| |
| virtual void | newActivationWithExternalSource (KisPaintDeviceSP externalSource) |
| | newActivationWithExternalSource Makes sure that the tool is active and starts a new stroke, which will be able to access the pixels from the specified external source.
|
| |
| KisTool::NodePaintAbility | nodePaintAbility () |
| |
| virtual bool | primaryActionSupportsHiResEvents () const |
| |
| virtual bool | supportsPaintingAssistants () const |
| |
| | ~KisTool () override |
| |
| | Private (KisCanvas2 *c) |
| |
| QAction * | action (const QString &name) const |
| |
| KoCanvasBase * | canvas () const |
| | Returns the canvas the tool is working on.
|
| |
| virtual void | copy () const |
| |
| QCursor | cursor () const |
| | return the last emitted cursor
|
| |
| virtual void | customMoveEvent (KoPointerEvent *event) |
| |
| virtual void | customPressEvent (KoPointerEvent *event) |
| |
| virtual void | customReleaseEvent (KoPointerEvent *event) |
| |
| virtual void | cut () |
| |
| virtual QRectF | decorationsRect () const |
| |
| int | decorationThickness () const |
| | decorationThickness The minimum thickness for tool decoration lines, this is derived from the screen magnification, thus the HiDPI settings. Note: to use this effectively, also set the pen to isCosmetic(true);
|
| |
| virtual void | deselect () |
| | deselect the tool should clear the selection if it has one.
|
| |
| virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
| |
| virtual void | dragMoveEvent (QDragMoveEvent *event, const QPointF &point) |
| |
| virtual void | dropEvent (QDropEvent *event, const QPointF &point) |
| |
| virtual void | explicitUserStrokeEndRequest () |
| | explicitUserStrokeEndRequest is called by the input manager when the user presses the Enter key or any equivalent key. This callback comes before requestStrokeEnd(), which comes from a different source.
|
| |
| KoToolFactoryBase * | factory () const |
| |
| virtual void | focusInEvent (QFocusEvent *event) |
| |
| virtual void | focusOutEvent (QFocusEvent *event) |
| |
| virtual bool | hasSelection () |
| |
| virtual void | inputMethodEvent (QInputMethodEvent *event) |
| |
| virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
| |
| bool | isInTextMode () const |
| |
| bool | isOpacityPresetMode () const |
| |
| | KoToolBase (KoCanvasBase *canvas) |
| |
| bool | maskSyntheticEvents () const |
| |
| QList< QPointer< QWidget > > | optionWidgets () |
| |
| virtual bool | paste () |
| |
| virtual QMenu * | popupActionsMenu () |
| |
| virtual bool | selectAll () |
| | selectAll select all data the tool can select.
|
| |
| virtual KoToolSelection * | selection () |
| |
| Q_INVOKABLE QString | toolId () const |
| |
| virtual bool | wantsAutoScroll () const |
| |
| | ~KoToolBase () override |
| |
|
| void | applyConstraints (QSizeF &area, bool overrideRatio) |
| |
| void | cancelStroke () |
| |
| virtual QRectF | createRect (const QPointF &start, const QPointF &end) |
| |
| QPainterPath | drawX (const QPointF &pt) |
| |
| void | endStroke () |
| |
| virtual void | finishRect (const QRectF &rect, qreal roundCornersX, qreal roundCornersY)=0 |
| |
| void | getRotatedPath (QPainterPath &path, const QPointF ¢er, const qreal &angle) |
| |
| qreal | getRotationAngle () |
| |
| bool | isFixedSize () |
| |
| virtual void | paintRectangle (QPainter &gc, const QRectF &imageRect) |
| |
| virtual bool | showRoundCornersGUI () const |
| |
| void | updateArea () |
| |
| void | addPathShape (KoPathShape *pathShape, const KUndo2MagicString &name) |
| |
| void | addShape (KoShape *shape) |
| |
| virtual void | beginShape () |
| |
| QWidget * | createOptionWidget () override |
| |
| qreal | currentStrokeWidth () const |
| |
| virtual void | endShape () |
| |
| KisToolShapeUtils::FillStyle | fillStyle () |
| |
| QTransform | fillTransform () |
| |
| ShapeAddInfo | shouldAddShape (KisNodeSP currentNode) const |
| |
| KisToolShapeUtils::StrokeStyle | strokeStyle () |
| |
| void | activateAlternateAction (AlternateAction action) override |
| |
| void | activatePrimaryAction () override |
| |
| void | addOptionWidgetLayout (QLayout *layout) |
| | Add the tool-specific layout to the default option widget layout.
|
| |
| virtual void | addOptionWidgetOption (QWidget *control, QWidget *label=nullptr) |
| | Add a widget and a label to the current option widget layout.
|
| |
| void | beginAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| |
| void | canvasResourceChanged (int key, const QVariant &v) override |
| |
| void | continueAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| |
| void | deactivateAlternateAction (AlternateAction action) override |
| |
| void | deactivatePrimaryAction () override |
| |
| void | enableControl (QWidget *control, bool value) |
| |
| void | endAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| |
| virtual KisOptimizedBrushOutline | getOutlinePath (const QPointF &documentPos, const KoPointerEvent *event, KisPaintOpSettings::OutlineMode outlineMode) |
| |
| bool | isEraser () const |
| |
| bool | isOutlineEnabled () const |
| |
| bool | isOutlineVisible () const |
| |
| virtual QString | quickHelp () const |
| |
| virtual void | requestUpdateOutline (const QPointF &outlineDocPoint, const KoPointerEvent *event) |
| |
| void | setMode (ToolMode mode) override |
| |
| void | setOutlineEnabled (bool enabled) |
| |
| void | setOutlineVisible (bool visible) |
| |
| void | setSupportOutline (bool supportOutline) |
| |
| void | showControl (QWidget *control, bool value) |
| |
| bool | blockUntilOperationsFinished () |
| |
| void | blockUntilOperationsFinishedForced () |
| |
| QPointF | convertDocumentToWidget (const QPointF &pt) |
| |
| QPoint | convertToImagePixelCoordFloored (KoPointerEvent *e) |
| |
| QPointF | convertToPixelCoord (const QPointF &pt) |
| |
| QPointF | convertToPixelCoord (KoPointerEvent *e) |
| |
| QPointF | convertToPixelCoordAndAlignOnWidget (const QPointF &pt) |
| |
| QPointF | convertToPixelCoordAndSnap (const QPointF &pt, const QPointF &offset=QPointF()) |
| |
| QPointF | convertToPixelCoordAndSnap (KoPointerEvent *e, const QPointF &offset=QPointF(), bool useModifiers=true) |
| |
| QRectF | convertToPt (const QRectF &rect) |
| |
| qreal | convertToPt (qreal value) |
| |
| KoColor | currentBgColor () |
| |
| KoColor | currentFgColor () |
| |
| KisFilterConfigurationSP | currentGenerator () |
| |
| KoAbstractGradientSP | currentGradient () |
| |
| KisImageWSP | currentImage () |
| |
| KisNodeSP | currentNode () const |
| |
| KisPaintOpPresetSP | currentPaintOpPreset () |
| |
| KoPatternSP | currentPattern () |
| |
| QCursor | cursor () const |
| |
| KisImageWSP | image () const |
| |
| virtual bool | listeningToModifiers () |
| |
| virtual void | listenToModifiers (bool listen) |
| |
| virtual ToolMode | mode () const |
| |
| bool | nodeEditable () |
| | Checks checks if the current node is editable.
|
| |
| bool | overrideCursorIfNotEditable () |
| | Override the cursor appropriately if current node is not editable.
|
| |
| void | paintToolOutline (QPainter *painter, const KisOptimizedBrushOutline &path) |
| |
| KisOptimizedBrushOutline | pixelToView (const KisOptimizedBrushOutline &path) const |
| |
| QPainterPath | pixelToView (const QPainterPath &pixelPath) const |
| | Convert a pixel path into a view path.
|
| |
| QPointF | pixelToView (const QPoint &pixelCoord) const |
| |
| QPointF | pixelToView (const QPointF &pixelCoord) const |
| | Convert a floating point pixel coordinate into a view coordinate.
|
| |
| QPolygonF | pixelToView (const QPolygonF &pixelPolygon) const |
| | Convert a pixel polygon into a view path.
|
| |
| QRectF | pixelToView (const QRectF &pixelRect) const |
| | Convert a pixel rectangle into a view rectangle.
|
| |
| KisNodeList | selectedNodes () const |
| |
| bool | selectionEditable () |
| | Checks checks if the selection is editable, only applies to local selection as global selection is always editable.
|
| |
| void | setCursor (const QCursor &cursor) |
| |
| void | updateCanvasPixelRect (const QRectF &pixelRect) |
| | Update the canvas for the given rectangle in image pixel coordinates.
|
| |
| void | updateCanvasViewRect (const QRectF &viewRect) |
| | Update the canvas for the given rectangle in view coordinates.
|
| |
| QPointF | viewToPixel (const QPointF &viewCoord) const |
| |
| QPointF | widgetCenterInWidgetPixels () |
| |
| int | grabSensitivity () const |
| | Convenience function to get the current grab sensitivity.
|
| |
| qreal | handleDocRadius () const |
| |
| QRectF | handleGrabRect (const QPointF &position) const |
| |
| QRectF | handlePaintRect (const QPointF &position) const |
| |
| int | handleRadius () const |
| | Convenience function to get the current handle radius.
|
| |
| bool | isActivated () const |
| |
| | KoToolBase (KoToolBasePrivate &dd) |
| |
| KoPointerEvent * | lastDeliveredPointerEvent () const |
| |
| void | setAbstractResource (KoAbstractCanvasResourceInterfaceSP abstractResource) |
| |
| void | setConverter (KoDerivedResourceConverterSP converter) |
| |
| void | setIsOpacityPresetMode (bool value) |
| |
| void | setMaskSyntheticEvents (bool value) |
| |
| void | setTextMode (bool value) |
| |
| QHash< int, KoAbstractCanvasResourceInterfaceSP > | toolAbstractResources () |
| |
| QHash< int, KoDerivedResourceConverterSP > | toolConverters () |
| |
| void | useCursor (const QCursor &cursor) |
| |
Definition at line 13 of file kis_tool_rectangle_base.h.
Called by KisToolProxy when a primary action for the tool is started. The event stores the original event that started the stroke. The event is accepted by default. If the tool decides to ignore this particular action (e.g. when the node is not editable), it should call event->ignore(). Then no further continuePrimaryAction() or endPrimaryAction() will be called until the next user action.
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectEllipticalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 151 of file kis_tool_rectangle_base.cpp.
152{
155
158 QString message = i18n("This tool cannot paint on clone layers. Please select a paint or vector layer or mask.");
160 }
161
164 QString message = i18n("The MyPaint Brush Engine is not available for this colorspace");
166 }
167
168 event->ignore();
169 return;
170 }
173
175
180
181 QSizeF area = QSizeF(0,0);
182
184
187
191 event->accept();
192}
KisViewManager * viewManager() const
void showFloatingMessage(const QString &message, const QIcon &icon, int timeout=4500, KisFloatingMessage::Priority priority=KisFloatingMessage::Medium, int alignment=Qt::AlignCenter|Qt::TextWordWrap)
shows a floating message in the top right corner of the canvas
#define koIcon(name)
Use these macros for icons without any issues.
References applyConstraints(), KisToolShape::beginShape(), Private::canvas, KisTool::CLONE, KisTool::convertToPixelCoordAndSnap(), koIcon, m_angle, m_angleBuffer, m_currentModifiers, m_dragCenter, m_dragEnd, m_dragStart, m_rotateActive, m_type, KisTool::MYPAINTBRUSH_UNPAINTABLE, KisTool::nodeEditable(), KisTool::nodePaintAbility(), PAINT, KisTool::PAINT_MODE, SELECT, KisTool::selectionEditable(), KisToolPaint::setMode(), KisViewManager::showFloatingMessage(), showSize(), KisTool::UNPAINTABLE, and KisCanvas2::viewManager().
Called by KisToolProxy when the primary action is in progress of pointer movement. If the tool has ignored the event in beginPrimaryAction(), this method will not be called.
Reimplemented from KisTool.
Reimplemented in KisToolSelectBase< __KisToolSelectEllipticalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 222 of file kis_tool_rectangle_base.cpp.
223{
225
229
230 bool rotateMode = expandFromCenter && translateMode;
231 bool fixedSize =
isFixedSize() && !constraintToggle;
232
234
235 if (rotateMode) {
236 QPointF angleVector;
239 angleVector = (fixedSize)?
m_dragEnd: pos;
242 }
244 qreal a2 =
atan2(angleVector.y(), angleVector.x());
246 } else {
250 }
251
252 if (fixedSize && !rotateMode) {
254 } else if (translateMode && !rotateMode) {
258
259 }
260
262 QTransform t1, t2;
264 QPointF baseDiag = t1.map(diag);
265 QSizeF area = QSizeF(fabs(baseDiag.x()), fabs(baseDiag.y()));
266
268 if (!constraintToggle || overrideRatio) {
270 }
271
272 baseDiag = QPointF(
273 (baseDiag.x() < 0) ? -area.width() : area.width(),
274 (baseDiag.
y() < 0) ? -area.height() : area.height()
275 );
276
278 diag = t2.map(baseDiag);
279
280
281 if (expandFromCenter && !fixedSize && !rotateMode) {
284 } else {
286 }
287
288 if(!translateMode) {
290 }
291 else {
296 , QString::number(
m_dragStart.y(),
'f', 1)), QIcon(), 1000
298 }
302
304}
QPointF point
The point in document coordinates.
KRITAIMAGE_EXPORT qreal atan2(qreal y, qreal x)
atan2 replacement
References applyConstraints(), Private::canvas, CHECK_MODE_SANITY_OR_RETURN, KisTool::convertToPixelCoordAndSnap(), getRotationAngle(), KisFloatingMessage::High, isFixedSize(), KIS_ASSERT, m_angle, m_angleBuffer, m_currentModifiers, m_dragCenter, m_dragEnd, m_dragStart, m_isHeightForced, m_isRatioForced, m_isWidthForced, m_referenceAngle, m_rotateActive, KisTool::PAINT_MODE, KoPointerEvent::point, KisToolPaint::requestUpdateOutline(), KisViewManager::showFloatingMessage(), showSize(), updateArea(), and KisCanvas2::viewManager().