point.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 ** Kenneth Gangstoe
28 ** Harry Storbacka
29 ** Mark Page
30 */
31 
32 
33 #pragma once
34 
35 #include "../api_core.h"
36 #include "vec2.h"
37 #include "angle.h"
38 #include "origin.h"
39 #include "size.h"
40 
41 namespace clan
42 {
45 
46 class Pointf;
47 class Pointd;
48 
52 template<typename Type>
53 class Pointx : public Vec2<Type>
54 {
55 public:
56  Pointx() : Vec2<Type>() {}
57  Pointx(Type x, Type y) : Vec2<Type>(x, y) {}
58  Pointx(const Pointx<Type> &p) : Vec2<Type>(p.x, p.y) {}
59  Pointx(const Vec2<Type> &p) : Vec2<Type>(p.x, p.y) {}
60 };
61 
63 class Point : public Pointx<int>
64 {
65 public:
66  Point() : Pointx<int>() {}
67  Point(int x, int y) : Pointx<int>(x, y) {}
68  Point(const Pointx<int> &p) : Pointx<int>(p.x, p.y) {}
69  Point(const Vec2<int> &p) : Pointx<int>(p.x, p.y) {}
70 };
71 
73 class Pointf : public Pointx<float>
74 {
75 public:
76  Pointf() : Pointx<float>() {}
77  Pointf(float x, float y) : Pointx<float>(x, y) {}
78  Pointf(const Pointx<float> &p) : Pointx<float>(p.x, p.y) {}
79  Pointf(const Vec2<float> &p) : Pointx<float>(p.x, p.y) {}
80 };
81 
83 class Pointd : public Pointx<double>
84 {
85 public:
86  Pointd() : Pointx<double>() {}
87  Pointd(double x, double y) : Pointx<double>(x, y) {}
88  Pointd(const Pointx<double> &p) : Pointx<double>(p.x, p.y) {}
89  Pointd(const Vec2<double> &p) : Pointx<double>(p.x, p.y) {}
90 };
91 
92 }
93 
95 
Pointd(double x, double y)
Definition: point.h:87
Point(int x, int y)
Definition: point.h:67
Pointd(const Vec2< double > &p)
Definition: point.h:89
Point()
Definition: point.h:66
Pointd()
Definition: point.h:86
Pointx(const Pointx< Type > &p)
Definition: point.h:58
Point(const Vec2< int > &p)
Definition: point.h:69
2D (x,y) point structure - Double
Definition: point.h:83
Type x
Definition: vec2.h:82
Pointf(float x, float y)
Definition: point.h:77
2D vector
Definition: line.h:49
Pointx(Type x, Type y)
Definition: point.h:57
Pointf(const Pointx< float > &p)
Definition: point.h:78
2D (x,y) point structure - Integer
Definition: point.h:63
Pointf(const Vec2< float > &p)
Definition: point.h:79
Pointx(const Vec2< Type > &p)
Definition: point.h:59
Point(const Pointx< int > &p)
Definition: point.h:68
2D (x,y) point structure.
Definition: point.h:53
2D (x,y) point structure - Float
Definition: point.h:73
Pointx()
Definition: point.h:56
Pointf()
Definition: point.h:76
Pointd(const Pointx< double > &p)
Definition: point.h:88
Type y
Definition: vec2.h:83