|
Krita Source Code Documentation
|
#include <RulerAssistant.h>
Inheritance diagram for RulerAssistant:Protected Member Functions | |
| void | drawAssistant (QPainter &gc, const QRectF &updateRect, const KisCoordinatesConverter *converter, bool cached, KisCanvas2 *canvas, bool assistantVisible=true, bool previewVisible=true) override |
| void | drawCache (QPainter &gc, const KisCoordinatesConverter *converter, bool assistantVisible=true) override |
| performance layer where the graphics can be drawn from a cache instead of generated every render update | |
| RulerAssistant (const QString &id, const QString &name) | |
| RulerAssistant (const RulerAssistant &rhs, QMap< KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP > &handleMap) | |
Protected Member Functions inherited from KisPaintingAssistant | |
| virtual QRect | boundingRect () const |
| QPointF | effectiveBrushPosition (const KisCoordinatesConverter *converter, KisCanvas2 *canvas) const |
| Query the effective brush position to be used for preview lines. This is intended to be used for painting the dynamic preview lines for assistants that feature them. Affected by setAdjustedBrushPosition() and setFollowBrushPosition(). | |
| virtual KisPaintingAssistantHandleSP | firstLocalHandle () const |
| firstLocalHandle Note: this doesn't guarantee it will be the topleft corner! For that, use getLocalRect().topLeft() The only purpose of those functions to exist is to be able to put getLocalRect() function in the KisPaintingAssistant instead of reimplementing it in every specific assistant. | |
| QRectF | getLocalRect () const |
| getLocalRect The function deals with local handles not being topLeft and bottomRight gracefully and returns a correct rectangle. Thanks to that the user can place handles in a "wrong" order or move them around but the local rectangle will still be correct. | |
| void | initHandles (QList< KisPaintingAssistantHandleSP > _handles) |
| KisPaintingAssistant (const KisPaintingAssistant &rhs, QMap< KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP > &handleMap) | |
| QPointF | pixelToView (const QPoint pixelCoords) const |
| virtual KisPaintingAssistantHandleSP | secondLocalHandle () const |
| secondLocalHandle Note: this doesn't guarantee it will be the bottomRight corner! For that, use getLocalRect().bottomRight() (and remember that for QRect bottomRight() works differently than for QRectF, so don't convert to QRect before accessing the corner) | |
Private Member Functions | |
| void | drawHandleAnnotations (QPainter &gc, const KisCoordinatesConverter *converter) |
| void | drawSubdivisions (QPainter &gc, const KisCoordinatesConverter *converter) |
| QPointF | project (const QPointF &pt) const |
Private Attributes | |
| qreal | m_fixedLength {0.0} |
| QString | m_fixedLengthUnit {"px"} |
| bool | m_hasFixedLength {false} |
| int | m_minorSubdivisions {0} |
| int | m_subdivisions {0} |
Additional Inherited Members | |
Static Public Member Functions inherited from KisPaintingAssistant | |
| static QList< KisPaintingAssistantSP > | cloneAssistantList (const QList< KisPaintingAssistantSP > &list) |
| static double | norm2 (const QPointF &p) |
Protected Attributes inherited from KisPaintingAssistant | |
| QList< KisPaintingAssistantHandleSP > | m_handles |
| bool | m_hasBeenInsideLocalRect {false} |
Definition at line 18 of file RulerAssistant.h.
| RulerAssistant::RulerAssistant | ( | ) |
Definition at line 24 of file RulerAssistant.cc.
|
explicitprotected |
Definition at line 29 of file RulerAssistant.cc.
|
explicitprotected |
Definition at line 39 of file RulerAssistant.cc.
|
overridevirtual |
Implements KisPaintingAssistant.
Definition at line 77 of file RulerAssistant.cc.
References project().
|
overridevirtual |
Adjust the position given in parameter.
| point | the coordinates in point in the document reference |
| strokeBegin | the coordinates of the beginning of the stroke |
| snapToAny | because now assistants can be composited out of multiple inside assistants. snapToAny true means that you can use any of the inside assistant, while it being false means you should use the last used one. The logic determining when it happens (first stroke etc.) is in the decoration, so those two options are enough. |
| moveThresholdPt | the threshold for the "move" of the cursor measured in pt (usually equals to 2px in screen coordinates converted to pt) |
Implements KisPaintingAssistant.
Definition at line 72 of file RulerAssistant.cc.
References project().
|
overridevirtual |
Implements KisPaintingAssistant.
Definition at line 34 of file RulerAssistant.cc.
References RulerAssistant().
|
overrideprotectedvirtual |
Reimplemented from KisPaintingAssistant.
Definition at line 182 of file RulerAssistant.cc.
References KisPaintingAssistant::drawAssistant(), drawHandleAnnotations(), drawSubdivisions(), hasFixedLength(), isAssistantComplete(), KisPaintingAssistantsDecoration::isEditingAssistants(), KisCanvas2::paintingAssistantsDecoration(), and subdivisions().
|
overrideprotectedvirtual |
performance layer where the graphics can be drawn from a cache instead of generated every render update
Implements KisPaintingAssistant.
Definition at line 200 of file RulerAssistant.cc.
References KisCoordinatesConverter::documentToWidgetTransform(), KisPaintingAssistant::drawPath(), KisPaintingAssistant::handles(), isAssistantComplete(), KisPaintingAssistant::isSnappingActive(), p1, and p2.
|
private |
Definition at line 150 of file RulerAssistant.cc.
References bounds, KisCoordinatesConverter::documentToWidgetTransform(), KisPaintingAssistant::drawPath(), and KisPaintingAssistant::handles().
|
private |
Definition at line 83 of file RulerAssistant.cc.
References KisCoordinatesConverter::documentToWidgetTransform(), KisPaintingAssistant::drawPath(), KisPaintingAssistant::handles(), KisPaintingAssistant::isSnappingActive(), length(), minorSubdivisions(), KisPaintingAssistant::norm2(), p1, p2, and subdivisions().
| void RulerAssistant::enableFixedLength | ( | bool | enabled | ) |
Definition at line 257 of file RulerAssistant.cc.
References m_hasFixedLength.
| void RulerAssistant::ensureLength | ( | ) |
Definition at line 285 of file RulerAssistant.cc.
References distance(), fixedLength(), KisPaintingAssistant::handles(), hasFixedLength(), KisPaintingAssistant::norm2(), and KisPaintingAssistant::uncache().
| qreal RulerAssistant::fixedLength | ( | ) | const |
Definition at line 261 of file RulerAssistant.cc.
References m_fixedLength.
| QString RulerAssistant::fixedLengthUnit | ( | ) | const |
Definition at line 273 of file RulerAssistant.cc.
References m_fixedLengthUnit.
|
overridevirtual |
Implements KisPaintingAssistant.
Definition at line 219 of file RulerAssistant.cc.
References KisPaintingAssistant::handles().
| bool RulerAssistant::hasFixedLength | ( | ) | const |
Definition at line 253 of file RulerAssistant.cc.
References m_hasFixedLength.
|
overridevirtual |
determines if the assistant has enough handles to be considered created new assistants get in a "creation" phase where they are currently being made on the canvas it will return false if we are in the middle of creating the assistant.
Reimplemented from KisPaintingAssistant.
Definition at line 224 of file RulerAssistant.cc.
References KisPaintingAssistant::handles().
|
overridevirtual |
Reimplemented from KisPaintingAssistant.
Definition at line 315 of file RulerAssistant.cc.
References enableFixedLength(), setFixedLength(), setFixedLengthUnit(), setMinorSubdivisions(), setSubdivisions(), KisDomUtils::toDouble(), and KisDomUtils::toInt().
| int RulerAssistant::minorSubdivisions | ( | ) | const |
Definition at line 241 of file RulerAssistant.cc.
References m_minorSubdivisions.
|
inlineoverridevirtual |
|
private |
Definition at line 49 of file RulerAssistant.cc.
References KisPaintingAssistant::handles(), isAssistantComplete(), and u.
|
overridevirtual |
Reimplemented from KisPaintingAssistant.
Definition at line 299 of file RulerAssistant.cc.
References fixedLength(), fixedLengthUnit(), hasFixedLength(), minorSubdivisions(), subdivisions(), and KisDomUtils::toString().
| void RulerAssistant::setFixedLength | ( | qreal | length | ) |
Definition at line 265 of file RulerAssistant.cc.
References length(), and m_fixedLength.
| void RulerAssistant::setFixedLengthUnit | ( | QString | unit | ) |
Definition at line 277 of file RulerAssistant.cc.
References m_fixedLengthUnit.
| void RulerAssistant::setMinorSubdivisions | ( | int | subdivisions | ) |
Definition at line 245 of file RulerAssistant.cc.
References m_minorSubdivisions, and subdivisions().
| void RulerAssistant::setSubdivisions | ( | int | subdivisions | ) |
Definition at line 233 of file RulerAssistant.cc.
References m_subdivisions, and subdivisions().
| int RulerAssistant::subdivisions | ( | ) | const |
Definition at line 229 of file RulerAssistant.cc.
References m_subdivisions.
|
private |
Definition at line 58 of file RulerAssistant.h.
|
private |
Definition at line 59 of file RulerAssistant.h.
|
private |
Definition at line 57 of file RulerAssistant.h.
|
private |
Definition at line 56 of file RulerAssistant.h.
|
private |
Definition at line 55 of file RulerAssistant.h.