// Copyright (c) 2009   INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL: https://github.com/CGAL/cgal/blob/v6.0.1/Triangulation_3/include/CGAL/Triangulation_3/internal/Delaunay_triangulation_hierarchy_3.h $
// $Id: include/CGAL/Triangulation_3/internal/Delaunay_triangulation_hierarchy_3.h 50cfbde3b84 $
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s)     : Sylvain Pion

#ifndef CGAL_INTERNAL_DELAUNAY_TRIANGULATION_HIERARCHY_3_H
#define CGAL_INTERNAL_DELAUNAY_TRIANGULATION_HIERARCHY_3_H

#include <CGAL/license/Triangulation_3.h>


#if !defined CGAL_DELAUNAY_TRIANGULATION_3_H
#  error  "Other header files need to be included first..."
#endif

#include <CGAL/Triangulation_hierarchy_3.h>

namespace CGAL {

// Specializations of Delaunay_triangulation_3 for Fast_location,
// as 2nd as well as 3rd positions (deduced parameter).

#define CGAL_TDS_3 \
typename Default::Get<Tds_, Triangulation_data_structure_3 <\
                              Triangulation_vertex_base_3<Gt>,\
                              Delaunay_triangulation_cell_base_3<Gt> > >::type

template < class Gt, class Tds_ >
class Delaunay_triangulation_3<Gt, Tds_, Fast_location>
  : public Triangulation_hierarchy_3<Delaunay_triangulation_3<Gt,
      CGAL_TDS_3::template Rebind_vertex<Triangulation_hierarchy_vertex_base_3<CGAL_TDS_3::Vertex> >::Other> >
{
    typedef Triangulation_hierarchy_3<Delaunay_triangulation_3<Gt,
      CGAL_TDS_3::template Rebind_vertex<Triangulation_hierarchy_vertex_base_3<CGAL_TDS_3::Vertex> >::Other> >  Base;

public:

    Delaunay_triangulation_3(const Gt& traits = Gt())
      : Base(traits) {}

    template < typename InputIterator >
    Delaunay_triangulation_3(InputIterator first, InputIterator last,
                             const Gt& traits = Gt())
      : Base(first, last, traits) {}
};

#undef CGAL_TDS_3

template < class Gt, class Tds_ >
class Delaunay_triangulation_3<Gt, Tds_, Compact_location>
  : public Delaunay_triangulation_3<Gt, Tds_>
{
    typedef Delaunay_triangulation_3<Gt, Tds_> Base;

public:

    Delaunay_triangulation_3(const Gt& traits = Gt())
      : Base(traits) {}

    template < typename InputIterator >
    Delaunay_triangulation_3(InputIterator first, InputIterator last,
                             const Gt& traits = Gt())
      : Base(first, last, traits) {}
};

// 2 cases for Location_policy<> in 2nd position.

template < class Gt >
class Delaunay_triangulation_3<Gt, Fast_location>
  : public Triangulation_hierarchy_3<Delaunay_triangulation_3<Gt,
             Triangulation_data_structure_3<
               Triangulation_hierarchy_vertex_base_3<Triangulation_vertex_base_3<Gt> >,
               Delaunay_triangulation_cell_base_3<Gt> > > >
{
    typedef Triangulation_hierarchy_3<Delaunay_triangulation_3<Gt,
             Triangulation_data_structure_3<
               Triangulation_hierarchy_vertex_base_3<Triangulation_vertex_base_3<Gt> >,
               Delaunay_triangulation_cell_base_3<Gt> > > >  Base;

public:

    Delaunay_triangulation_3(const Gt& traits = Gt())
      : Base(traits) {}

    template < typename InputIterator >
    Delaunay_triangulation_3(InputIterator first, InputIterator last,
                             const Gt& traits = Gt())
      : Base(first, last, traits) {}
};

template < class Gt >
class Delaunay_triangulation_3<Gt, Compact_location>
  : public Delaunay_triangulation_3<Gt>
{
    typedef Delaunay_triangulation_3<Gt> Base;

public:

    Delaunay_triangulation_3(const Gt& traits = Gt())
      : Base(traits) {}

    template < typename InputIterator >
    Delaunay_triangulation_3(InputIterator first, InputIterator last,
                             const Gt& traits = Gt())
      : Base(first, last, traits) {}
};

} // namespace CGAL

#endif // CGAL_INTERNAL_DELAUNAY_TRIANGULATION_HIERARCHY_3_H
