BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Cartesian/Circle_2.h
Go to the documentation of this file.
00001 // Copyright (c) 1997-2004  Utrecht University (The Netherlands),
00002 // ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
00003 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
00004 // (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
00005 // and Tel-Aviv University (Israel).  All rights reserved.
00006 //
00007 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or
00008 // modify it under the terms of the GNU Lesser General Public License as
00009 // published by the Free Software Foundation; version 2.1 of the License.
00010 // See the file LICENSE.LGPL distributed with CGAL.
00011 //
00012 // Licensees holding a valid commercial license may use this file in
00013 // accordance with the commercial license agreement provided with the software.
00014 //
00015 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 //
00018 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h $
00019 // $Id: Circle_2.h 49589 2009-05-26 07:54:52Z spion $
00020 // 
00021 //
00022 // Author(s)     : Andreas Fabri, Herve Bronnimann
00023 
00024 #ifndef CGAL_CARTESIAN_CIRCLE_2_H
00025 #define CGAL_CARTESIAN_CIRCLE_2_H
00026 
00027 #include <CGAL/Cartesian/predicates_on_points_2.h>
00028 #include <boost/tuple/tuple.hpp>
00029 
00030 CGAL_BEGIN_NAMESPACE
00031 
00032 template <class R_ >
00033 class CircleC2
00034 {
00035   typedef typename R_::FT                   FT;
00036   typedef typename R_::RT                   RT;
00037   typedef typename R_::Circle_2             Circle_2;
00038   typedef typename R_::Point_2              Point_2;
00039 
00040   typedef boost::tuple<Point_2, FT, Orientation>   Rep;
00041   typedef typename R_::template Handle<Rep>::type  Base;
00042 
00043   Base base;
00044 
00045 public:
00046   typedef R_                                     R;
00047 
00048   CircleC2() {}
00049 
00050   explicit CircleC2(const Point_2 &center, const FT &squared_radius = FT(0),
00051            const Orientation &orient = COUNTERCLOCKWISE) // Is this new?
00052   {
00053     CGAL_kernel_precondition( ( squared_radius >= FT(0) ) &
00054                               ( orient    != COLLINEAR) );
00055 
00056     base = Rep(center, squared_radius, orient);
00057   }
00058  
00059   bool           operator==(const CircleC2 &s) const;
00060   bool           operator!=(const CircleC2 &s) const;
00061 
00062   const Point_2 & center() const
00063   {
00064     return get(base).template get<0>();
00065   }
00066 
00067   const FT & squared_radius() const
00068   {
00069     return get(base).template get<1>();
00070   }
00071 
00072   Orientation orientation() const
00073   {
00074     return get(base).template get<2>();
00075   }
00076 
00077 };
00078 
00079 CGAL_END_NAMESPACE
00080 
00081 #endif // CGAL_CARTESIAN_CIRCLE_2_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines