BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Dimension.h
Go to the documentation of this file.
00001 // Copyright (c) 2008  INRIA Sophia-Antipolis (France).
00002 // Aviv University (Israel).  All rights reserved.
00003 //
00004 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public License as
00006 // published by the Free Software Foundation; version 2.1 of the License.
00007 // See the file LICENSE.LGPL distributed with CGAL.
00008 //
00009 // Licensees holding a valid commercial license may use this file in
00010 // accordance with the commercial license agreement provided with the software.
00011 //
00012 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00013 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00014 //
00015 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Kernel_23/include/CGAL/Dimension.h $
00016 // $Id: Dimension.h 42932 2008-04-17 10:13:31Z spion $
00017 //
00018 // Author(s)     : Sylvain Pion
00019 
00020 #ifndef CGAL_DIMENSION_H
00021 #define CGAL_DIMENSION_H
00022 
00023 #include <CGAL/basic.h>
00024 #include <CGAL/Kernel_traits.h>
00025 #include <climits>
00026 
00027 CGAL_BEGIN_NAMESPACE
00028 
00029 // These tag classes help dispatching functions based on a geometric dimension.
00030 
00031 template < int dim >
00032 struct Dimension_tag
00033 {
00034   static const int value = dim;
00035 };
00036 
00037 struct Dynamic_dimension_tag {};
00038 
00039 
00040 namespace CGALi {
00041 
00042   template < typename D >
00043   struct Dim_value {
00044     static const int value = D::value;
00045   };
00046 
00047   template <>
00048   struct Dim_value <Dynamic_dimension_tag> {};
00049 
00050 } // namespace CGALi
00051 
00052 
00053 // Ambient_dimension gives access to the dimension of the ambient space of an object.
00054 
00055 template < typename T, typename K = typename Kernel_traits<T>::Kernel >
00056 struct Ambient_dimension
00057   : public CGALi::Dim_value< typename K::template Ambient_dimension<T>::type >
00058 {
00059   typedef typename K::template Ambient_dimension<T>::type type;
00060 };
00061 
00062 
00063 // Feature_dimension gives access to the dimension of an object.
00064 
00065 template < typename T, typename K = typename Kernel_traits<T>::Kernel >
00066 struct Feature_dimension
00067   : public CGALi::Dim_value< typename K::template Feature_dimension<T>::type >
00068 {
00069   typedef typename K::template Feature_dimension<T>::type type;
00070 };
00071 
00072 CGAL_END_NAMESPACE
00073 
00074 #endif // CGAL_DIMENSION_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines