point.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2015 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 "vec2.h"
36 #include "angle.h"
37 #include "origin.h"
38 #include "size.h"
39 
40 namespace clan
41 {
44 
45 class Pointf;
46 class Pointd;
47 
51 template<typename Type>
52 class Pointx : public Vec2<Type>
53 {
54 public:
55  Pointx() : Vec2<Type>() {}
56  Pointx(Type x, Type y) : Vec2<Type>(x, y) {}
57  Pointx(const Pointx<Type> &p) : Vec2<Type>(p.x, p.y) {}
58  Pointx(const Vec2<Type> &p) : Vec2<Type>(p.x, p.y) {}
59 };
60 
62 class Point : public Pointx<int>
63 {
64 public:
65  Point() : Pointx<int>() {}
66  Point(int x, int y) : Pointx<int>(x, y) {}
67  Point(const Pointx<int> &p) : Pointx<int>(p.x, p.y) {}
68  Point(const Vec2<int> &p) : Pointx<int>(p.x, p.y) {}
69 };
70 
72 class Pointf : public Pointx<float>
73 {
74 public:
75  Pointf() : Pointx<float>() {}
76  Pointf(float x, float y) : Pointx<float>(x, y) {}
77  Pointf(const Pointx<float> &p) : Pointx<float>(p.x, p.y) {}
78  Pointf(const Vec2<float> &p) : Pointx<float>(p.x, p.y) {}
79 };
80 
82 class Pointd : public Pointx<double>
83 {
84 public:
85  Pointd() : Pointx<double>() {}
86  Pointd(double x, double y) : Pointx<double>(x, y) {}
87  Pointd(const Pointx<double> &p) : Pointx<double>(p.x, p.y) {}
88  Pointd(const Vec2<double> &p) : Pointx<double>(p.x, p.y) {}
89 };
90 
91 }
92 
94 
Pointd(const Pointx< double > &p)
Definition: point.h:87
2D (x,y) point structure - Integer
Definition: point.h:63
Type y
Definition: vec2.h:81
Pointf(const Vec2< float > &p)
Definition: point.h:78
2D (x,y) point structure.
Definition: point.h:53
Pointd()
Definition: point.h:85
Pointf(const Pointx< float > &p)
Definition: point.h:77
2D (x,y) point structure - Float
Definition: point.h:73
Pointf()
Definition: point.h:75
Type x
Definition: vec2.h:80
Point(int x, int y)
Definition: point.h:66
Pointd(double x, double y)
Definition: point.h:86
Point(const Vec2< int > &p)
Definition: point.h:68
Point()
Definition: point.h:65
Pointx(Type x, Type y)
Definition: point.h:56
Pointx(const Pointx< Type > &p)
Definition: point.h:57
2D vector
Definition: line.h:48
Definition: clanapp.h:36
Pointd(const Vec2< double > &p)
Definition: point.h:88
Pointx(const Vec2< Type > &p)
Definition: point.h:58
Pointf(float x, float y)
Definition: point.h:76
Point(const Pointx< int > &p)
Definition: point.h:67
2D (x,y) point structure - Double
Definition: point.h:83
Pointx()
Definition: point.h:55