BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/constructions_d.h
Go to the documentation of this file.
00001 // Copyright (c) 2000,2001  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/Kernel_d/include/CGAL/constructions_d.h $
00019 // $Id: constructions_d.h 28567 2006-02-16 14:30:13Z lsaboret $
00020 // 
00021 //
00022 // Author(s)     : Michael Seel
00023 
00024 #ifndef CGAL_CONSTRUCTIONS_D_H
00025 #define CGAL_CONSTRUCTIONS_D_H
00026 
00027 CGAL_BEGIN_NAMESPACE
00028 
00029 /*{\Moptions outfile=constructions_d.man}*/
00030 
00031 /*{\Mtext \setopdims{4cm}{2cm}\computewidths
00032 \headerline{Constructions}}*/
00033 
00034 template <class R>
00035 Point_d<R> lift_to_paraboloid(const Point_d<R>& p)
00036 /*{\Mfunc returns $p = (x_0,\ldots,x_{d-1})$ lifted to the paraboloid 
00037 of revolution . }*/
00038 { typename R::Lift_to_paraboloid_d lift; 
00039   return lift(p); }
00040 
00041 template <class R>
00042 Point_d<R> project_along_d_axis(const Point_d<R>& p)
00043 /*{\Mfunc returns |p| projected along the $d$-axis onto the hyperspace
00044 spanned by the first $d-1$ standard base vectors.}*/
00045 { typename R::Project_along_d_axis_d proj; 
00046   return proj(p); }
00047 
00048 template <class R>
00049 Point_d<R> midpoint(const Point_d<R>& p, const Point_d<R>& q)
00050 /*{\Mfunc returns the midpoint of |p| and |q|. }*/
00051 { typename R::Midpoint_d mp; return mp(p,q); }
00052 
00053 template <class R, class Forward_iterator>
00054 Point_d<R> center_of_sphere(Forward_iterator start, Forward_iterator end)
00055 { typename R::Center_of_sphereHd center;
00056   return center(start,end); }
00057 
00058 template <class R> typename R::FT
00059 squared_distance(const Point_d<R>& p, const Point_d<R>& q)
00060 /*{\Mfunc returns the squared distance between |p| and $q$. }*/
00061 { typename R::Squared_distance_d dist; return dist(p,q); }
00062 
00063 template <class ForwardIterator, class OutputIterator>
00064 OutputIterator linear_base(
00065   ForwardIterator first, ForwardIterator last, OutputIterator result)
00066 /*{\Mfunc computes a basis of the linear space spanned by the vectors 
00067 in |set [first,last)| and returns it via an iterator range starting
00068 in |result|. The returned iterator marks the end of the output.
00069 \precond value type of |ForwardIterator| and |OutputIterator| is 
00070 |Vector_d<R>|.}*/
00071 { typedef typename std::iterator_traits<ForwardIterator>::
00072     value_type value_type;
00073   typedef typename value_type::R R;
00074   typename R::Linear_base_d base; 
00075   return base(first,last,result); 
00076 }
00077 
00078 
00079 CGAL_END_NAMESPACE
00080 #endif // CGAL_CONSTRUCTIONS_D_H
00081 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines