Merge remote-tracking branch 'cgal/master' into PMP-Add_split_to_clip-GF

This commit is contained in:
Maxime Gimeno 2019-07-04 11:23:20 +02:00
commit 0989cdd390
560 changed files with 7727 additions and 4269 deletions

View File

@ -64,7 +64,7 @@ before_script:
- sudo chmod +x /usr/bin/doxygen
- mkdir -p build
- cd build
- /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON ..
- /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++1y" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON ..
- /usr/bin/time -f 'Spend time of %C -- %E (real)' make
- /usr/bin/time -f 'Spend time of %C -- %E (real)' sudo make install &>/dev/null
- cd ..

View File

@ -19,7 +19,7 @@ before_script:
- sudo chmod +x /usr/bin/doxygen
- mkdir -p build
- cd build
- /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++11" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON ..
- /usr/bin/time -f 'Spend time of %C -- %E (real)' cmake -DCMAKE_CXX_FLAGS="-std=c++1y" -DCGAL_HEADER_ONLY=ON -DCMAKE_CXX_FLAGS_RELEASE=-DCGAL_NDEBUG -DWITH_examples=ON -DWITH_demos=ON -DWITH_tests=ON ..
- /usr/bin/time -f 'Spend time of %C -- %E (real)' make
- /usr/bin/time -f 'Spend time of %C -- %E (real)' sudo make install &>/dev/null
- cd ..

View File

@ -1,19 +1,9 @@
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15)
project( AABB_traits_benchmark)
cmake_minimum_required(VERSION 3.1)
cmake_policy(VERSION 3.1)
if ( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
endif()
# CGAL and its components
find_package( CGAL QUIET)
if ( CGAL_FOUND )

View File

@ -1,12 +1,12 @@
# This is the CMake script for compiling the AABB tree demo.
cmake_minimum_required(VERSION 3.1...3.15)
project( AABB_tree_Demo )
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( AABB_tree_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( AABB_tree_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Advancing_front_surface_reconstruction_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Advancing_front_surface_reconstruction_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_foundations_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_foundations_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_kernel_d_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_kernel_d_Tests )
cmake_minimum_required(VERSION 3.1)
# CGAL and its components

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_kernel_for_circles_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Algebraic_kernel_for_spheres_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Alpha_shapes_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Alpha_shapes_2_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,13 +1,13 @@
# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project (Alpha_shapes_3_Demo)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Alpha_shapes_3_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Alpha_shapes_3_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Apollonius_graph_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core )

View File

@ -32,8 +32,9 @@
#include <iostream>
#include <vector>
#include <map>
#include <vector>
#include <stack>
#include <boost/tuple/tuple.hpp>

View File

@ -817,69 +817,85 @@ check_edge_for_hidden_sites(const Face_handle& f, int i,
template<class Gt, class Agds, class LTag>
void
Apollonius_graph_2<Gt,Agds,LTag>::
expand_conflict_region(const Face_handle& f, const Site_2& p,
List& l, Face_map& fm, Vertex_map& vm,
std::vector<Vh_triple*>* fe)
expand_conflict_region(const Face_handle& in_f,
const Site_2& p,
List& l,
Face_map& fm,
Vertex_map& vm,
std::vector<Vh_triple*>* fe)
{
// setting fm[f] to true means that the face has been reached and
// that the face is available for recycling. If we do not want the
// face to be available for recycling we must set this flag to
// false.
fm[f] = true;
std::stack<Face_handle> face_stack;
face_stack.push(in_f);
// CGAL_assertion( fm.find(f) != fm.end() );
for (int i = 0; i < 3; i++) {
bool hidden_found =
check_edge_for_hidden_sites(f, i, p, vm);
while(!face_stack.empty())
{
const Face_handle curr_f = face_stack.top();
face_stack.pop();
Face_handle n = f->neighbor(i);
// setting fm[curr_f] to true means that the face has been reached and
// that the face is available for recycling. If we do not want the
// face to be available for recycling we must set this flag to false.
fm[curr_f] = true;
if ( !hidden_found ) {
Sign s = incircle(n, p);
if ( s != NEGATIVE ) { continue; }
// CGAL_assertion( fm.find(curr_f) != fm.end() );
for (int i = 0; i < 3; ++i)
{
bool hidden_found = check_edge_for_hidden_sites(curr_f, i, p, vm);
bool interior_in_conflict = edge_interior(f, i, p, true);
Face_handle n = curr_f->neighbor(i);
if ( !interior_in_conflict ) { continue; }
}
if ( !hidden_found )
{
Sign s = incircle(n, p);
if ( s != NEGATIVE )
continue;
if ( fm.find(n) != fm.end() ) {
Edge e = sym_edge(f, i);
if ( l.is_in_list(e) ||
l.is_in_list(sym_edge(e)) ) {
l.remove(e);
l.remove(sym_edge(e));
bool interior_in_conflict = edge_interior(curr_f, i, p, true);
if ( !interior_in_conflict )
continue;
}
continue;
}
Edge e = sym_edge(f, i);
if ( fm.find(n) != fm.end() )
{
Edge e = sym_edge(curr_f, i);
if ( l.is_in_list(e) )
l.remove(e);
CGAL_assertion( l.is_in_list(e) );
int j = tds().mirror_index(f, i);
Edge e_before = sym_edge(n, ccw(j));
Edge e_after = sym_edge(n, cw(j));
if ( !l.is_in_list(e_before) ) {
l.insert_before(e, e_before);
}
if ( !l.is_in_list(e_after) ) {
l.insert_after(e, e_after);
}
l.remove(e);
if( l.is_in_list(sym_edge(e)) )
l.remove(sym_edge(e));
if ( fe != nullptr ) {
Vh_triple* vhq = new Vh_triple[1];
continue;
}
(*vhq)[0] = Vertex_handle();
(*vhq)[1] = n->vertex( j );
(*vhq)[2] = n->vertex( ccw(j) );
Edge e = sym_edge(curr_f, i);
CGAL_assertion( l.is_in_list(e) );
fe->push_back(vhq);
}
int j = tds().mirror_index(curr_f, i);
Edge e_before = sym_edge(n, ccw(j));
Edge e_after = sym_edge(n, cw(j));
if ( !l.is_in_list(e_before) )
l.insert_before(e, e_before);
expand_conflict_region(n, p, l, fm, vm, fe);
} // for-loop
if ( !l.is_in_list(e_after) )
l.insert_after(e, e_after);
l.remove(e);
if ( fe != nullptr )
{
Vh_triple* vhq = new Vh_triple[1];
(*vhq)[0] = Vertex_handle();
(*vhq)[1] = n->vertex( j );
(*vhq)[2] = n->vertex( ccw(j) );
fe->push_back(vhq);
}
face_stack.push(n);
} // neighbor for-loop
}
}

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Apollonius_graph_2_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Arithmetic_kernel_Tests )
cmake_minimum_required(VERSION 3.1)

View File

@ -1,8 +1,8 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Arrangement_on_surface_2_Demo )
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Arrangement_on_surface_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core)

View File

@ -2,11 +2,11 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Arrangement_on_surface_2_Tests )
enable_testing()
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core)

View File

@ -1,10 +1,10 @@
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15)
project( BGL_LCC_Examples )
cmake_minimum_required(VERSION 3.1)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )

View File

@ -1,10 +1,10 @@
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15)
project( BGL_OpenMesh_Examples )
cmake_minimum_required(VERSION 3.1)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( BGL_arrangement_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,10 +1,10 @@
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15)
project( BGL_polyhedron_3_Examples )
cmake_minimum_required(VERSION 3.1)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( BGL_surface_mesh_Examples )
cmake_minimum_required(VERSION 3.1)
find_package( CGAL QUIET )

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( BGL_triangulation_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -82,6 +82,7 @@ CGAL_add_named_parameter(use_compact_clipper_t, use_compact_clipper, use_compact
CGAL_add_named_parameter(output_iterator_t, output_iterator, output_iterator)
CGAL_add_named_parameter(erase_all_duplicates_t, erase_all_duplicates, erase_all_duplicates)
CGAL_add_named_parameter(require_same_orientation_t, require_same_orientation, require_same_orientation)
CGAL_add_named_parameter(face_size_map_t, face_size_map, face_size_map)
// List of named parameters that we use in the package 'Surface Mesh Simplification'
CGAL_add_named_parameter(get_cost_policy_t, get_cost_policy, get_cost)

View File

@ -1,10 +1,10 @@
# Created by the script cgal_create_cmake_script_with_options
# This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15)
project( BGL_Tests )
cmake_minimum_required(VERSION 3.1)

View File

@ -51,7 +51,6 @@ void test(const NamedParameters& np)
assert(get_param(np, CGAL::internal_np::vertex_to_vertex_map).v == 800000007);
assert(get_param(np, CGAL::internal_np::halfedge_to_halfedge_map).v == 800000008);
assert(get_param(np, CGAL::internal_np::face_to_face_map).v == 800000009);
// Named parameters that we use in the package 'Mesh_3'
assert(get_param(np, CGAL::internal_np::vertex_feature_degree).v == 9);
@ -88,6 +87,7 @@ void test(const NamedParameters& np)
assert(get_param(np, CGAL::internal_np::erase_all_duplicates).v == 48);
assert(get_param(np, CGAL::internal_np::require_same_orientation).v == 49);
assert(get_param(np, CGAL::internal_np::use_bool_op_to_clip_surface).v == 50);
assert(get_param(np, CGAL::internal_np::face_size_map).v == 52);
// Named parameters that we use in the package 'Surface Mesh Simplification'
assert(get_param(np, CGAL::internal_np::get_cost_policy).v == 34);
@ -107,7 +107,6 @@ void test(const NamedParameters& np)
assert(get_param(np, CGAL::internal_np::apply_per_connected_component).v == 46);
assert(get_param(np, CGAL::internal_np::output_iterator).v == 47);
// Test types
// Named parameters from Boost
@ -169,6 +168,7 @@ void test(const NamedParameters& np)
check_same_type<48>(get_param(np, CGAL::internal_np::erase_all_duplicates));
check_same_type<49>(get_param(np, CGAL::internal_np::require_same_orientation));
check_same_type<50>(get_param(np, CGAL::internal_np::use_bool_op_to_clip_surface));
check_same_type<52>(get_param(np, CGAL::internal_np::face_size_map));
// Named parameters that we use in the package 'Surface Mesh Simplification'
check_same_type<34>(get_param(np, CGAL::internal_np::get_cost_policy));
@ -253,6 +253,7 @@ int main()
.output_iterator(A<47>(47))
.erase_all_duplicates(A<48>(48))
.require_same_orientation(A<49>(49))
.face_size_map(A<52>(52))
);
return EXIT_SUCCESS;

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Barycentric_coordinates_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Barycentric_coordinates_2_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,9 +1,9 @@
# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Boolean_set_operations_2_GraphicsView_Demo )
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Boolean_set_operations_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Boolean_set_operations_2_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Approximate_min_ellipsoid_d_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Min_annulus_d_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Min_circle_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Min_ellipse_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Min_quadrilateral_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Min_sphere_d_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Min_sphere_of_spheres_d_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Rectangular_p_center_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Bounding_volumes_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core )

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Box_intersection_d_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Box_intersection_d_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.1...3.15)
project( Core_Examples )
cmake_minimum_required(VERSION 3.1)

View File

@ -46,15 +46,14 @@ MA 02110-1301, USA. */
#include <string>
#include <cstdio>
using namespace std;
namespace CORE {
CGAL_INLINE_FUNCTION
int
__gmp_istream_set_base (istream &i, char &c, bool &zero, bool &showbase)
__gmp_istream_set_base (std::istream &i, char &c, bool &zero, bool &showbase)
{
int base;
using std::ios;
zero = showbase = false;
switch (i.flags() & ios::basefield)
@ -96,7 +95,7 @@ __gmp_istream_set_base (istream &i, char &c, bool &zero, bool &showbase)
CGAL_INLINE_FUNCTION
void
__gmp_istream_set_digits (string &s, istream &i, char &c, bool &ok, int base)
__gmp_istream_set_digits (std::string &s, std::istream &i, char &c, bool &ok, int base)
{
switch (base)
{
@ -131,13 +130,14 @@ __gmp_istream_set_digits (string &s, istream &i, char &c, bool &ok, int base)
}
CGAL_INLINE_FUNCTION
istream &
//operator>> (istream &i, mpz_ptr z)
io_read (istream &i, mpz_ptr z)
std::istream &
//operator>> (std::istream &i, mpz_ptr z)
io_read (std::istream &i, mpz_ptr z)
{
using namespace std;
int base;
char c = 0;
string s;
std::string s;
bool ok = false, zero, showbase;
i.get(c); // start reading
@ -175,13 +175,14 @@ io_read (istream &i, mpz_ptr z)
}
CGAL_INLINE_FUNCTION
istream &
//operator>> (istream &i, mpq_ptr q)
io_read (istream &i, mpq_ptr q)
std::istream &
//operator>> (std::istream &i, mpq_ptr q)
io_read (std::istream &i, mpq_ptr q)
{
using namespace std;
int base;
char c = 0;
string s;
std::string s;
bool ok = false, zero, showbase;
i.get(c); // start reading
@ -253,9 +254,9 @@ io_read (istream &i, mpq_ptr q)
}
CGAL_INLINE_FUNCTION
ostream&
//operator<< (ostream &o, mpz_srcptr z)
io_write (ostream &o, mpz_srcptr z)
std::ostream&
//operator<< (std::ostream &o, mpz_srcptr z)
io_write (std::ostream &o, mpz_srcptr z)
{
char *str = new char [mpz_sizeinbase(z,10) + 2];
str = mpz_get_str(str, 10, z);
@ -265,9 +266,9 @@ io_write (ostream &o, mpz_srcptr z)
}
CGAL_INLINE_FUNCTION
ostream&
//operator<< (ostream &o, mpq_srcptr q)
io_write (ostream &o, mpq_srcptr q)
std::ostream&
//operator<< (std::ostream &o, mpq_srcptr q)
io_write (std::ostream &o, mpq_srcptr q)
{
// size according to GMP documentation
char *str = new char [mpz_sizeinbase(mpq_numref(q), 10) +

View File

@ -65,7 +65,6 @@
#include <CGAL/tss.h>
namespace CORE {
using namespace std;
class Expr;
// ==================================================
// Typedefs
@ -117,25 +116,25 @@ public:
Polynomial(const Polynomial &);
Polynomial(const VecNT &);
Polynomial(int n, const char* s[]);
Polynomial(const string & s, char myX='x');
Polynomial(const std::string & s, char myX='x');
Polynomial(const char* s, char myX='x');
~Polynomial();
private:
void constructX(int n, Polynomial<NT>& P);
void constructFromString(string & s, char myX='x');
void constructFromString(std::string & s, char myX='x');
int getnumber(const char* c, int i, unsigned int len, Polynomial<NT> & P);
bool isint(char c);
int getint(const char* c, int i, unsigned int len, int & n);
int matchparen(const char* cstr, int start);
int getbasicterm(string & s, Polynomial<NT> & P);
int getterm(string & s, Polynomial<NT> & P);
int getbasicterm(std::string & s, Polynomial<NT> & P);
int getterm(std::string & s, Polynomial<NT> & P);
public:
//Returns a Polynomial corresponding to s, which is supposed to
//contain as place-holders the chars 'x' and 'y'.
Polynomial<NT> getpoly(string & s);
Polynomial<NT> getpoly(std::string & s);
// Assignment:
Polynomial & operator=(const Polynomial&);

View File

@ -131,21 +131,21 @@ Polynomial<NT>::Polynomial(int n, const char * s[]) {
// want to generalize this to BigFloat, etc.
//
template <class NT>
Polynomial<NT>::Polynomial(const string & s, char myX) {
string ss(s);
Polynomial<NT>::Polynomial(const std::string & s, char myX) {
std::string ss(s);
constructFromString(ss, myX);
}
template <class NT>
Polynomial<NT>::Polynomial(const char * s, char myX) {
string ss(s);
std::string ss(s);
constructFromString(ss, myX);
}
template <class NT>
void Polynomial<NT>::constructFromString(string & s, char myX) {
void Polynomial<NT>::constructFromString(std::string & s, char myX) {
if(myX != 'x' || myX != 'X'){
//Replace myX with 'x'.
string::size_type loc = s.find(myX, 0);
while(loc != string::npos){
std::string::size_type loc = s.find(myX, 0);
while(loc != std::string::npos){
s.replace(loc,1,1,'x');
loc = s.find(myX, loc+1);
}
@ -241,7 +241,7 @@ int Polynomial<NT>::matchparen(const char* cstr, int start){
template <class NT>
int Polynomial<NT>::getbasicterm(string & s, Polynomial<NT> & P){
int Polynomial<NT>::getbasicterm(std::string & s, Polynomial<NT> & P){
const char * cstr = s.c_str();
unsigned int len = s.length();
int i=0;
@ -254,7 +254,7 @@ int Polynomial<NT>::getbasicterm(string & s, Polynomial<NT> & P){
}else if(cstr[i] =='('){
int oldi = i;
i = matchparen(cstr, i);
string t = s.substr(oldi+1, i -oldi -1);
std::string t = s.substr(oldi+1, i -oldi -1);
P = getpoly(t);
}else{
#ifdef CGAL_CORE_TRACE
@ -272,7 +272,7 @@ int Polynomial<NT>::getbasicterm(string & s, Polynomial<NT> & P){
template <class NT>
int Polynomial<NT>::getterm(string & s, Polynomial<NT> & P){
int Polynomial<NT>::getterm(std::string & s, Polynomial<NT> & P){
unsigned int len = s.length();
if(len == 0){// Zero Polynomial
P=Polynomial<NT>();
@ -280,7 +280,7 @@ int Polynomial<NT>::getterm(string & s, Polynomial<NT> & P){
}
unsigned int ind, oind;
const char* cstr =s.c_str();
string t;
std::string t;
//P will be used to accumulate the product of basic terms.
ind = getbasicterm(s, P);
while(ind != len-1 && cstr[ind + 1]!='+' && cstr[ind + 1]!='-' ){
@ -304,11 +304,11 @@ int Polynomial<NT>::getterm(string & s, Polynomial<NT> & P){
}
template <class NT>
Polynomial<NT> Polynomial<NT>::getpoly(string & s){
Polynomial<NT> Polynomial<NT>::getpoly(std::string & s){
//Remove white spaces from the string
string::size_type cnt=s.find(' ',0);
while(cnt != string::npos){
std::string::size_type cnt=s.find(' ',0);
while(cnt != std::string::npos){
s.erase(cnt, 1);
cnt = s.find(' ', cnt);
}
@ -321,10 +321,10 @@ Polynomial<NT> Polynomial<NT>::getpoly(string & s){
//To handle the case when there is one '=' sign
//Suppose s is of the form s1 = s2. Then we assign s to
//s1 + (-1)(s2) and reset len
string::size_type loc;
if((loc=s.find('=',0)) != string::npos){
std::string::size_type loc;
if((loc=s.find('=',0)) != std::string::npos){
s.replace(loc,1,1,'+');
string s3 = "(-1)(";
std::string s3 = "(-1)(";
s.insert(loc+1, s3);
len = s.length();
s.insert(len, 1, ')');
@ -332,7 +332,7 @@ Polynomial<NT> Polynomial<NT>::getpoly(string & s){
len = s.length();
const char *cstr = s.c_str();
string t;
std::string t;
Polynomial<NT> P;
// P will be the polynomial in which we accumulate the
//sum and difference of the different terms.
@ -966,7 +966,7 @@ BigInt Polynomial<NT>::UpperBound() const {
lhsNeg.makeCeilExact();
/* compute B^{deg} */
if (rhs <= max(lhsPos,lhsNeg)) {
if (rhs <= (std::max)(lhsPos,lhsNeg)) {
B <<= 1;
rhs *= (BigInt(1)<<deg);
} else

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project(CGALimageIO_Demo)
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)

View File

@ -1,9 +1,9 @@
# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( CGALimageIO_Examples )
cmake_minimum_required(VERSION 3.1)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)

View File

@ -155,6 +155,10 @@ public:
double vy() const { return image_ptr->vy; }
double vz() const { return image_ptr->vz; }
double tx() const { return image_ptr->tx; }
double ty() const { return image_ptr->ty; }
double tz() const { return image_ptr->tz; }
float value(const std::size_t i,
const std::size_t j,
const std::size_t k) const

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( CGAL_ImageIO_Tests )
cmake_minimum_required(VERSION 3.1)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project(CGAL_ipelets_Demo)
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( CGAL_ipelets_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,9 +1,9 @@
# Top level CMakeLists.txt for CGAL-branchbuild
message( "== CMake setup ==" )
cmake_minimum_required(VERSION 3.1...3.15)
project(CGAL CXX C)
export(PACKAGE CGAL)
# Minimal version of CMake:
cmake_minimum_required(VERSION 3.1)
set( CGAL_BRANCH_BUILD ON CACHE INTERNAL "Create CGAL from a Git branch" FORCE)

View File

@ -37,6 +37,7 @@ template < class R > class Aff_transformation_repC2;
template < class R > class Translation_repC2;
template < class R > class Rotation_repC2;
template < class R > class Scaling_repC2;
template < class R > class Reflection_repC2;
} //namespace CGAL
@ -44,6 +45,7 @@ template < class R > class Scaling_repC2;
#include <CGAL/Cartesian/Translation_rep_2.h>
#include <CGAL/Cartesian/Rotation_rep_2.h>
#include <CGAL/Cartesian/Scaling_rep_2.h>
#include <CGAL/Cartesian/Reflection_rep_2.h>
namespace CGAL {
@ -107,6 +109,11 @@ public:
else
initialize_with(Scaling_repC2<R>(s));
}
Aff_transformationC2(const Reflection, const Line_2& l)
{
initialize_with(Reflection_repC2<R>(l));
}
// The general case:
// a 3x2 matrix for the operations combining rotation, scaling, translation
@ -128,6 +135,7 @@ public:
{
initialize_with(Aff_transformation_repC2<R>(m11/w, m12/w, m21/w, m22/w));
}
Point_2
transform(const Point_2 &p) const

View File

@ -63,6 +63,9 @@ public:
virtual Aff_transformation_2 compose(
const Scaling_repC2<R> &t) const = 0;
virtual Aff_transformation_2 compose(
const Reflection_repC2<R> &t) const = 0;
virtual Aff_transformation_2 inverse() const = 0;
virtual bool is_even() const = 0;
@ -86,6 +89,7 @@ public:
friend class Translation_repC2<R>;
friend class Rotation_repC2<R>;
friend class Scaling_repC2<R>;
friend class Reflection_repC2<R>;
Aff_transformation_repC2()
{}
@ -131,6 +135,7 @@ friend class Scaling_repC2<R>;
Aff_transformation_2 compose(const Translation_repC2<R> &t) const;
Aff_transformation_2 compose(const Rotation_repC2<R> &t) const;
Aff_transformation_2 compose(const Scaling_repC2<R> &t) const;
Aff_transformation_2 compose(const Reflection_repC2<R> &t) const;
bool is_even() const
{
@ -252,6 +257,17 @@ compose(const Scaling_repC2<R> &t) const
t.scalefactor_ * t23);
}
template < class R >
CGAL_KERNEL_LARGE_INLINE
typename Aff_transformation_repC2<R>::Aff_transformation_2
Aff_transformation_repC2<R>::
compose(const Reflection_repC2<R> &r) const
{
return Aff_transformation_2(
r.cosinus_*t11+r.sinus_*t21, r.cosinus_*t12+r.sinus_*t22, r.cosinus_*(t13-r.t.x())+r.sinus_*(t23-r.t.y())+r.t.x(),
r.sinus_*(t11)-r.cosinus_*(t21), r.sinus_*(t12)-r.cosinus_*(t22), r.sinus_*(t13-r.t.x())-r.cosinus_*(t23-r.t.y())+r.t.y());
}
} //namespace CGAL
#endif // CGAL_CARTESIAN_AFF_TRANSFORMATION_REP_2_H

View File

@ -0,0 +1,208 @@
// Copyright (c) 2018
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). 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 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.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0+
//
//
// Author(s) : Maxime Gimeno
#ifndef CGAL_CARTESIAN_REFLECTION_REP_2_H
#define CGAL_CARTESIAN_REFLECTION_REP_2_H
#include <cmath>
namespace CGAL {
template < class R >
class Reflection_repC2: public Aff_transformation_rep_baseC2<R>
{
friend class Translation_repC2<R>;
friend class Rotation_repC2<R>;
friend class Scaling_repC2<R>;
friend class Aff_transformation_repC2<R>;
public:
typedef Aff_transformation_rep_baseC2<R> Aff_t_base;
typedef typename Aff_t_base::FT FT;
typedef typename Aff_t_base::Point_2 Point_2;
typedef typename Aff_t_base::Vector_2 Vector_2;
typedef typename Aff_t_base::Direction_2 Direction_2;
typedef typename CGAL::Line_2<R> Line_2;
typedef typename Aff_t_base::Aff_transformation_2 Aff_transformation_2;
typedef Aff_transformation_repC2<R> Transformation;
typedef Reflection_repC2<R> Reflection;
typedef Scaling_repC2<R> Scaling;
typedef Rotation_repC2<R> Rotation;
typedef Translation_repC2<R> Translation;
Reflection_repC2(const Line_2 &l)
{
if(l.a() == 0)
t = -Vector_2(0, l.c()/l.b());
else
t = -Vector_2(l.c()/l.a(),0);
Vector_2 l_to_v = l.to_vector();
FT scal = l_to_v.x(); //Projection of l_to_v on Ox. = |L|*cos(a)
FT det = l_to_v.y();// = |L|*sin(a)
sinus_ = 2*det*scal/l_to_v.squared_length(); //sin(2a) = 2*sin(a)*cos(a)
FT sq_cos = scal*scal/l_to_v.squared_length(); //cos(a)*cos(a)
cosinus_ = 2*sq_cos-1;
}
~Reflection_repC2()
{}
Point_2 transform(const Point_2 &p) const
{
return Point_2(
cosinus_*p.x()+sinus_*p.y()-cosinus_*t.x()-sinus_*t.y()+t.x(),
sinus_*p.x()-cosinus_*p.y()-sinus_*t.x()+cosinus_*t.y()+t.y());
}
Vector_2 transform(const Vector_2 &p) const
{
return Vector_2(
cosinus_*p.x()+sinus_*p.y()-cosinus_*t.x()-sinus_*t.y()+t.x(),
sinus_*p.x()-cosinus_*p.y()-sinus_*t.x()+cosinus_*t.y()+t.y());
}
Direction_2 transform(const Direction_2 &d) const
{
return transform(d.vector()).direction();
}
Aff_transformation_2 operator*(const Aff_t_base &t) const
{
return t.compose(*this);
}
Aff_transformation_2 compose(const Translation &tr) const
{
return Aff_transformation_2(cosinus_, sinus_, t13()+tr.translationvector_.x(),
sinus_, -cosinus_, t23()+tr.translationvector_.y());
}
Aff_transformation_2 compose(const Scaling &s) const
{
return Aff_transformation_2(s.scalefactor_ * cosinus_,
s.scalefactor_ * sinus_,
s.scalefactor_ * t13(),
s.scalefactor_ * sinus_,
-s.scalefactor_ * cosinus_,
s.scalefactor_ * t23());
}
Aff_transformation_2 compose(const Transformation &tr) const
{
return Aff_transformation_2(
tr.t11*cosinus_+tr.t12*sinus_,
tr.t11*sinus_-tr.t12*cosinus_,
tr.t11*t13()+tr.t12*t23()+tr.t13,
tr.t21*cosinus_+tr.t22*sinus_,
tr.t21*sinus_-tr.t22*cosinus_,
tr.t21*t13()+tr.t22*t23()+tr.t23);
}
Aff_transformation_2 compose(const Rotation &r) const
{
return Aff_transformation_2(
r.cosinus_*cosinus_-r.sinus_*sinus_,
r.cosinus_*sinus_+r.sinus_*cosinus_,
r.cosinus_*t13()
-r.sinus_*t23(),
r.sinus_*cosinus_+r.cosinus_*sinus_,
r.sinus_*sinus_-r.cosinus_*cosinus_,
r.sinus_*t13()
+r.cosinus_*t23());
}
Aff_transformation_2 compose(const Reflection &r) const
{
return Aff_transformation_2(
cosinus_*r.cosinus_+sinus_*r.sinus_,
r.cosinus_*sinus_-r.sinus_*cosinus_,
r.cosinus_*(t13()-r.t.x()) + r.sinus_*(t23()-r.t.y())+r.t.x(),
r.sinus_*cosinus_ - r.cosinus_*sinus_,
r.sinus_*sinus_+r.cosinus_*cosinus_,
r.sinus_*(t13()-r.t.x()) -r.cosinus_*(t23()-r.t.y())+r.t.y());
}
Aff_transformation_2 inverse() const
{
return Aff_transformation_2(cartesian(0,0), cartesian(0,1), cartesian(0,2),
cartesian(1,0), cartesian(1,1), cartesian(1,2));
}
bool is_even() const
{
return true;
}
FT cartesian(int i, int j) const
{
switch (i)
{
case 0: switch (j)
{
case 0: return cosinus_;
case 1: return sinus_;
default: return FT(0);
}
case 1: switch (j)
{
case 0: return sinus_;
case 1: return -cosinus_;
default: return FT(0);
}
case 2: switch (j)
{
case 0: return FT(0);
case 1: return FT(0);
default: return FT(1);
}
}
return FT(0);
}
std::ostream &print(std::ostream &os) const
{
os << "Aff_transformationC2(" << sinus_ << ", " << cosinus_ << "; "<< t <<")";
return os;
}
//convevience functions for composition
FT t13()const
{
return FT(-cosinus_*t.x()-sinus_*t.y()+t.x());
}
FT t23()const
{
return FT(-sinus_*t.x()+cosinus_*t.y()+t.y());
}
private:
Vector_2 t;
FT sinus_, cosinus_;
};
} //namespace CGAL
#endif // CGAL_CARTESIAN_REFLECTION_REP_2_H

View File

@ -36,6 +36,7 @@ class Rotation_repC2: public Aff_transformation_rep_baseC2<R>
friend class Aff_transformation_repC2<R>;
friend class Translation_repC2<R>;
friend class Scaling_repC2<R>;
friend class Reflection_repC2<R>;
public:
typedef Aff_transformation_rep_baseC2<R> Aff_t_base;
@ -48,6 +49,7 @@ public:
typedef Translation_repC2<R> Translation;
typedef Rotation_repC2<R> Rotation;
typedef Scaling_repC2<R> Scaling;
typedef Reflection_repC2<R> Reflection;
Rotation_repC2() {}
@ -126,6 +128,17 @@ public:
t.scalefactor_*cosinus_);
}
Aff_transformation_2 compose(const Reflection &r) const
{
return Aff_transformation_2(
r.cosinus_*cosinus_+r.sinus_*sinus_,
-r.cosinus_*sinus_+r.sinus_*cosinus_,
r.t13(),
r.sinus_*cosinus_-r.cosinus_*sinus_,
-r.sinus_*sinus_-r.cosinus_*cosinus_
, r.t23());
}
Aff_transformation_2 compose(const Transformation &t) const
{
return Aff_transformation_2(cosinus_*t.t11 + sinus_*t.t12,
@ -135,7 +148,6 @@ public:
-sinus_*t.t21 + cosinus_*t.t22,
t.t23);
}
bool is_even() const
{
return true;

View File

@ -34,6 +34,7 @@ class Scaling_repC2: public Aff_transformation_rep_baseC2<R>
friend class Aff_transformation_repC2<R>;
friend class Translation_repC2<R>;
friend class Rotation_repC2<R>;
friend class Reflection_repC2<R>;
public:
typedef Aff_transformation_rep_baseC2<R> Aff_t_base;
@ -45,6 +46,7 @@ public:
typedef Aff_transformation_repC2<R> Transformation;
typedef Translation_repC2<R> Translation;
typedef Rotation_repC2<R> Rotation;
typedef Reflection_repC2<R> Reflection;
typedef Scaling_repC2<R> Scaling;
Scaling_repC2()
@ -96,6 +98,12 @@ public:
scalefactor_ * t.cosinus_);
}
Aff_transformation_2 compose(const Reflection &r) const
{
return Aff_transformation_2(scalefactor_*r.cosinus_, scalefactor_*r.sinus_,-r.cosinus_*r.t.x()-r.sinus_*r.t.y()+r.t.x(),
scalefactor_*r.sinus_, -scalefactor_*r.cosinus_, -r.sinus_*r.t.x()+r.cosinus_*r.t.y()-r.t.y());
}
Aff_transformation_2 compose(const Scaling &t) const
{
return Aff_transformation_2(SCALING, scalefactor_*t.scalefactor_);

View File

@ -36,6 +36,7 @@ class Translation_repC2 : public Aff_transformation_rep_baseC2<R>
friend class Aff_transformation_repC2<R>;
friend class Rotation_repC2<R>;
friend class Scaling_repC2<R>;
friend class Reflection_repC2<R>;
public:
typedef typename R::FT FT;
@ -43,6 +44,7 @@ public:
typedef Aff_transformation_repC2<R> Transformation;
typedef Translation_repC2<R> Translation;
typedef Rotation_repC2<R> Rotation;
typedef Reflection_repC2<R> Reflection;
typedef Scaling_repC2<R> Scaling;
typedef typename Aff_t_base::Point_2 Point_2;
typedef typename Aff_t_base::Vector_2 Vector_2;
@ -114,6 +116,14 @@ public:
+ t.t22*translationvector_.y()
+ t.t23);
}
Aff_transformation_2 compose(const Reflection &r) const
{
return Aff_transformation_2(r.cosinus_, r.sinus_,
r.cosinus_*(translationvector_.x()-r.t.x())+r.sinus_*(translationvector_.y() - r.t.y()) +r.t.x(),
r.sinus_, -r.cosinus_,
r.sinus_*(translationvector_.x()-r.t.x())-r.cosinus_*(translationvector_.y() - r.t.y())+r.t.y());
}
Aff_transformation_2 inverse() const
{

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Circular_kernel_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,10 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Circular_kernel_2_Tests )
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
find_package(CGAL QUIET)
if ( CGAL_FOUND )

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.1...3.15)
project (Circular_kernel_3_Demo)
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Circular_kernel_3_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,10 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Circular_kernel_3_Tests )
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core )
if ( CGAL_FOUND )

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Circulator_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Circulator_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,10 +1,10 @@
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15)
project( Classification_Examples )
cmake_minimum_required(VERSION 3.1)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )

View File

@ -69,6 +69,28 @@ public:
std::shared_ptr<std::vector<std::size_t> > neighbors;
/// \endcond
/// \cond SKIP_IN_MANUAL
class Point_idx_to_point_unary_function
{
public:
typedef std::size_t argument_type;
typedef typename ItemMap::reference result_type;
typedef boost::readable_property_map_tag category;
const ItemRange* m_range;
ItemMap m_item_map;
Point_idx_to_point_unary_function (const ItemRange* range, ItemMap item_map)
: m_range (range), m_item_map (item_map)
{ }
result_type operator() (const argument_type& arg) const
{
return get (m_item_map, *(m_range->begin() + arg));
}
};
/// \endcond
private:
const ItemRange* m_range;
ItemMap m_item_map;
@ -139,14 +161,12 @@ public:
*/
const CGAL::Bbox_3& bbox() const
{
auto transform = [&](const std::size_t& idx) -> typename ItemMap::reference
{
return get (m_item_map, *(m_range->begin() + idx));
};
if (m_bounding_box == CGAL::Bbox_3())
{
Point_idx_to_point_unary_function transform (m_range, m_item_map);
m_bounding_box = CGAL::bbox_3 (boost::make_transform_iterator (m_inliers->begin(), transform),
boost::make_transform_iterator (m_inliers->end(), transform));
}
return m_bounding_box;
}

View File

@ -1,10 +1,10 @@
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15)
project( Classification_Tests )
cmake_minimum_required(VERSION 3.1)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Combinatorial_map_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Combinatorial_map_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1...3.13)
cmake_minimum_required(VERSION 3.1...3.15)
project( Cone_spanners_2_Examples )
find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Cone_spanners_2_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET COMPONENTS Core)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Convex_decomposition_3_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Convex_decomposition_3_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Convex_hull_2_Examples )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Convex_hull_2_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Convex_hull_3_Demo )
cmake_minimum_required(VERSION 3.1)
if(NOT POLICY CMP0070 AND POLICY CMP0053)
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
cmake_policy(SET CMP0053 OLD)

View File

@ -13,6 +13,13 @@ function when `R` is a kernel with exact predicates but inexact constructions
\cgalModels `IsStronglyConvexTraits_3`
\attention The user must include the header file of the polygon mesh type, even for the default type.
\cgalAdvancedBegin
This class has a fourth undocumented template argument. Passing `CGAL::Tag_false`
switches off a caching of a plane with coordinates with interval arithmetic.
Instead an orientation test of four points is performed.
\cgalAdvancedEnd
*/
template< typename R, typename PolygonMesh = Polyhedron_3<R> >
class Convex_hull_traits_3 {

View File

@ -4,7 +4,7 @@ namespace CGAL {
\ingroup PkgConvexHull3Functions
\brief computes the convex hull of the set of points in the range
[`first`, `last`). The polyhedron `pm` is cleared, then
[`first`, `last`). The polygon mesh `pm` is cleared, then
the convex hull is stored in `pm`. Note that the convex hull will be triangulated,
that is `pm` will contain only triangular facets.
if the convex hull is a point or a segment, endpoints will be added in `pm` as isolated vertices.
@ -39,9 +39,9 @@ void convex_hull_3(InputIterator first, InputIterator last, PolygonMesh& pm, con
\brief computes the convex hull of the set of points in the range
[`first`, `last`). The result, which may be a point, a segment,
a triangle, or a polyhedron, is stored in `ch_object`.
In the case the result is a polyhedron, the convex hull will be triangulated,
that is the polyhedron will contain only triangular facets.
a triangle, or a polygon mesh, is stored in `ch_object`.
In the case the result is a polygon mesh, the convex hull will be triangulated,
that is the polygon mesh will contain only triangular facets.
\tparam InputIterator must be an input iterator with a value type equivalent to `Traits::Point_3`.
\tparam Traits must be model of the concept `ConvexHullTraits_3`.

View File

@ -49,11 +49,19 @@ computing the hull.
The function `convex_hull_3()` is parameterized by a traits class,
which specifies the types and geometric primitives to be used in the
computation. If input points from a kernel with exact predicates
computation. As the function constructs 3D planes from three input
points, we cannot simply pass a kernel with inexact constructions as
optional argument for the traits class.
If input points from a kernel with exact predicates
and non-exact constructions are used, and a certified result is expected,
the traits `Convex_hull_traits_3<R>` should be used
(`R` being the input kernel). Note that the default traits class takes this into
account.
the class `Convex_hull_traits_3<R>` should be used
(`R` being the input kernel).
If the constructions from a kernel are exact this kernel can be used
directly as a traits class.
Note that the default traits class takes this into account, that is the
above considerations are only important for custom traits classes.
\subsubsection Convex_hull_3Example Example

View File

@ -1,10 +1,10 @@
# Created by the script cgal_create_CMakeLists
# This is the CMake script for compiling a set of CGAL applications.
cmake_minimum_required(VERSION 3.1...3.15)
project( Convex_hull_3_Examples )
cmake_minimum_required(VERSION 3.1)
# CGAL and its components
find_package( CGAL QUIET COMPONENTS )

View File

@ -43,6 +43,7 @@
#include <iostream>
#include <algorithm>
#include <utility>
#include <memory>
#include <list>
#include <vector>
#include <boost/bind.hpp>
@ -236,17 +237,23 @@ public:
//and in case of failure, exact arithmetic is used.
template <class Kernel, class P>
class Is_on_positive_side_of_plane_3<Convex_hull_traits_3<Kernel, P, Tag_true>, boost::true_type >{
typedef Simple_cartesian<CGAL::internal::Exact_field_selector<double>::Type> PK;
typedef Simple_cartesian<Interval_nt_advanced > CK;
typedef Simple_cartesian<CGAL::internal::Exact_field_selector<double>::Type> Exact_K;
typedef Simple_cartesian<Interval_nt_advanced > Approx_K;
typedef Convex_hull_traits_3<Kernel, P, Tag_true> Traits;
typedef typename Traits::Point_3 Point_3;
Cartesian_converter<Kernel,CK> to_CK;
Cartesian_converter<Kernel,PK> to_PK;
Cartesian_converter<Kernel,Approx_K> to_AK;
Cartesian_converter<Kernel,Exact_K> to_EK;
template <typename K>
struct Vector_plus_point {
typename K::Vector_3 vector;
typename K::Point_3 point;
};
const Point_3& p,q,r;
mutable typename CK::Plane_3* ck_plane;
mutable typename PK::Plane_3* pk_plane;
mutable Vector_plus_point<Approx_K> ak_plane;
mutable Vector_plus_point<Exact_K>* ek_plane_ptr;
double m10,m20,m21,Maxx,Maxy,Maxz;
@ -292,8 +299,13 @@ public:
typedef typename Interval_nt_advanced::Protector Protector;
Is_on_positive_side_of_plane_3(const Traits&,const Point_3& p_,const Point_3& q_,const Point_3& r_)
:p(p_),q(q_),r(r_),ck_plane(nullptr),pk_plane(nullptr)
: p(p_),q(q_),r(r_)
, ak_plane()
, ek_plane_ptr(nullptr)
{
ak_plane.vector =
typename Approx_K::Vector_3(Interval_nt_advanced(0., std::numeric_limits<double>::infinity()),
0., 0.);
double pqx = q.x() - p.x();
double pqy = q.y() - p.y();
double pqz = q.z() - p.z();
@ -319,8 +331,7 @@ public:
}
~Is_on_positive_side_of_plane_3(){
if (ck_plane!=nullptr) delete ck_plane;
if (pk_plane!=nullptr) delete pk_plane;
if (ek_plane_ptr!=nullptr) delete ek_plane_ptr;
}
bool operator() (const Point_3& s) const
@ -334,15 +345,29 @@ public:
return static_res == 1;
try{
if (ck_plane==nullptr)
ck_plane=new typename CK::Plane_3(to_CK(p),to_CK(q),to_CK(r));
return ck_plane->has_on_positive_side(to_CK(s));
// infinity() is the sentinel for uninitialized `ak_plane`
if (ak_plane.vector.x().sup() == std::numeric_limits<double>::infinity())
{
const typename Approx_K::Point_3 ap = to_AK(p);
ak_plane.vector = cross_product(to_AK(q)-ap, to_AK(r)-ap);
ak_plane.point = ap;
}
Uncertain<Sign> res =
sign(scalar_product(to_AK(s) - ak_plane.point,
ak_plane.vector));
if(is_certain(res)) {
return (get_certain(res) == POSITIVE);
}
}
catch (Uncertain_conversion_exception&){
if (pk_plane==nullptr)
pk_plane=new typename PK::Plane_3(to_PK(p),to_PK(q),to_PK(r));
return pk_plane->has_on_positive_side(to_PK(s));
catch (Uncertain_conversion_exception&){}
if (ek_plane_ptr==nullptr) {
const typename Exact_K::Point_3 ep = to_EK(p);
ek_plane_ptr = new Vector_plus_point<Exact_K>;
ek_plane_ptr->vector = cross_product(to_EK(q)-ep, to_EK(r)-ep);
ek_plane_ptr->point = ep;
}
return sign(scalar_product(to_EK(s) - ek_plane_ptr->point,
ek_plane_ptr->vector)) == POSITIVE;
}
};

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Convex_hull_3_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -14,7 +14,7 @@
#include <iostream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Epick_without_intervals K;
typedef CGAL::Polyhedron_3<K> Polyhedron_3;
typedef K::Point_3 Point_3;

View File

@ -81,4 +81,6 @@ int main()
test<Epec,CGAL::Polyhedron_3<Epec> >();
test<Epic,CGAL::Surface_mesh<Epic::Point_3> >();
test<Epec,CGAL::Surface_mesh<Epec::Point_3> >();
test<CGAL::Epick_without_intervals,
CGAL::Surface_mesh<CGAL::Epick_without_intervals::Point_3> >();
}

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Convex_hull_d_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Distance_2_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -2,9 +2,9 @@
# This is the CMake script for compiling a CGAL application.
cmake_minimum_required(VERSION 3.1...3.15)
project( Distance_3_Tests )
cmake_minimum_required(VERSION 3.1)
find_package(CGAL QUIET)

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.1...3.15)
project(Documentation NONE)
# Minimal version of CMake:
cmake_minimum_required(VERSION 3.1)
# Check whether this cmake script is the top level one
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})

Some files were not shown because too many files have changed in this diff Show More