Krita Source Code Documentation
Loading...
Searching...
No Matches
CurvilinearPerspectiveAssistant.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2008 Cyrille Berger <cberger@cberger.net>
3 * SPDX-FileCopyrightText: 2010 Geoffry Song <goffrie@gmail.com>
4 * SPDX-FileCopyrightText: 2014 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
5 * SPDX-FileCopyrightText: 2017 Scott Petrovic <scottpetrovic@gmail.com>
6 *
7 * SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9
10#ifndef _CURVILINEARPERSPECTIVE_ASSISTANT_H_
11#define _CURVILINEARPERSPECTIVE_ASSISTANT_H_
12
14#include <QObject>
15#include <QLineF>
16//class CurvilinearPerspective;
17
19{
20public:
22 KisPaintingAssistantSP clone(QMap<KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP> &handleMap) const override;
23
24 QPointF adjustPosition(const QPointF& point, const QPointF& strokeBegin, const bool snapToAny, qreal moveThresholdPt) override;
25 void adjustLine(QPointF &point, QPointF& strokeBegin) override;
26
27 QPointF getDefaultEditorPosition() const override;
28 int numHandles() const override { return 2; }
29
30 bool isAssistantComplete() const override;
31
32protected:
33 void drawAssistant(QPainter& gc, const QRectF& updateRect, const KisCoordinatesConverter* converter, bool cached = true,KisCanvas2* canvas=0, bool assistantVisible=true, bool previewVisible=true) override;
34 void drawCache(QPainter& gc, const KisCoordinatesConverter *converter, bool assistantVisible=true) override;
35private:
36 QLineF identifyCircle(const QPointF thirdPoint);
37 explicit CurvilinearPerspectiveAssistant(const CurvilinearPerspectiveAssistant &rhs, QMap<KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP> &handleMap);
38};
39
41{
42public:
45 QString id() const override;
46 QString name() const override;
48};
49
50#endif
KisPaintingAssistant * createPaintingAssistant() const override
KisPaintingAssistantSP clone(QMap< KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP > &handleMap) const override
QLineF identifyCircle(const QPointF thirdPoint)
QPointF adjustPosition(const QPointF &point, const QPointF &strokeBegin, const bool snapToAny, qreal moveThresholdPt) 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 upda...
void drawAssistant(QPainter &gc, const QRectF &updateRect, const KisCoordinatesConverter *converter, bool cached=true, KisCanvas2 *canvas=0, bool assistantVisible=true, bool previewVisible=true) override
void adjustLine(QPointF &point, QPointF &strokeBegin) override