Krita Source Code Documentation
Loading...
Searching...
No Matches
ParallelRulerAssistant.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 _PARALLELRULER_ASSISTANT_H_
11#define _PARALLELRULER_ASSISTANT_H_
12
14#include <QObject>
15#include <QLineF>
16/* Design:
17 */
18class ParallelRuler;
19
21{
22public:
24 KisPaintingAssistantSP clone(QMap<KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP> &handleMap) const override;
25 QPointF adjustPosition(const QPointF& point, const QPointF& strokeBegin, const bool snapToAny, qreal moveThresholdPt) override;
26 void adjustLine(QPointF &point, QPointF& strokeBegin) override;
27 QPointF getDefaultEditorPosition() const override;
28 int numHandles() const override { return isLocal() ? 4 : 2; }
29 bool isAssistantComplete() const override;
30 bool canBeLocal() const override;
31
32 void saveCustomXml(QXmlStreamWriter* xml) override;
33 bool loadCustomXml(QXmlStreamReader* xml) override;
34
35protected:
36 void drawAssistant(QPainter& gc, const QRectF& updateRect, const KisCoordinatesConverter* converter, bool cached = true,KisCanvas2* canvas=0, bool assistantVisible=true, bool previewVisible=true) override;
37 void drawCache(QPainter& gc, const KisCoordinatesConverter *converter, bool assistantVisible=true) override;
38
41
42private:
43 QPointF project(const QPointF& pt, const QPointF& strokeBegin, qreal moveThresholdPt);
44 explicit ParallelRulerAssistant(const ParallelRulerAssistant &rhs, QMap<KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP> &handleMap);
45
46};
47
49{
50public:
53 QString id() const override;
54 QString name() const override;
56};
57
58#endif
KisPaintingAssistant * createPaintingAssistant() const override
QPointF getDefaultEditorPosition() const override
QPointF project(const QPointF &pt, const QPointF &strokeBegin, qreal moveThresholdPt)
void adjustLine(QPointF &point, QPointF &strokeBegin) override
KisPaintingAssistantSP clone(QMap< KisPaintingAssistantHandleSP, KisPaintingAssistantHandleSP > &handleMap) const override
int numHandles() const 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
bool loadCustomXml(QXmlStreamReader *xml) override
KisPaintingAssistantHandleSP secondLocalHandle() const override
secondLocalHandle Note: this doesn't guarantee it will be the bottomRight corner! For that,...
QPointF adjustPosition(const QPointF &point, const QPointF &strokeBegin, const bool snapToAny, qreal moveThresholdPt) override
void saveCustomXml(QXmlStreamWriter *xml) override
KisPaintingAssistantHandleSP firstLocalHandle() const override
firstLocalHandle Note: this doesn't guarantee it will be the topleft corner! For that,...
bool canBeLocal() const override
canBeLocal
bool isAssistantComplete() const override