// Copyright (c) 2005,2008 INRIA Sophia-Antipolis (France). // All rights reserved. // // This file is part of CGAL (www.cgal.org) // // $URL: https://github.com/CGAL/cgal/blob/v5.1/Kernel_23/include/CGAL/Kernel/Dimension_utils.h $ // $Id: Dimension_utils.h 52164b1 2019-10-19T15:34:59+02:00 Sébastien Loriot // SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial // // Author(s) : Sylvain Pion #ifndef CGAL_KERNEL_DIMENSION_UTILS_H #define CGAL_KERNEL_DIMENSION_UTILS_H #include #include namespace CGAL { namespace Access { // Some tools to find the type of a kernel object given its dimension. // E.g. : Vector::type is K::Vector_2. // // Currently undocumented => for CGAL internal use only. // TODO : // - What about functors ? // At least those with a dimensional-independent interface. // - Another thing which would be nice would be to make d-dimensional // algorithms use the 2d-3d kernel interface with a smaller wrapper. // (again, this forces a full kernel, not a sub-set traits, but at least...) // Then, based on Dimension<>, it's possible to automatically use it. template < typename K, typename Dim_tag = typename K::Dimension> struct Point; template < typename K, typename Dim_tag = typename K::Dimension> struct Vector; template < typename K, typename Dim_tag = typename K::Dimension> struct Iso_box; template < typename K, typename Dim_tag = typename K::Dimension> struct Direction; template < typename K, typename Dim_tag = typename K::Dimension> struct Line; template < typename K, typename Dim_tag = typename K::Dimension> struct Ray; template < typename K, typename Dim_tag = typename K::Dimension> struct Segment; template < typename K, typename Dim_tag = typename K::Dimension> struct Triangle; template < typename K, typename Dim_tag = typename K::Dimension> struct Hypersphere; template < typename K, typename Dim_tag = typename K::Dimension> struct Hyperplane; template < typename K, typename Dim_tag = typename K::Dimension> struct Aff_transformation; // Not-so generalizable stuff : Conic_2, Tetrahedron_3. template < typename K, typename Dim_tag = typename K::Dimension> struct Tetrahedron; template < typename K > struct Point > { typedef typename K::Point_2 type; }; template < typename K > struct Point > { typedef typename K::Point_3 type; }; template < typename K > struct Point { typedef typename K::Point_d type; }; template < typename K > struct Vector > { typedef typename K::Vector_2 type; }; template < typename K > struct Vector > { typedef typename K::Vector_3 type; }; template < typename K > struct Vector { typedef typename K::Vector_d type; }; template < typename K > struct Iso_box > { typedef typename K::Iso_rectangle_2 type; }; template < typename K > struct Iso_box > { typedef typename K::Iso_cuboid_3 type; }; template < typename K > struct Iso_box { typedef typename K::Iso_box_d type; }; template < typename K > struct Direction > { typedef typename K::Direction_2 type; }; template < typename K > struct Direction > { typedef typename K::Direction_3 type; }; template < typename K > struct Direction { typedef typename K::Direction_d type; }; template < typename K > struct Line > { typedef typename K::Line_2 type; }; template < typename K > struct Line > { typedef typename K::Line_3 type; }; template < typename K > struct Line { typedef typename K::Line_d type; }; template < typename K > struct Ray > { typedef typename K::Ray_2 type; }; template < typename K > struct Ray > { typedef typename K::Ray_3 type; }; template < typename K > struct Ray { typedef typename K::Ray_d type; }; template < typename K > struct Segment > { typedef typename K::Segment_2 type; }; template < typename K > struct Segment > { typedef typename K::Segment_3 type; }; template < typename K > struct Segment { typedef typename K::Segment_d type; }; template < typename K > struct Triangle > { typedef typename K::Triangle_2 type; }; template < typename K > struct Triangle > { typedef typename K::Triangle_3 type; }; template < typename K > struct Triangle { typedef typename K::Triangle_d type; }; template < typename K > struct Tetrahedron > { typedef typename K::Tetrahedron_3 type; }; template < typename K > struct Tetrahedron { typedef typename K::Tetrahedron_d type; }; template < typename K > struct Hypersphere > { typedef typename K::Circle_2 type; }; template < typename K > struct Hypersphere > { typedef typename K::Sphere_3 type; }; template < typename K > struct Hypersphere { typedef typename K::Sphere_d type; }; template < typename K > struct Hyperplane > { typedef typename K::Line_2 type; }; template < typename K > struct Hyperplane > { typedef typename K::Plane_3 type; }; template < typename K > struct Hyperplane { typedef typename K::Hyperplane_d type; }; template < typename K > struct Aff_transformation > { typedef typename K::Aff_transformation_2 type; }; template < typename K > struct Aff_transformation > { typedef typename K::Aff_transformation_3 type; }; template < typename K > struct Aff_transformation { typedef typename K::Aff_transformation_d type; }; } // namespace Access } //namespace CGAL #endif // CGAL_KERNEL_DIMENSION_UTILS_H