|
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 () |
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 74 of file kis_painting_assistants_decoration.h.
Definition at line 59 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 72 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 509 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 96 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), KisCanvasDecoration::setVisible(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::adjustLine | ( | QPointF & | point, |
| QPointF & | strokeBegin ) |
Definition at line 247 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 167 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, KisImage::xRes(), and KisImage::yRes().
|
signal |
| QList< KisPaintingAssistantSP > KisPaintingAssistantsDecoration::assistants | ( | ) | const |
Definition at line 412 of file kis_painting_assistants_decoration.cpp.
References assistants(), and KisCanvasDecoration::view().
| bool KisPaintingAssistantsDecoration::assistantVisibility | ( | ) |
returns assistant visibility
Definition at line 465 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 516 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 439 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::selectedAssistant.
|
overrideprotectedvirtual |
Implements KisCanvasDecoration.
Definition at line 304 of file kis_painting_assistants_decoration.cpp.
References assistants(), assistantVisibility(), d, dbgFile, KisCanvas2::displayRendererInterface(), drawEditorWidget(), drawHandles(), isEditingAssistants(), KIS_SAFE_ASSERT_RECOVER_RETURN, KisPaintingAssistantsDecoration::Private::m_canvas, KisPaintingAssistantsDecoration::Private::m_isEditingAssistants, outlineVisibility(), KisToolProxy::supportsPaintingAssistants(), KisPaintingAssistantsDecoration::Private::useCache, and KisCanvasDecoration::view().
|
protected |
Definition at line 587 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 344 of file kis_painting_assistants_decoration.cpp.
References KoColorDisplayRendererInterface::convertColorToDisplayColorSpace(), KisCoordinatesConverter::documentToWidgetTransform(), KoColor::fromQColor(), and handleSize().
| void KisPaintingAssistantsDecoration::endStroke | ( | ) |
Definition at line 295 of file kis_painting_assistants_decoration.cpp.
References assistants(), d, and KisPaintingAssistantsDecoration::Private::firstAssistant.
| QColor KisPaintingAssistantsDecoration::globalAssistantsColor | ( | ) |
Definition at line 491 of file kis_painting_assistants_decoration.cpp.
References KisCanvasDecoration::view().
| QList< KisPaintingAssistantHandleSP > KisPaintingAssistantsDecoration::handles | ( | ) |
Definition at line 394 of file kis_painting_assistants_decoration.cpp.
References assistants().
| int KisPaintingAssistantsDecoration::handleSize | ( | ) |
Definition at line 384 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::m_handleSize.
| bool KisPaintingAssistantsDecoration::hasPaintableAssistants | ( | ) | const |
Definition at line 423 of file kis_painting_assistants_decoration.cpp.
References assistants().
| 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 526 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::m_isEditingAssistants.
| bool KisPaintingAssistantsDecoration::outlineVisibility | ( | ) |
returns preview visibility
Definition at line 469 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::outlineVisible.
| void KisPaintingAssistantsDecoration::raiseAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 110 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), KisCanvasDecoration::setVisible(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::removeAll | ( | ) |
Definition at line 136 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), KisCanvasDecoration::setVisible(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::removeAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 124 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), KIS_ASSERT_RECOVER_NOOP, KisCanvasDecoration::setVisible(), 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 428 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::selectedAssistant.
|
signal |
| void KisPaintingAssistantsDecoration::setAdjustedBrushPosition | ( | const QPointF | position | ) |
Definition at line 157 of file kis_painting_assistants_decoration.cpp.
References assistants().
| void KisPaintingAssistantsDecoration::setAssistants | ( | const QList< KisPaintingAssistantSP > & | assistants | ) |
Definition at line 146 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), KisCanvasDecoration::setVisible(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::setAssistantVisible | ( | bool | set | ) |
sets whether the main assistant is visible
Definition at line 445 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 460 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::snapEraser.
| void KisPaintingAssistantsDecoration::setGlobalAssistantsColor | ( | QColor | color | ) |
Definition at line 496 of file kis_painting_assistants_decoration.cpp.
References assistants(), uncache(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::setHandleSize | ( | int | handleSize | ) |
Definition at line 389 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 455 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 450 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::outlineVisible.
| void KisPaintingAssistantsDecoration::setSelectedAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 433 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::selectedAssistant, and selectedAssistantChanged().
|
slot |
Definition at line 86 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 77 of file kis_painting_assistants_decoration.cpp.
References assistants(), KisCanvasDecoration::setVisible(), and KisCanvasDecoration::visible().
|
slot |
Definition at line 544 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::m_canvas, KoSnapGuide::snap(), and KoCanvasBase::snapGuide.
|
slot |
Definition at line 531 of file kis_painting_assistants_decoration.cpp.
References KisCanvas2::currentImage(), d, KisPaintingAssistantsDecoration::Private::m_canvas, KoPointerEvent::modifiers(), KoPointerEvent::point, KoSnapGuide::snap(), and KoCanvasBase::snapGuide.
|
slot |
toggles whether the assistant is active or not
Definition at line 479 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 485 of file kis_painting_assistants_decoration.cpp.
References outlineVisibility(), and setOutlineVisible().
| void KisPaintingAssistantsDecoration::uncache | ( | ) |
uncache all assistants
Definition at line 473 of file kis_painting_assistants_decoration.cpp.
References assistants().
|
private |
Definition at line 168 of file kis_painting_assistants_decoration.h.
| struct AssistantEditorData KisPaintingAssistantsDecoration::globalEditorWidgetData |
Definition at line 92 of file kis_painting_assistants_decoration.h.