ClanLib  2.3.7
point.h
Go to the documentation of this file.
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2011 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 
34 
35 #pragma once
36 
37 #include "../api_core.h"
38 #include "vec2.h"
39 #include "angle.h"
40 #include "origin.h"
41 #include "size.h"
42 
43 class CL_Pointf;
44 class CL_Pointd;
45 
50 template<typename Type>
51 class CL_Pointx : public CL_Vec2<Type>
52 {
53 public:
54  CL_Pointx() : CL_Vec2<Type>() {}
55  CL_Pointx(Type x, Type y) : CL_Vec2<Type>(x, y) {}
56  CL_Pointx(const CL_Pointx<Type> &p) : CL_Vec2<Type>(p.x, p.y) {}
57  CL_Pointx(const CL_Vec2<Type> &p) : CL_Vec2<Type>(p.x, p.y) {}
58 };
59 
63 class CL_Point : public CL_Pointx<int>
64 {
65 public:
66  CL_Point() : CL_Pointx<int>() {}
67  CL_Point(int x, int y) : CL_Pointx<int>(x, y) {}
68  CL_Point(const CL_Pointx<int> &p) : CL_Pointx<int>(p.x, p.y) {}
69  CL_Point(const CL_Vec2<int> &p) : CL_Pointx<int>(p.x, p.y) {}
70 };
71 
75 class CL_Pointf : public CL_Pointx<float>
76 {
77 public:
78  CL_Pointf() : CL_Pointx<float>() {}
79  CL_Pointf(float x, float y) : CL_Pointx<float>(x, y) {}
80  CL_Pointf(const CL_Pointx<float> &p) : CL_Pointx<float>(p.x, p.y) {}
81  CL_Pointf(const CL_Vec2<float> &p) : CL_Pointx<float>(p.x, p.y) {}
82 };
83 
87 class CL_Pointd : public CL_Pointx<double>
88 {
89 public:
90  CL_Pointd() : CL_Pointx<double>() {}
91  CL_Pointd(double x, double y) : CL_Pointx<double>(x, y) {}
92  CL_Pointd(const CL_Pointx<double> &p) : CL_Pointx<double>(p.x, p.y) {}
93  CL_Pointd(const CL_Vec2<double> &p) : CL_Pointx<double>(p.x, p.y) {}
94 };
95 
97