|
BWAPI
|
00001 // Copyright (c) 2003-2008 INRIA Sophia-Antipolis (France). 00002 // All rights reserved. 00003 // 00004 // This file is part of CGAL (www.cgal.org); you may redistribute it under 00005 // the terms of the Q Public License version 1.0. 00006 // See the file LICENSE.QPL distributed with CGAL. 00007 // 00008 // Licensees holding a valid commercial license may use this file in 00009 // accordance with the commercial license agreement provided with the software. 00010 // 00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 // 00014 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_point_2.h $ 00015 // $Id: Circular_arc_point_2.h 45889 2008-09-30 13:36:33Z pmachado $ 00016 // 00017 // Author(s) : Monique Teillaud, Sylvain Pion, Pedro Machado 00018 00019 // Partially supported by the IST Programme of the EU as a Shared-cost 00020 // RTD (FET Open) Project under Contract No IST-2000-26473 00021 // (ECG - Effective Computational Geometry for Curves and Surfaces) 00022 // and a STREP (FET Open) Project under Contract No IST-006413 00023 // (ACS -- Algorithms for Complex Shapes) 00024 00025 #ifndef CGAL_CIRCULAR_KERNEL_CIRCULAR_ARC_POINT_2_H 00026 #define CGAL_CIRCULAR_KERNEL_CIRCULAR_ARC_POINT_2_H 00027 00028 #include <iostream> 00029 #include <CGAL/Bbox_2.h> 00030 #include <CGAL/Interval_nt.h> 00031 #include <boost/type_traits/is_same.hpp> 00032 00033 namespace CGAL { 00034 namespace CGALi { 00035 00036 template <class CK > 00037 class Circular_arc_point_2 00038 { 00039 typedef typename CK::FT FT; 00040 typedef typename CK::Root_of_2 Root_of_2; 00041 typedef typename CK::Point_2 Point_2; 00042 00043 public: // fixme ? 00044 typedef typename CK::Root_for_circles_2_2 Root_for_circles_2_2; 00045 typedef typename CK::template Handle<Root_for_circles_2_2>::type Base; 00046 00047 Circular_arc_point_2() 00048 {} 00049 00050 Circular_arc_point_2(const Root_for_circles_2_2 & np) 00051 : _p(np) 00052 {} 00053 00054 Circular_arc_point_2(const Point_2 & p) 00055 : _p(p.x(),p.y()/*,1,1,-p.x()-p.y()*/) 00056 {} 00057 00058 const Root_of_2 & x() const 00059 { return get(_p).x(); } 00060 00061 const Root_of_2 & y() const 00062 { return get(_p).y(); } 00063 00064 CGAL::Bbox_2 bbox() const 00065 { 00066 return get(_p).bbox(); 00067 } 00068 00069 const Root_for_circles_2_2 & coordinates() const 00070 { return get(_p); } 00071 00072 bool equal_ref(const Circular_arc_point_2 &p) const 00073 { 00074 return CGAL::identical(_p, p._p); 00075 } 00076 00077 private: 00078 Base _p; 00079 }; 00080 00081 template < typename CK > 00082 std::ostream & 00083 print(std::ostream & os, const Circular_arc_point_2<CK> &p) 00084 { 00085 return os << "CirclArcEndPoint_2(" << std::endl 00086 << p.x() << ", " << p.y() << ')'; 00087 } 00088 00089 } // namespace CGALi 00090 } // namespace CGAL 00091 00092 #endif // CGAL_CIRCULAR_KERNEL_CIRCULAR_ARC_POINT_2_H
1.7.6.1