point.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2011 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 **    Kenneth Gangstoe
00028 **    Harry Storbacka
00029 **    Mark Page
00030 */
00031 
00034 
00035 #pragma once
00036 
00037 #include "../api_core.h"
00038 #include "vec2.h"
00039 #include "angle.h"
00040 #include "origin.h"
00041 #include "size.h"
00042 
00043 class CL_Pointf;
00044 class CL_Pointd;
00045 
00050 template<typename Type>
00051 class CL_Pointx : public CL_Vec2<Type>
00052 {
00053 public:
00054         CL_Pointx() : CL_Vec2<Type>() {}
00055         CL_Pointx(Type x, Type y) : CL_Vec2<Type>(x, y) {}
00056         CL_Pointx(const CL_Pointx<Type> &p) : CL_Vec2<Type>(p.x, p.y) {}
00057         CL_Pointx(const CL_Vec2<Type> &p) : CL_Vec2<Type>(p.x, p.y) {}
00058 };
00059 
00063 class CL_Point : public CL_Pointx<int>
00064 {
00065 public:
00066         CL_Point() : CL_Pointx<int>() {}
00067         CL_Point(int x, int y) : CL_Pointx<int>(x, y) {}
00068         CL_Point(const CL_Pointx<int> &p) : CL_Pointx<int>(p.x, p.y) {}
00069         CL_Point(const CL_Vec2<int> &p) : CL_Pointx<int>(p.x, p.y) {}
00070 };
00071 
00075 class CL_Pointf : public CL_Pointx<float>
00076 {
00077 public:
00078         CL_Pointf() : CL_Pointx<float>() {}
00079         CL_Pointf(float x, float y) : CL_Pointx<float>(x, y) {}
00080         CL_Pointf(const CL_Pointx<float> &p) : CL_Pointx<float>(p.x, p.y) {}
00081         CL_Pointf(const CL_Vec2<float> &p) : CL_Pointx<float>(p.x, p.y) {}
00082 };
00083 
00087 class CL_Pointd : public CL_Pointx<double>
00088 {
00089 public:
00090         CL_Pointd() : CL_Pointx<double>() {}
00091         CL_Pointd(double x, double y) : CL_Pointx<double>(x, y) {}
00092         CL_Pointd(const CL_Pointx<double> &p) : CL_Pointx<double>(p.x, p.y) {}
00093         CL_Pointd(const CL_Vec2<double> &p) : CL_Pointx<double>(p.x, p.y) {}
00094 };
00095 
00097