|
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) |
| void | drawHandles (KisPaintingAssistantSP assistant, QPainter &gc, const KisCoordinatesConverter *converter) |
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 73 of file kis_painting_assistants_decoration.h.
Definition at line 58 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 71 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 508 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 95 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 246 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 166 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 411 of file kis_painting_assistants_decoration.cpp.
References assistants(), and KisCanvasDecoration::view().
| bool KisPaintingAssistantsDecoration::assistantVisibility | ( | ) |
returns assistant visibility
Definition at line 464 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 515 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 438 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::selectedAssistant.
|
overrideprotectedvirtual |
Implements KisCanvasDecoration.
Definition at line 305 of file kis_painting_assistants_decoration.cpp.
References assistants(), assistantVisibility(), d, dbgFile, 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 561 of file kis_painting_assistants_decoration.cpp.
References AssistantEditorData::boundingSize, d, AssistantEditorData::deleteButtonActivated, AssistantEditorData::deleteIconPosition, KisCoordinatesConverter::documentToWidgetTransform(), AssistantEditorData::dragDecorationWidth, AssistantEditorData::duplicateButtonActivated, AssistantEditorData::duplicateIconPosition, globalEditorWidgetData, AssistantEditorData::lockButtonActivated, AssistantEditorData::lockedIconPosition, KisPaintingAssistantsDecoration::Private::m_canvas, AssistantEditorData::m_iconDelete, AssistantEditorData::m_iconDuplicate, AssistantEditorData::m_iconLockOff, AssistantEditorData::m_iconLockOn, AssistantEditorData::m_iconMove, AssistantEditorData::m_iconSnapOff, AssistantEditorData::m_iconSnapOn, KisViewManager::mainWindowAsQWidget(), AssistantEditorData::moveButtonActivated, AssistantEditorData::moveIconPosition, selectedAssistant(), AssistantEditorData::snapButtonActivated, AssistantEditorData::snapIconPosition, KisCanvas2::viewManager(), AssistantEditorData::widgetActivated, and AssistantEditorData::widgetOffset.
|
protected |
Definition at line 345 of file kis_painting_assistants_decoration.cpp.
References KisCoordinatesConverter::documentToWidgetTransform(), and handleSize().
| void KisPaintingAssistantsDecoration::endStroke | ( | ) |
Definition at line 296 of file kis_painting_assistants_decoration.cpp.
References assistants(), d, and KisPaintingAssistantsDecoration::Private::firstAssistant.
| QColor KisPaintingAssistantsDecoration::globalAssistantsColor | ( | ) |
Definition at line 490 of file kis_painting_assistants_decoration.cpp.
References KisCanvasDecoration::view().
| QList< KisPaintingAssistantHandleSP > KisPaintingAssistantsDecoration::handles | ( | ) |
Definition at line 393 of file kis_painting_assistants_decoration.cpp.
References assistants().
| int KisPaintingAssistantsDecoration::handleSize | ( | ) |
Definition at line 383 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::m_handleSize.
| bool KisPaintingAssistantsDecoration::hasPaintableAssistants | ( | ) | const |
Definition at line 422 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 525 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::m_isEditingAssistants.
| bool KisPaintingAssistantsDecoration::outlineVisibility | ( | ) |
returns preview visibility
Definition at line 468 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::outlineVisible.
| void KisPaintingAssistantsDecoration::raiseAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 109 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), KisCanvasDecoration::setVisible(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::removeAll | ( | ) |
Definition at line 135 of file kis_painting_assistants_decoration.cpp.
References assistantChanged(), assistants(), KisCanvasDecoration::setVisible(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::removeAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 123 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 427 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::selectedAssistant.
|
signal |
| void KisPaintingAssistantsDecoration::setAdjustedBrushPosition | ( | const QPointF | position | ) |
Definition at line 156 of file kis_painting_assistants_decoration.cpp.
References assistants().
| void KisPaintingAssistantsDecoration::setAssistants | ( | const QList< KisPaintingAssistantSP > & | assistants | ) |
Definition at line 145 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 444 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 459 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::snapEraser.
| void KisPaintingAssistantsDecoration::setGlobalAssistantsColor | ( | QColor | color | ) |
Definition at line 495 of file kis_painting_assistants_decoration.cpp.
References assistants(), uncache(), and KisCanvasDecoration::view().
| void KisPaintingAssistantsDecoration::setHandleSize | ( | int | handleSize | ) |
Definition at line 388 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 454 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 449 of file kis_painting_assistants_decoration.cpp.
References d, and KisPaintingAssistantsDecoration::Private::outlineVisible.
| void KisPaintingAssistantsDecoration::setSelectedAssistant | ( | KisPaintingAssistantSP | assistant | ) |
Definition at line 432 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::selectedAssistant, and selectedAssistantChanged().
|
slot |
Definition at line 85 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 76 of file kis_painting_assistants_decoration.cpp.
References assistants(), KisCanvasDecoration::setVisible(), and KisCanvasDecoration::visible().
|
slot |
Definition at line 543 of file kis_painting_assistants_decoration.cpp.
References d, KisPaintingAssistantsDecoration::Private::m_canvas, KoSnapGuide::snap(), and KoCanvasBase::snapGuide.
|
slot |
Definition at line 530 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 478 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 484 of file kis_painting_assistants_decoration.cpp.
References outlineVisibility(), and setOutlineVisible().
| void KisPaintingAssistantsDecoration::uncache | ( | ) |
uncache all assistants
Definition at line 472 of file kis_painting_assistants_decoration.cpp.
References assistants().
|
private |
Definition at line 167 of file kis_painting_assistants_decoration.h.
| struct AssistantEditorData KisPaintingAssistantsDecoration::globalEditorWidgetData |
Definition at line 91 of file kis_painting_assistants_decoration.h.