Remove dependencies of Triangulation_3 on Triangulation_2

This commit is contained in:
Andreas Fabri 2017-04-06 11:08:37 +02:00
parent 3ec934e291
commit 8cbbe0e165
9 changed files with 44 additions and 31 deletions

View File

@ -30,7 +30,7 @@
#include <map>
#include <utility>
#include <CGAL/internal/Triangulation/Has_nested_type_Bare_point.h>
#include <CGAL/internal/Has_nested_type_Bare_point.h>
namespace CGAL {

View File

@ -2,10 +2,10 @@
// Copyright (c) 2016 GeometryFactory Sarl (France)
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
@ -13,14 +13,10 @@
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
//
// Author(s) : Jane Tournois
#ifndef CGAL_TRIANGULATION_HAS_NESTED_TYPE_BARE_POINT_H
#define CGAL_TRIANGULATION_HAS_NESTED_TYPE_BARE_POINT_H
#include <CGAL/license/Triangulation.h>
#ifndef CGAL_HAS_NESTED_TYPE_BARE_POINT_H
#define CGAL_HAS_NESTED_TYPE_BARE_POINT_H
#include <boost/mpl/has_xxx.hpp>
@ -40,4 +36,4 @@ namespace CGAL {
} // end namespace internal
} // end namespace CGAL
#endif // CGAL_TRIANGULATION_HAS_NESTED_TYPE_BARE_POINT_H
#endif // CGAL_HAS_NESTED_TYPE_BARE_POINT_H

View File

@ -1,10 +1,10 @@
// Copyright (c) 2010 GeometryFactory (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
@ -22,8 +22,6 @@
#ifndef CGAL_INTERNAL_INFO_CHECK_H
#define CGAL_INTERNAL_INFO_CHECK_H
#include <CGAL/license/Triangulation_2.h>
#include <boost/mpl/has_xxx.hpp>

View File

@ -1,10 +1,9 @@
// Copyright (c) 2001 INRIA Sophia-Antipolis (France).
// All rights reserved.
// Copyright (c) 2001 INRIA Sophia-Antipolis (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
@ -40,7 +39,6 @@
|| defined(NDEBUG)
# define CGAL_triangulation_assertion(EX) (static_cast<void>(0))
#include <CGAL/license/Triangulation_2.h>
# define CGAL_triangulation_assertion_msg(EX,MSG) (static_cast<void>(0))
# define CGAL_triangulation_assertion_code(CODE)

View File

@ -30,7 +30,7 @@
#include <CGAL/Regular_triangulation_vertex_base_2.h>
#include <CGAL/utility.h>
#include <CGAL/Object.h>
#include <CGAL/internal/Triangulation/Has_nested_type_Bare_point.h>
#include <CGAL/internal/Has_nested_type_Bare_point.h>
#include <boost/bind.hpp>
#include <boost/mpl/if.hpp>

View File

@ -53,7 +53,7 @@ struct Weighted_point_mapper_3
#include <CGAL/Triangulation_3.h>
#include <CGAL/Regular_triangulation_vertex_base_3.h>
#include <CGAL/Regular_triangulation_cell_base_3.h>
#include <CGAL/internal/Triangulation/Has_nested_type_Bare_point.h>
#include <CGAL/internal/Has_nested_type_Bare_point.h>
#include <boost/bind.hpp>
#include <boost/mpl/if.hpp>

View File

@ -25,7 +25,6 @@
#include <CGAL/basic.h>
#include <CGAL/triangulation_assertions.h>
#include <CGAL/Triangulation_utils_2.h>
namespace CGAL {
@ -36,6 +35,10 @@ struct Triangulation_utils_base_3
{
static const char tab_next_around_edge[4][4];
static const int tab_vertex_triple_index[4][3];
// copied from Triangulation_utils_2.h to avoid package dependency
static const int ccw_map[3];
static const int cw_map[3];
};
template < class T >
@ -53,14 +56,31 @@ const int Triangulation_utils_base_3<T>::tab_vertex_triple_index[4][3] = {
{0, 1, 2}
};
template < class T >
const int Triangulation_utils_base_3<T>::ccw_map[3] = {1, 2, 0};
template < class T >
const int Triangulation_utils_base_3<T>::cw_map[3] = {2, 0, 1};
// We derive from Triangulation_cw_ccw_2 because we still use cw() and ccw()
// in the 2D part of the code. Ideally, this should go away when we re-use
// T2D entirely.
struct Triangulation_utils_3
: public Triangulation_cw_ccw_2,
public Triangulation_utils_base_3<>
: public Triangulation_utils_base_3<>
{
static int ccw(const int i)
{
CGAL_triangulation_precondition( i >= 0 && i < 3);
return ccw_map[i];
}
static int cw(const int i)
{
CGAL_triangulation_precondition( i >= 0 && i < 3);
return cw_map[i];
}
static int next_around_edge(const int i, const int j)
{
// index of the next cell when turning around the

View File

@ -5,5 +5,4 @@
#define CGAL_LICENSE_ERROR
#define CGAL_TRIANGULATION_3_COMMERCIAL_LICENSE 22222222
#define CGAL_TRIANGULATION_2_COMMERCIAL_LICENSE 22222222
#define CGAL_TDS_3_COMMERCIAL_LICENSE 22222222

View File

@ -1,3 +1,5 @@
#include "test_dependencies.h"
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Regular_triangulation_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>