File indexing completed on 2024-05-12 16:01:24
0001 /* 0002 * This file is part of Krita 0003 * 0004 * SPDX-FileCopyrightText: 2010 Geoffry Song <goffrie@gmail.com> 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef KIS_ABSTRACT_PERSPECTIVE_GRID_H 0010 #define KIS_ABSTRACT_PERSPECTIVE_GRID_H 0011 0012 #include <QPointF> 0013 #include <QObject> 0014 0015 #include "kritaui_export.h" 0016 0017 class KRITAUI_EXPORT KisAbstractPerspectiveGrid : public QObject 0018 { 0019 Q_OBJECT 0020 public: 0021 0022 KisAbstractPerspectiveGrid(QObject * parent = 0); 0023 0024 ~KisAbstractPerspectiveGrid() override {} 0025 0026 virtual bool contains(const QPointF& pt) const = 0; 0027 /** 0028 * Returns the reciprocal of the distance from the given point 0029 * to the 'observer', in the range [0, 1] where 0 = infinite 0030 * distance and 1 = closest. 0031 */ 0032 virtual qreal distance(const QPointF& pt) const = 0; 0033 }; 0034 0035 #endif