circle.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 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 **    Harry Storbacka
00027 **    (if your name is missing here, please add it)
00028 */
00029 
00032 
00033 #pragma once
00034 
00035 #include "point.h"
00036 
00037 class CL_Circlef;
00038 
00042 class CL_Circle
00043 {
00044 // Construction:
00045 public:
00047         CL_Circle()
00048         { return; }
00049 
00055         CL_Circle(int x, int y, int radius)
00056         : position(x,y), radius(radius) { return; }
00057 
00062         CL_Circle(const CL_Point &p, int radius)
00063         : position(p), radius(radius) { return; }
00064 
00065         explicit CL_Circle(const CL_Circlef& other);
00066 
00067 // Attributes:
00068 public:
00070         CL_Point position;
00071 
00073         int radius;
00074 };
00075 
00079 class CL_Circlef
00080 {
00081 // Construction:
00082 public:
00084         CL_Circlef()
00085         { return; }
00086 
00092         CL_Circlef(float x, float y, float radius)
00093         : position((float)x,(float)y), radius(radius) { return; }
00094 
00099         CL_Circlef(const CL_Pointf &p, float radius)
00100         : position(p), radius(radius) { return; }
00101 
00102 // Attributes:
00103 public:
00105         CL_Pointf position;
00106 
00108         float radius;
00109 };
00110 
00111 inline CL_Circle::CL_Circle(const CL_Circlef &other)
00112 : position(other.position), radius(int(other.radius+0.5))
00113 {
00114         return;
00115 }
00116 

Generated on Thu Dec 3 02:39:28 2009 for ClanLib by  doxygen 1.4.6