|
Krita Source Code Documentation
|
#include <kis_painting_assistants_decoration.h>
Inheritance diagram for KisPaintingAssistantsDecoration:Classes | |
| struct | Private |
Public Slots | |
| void | slotConfigChanged () |
| void | slotUpdateDecorationVisibility () |
| QPointF | snapToGuide (const QPointF &pt, const QPointF &offset) |
| QPointF | snapToGuide (KoPointerEvent *e, const QPointF &offset, bool useModifiers) |
| void | toggleAssistantVisible () |
| toggles whether the assistant is active or not | |
| void | toggleOutlineVisible () |
| toggles whether there will be a preview of the assistant result when painting | |
Public Slots inherited from KisCanvasDecoration | |
| virtual void | setVisible (bool v) |
| void | toggleVisibility () |
Signals | |
| void | assistantChanged () |
| void | selectedAssistantChanged () |
| void | temporaryConstraintAvailabilityChanged () |
Public Attributes | |
| struct AssistantEditorData | globalEditorWidgetData |
Protected Member Functions | |
| void | drawDecoration (QPainter &gc, const QRectF &updateRect, const KisCoordinatesConverter *converter, KisCanvas2 *canvas) override |
| void | drawEditorWidget (KisPaintingAssistantSP assistant, QPainter &gc, const KisCoordinatesConverter *converter, const KoColorDisplayRendererInterface *renderInterface) |
| void | drawHandles (KisPaintingAssistantSP assistant, QPainter &gc, const KisCoordinatesConverter *converter, const KoColorDisplayRendererInterface *renderInterface) |
Protected Member Functions inherited from KisCanvasDecoration | |
| int | decorationThickness () const |
| void | setPriority (int value) |
| QPointer< KisView > | view () const |
Protected Member Functions inherited from KisShared | |
| KisShared () | |
| ~KisShared () | |
Private Attributes | |
| Private *const | d |
Additional Inherited Members | |
Static Public Member Functions inherited from KisCanvasDecoration | |
| static bool | comparePriority (KisCanvasDecorationSP decoration1, KisCanvasDecorationSP decoration2) |
KisPaintingAssistantsDecoration draws the assistants stored in the document on the canvas. In the application flow, each canvas holds one of these classes to manage the assistants There is an assistants manager, but that is higher up in the flow and makes sure each view gets one of these Since this is off the canvas level, the decoration can be seen across all tools. The contents from here will be in front of the kis_assistant_tool, which hold and displays the editor controls.
Many of the events this receives such as adding and removing assistants comes from kis_assistant_tool
Definition at line 78 of file kis_painting_assistants_decoration.h.
Definition at line 75 of file kis_painting_assistants_decoration.cpp.
References d, setAssistantVisible(), setOutlineVisible(), KisCanvasDecoration::setPriority(), slotConfigChanged(), KisPaintingAssistantsDecoration::Private::snapEraser, and KisPaintingAssistantsDecoration::Private::snapOnlyOneAssistant.
|
override |
Definition at line 88 of file kis_painting_assistants_decoration.cpp.
References d.
| void KisPaintingAssistantsDecoration::activateAssistantsEditor | ( | ) |
called when assistant editor is activated right now this happens when the assistants tool is selected
Definition at line 641 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::m_isEditingAssistants, KisCanvasDecoration::setVisible(), and uncache().
| void KisPaintingAssistantsDecoration::addAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 112 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), slotUpdateDecorationVisibility(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::adjustLine | ( | QPointF & | point, |
| QPointF & | strokeBegin ) |
Definition at line 283 of file kis_painting_assistants_decoration.cpp.
References assistants(), COMPOSITE_ERASE, KoCanvasResource::CurrentEffectiveCompositeOp, d, distance(), kisSquareDistance(), KisPaintingAssistantsDecoration::Private::m_canvas, p1, p2, KoCanvasBase::resourceManager, and KisPaintingAssistantsDecoration::Private::snapEraser.
| QPointF KisPaintingAssistantsDecoration::adjustPosition | ( | const QPointF & | point, |
| const QPointF & | strokeBegin ) |
Definition at line 192 of file kis_painting_assistants_decoration.cpp.
References assistants(), COMPOSITE_ERASE, KisCanvas2::coordinatesConverter, KoCanvasResource::CurrentEffectiveCompositeOp, d, KisCoordinatesConverter::effectiveZoom(), KisPaintingAssistantsDecoration::Private::firstAssistant, KisCanvas2::image(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, kisSquareDistance(), KisPaintingAssistantsDecoration::Private::m_canvas, KisAlgebra2D::norm(), KoCanvasBase::resourceManager, KisPaintingAssistantsDecoration::Private::snapEraser, KisPaintingAssistantsDecoration::Private::snapOnlyOneAssistant, KisPaintingAssistantsDecoration::Private::temporaryConstraint, KisCanvasDecoration::view(), KisImage::xRes(), and KisImage::yRes().
|
signal |
| QList< KisPaintingAssistantSP > KisPaintingAssistantsDecoration::assistants | ( | ) | const |
Definition at line 538 of file kis_painting_assistants_decoration.cpp.
References assistants(), and KisCanvasDecoration::view().
| bool KisPaintingAssistantsDecoration::assistantVisibility | ( | ) |
returns assistant visibility
Definition at line 591 of file kis_painting_assistants_decoration.cpp.
References KisPaintingAssistantsDecoration::Private::assistantVisible, and d.
| void KisPaintingAssistantsDecoration::deactivateAssistantsEditor | ( | ) |
called when assistant editor is deactivated right now this happens when the assistants tool is un-selected
Definition at line 648 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::m_canvas, KisPaintingAssistantsDecoration::Private::m_isEditingAssistants, and uncache().
| void KisPaintingAssistantsDecoration::deselectAssistant | ( | ) |
Definition at line 565 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::selectedAssistant.
|
overrideprotectedvirtual |
Implements KisCanvasDecoration.
Definition at line 366 of file kis_painting_assistants_decoration.cpp.
References assistants(), assistantVisibility(), KoColorDisplayRendererInterface::convertColorToDisplayColorSpace(), d, dbgFile, KisCanvas2::displayRendererInterface(), KisCoordinatesConverter::documentToWidgetTransform(), drawEditorWidget(), drawHandles(), globalAssistantsColor(), KisPaintingAssistantsDecoration::Private::hasTemporaryAdjustedBrushPosition, KoColorSpaceRegistry::instance(), KisAlgebra2D::intersectLineRect(), isEditingAssistants(), KIS_SAFE_ASSERT_RECOVER_RETURN, KisPaintingAssistantsDecoration::Private::m_canvas, KisPaintingAssistantsDecoration::Private::m_isEditingAssistants, KisAlgebra2D::normSquared(), outlineVisibility(), p1, p2, KisToolProxy::supportsPaintingAssistants(), KisPaintingAssistantsDecoration::Private::temporaryAdjustedBrushPosition, KisPaintingAssistantsDecoration::Private::temporaryConstraint, KisPaintingAssistantsDecoration::Private::useCache, and KisCanvasDecoration::view().
|
protected |
Definition at line 744 of file kis_painting_assistants_decoration.cpp.
References AssistantEditorData::boundingSize, AssistantEditorData::buttonSize, KoColorDisplayRendererInterface::convertColorToDisplayColorSpace(), AssistantEditorData::deleteButtonActivated, AssistantEditorData::deleteIconPosition, KisCoordinatesConverter::documentToWidgetTransform(), AssistantEditorData::dragDecorationWidth, drawDoubleState(), drawSingleState(), AssistantEditorData::duplicateButtonActivated, AssistantEditorData::duplicateIconPosition, KoColor::fromQColor(), globalEditorWidgetData, AssistantEditorData::lockButtonActivated, AssistantEditorData::lockedIconPosition, AssistantEditorData::m_iconDelete, AssistantEditorData::m_iconDuplicate, AssistantEditorData::m_iconLockOff, AssistantEditorData::m_iconLockOn, AssistantEditorData::m_iconMove, AssistantEditorData::m_iconSnapOff, AssistantEditorData::m_iconSnapOn, AssistantEditorData::moveButtonActivated, AssistantEditorData::moveIconPosition, selectedAssistant(), AssistantEditorData::snapButtonActivated, AssistantEditorData::snapIconPosition, KoColorDisplayRendererInterface::systemPaletteForDisplayColorSpace(), AssistantEditorData::widgetActivated, and AssistantEditorData::widgetOffset.
|
protected |
Definition at line 470 of file kis_painting_assistants_decoration.cpp.
References KoColorDisplayRendererInterface::convertColorToDisplayColorSpace(), KisCoordinatesConverter::documentToWidgetTransform(), KoColor::fromQColor(), and handleSize().
| void KisPaintingAssistantsDecoration::endStroke | ( | ) |
Definition at line 331 of file kis_painting_assistants_decoration.cpp.
References assistants(), d, and KisPaintingAssistantsDecoration::Private::firstAssistant.
| QColor KisPaintingAssistantsDecoration::globalAssistantsColor | ( | ) |
Definition at line 623 of file kis_painting_assistants_decoration.cpp.
References KisCanvasDecoration::view().
| QList< KisPaintingAssistantHandleSP > KisPaintingAssistantsDecoration::handles | ( | ) |
Definition at line 520 of file kis_painting_assistants_decoration.cpp.
References assistants().
| int KisPaintingAssistantsDecoration::handleSize | ( | ) |
Definition at line 510 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::m_handleSize.
| bool KisPaintingAssistantsDecoration::hasPaintableAssistants | ( | ) | const |
Definition at line 549 of file kis_painting_assistants_decoration.cpp.
References assistants(), d, and KisPaintingAssistantsDecoration::Private::temporaryConstraint.
| bool KisPaintingAssistantsDecoration::isEditingAssistants | ( | ) |
brings back if we are currently editing assistants or not useful for some assistants (like spline) that draw bezier curves
Definition at line 658 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::m_isEditingAssistants.
| bool KisPaintingAssistantsDecoration::outlineVisibility | ( | ) |
returns preview visibility
Definition at line 595 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::outlineVisible.
| void KisPaintingAssistantsDecoration::raiseAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 126 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), slotUpdateDecorationVisibility(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::removeAll | ( | ) |
Definition at line 152 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), slotUpdateDecorationVisibility(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::removeAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 140 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), KIS_ASSERT_RECOVER_NOOP, slotUpdateDecorationVisibility(), and KisCanvasDecoration::view().
| KisPaintingAssistantSP KisPaintingAssistantsDecoration::selectedAssistant | ( | ) |
getter and setter functions for what assistant is currently selected this is used to control some tool options that are specific to a assistant
Definition at line 554 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::selectedAssistant.
|
signal |
| void KisPaintingAssistantsDecoration::setAdjustedBrushPosition | ( | const QPointF | position | ) |
Definition at line 173 of file kis_painting_assistants_decoration.cpp.
References assistants(), d, KisPaintingAssistantsDecoration::Private::hasTemporaryAdjustedBrushPosition, KisPaintingAssistantsDecoration::Private::m_canvas, KisPaintingAssistantsDecoration::Private::temporaryAdjustedBrushPosition, KisPaintingAssistantsDecoration::Private::temporaryConstraint, and KisCanvas2::updateCanvasDecorations().
| void KisPaintingAssistantsDecoration::setAssistants | ( | const QList< KisPaintingAssistantSP > & | assistants | ) |
Definition at line 162 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), slotUpdateDecorationVisibility(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::setAssistantVisible | ( | bool | set | ) |
sets whether the main assistant is visible
Definition at line 571 of file kis_painting_assistants_decoration.cpp.
References KisPaintingAssistantsDecoration::Private::assistantVisible, and d.
| void KisPaintingAssistantsDecoration::setEraserSnap | ( | bool | assistant | ) |
sets whether eraser brushes snap
Definition at line 586 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::snapEraser.
| void KisPaintingAssistantsDecoration::setGlobalAssistantsColor | ( | QColor | color | ) |
Definition at line 628 of file kis_painting_assistants_decoration.cpp.
References assistants(), uncache(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::setHandleSize | ( | int | handleSize | ) |
Definition at line 515 of file kis_painting_assistants_decoration.cpp.
References d, handleSize(), and KisPaintingAssistantsDecoration::Private::m_handleSize.
| void KisPaintingAssistantsDecoration::setOnlyOneAssistantSnap | ( | bool | assistant | ) |
sets whether we snap to only one assistant
Definition at line 581 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::snapOnlyOneAssistant.
| void KisPaintingAssistantsDecoration::setOutlineVisible | ( | bool | set | ) |
sets whether the preview is visible
Definition at line 576 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::outlineVisible.
| void KisPaintingAssistantsDecoration::setSelectedAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 559 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::selectedAssistant, and selectedAssistantChanged().
| void KisPaintingAssistantsDecoration::setTemporaryConstraint | ( | std::optional< KisTemporaryPaintConstraint > | constraint | ) |
Definition at line 340 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::hasTemporaryAdjustedBrushPosition, KisPaintingAssistantsDecoration::Private::m_canvas, slotUpdateDecorationVisibility(), KisPaintingAssistantsDecoration::Private::temporaryConstraint, temporaryConstraintAvailabilityChanged(), and KisCanvas2::updateCanvasDecorations().
|
slot |
Definition at line 102 of file kis_painting_assistants_decoration.cpp.
References KisConfig::ASSISTANTS_DRAW_MODE_LARGE_PIXMAP_CACHE, KisConfig::ASSISTANTS_DRAW_MODE_PIXMAP_CACHE, KisConfig::assistantsDrawMode(), d, and KisPaintingAssistantsDecoration::Private::useCache.
|
slot |
Definition at line 93 of file kis_painting_assistants_decoration.cpp.
References assistants(), d, KisCanvasDecoration::setVisible(), KisPaintingAssistantsDecoration::Private::temporaryConstraint, and KisCanvasDecoration::visible().
|
slot |
Definition at line 676 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::m_canvas, KoSnapGuide::snap(), and KoCanvasBase::snapGuide.
|
slot |
Definition at line 663 of file kis_painting_assistants_decoration.cpp.
References KisCanvas2::currentImage(), d, KisPaintingAssistantsDecoration::Private::m_canvas, KoPointerEvent::modifiers(), KoPointerEvent::point, KoSnapGuide::snap(), and KoCanvasBase::snapGuide.
| std::optional< KisTemporaryPaintConstraint > KisPaintingAssistantsDecoration::temporaryConstraint | ( | ) | const |
Definition at line 361 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::temporaryConstraint.
|
signal |
|
slot |
toggles whether the assistant is active or not
Definition at line 610 of file kis_painting_assistants_decoration.cpp.
References assistantVisibility(), setAssistantVisible(), and uncache().
|
slot |
toggles whether there will be a preview of the assistant result when painting
Definition at line 616 of file kis_painting_assistants_decoration.cpp.
References outlineVisibility(), setOutlineVisible(), and uncache().
| void KisPaintingAssistantsDecoration::uncache | ( | ) |
uncache all assistants
Definition at line 599 of file kis_painting_assistants_decoration.cpp.
References assistants(), d, KisPaintingAssistantsDecoration::Private::m_canvas, and KisCanvas2::updateCanvasDecorations().
|
private |
Definition at line 175 of file kis_painting_assistants_decoration.h.
| struct AssistantEditorData KisPaintingAssistantsDecoration::globalEditorWidgetData |
Definition at line 98 of file kis_painting_assistants_decoration.h.