~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/core/kis_point.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 *
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.
17
17
 */
18
18
#ifndef KIS_POINT_H_
19
19
#define KIS_POINT_H_
20
20
 
21
21
#include <qvaluevector.h>
22
 
#include <koPoint.h>
 
22
#include <KoPoint.h>
23
23
 
 
24
/**
 
25
 * A double-based point class that can return it's coordinates
 
26
 * approximated to integers.
 
27
 */
24
28
class KisPoint : public KoPoint {
25
 
        typedef KoPoint super;
 
29
    typedef KoPoint super;
26
30
public:
27
 
        KisPoint() {}
28
 
        KisPoint(double x, double y) : super(x, y) {}
29
 
        KisPoint(const QPoint& pt) : super(pt) {}
30
 
        KisPoint(const KoPoint& pt) : super(pt) {}
31
 
 
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()); }
36
 
 
37
 
        QPoint floorQPoint() const { return QPoint(static_cast<int>(x()), static_cast<int>(y())); }
38
 
        QPoint roundQPoint() const { return QPoint(qRound(x()), qRound(y())); }
 
31
    KisPoint() {}
 
32
    KisPoint(double x, double y) : super(x, y) {}
 
33
    KisPoint(const QPoint& pt) : super(pt) {}
 
34
    KisPoint(const KoPoint& pt) : super(pt) {}
 
35
 
 
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()); }
 
40
 
 
41
    QPoint floorQPoint() const { return QPoint(static_cast<int>(x()), static_cast<int>(y())); }
 
42
    QPoint roundQPoint() const { return QPoint(qRound(x()), qRound(y())); }
39
43
};
40
44
 
41
45
typedef QValueVector<KisPoint> vKisPoint;