14
14
* You should have received a copy of the GNU General Public License
15
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
18
#ifndef KIS_POINT_H_
19
19
#define KIS_POINT_H_
21
21
#include <qvaluevector.h>
25
* A double-based point class that can return it's coordinates
26
* approximated to integers.
24
28
class KisPoint : public KoPoint {
25
typedef KoPoint super;
29
typedef KoPoint super;
28
KisPoint(double x, double y) : super(x, y) {}
29
KisPoint(const QPoint& pt) : super(pt) {}
30
KisPoint(const KoPoint& pt) : super(pt) {}
32
int floorX() const { return static_cast<int>(x()); }
33
int floorY() const { return static_cast<int>(y()); }
34
int roundX() const { return qRound(x()); }
35
int roundY() const { return qRound(y()); }
37
QPoint floorQPoint() const { return QPoint(static_cast<int>(x()), static_cast<int>(y())); }
38
QPoint roundQPoint() const { return QPoint(qRound(x()), qRound(y())); }
32
KisPoint(double x, double y) : super(x, y) {}
33
KisPoint(const QPoint& pt) : super(pt) {}
34
KisPoint(const KoPoint& pt) : super(pt) {}
36
int floorX() const { return static_cast<int>(x()); }
37
int floorY() const { return static_cast<int>(y()); }
38
int roundX() const { return qRound(x()); }
39
int roundY() const { return qRound(y()); }
41
QPoint floorQPoint() const { return QPoint(static_cast<int>(x()), static_cast<int>(y())); }
42
QPoint roundQPoint() const { return QPoint(qRound(x()), qRound(y())); }
41
45
typedef QValueVector<KisPoint> vKisPoint;