chalk

kis_rect.h
1/*
2 * Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18#ifndef KIS_RECT_H_
19#define KIS_RECT_H_
20
21#include <tqrect.h>
22#include <KoRect.h>
23#include "kis_point.h"
24
28class KisRect : public KoRect
29{
30 typedef KoRect super;
31public:
32 KisRect() {}
33 KisRect(double x, double y, double w, double h) : super(x, y, w, h) {}
34 KisRect(const KisPoint& topLeft, const KisPoint& bottomRight) : super(topLeft, bottomRight) {}
35 KisRect(const TQRect& qr) : super(qr.x(), qr.y(), qr.width(), qr.height()) {}
36 KisRect(const KoRect& r) : super(r) {}
37
41 TQRect qRect() const;
42
43private:
44 // Use qRect() which uses ceil() and floor() to return a rectangle
45 // 'enclosing' the rectangle, whereas toTQRect rounds the points.
46 TQRect toTQRect() const;
47};
48
49#endif // KIS_RECT_H_
50
A double-based point class that can return it's coordinates approximated to integers.
Definition kis_point.h:28
TQRect qRect() const
Return the TQRect that encloses this KisRect.
Definition kis_rect.cpp:24