Krita Source Code Documentation
Loading...
Searching...
No Matches
PerspectiveEllipseAssistant Class Reference

#include <PerspectiveEllipseAssistant.h>

+ Inheritance diagram for PerspectiveEllipseAssistant:

Classes

class  Private
 

Public Member Functions

void adjustLine (QPointF &point, QPointF &strokeBegin) override
 
QPointF adjustPosition (const QPointF &point, const QPointF &strokeBegin, const bool snapToAny, qreal moveThresholdPt) override
 
KisPaintingAssistantSP clone (QMap< KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP > &handleMap) const override
 
bool contains (const QPointF &point) const override
 
qreal distance (const QPointF &point) const override
 
QPointF getDefaultEditorPosition () const override
 
bool isActive () const override
 
bool isAssistantComplete () const override
 
int numHandles () const override
 
 PerspectiveEllipseAssistant (QObject *parent=0)
 
 ~PerspectiveEllipseAssistant ()
 
- Public Member Functions inherited from KisAbstractPerspectiveGrid
 KisAbstractPerspectiveGrid (QObject *parent=0)
 
 ~KisAbstractPerspectiveGrid () override
 
- Public Member Functions inherited from KisPaintingAssistant
void addHandle (KisPaintingAssistantHandleSP handle, HandleType type)
 
bool areTwoPointsClose (const QPointF &pointOne, const QPointF &pointTwo)
 
QColor assistantCustomColor ()
 
KisPaintingAssistantHandleSP bottomLeft ()
 
const KisPaintingAssistantHandleSP bottomLeft () const
 
KisPaintingAssistantHandleSP bottomMiddle ()
 
const KisPaintingAssistantHandleSP bottomMiddle () const
 
KisPaintingAssistantHandleSP bottomRight ()
 
const KisPaintingAssistantHandleSP bottomRight () const
 
virtual bool canBeLocal () const
 canBeLocal
 
KisPaintingAssistantHandleSP closestCornerHandleFromPoint (QPointF point)
 
void copySharedData (KisPaintingAssistantSP assistant)
 
void drawError (QPainter &painter, const QPainterPath &path)
 
void drawPath (QPainter &painter, const QPainterPath &path, bool drawActive=true)
 
void drawPreview (QPainter &painter, const QPainterPath &path)
 
void drawX (QPainter &painter, const QPointF &pt)
 
QPointF editorWidgetOffset ()
 
QColor effectiveAssistantColor () const
 
virtual void endStroke ()
 
void findPerspectiveAssistantHandleLocation ()
 
virtual QPointF getEditorPosition () const
 
QList< KisPaintingAssistantHandleSPhandles ()
 
const QList< KisPaintingAssistantHandleSP > & handles () const
 
const QString & id () const
 
bool isDuplicating ()
 isDuplicating
 
bool isLocal () const
 isLocal
 
bool isLocked ()
 isLocked
 
bool isSnappingActive () const
 
 KisPaintingAssistant (const QString &id, const QString &name)
 
KisPaintingAssistantHandleSP leftMiddle ()
 
const KisPaintingAssistantHandleSP leftMiddle () const
 
virtual bool loadCustomXml (QXmlStreamReader *xml)
 
void loadXml (KoStore *store, QMap< int, KisPaintingAssistantHandleSP > &handleMap, QString path)
 
const QString & name () const
 
KisPaintingAssistantHandleSP oppHandleOne ()
 
void replaceHandle (KisPaintingAssistantHandleSP _handle, KisPaintingAssistantHandleSP _with)
 
KisPaintingAssistantHandleSP rightMiddle ()
 
const KisPaintingAssistantHandleSP rightMiddle () const
 
virtual void saveCustomXml (QXmlStreamWriter *xml)
 
QByteArray saveXml (QMap< KisPaintingAssistantHandleSP, int > &handleMap)
 
void saveXmlList (QDomDocument &doc, QDomElement &assistantsElement, int count)
 
virtual void setAdjustedBrushPosition (const QPointF position)
 
void setAssistantCustomColor (QColor color)
 
void setAssistantGlobalColorCache (const QColor &color)
 
void setDecorationThickness (int thickness)
 
void setDuplicating (bool value)
 setDuplicating
 
void setEditorWidgetOffset (QPointF offset)
 
virtual void setFollowBrushPosition (bool follow)
 
void setLocal (bool value)
 setLocal
 
void setLocked (bool value)
 setLocked
 
void setSnappingActive (bool set)
 
void setUseCustomColor (bool useCustomColor)
 
QList< KisPaintingAssistantHandleSPsideHandles ()
 
const QList< KisPaintingAssistantHandleSP > & sideHandles () const
 
KisPaintingAssistantHandleSP topLeft ()
 
const KisPaintingAssistantHandleSP topLeft () const
 
KisPaintingAssistantHandleSP topMiddle ()
 
const KisPaintingAssistantHandleSP topMiddle () const
 
KisPaintingAssistantHandleSP topRight ()
 
const KisPaintingAssistantHandleSP topRight () const
 
virtual void transform (const QTransform &transform)
 
void uncache ()
 
bool useCustomColor ()
 
QPointF viewportConstrainedEditorPosition (const KisCoordinatesConverter *converter, const QSize editorSize)
 
virtual ~KisPaintingAssistant ()
 

Protected Member Functions

QRect boundingRect () const override
 
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
 
- Protected Member Functions inherited from KisPaintingAssistant
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

bool getTransform (QPolygonF &polyOut, QTransform &transformOut)
 
bool isEllipseValid ()
 
 PerspectiveEllipseAssistant (const PerspectiveEllipseAssistant &rhs, QMap< KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP > &handleMap)
 
QPointF project (const QPointF &pt, const QPointF &strokeBegin)
 
void updateCache ()
 

Private Attributes

QScopedPointer< Privated
 

Additional Inherited Members

- Static Public Member Functions inherited from KisPaintingAssistant
static QList< KisPaintingAssistantSPcloneAssistantList (const QList< KisPaintingAssistantSP > &list)
 
static double norm2 (const QPointF &p)
 
- Protected Attributes inherited from KisPaintingAssistant
QList< KisPaintingAssistantHandleSPm_handles
 
bool m_hasBeenInsideLocalRect {false}
 

Detailed Description

Definition at line 13 of file PerspectiveEllipseAssistant.h.

Constructor & Destructor Documentation

◆ PerspectiveEllipseAssistant() [1/2]

PerspectiveEllipseAssistant::PerspectiveEllipseAssistant ( QObject * parent = 0)

Definition at line 330 of file PerspectiveEllipseAssistant.cc.

332 , KisPaintingAssistant("perspective ellipse", i18n("Perspective Ellipse assistant"))
333 , d(new Private())
334{
335
336}
KisPaintingAssistant(const QString &id, const QString &name)

◆ ~PerspectiveEllipseAssistant()

PerspectiveEllipseAssistant::~PerspectiveEllipseAssistant ( )

Definition at line 338 of file PerspectiveEllipseAssistant.cc.

338{}

◆ PerspectiveEllipseAssistant() [2/2]

PerspectiveEllipseAssistant::PerspectiveEllipseAssistant ( const PerspectiveEllipseAssistant & rhs,
QMap< KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP > & handleMap )
explicitprivate

Definition at line 340 of file PerspectiveEllipseAssistant.cc.

341 : KisAbstractPerspectiveGrid(rhs.parent())
342 , KisPaintingAssistant(rhs, handleMap)
343 , d(new Private())
344{
345 updateCache();
346}

References updateCache().

Member Function Documentation

◆ adjustLine()

void PerspectiveEllipseAssistant::adjustLine ( QPointF & point,
QPointF & strokeBegin )
overridevirtual

Implements KisPaintingAssistant.

Definition at line 368 of file PerspectiveEllipseAssistant.cc.

369{
370 point = QPointF();
371 strokeBegin = QPointF();
372}

◆ adjustPosition()

QPointF PerspectiveEllipseAssistant::adjustPosition ( const QPointF & point,
const QPointF & strokeBegin,
const bool snapToAny,
qreal moveThresholdPt )
overridevirtual

Adjust the position given in parameter.

Parameters
pointthe coordinates in point in the document reference
strokeBeginthe coordinates of the beginning of the stroke
snapToAnybecause 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.
moveThresholdPtthe 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 363 of file PerspectiveEllipseAssistant.cc.

364{
365 return project(pt, strokeBegin);
366}
QPointF project(const QPointF &pt, const QPointF &strokeBegin)

References project().

◆ boundingRect()

QRect PerspectiveEllipseAssistant::boundingRect ( ) const
overrideprotectedvirtual

Reimplemented from KisPaintingAssistant.

Definition at line 521 of file PerspectiveEllipseAssistant.cc.

522{
523 if (!isAssistantComplete()) {
525 }
526
527 if (d->ellipseInPolygon.setSimpleEllipseVertices(d->simpleEllipse)) {
528 return d->simpleEllipse.boundingRect().adjusted(-2, -2, 2, 2).toAlignedRect();
529 } else {
530 return QRect();
531 }
532}
virtual QRect boundingRect() const

References KisPaintingAssistant::boundingRect(), d, and isAssistantComplete().

◆ clone()

KisPaintingAssistantSP PerspectiveEllipseAssistant::clone ( QMap< KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP > & handleMap) const
overridevirtual

Implements KisPaintingAssistant.

Definition at line 348 of file PerspectiveEllipseAssistant.cc.

349{
350 return KisPaintingAssistantSP(new PerspectiveEllipseAssistant(*this, handleMap));
351}
QSharedPointer< KisPaintingAssistant > KisPaintingAssistantSP
Definition kis_types.h:189

References PerspectiveEllipseAssistant().

◆ contains()

bool PerspectiveEllipseAssistant::contains ( const QPointF & point) const
overridevirtual

Implements KisAbstractPerspectiveGrid.

Definition at line 597 of file PerspectiveEllipseAssistant.cc.

598{
599
600 QPolygonF poly;
602 return poly.containsPoint(point, Qt::OddEvenFill);
603}
const QList< KisPaintingAssistantHandleSP > & handles() const
static bool getTetragon(const QList< KisPaintingAssistantHandleSP > &handles, bool isAssistantComplete, QPolygonF &outPolygon)

References PerspectiveBasedAssistantHelper::getTetragon(), KisPaintingAssistant::handles(), and isAssistantComplete().

◆ distance()

qreal PerspectiveEllipseAssistant::distance ( const QPointF & pt) const
overridevirtual

Returns the reciprocal of the distance from the given point to the 'observer', in the range [0, 1] where 0 = infinite distance and 1 = closest.

Implements KisAbstractPerspectiveGrid.

Definition at line 605 of file PerspectiveEllipseAssistant.cc.

606{
607 KIS_SAFE_ASSERT_RECOVER_NOOP(d->cacheValid);
609}
static qreal distanceInGrid(const QList< KisPaintingAssistantHandleSP > &handles, bool isAssistantComplete, const QPointF &point)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References d, PerspectiveBasedAssistantHelper::distanceInGrid(), and KIS_SAFE_ASSERT_RECOVER_NOOP.

◆ drawAssistant()

void PerspectiveEllipseAssistant::drawAssistant ( QPainter & gc,
const QRectF & updateRect,
const KisCoordinatesConverter * converter,
bool cached,
KisCanvas2 * canvas,
bool assistantVisible = true,
bool previewVisible = true )
overrideprotectedvirtual

Reimplemented from KisPaintingAssistant.

Definition at line 374 of file PerspectiveEllipseAssistant.cc.

375{
376 gc.save();
377 gc.resetTransform();
378
379 bool isEditing = false;
380
381 if (canvas) {
382 isEditing = canvas->paintingAssistantsDecoration()->isEditingAssistants();
383 }
384
385 QTransform initialTransform = converter->documentToWidgetTransform();
386
387 // need to update ellipse cache
388 updateCache();
389
390 QPolygonF poly = d->ellipseInPolygon.polygon;
391 QTransform transform = d->ellipseInPolygon.originalTransform; // unused, but computed for caching purposes
392
393
394 if (isEllipseValid() && assistantVisible==true) {
395 // draw vanishing points
396 if (d->cache.vanishingPoint1) {
397 drawX(gc, initialTransform.map(d->cache.vanishingPoint1.get()));
398 }
399 if (d->cache.vanishingPoint2) {
400 drawX(gc, initialTransform.map(d->cache.vanishingPoint2.get()));
401 }
402 }
403
404 // draw ellipse and axes
405 if (isEllipseValid() && (assistantVisible || previewVisible || isEditing)) { // ensure that you only draw the ellipse if it's valid - otherwise it would just show some outdated one
406 QPointF mousePos = effectiveBrushPosition(converter, canvas);
407 gc.setTransform(initialTransform);
408 gc.setTransform(d->simpleEllipse.getTransform().inverted(), true);
409
410 QPainterPath path;
411 path.addEllipse(QPointF(0.0, 0.0), d->simpleEllipse.semiMajor(), d->simpleEllipse.semiMinor());
412
413 if (assistantVisible || isEditing) {
414 drawPath(gc, path, isSnappingActive());
415 } else if (previewVisible && isSnappingActive() && boundingRect().contains(initialTransform.inverted().map(mousePos.toPoint()), false)) {
416 drawPreview(gc, path);
417 }
418
419 if (isEditing) {
420 QPainterPath axes;
421 axes.moveTo(QPointF(-d->simpleEllipse.semiMajor(), 0));
422 axes.lineTo(QPointF(d->simpleEllipse.semiMajor(), 0));
423
424 axes.moveTo(QPointF(0, -d->simpleEllipse.semiMinor()));
425 axes.lineTo(QPointF(0, d->simpleEllipse.semiMinor()));
426
427 gc.save();
428
429 QPen p(gc.pen());
430 p.setCosmetic(true);
431 p.setStyle(Qt::DotLine);
432 QColor color = effectiveAssistantColor();
433 if (!isSnappingActive()) {
434 color.setAlpha(color.alpha()*0.2);
435 }
436 p.setWidthF(1.5);
437 p.setColor(color);
438 gc.setPen(p);
439
440 gc.drawPath(axes);
441
442 gc.restore();
443 }
444
445 gc.setTransform(converter->documentToWidgetTransform());
446 gc.setTransform(d->ellipseInPolygon.originalTransform, true);
447
448 // drawing original axes ("lines to touching points")
449 QPointF pt1 = QPointF(0.5, 1.0);
450 QPointF pt2 = QPointF(1.0, 0.5);
451 QPointF pt3 = QPointF(0.5, 0.0);
452 QPointF pt4 = QPointF(0.0, 0.5);
453
454 QPainterPath touchingLine;
455
456 touchingLine.moveTo(pt1);
457 touchingLine.lineTo(pt3);
458
459 touchingLine.moveTo(pt2);
460 touchingLine.lineTo(pt4);
461
462 if (assistantVisible) {
463 drawPath(gc, touchingLine, isSnappingActive());
464 }
465 }
466
467
468 gc.setTransform(converter->documentToWidgetTransform());
469
470 if (assistantVisible || isEditing) {
471 if (!isEllipseValid()) {
472 // color red for an invalid transform, but not for an incomplete one
473 if(isAssistantComplete()) {
474 QPainterPath path;
475 QPolygonF polyAllConnected;
476 // that will create a triangle with a point inside connected to all vertices of the triangle
477 polyAllConnected << *handles()[0] << *handles()[1] << *handles()[2] << *handles()[3] << *handles()[0] << *handles()[2] << *handles()[1] << *handles()[3];
478 path.addPolygon(polyAllConnected);
479 drawError(gc, path);
480 } else {
481 QPainterPath path;
482 path.addPolygon(poly);
483 drawPath(gc, path, isSnappingActive());
484 }
485 } else {
486 gc.setPen(QColor(0, 0, 0, 125));
487 gc.setTransform(transform, true);
488 QPainterPath path;
489 for (int y = 0; y <= 1; ++y)
490 {
491 QLineF line = QLineF(QPointF(0.0, y), QPointF(1.0, y));
492 KisAlgebra2D::cropLineToRect(line, gc.window(), false, false);
493 path.moveTo(line.p1());
494 path.lineTo(line.p2());
495 }
496 for (int x = 0; x <= 1; ++x)
497 {
498 QLineF line = QLineF(QPointF(x, 0.0), QPointF(x, 1.0));
499 KisAlgebra2D::cropLineToRect(line, gc.window(), false, false);
500 path.moveTo(line.p1());
501 path.lineTo(line.p2());
502 }
503
504 drawPath(gc, path, isSnappingActive());
505 }
506 }
507
508 gc.restore();
509 KisPaintingAssistant::drawAssistant(gc, updateRect, converter, cached, canvas, assistantVisible, previewVisible);
510
511}
const Params2D p
KisPaintingAssistantsDecorationSP paintingAssistantsDecoration() const
void drawX(QPainter &painter, const QPointF &pt)
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 pain...
void drawError(QPainter &painter, const QPainterPath &path)
void drawPath(QPainter &painter, const QPainterPath &path, bool drawActive=true)
void drawPreview(QPainter &painter, const QPainterPath &path)
virtual void transform(const QTransform &transform)
virtual void drawAssistant(QPainter &gc, const QRectF &updateRect, const KisCoordinatesConverter *converter, bool cached, KisCanvas2 *canvas=0, bool assistantVisible=true, bool previewVisible=true)
bool contains(const QPointF &point) const override
void cropLineToRect(QLineF &line, const QRect rect, bool extendFirst, bool extendSecond)

References boundingRect(), contains(), KisAlgebra2D::cropLineToRect(), d, KisCoordinatesConverter::documentToWidgetTransform(), KisPaintingAssistant::drawAssistant(), KisPaintingAssistant::drawError(), KisPaintingAssistant::drawPath(), KisPaintingAssistant::drawPreview(), KisPaintingAssistant::drawX(), KisPaintingAssistant::effectiveAssistantColor(), KisPaintingAssistant::effectiveBrushPosition(), KisPaintingAssistant::handles(), isAssistantComplete(), KisPaintingAssistantsDecoration::isEditingAssistants(), isEllipseValid(), KisPaintingAssistant::isSnappingActive(), p, KisCanvas2::paintingAssistantsDecoration(), KisPaintingAssistant::transform(), and updateCache().

◆ drawCache()

void PerspectiveEllipseAssistant::drawCache ( QPainter & gc,
const KisCoordinatesConverter * converter,
bool assistantVisible = true )
overrideprotectedvirtual

performance layer where the graphics can be drawn from a cache instead of generated every render update

Implements KisPaintingAssistant.

Definition at line 514 of file PerspectiveEllipseAssistant.cc.

515{
516 Q_UNUSED(converter);
517 Q_UNUSED(gc);
518 Q_UNUSED(assistantVisible);
519}

◆ getDefaultEditorPosition()

QPointF PerspectiveEllipseAssistant::getDefaultEditorPosition ( ) const
overridevirtual

Implements KisPaintingAssistant.

Definition at line 534 of file PerspectiveEllipseAssistant.cc.

535{
536 QPointF centroid(0, 0);
537 for (int i = 0; i < 4; ++i) {
538 centroid += *handles()[i];
539 }
540
541 return centroid * 0.25;
542}

References KisPaintingAssistant::handles().

◆ getTransform()

bool PerspectiveEllipseAssistant::getTransform ( QPolygonF & polyOut,
QTransform & transformOut )
private

◆ isActive()

bool PerspectiveEllipseAssistant::isActive ( ) const
overridevirtual

Implements KisAbstractPerspectiveGrid.

Definition at line 611 of file PerspectiveEllipseAssistant.cc.

612{
613 return isSnappingActive();
614}

References KisPaintingAssistant::isSnappingActive().

◆ isAssistantComplete()

bool PerspectiveEllipseAssistant::isAssistantComplete ( ) const
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 592 of file PerspectiveEllipseAssistant.cc.

593{
594 return handles().size() >= 4;
595}

References KisPaintingAssistant::handles().

◆ isEllipseValid()

bool PerspectiveEllipseAssistant::isEllipseValid ( )
private

Definition at line 544 of file PerspectiveEllipseAssistant.cc.

545{
546 return isAssistantComplete() && d->ellipseInPolygon.isValid();
547}

References d, and isAssistantComplete().

◆ numHandles()

int PerspectiveEllipseAssistant::numHandles ( ) const
inlineoverridevirtual

Implements KisPaintingAssistant.

Definition at line 26 of file PerspectiveEllipseAssistant.h.

26{ return 4; }

◆ project()

QPointF PerspectiveEllipseAssistant::project ( const QPointF & pt,
const QPointF & strokeBegin )
private

Definition at line 353 of file PerspectiveEllipseAssistant.cc.

354{
355 Q_UNUSED(strokeBegin);
356 Q_ASSERT(isAssistantComplete());
357
358 d->ellipseInPolygon.setSimpleEllipseVertices(d->simpleEllipse);
359
360 return d->simpleEllipse.project(pt);
361}

References d, and isAssistantComplete().

◆ updateCache()

void PerspectiveEllipseAssistant::updateCache ( )
private

Definition at line 549 of file PerspectiveEllipseAssistant.cc.

550{
551 // handles -> points -> polygon
552 d->cacheValid = false;
553 // check the cached points, whether they are the same as handles
554 if (d->cachedPoints.size() == handles().size()) {
555 for (int i = 0; i < handles().size(); ++i) {
556 if (d->cachedPoints[i] != *handles()[i]) break;
557 if (i == handles().size() - 1) {
558 // that means the cache is up to date, because the loop was still going
559 d->cacheValid = true;
560 return;
561 }
562 }
563 }
564
565 d->cachedPoints = QVector<QPointF>();
566 for (int i = 0; i < handles().size(); ++i) {
567 d->cachedPoints << *handles()[i];
568 }
569
570
571 QPolygonF poly = QPolygonF(d->cachedPoints);
572
573 if (!PerspectiveBasedAssistantHelper::getTetragon(handles(), isAssistantComplete(), poly)) { // this function changes poly to some "standardized" version, or a triangle when it cannot be achieved
574
575 poly = QPolygonF(d->cachedPoints);
576 poly << d->cachedPoints[0];
577 d->ellipseInPolygon.updateToPolygon(poly);
578 d->cacheValid = true;
579 return;
580 }
581
582 d->ellipseInPolygon.updateToPolygon(poly);
583 if (d->ellipseInPolygon.isValid()) {
584 d->ellipseInPolygon.setSimpleEllipseVertices(d->simpleEllipse);
585 }
586
588 d->cacheValid = true;
589
590}
static void updateCacheData(CacheData &cache, const QPolygonF &poly)
int size(const Forest< T > &forest)
Definition KisForest.h:1232

References d, PerspectiveBasedAssistantHelper::getTetragon(), KisPaintingAssistant::handles(), isAssistantComplete(), and PerspectiveBasedAssistantHelper::updateCacheData().

Member Data Documentation

◆ d

QScopedPointer<Private> PerspectiveEllipseAssistant::d
private

Definition at line 54 of file PerspectiveEllipseAssistant.h.


The documentation for this class was generated from the following files: