diff --git a/.gitattributes b/.gitattributes index 2ba9d114b4a..3e27d285f2b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4291,7 +4291,6 @@ Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_2.cpp -t Triangulation_2/examples/Triangulation_2/info_insert_with_pair_iterator_regular_2.cpp -text Triangulation_2/examples/Triangulation_2/info_insert_with_transform_iterator_2.cpp -text Triangulation_2/examples/Triangulation_2/info_insert_with_zip_iterator_2.cpp -text -Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp -text Triangulation_2/test/Triangulation_2/test_delaunay_triangulation_proj.cpp -text Triangulation_3/demo/Triangulation_3/CMakeLists.txt -text Triangulation_3/demo/Triangulation_3/MainWindow.cpp -text diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Angle_3.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Angle_3.h index 5008b1bbfdf..43e0f782bf6 100644 --- a/Filtered_kernel/include/CGAL/internal/Static_filters/Angle_3.h +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Angle_3.h @@ -52,15 +52,14 @@ public: #ifndef CGAL_CFG_MATCHING_BUG_6 using Base::operator(); -#else - +#else // CGAL_CFG_MATCHING_BUG_6 template result_type operator()(const T1& t1, const T2& t2) const { return Base()(t1,t2); } -#endif +#endif // CGAL_CFG_MATCHING_BUG_6 Sign sign_with_error(const double x, const double error) const { @@ -155,13 +154,12 @@ public: return err; } -}; // class Angle_3 +}; // end class Angle_3 -} // namespace Static_filters_predicates +} // end namespace Static_filters_predicates -} // namespace internal +} // end namespace internal - -} //namespace CGAL +} // end namespace CGAL #endif // CGAL_INTERNAL_STATIC_FILTERS_ANGLE_3_H diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h index 5b6cd4e0316..e7f9dd11e81 100644 --- a/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Do_intersect_3.h @@ -40,13 +40,14 @@ namespace internal { namespace Static_filters_predicates { -template < typename K_base > +template < typename K_base, typename SFK > class Do_intersect_3 : public K_base::Do_intersect_3 { typedef typename K_base::Point_3 Point_3; typedef typename K_base::Ray_3 Ray_3; typedef typename K_base::Segment_3 Segment_3; + typedef typename K_base::Triangle_3 Triangle_3; typedef typename K_base::Do_intersect_3 Base; public: @@ -56,15 +57,14 @@ public: #ifndef CGAL_CFG_MATCHING_BUG_6 using Base::operator(); -#else - +#else // CGAL_CFG_MATCHING_BUG_6 template result_type operator()(const T1& t1, const T2& t2) const { return Base()(t1,t2); } -#endif +#endif // CGAL_CFG_MATCHING_BUG_6 Sign sign_with_error(const double x, const double error) const { @@ -73,6 +73,26 @@ public: else return ZERO; } + + // The internal::do_intersect(..) function + // only performs orientation tests on the vertices + // of the triangle and the segment + // By calling the do_intersect function with + // the statically filtered kernel we avoid + // that doubles are put into Inteval_nt + // to get taken out again with fit_in_double + result_type + operator()(const Segment_3 &s, const Triangle_3& t) const + { + return internal::do_intersect(t,s, SFK()); + } + + result_type + operator()(const Triangle_3& t, const Segment_3 &s) const + { + return internal::do_intersect(t,s, SFK()); + } + result_type operator()(const Bbox_3& b, const Segment_3 &s) const { @@ -493,11 +513,11 @@ public: }; // class Do_intersect_3 -} // namespace Static_filters_predicates +} // end namespace Static_filters_predicates -} // namespace internal +} // end namespace internal -} //namespace CGAL +} // end namespace CGAL #endif // CGAL_INTERNAL_STATIC_FILTERS_DO_INTERSECT_3_H diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Equal_3.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Equal_3.h new file mode 100755 index 00000000000..176bd46bbf2 --- /dev/null +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Equal_3.h @@ -0,0 +1,91 @@ +// Copyright (c) 2011 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 Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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$ +// +// +// Author(s) : Andreas Fabri + + +#ifndef CGAL_INTERNAL_STATIC_FILTERS_EQUAL_3_H +#define CGAL_INTERNAL_STATIC_FILTERS_EQUAL_3_H + +#include +#include +#include +#include +#include + +namespace CGAL { + +namespace internal { + +namespace Static_filters_predicates { + + +template < typename K_base > +class Equal_3 + : public K_base::Equal_3 +{ + typedef typename K_base::Point_3 Point_3; + typedef typename K_base::Equal_3 Base; + +public: + + typedef typename Base::result_type result_type; + + +#ifndef CGAL_CFG_MATCHING_BUG_6 + using Base::operator(); +#else // CGAL_CFG_MATCHING_BUG_6 + template + result_type + operator()(const T& t1, const T& t2) const + { + return Base()(t1,t2); + } +#endif // CGAL_CFG_MATCHING_BUG_6 + + + result_type operator()(const Point_3 &p, const Point_3& q) const + { + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + + std::string(CGAL_PRETTY_FUNCTION), tmp); + + Get_approx get_approx; // Identity functor for all points + // but lazy points + double px, py, pz, qx, qy, qz; + + if (fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) && + fit_in_double(get_approx(p).z(), pz) && + fit_in_double(get_approx(q).x(), qx) && fit_in_double(get_approx(q).y(), qy) && + fit_in_double(get_approx(q).z(), qz) ) + { + CGAL_BRANCH_PROFILER_BRANCH(tmp); + return px == qx && py == qy && pz == qz; + } + return Base::operator()(p, q); + } + + +}; // end class Equal_3 + +} // end namespace Static_filters_predicates + +} // end namespace internal + +} // end namespace CGAL + +#endif // CGAL_INTERNAL_STATIC_FILTERS_EQUAL_3_H diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Is_degenerate_3.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Is_degenerate_3.h new file mode 100644 index 00000000000..b32f836a9a9 --- /dev/null +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Is_degenerate_3.h @@ -0,0 +1,82 @@ +// Copyright (c) 2011 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 Lesser General Public License as +// published by the Free Software Foundation; version 2.1 of the License. +// See the file LICENSE.LGPL distributed with CGAL. +// +// 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$ +// +// +// Author(s) : Andreas Fabri, Laurent Rineau + + +#ifndef CGAL_INTERNAL_STATIC_FILTERS_IS_DEGENERATE_3_H +#define CGAL_INTERNAL_STATIC_FILTERS_IS_DEGENERATE_3_H + +namespace CGAL { + +namespace internal { + +namespace Static_filters_predicates { + + +template < typename K_base, typename SFK > +class Is_degenerate_3 + : public K_base::Is_degenerate_3 +{ + typedef typename K_base::Ray_3 Ray_3; + typedef typename K_base::Segment_3 Segment_3; + typedef typename K_base::Is_degenerate_3 Base; + typedef typename K_base::Construct_source_3 Construct_source_3; + typedef typename K_base::Construct_target_3 Construct_target_3; + typedef typename K_base::Construct_second_point_3 Construct_second_point_3; + typedef typename SFK::Equal_3 Equal_3; + +public: + + typedef typename Base::result_type result_type; + + +#ifndef CGAL_CFG_MATCHING_BUG_6 + using Base::operator(); +#else // CGAL_CFG_MATCHING_BUG_6 + template + result_type + operator()(const T& t) const + { + return Base()(t); + } +#endif // end CGAL_CFG_MATCHING_BUG_6 + + + result_type + operator()(const Segment_3& s) const + { + return Equal_3()(Construct_source_3()(s), Construct_target_3()(s)); + } + + + result_type + operator()(const Ray_3& r) const + { + return Equal_3()(Construct_source_3()(r), Construct_second_point_3()(r)); + } + +}; // end class Is_degenerate_3 + +} // end namespace Static_filters_predicates + +} // end namespace internal + +} // end namespace CGAL + +#endif // CGAL_INTERNAL_STATIC_FILTERS_IS_DEGENERATE_3_H diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Static_filters.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Static_filters.h index b411e6eb0bc..72146e12d02 100644 --- a/Filtered_kernel/include/CGAL/internal/Static_filters/Static_filters.h +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Static_filters.h @@ -37,12 +37,32 @@ #include #include #include + +// for static filters added nov./dec. 2011 +#ifdef CGAL_DISABLE_STATIC_FILTERS_ADDED_2011 +# define CGAL_NO_EQUAL_3_STATIC_FILTERS 1 +# define CGAL_NO_IS_DEGENERATE_3_STATIC_FILTERS 1 +# define CGAL_NO_ANGLE_3_STATIC_FILTERS 1 +# define CGAL_NO_DO_INTERSECT_3_STATIC_FILTERS 1 +#endif // CGAL_DISABLE_STATIC_FILTERS_ADDED_2011 + + +#ifndef CGAL_NO_EQUAL_3_STATIC_FILTERS +# include +#endif // NOT CGAL_NO_EQUAL_3_STATIC_FILTERS + +#ifndef CGAL_NO_IS_DEGENERATE_3_STATIC_FILTERS +# include +#endif // NOT CGAL_NO_IS_DEGENERATE_3_STATIC_FILTERS + #ifndef CGAL_NO_ANGLE_3_STATIC_FILTERS # include -#endif // CGAL_NO_ANGLE_3_STATIC_FILTERS +#endif // NOT CGAL_NO_ANGLE_3_STATIC_FILTERS + #ifndef CGAL_NO_DO_INTERSECT_3_STATIC_FILTERS # include -#endif // NOT CGAL_NO_DO_INTERSECT_3_STATIC_FILTERS +#endif // NOT NOT CGAL_NO_DO_INTERSECT_3_STATIC_FILTERS + #include #include #include @@ -88,14 +108,20 @@ class Static_filters : public K_base { has_cheap_access_to_cartesian_coordinates> Self; public: +#ifndef CGAL_NO_EQUAL_3_STATIC_FILTERS + typedef Static_filters_predicates::Equal_3 Equal_3; +#endif // NOT CGAL_NO_EQUAL_3_STATIC_FILTERS +#ifndef CGAL_NO_IS_DEGENERATE_3_STATIC_FILTERS + typedef Static_filters_predicates::Is_degenerate_3 Is_degenerate_3; +#endif // NOT CGAL_NO_IS_DEGENERATE_3_STATIC_FILTERS typedef Static_filters_predicates::Orientation_2 Orientation_2; typedef Static_filters_predicates::Orientation_3 Orientation_3; #ifndef CGAL_NO_ANGLE_3_STATIC_FILTERS typedef Static_filters_predicates::Angle_3 Angle_3; -#endif // CGAL_NO_ANGLE_3_STATIC_FILTERS +#endif // NOT CGAL_NO_ANGLE_3_STATIC_FILTERS #ifndef CGAL_NO_DO_INTERSECT_3_STATIC_FILTERS - typedef Static_filters_predicates::Do_intersect_3 Do_intersect_3; + typedef Static_filters_predicates::Do_intersect_3 Do_intersect_3; #endif // NOT CGAL_NO_DO_INTERSECT_3_STATIC_FILTERS typedef Static_filters_predicates::Side_of_oriented_circle_2 Side_of_oriented_circle_2; typedef Static_filters_predicates::Side_of_oriented_sphere_3 Side_of_oriented_sphere_3; @@ -109,6 +135,18 @@ public: orientation_3_object() const { return Orientation_3(); } +#ifndef CGAL_NO_EQUAL_3_STATIC_FILTERS + Equal_3 + equal_3_object() const + { return Equal_3(); } +#endif // NOT CGAL_NO_EQUAL_3_STATIC_FILTERS + +#ifndef CGAL_NO_IS_DEGENERATE_3_STATIC_FILTERS + Is_degenerate_3 + is_degenerate_3_object() const + { return Is_degenerate_3(); } +#endif // NOT CGAL_NO_IS_DEGENERATE_3_STATIC_FILTERS + #ifndef CGAL_NO_ANGLE_3_STATIC_FILTERS Angle_3 angle_3_object() const diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index 3d904583a89..362fc1d711e 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -46,7 +46,7 @@ if(NOT USE_CGAL_FILE_INCLUDED) #message (STATUS "LIB: ${CGAL_LIBRARY}") #message (STATUS "LIBS: ${CGAL_LIBRARIES}") - include_directories ( BEFORE ${CGAL_INCLUDE_DIRS} ${CGAL_3RD_PARTY_INCLUDE_DIRS} ) + include_directories ( ${CGAL_INCLUDE_DIRS} ${CGAL_3RD_PARTY_INCLUDE_DIRS} ) add_definitions ( ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_DEFINITIONS} ) link_directories ( ${CGAL_LIBRARIES_DIR} ${CGAL_3RD_PARTY_LIBRARIES_DIRS} ) diff --git a/Maintenance/git/authors-file.txt b/Maintenance/git/authors-file.txt index 1785e1dea1e..5d3239f6bc0 100644 --- a/Maintenance/git/authors-file.txt +++ b/Maintenance/git/authors-file.txt @@ -101,7 +101,7 @@ shaihi = Shai Hirsch shornus = Samuel Hornus singler = Johannes Singler slimbach = Sebastian Limbach -sloriot = Sébastien Loriot +sloriot = Sébastien Loriot soudot = Steve Oudot spion = Sylvain Pion spostoll = Stéphane Postollec diff --git a/Mesh_3/doc_tex/Mesh_3_ref/Mesh_domain_with_polyline_features_3.tex b/Mesh_3/doc_tex/Mesh_3_ref/Mesh_domain_with_polyline_features_3.tex index d7348cceb74..a68aad4edde 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/Mesh_domain_with_polyline_features_3.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/Mesh_domain_with_polyline_features_3.tex @@ -41,7 +41,7 @@ It has to be a model of the \ccc{MeshDomain_3} concept. \ccc{MeshDomainWithFeatures_3} \ccInheritsFrom -\ccc{MeshDomain_3} +\ccHtmlNoLinksFrom{\ccc{MeshDomain_3}} \ccTypes diff --git a/Mesh_3/doc_tex/Mesh_3_ref/Mesh_edge_criteria_3.tex b/Mesh_3/doc_tex/Mesh_3_ref/Mesh_edge_criteria_3.tex index c6f028a5462..acb713602a7 100644 --- a/Mesh_3/doc_tex/Mesh_3_ref/Mesh_edge_criteria_3.tex +++ b/Mesh_3/doc_tex/Mesh_3_ref/Mesh_edge_criteria_3.tex @@ -48,7 +48,7 @@ for the length of the edges which are used to discretize the curve segments. Note that if one parameter is set to 0, then its corresponding criteria is ignored.} \ccConstructor{ - template + template Mesh_edge_criteria_3( SizingField length_bound);} % DistanceField distance_bound);} diff --git a/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp b/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp index 26701e99463..a1f697d1db0 100644 --- a/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_3D_image.cpp @@ -33,7 +33,7 @@ int main() // Mesh criteria Mesh_criteria criteria(facet_angle=30, facet_size=6, facet_distance=4, - cell_radius_edge=3, cell_size=8); + cell_radius_edge_ratio=3, cell_size=8); // Meshing C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp index c7e5007042b..55a9350f40b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_sphere.cpp @@ -35,7 +35,7 @@ int main() // Mesh criteria Mesh_criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025, - cell_radius_edge=2, cell_size=0.1); + cell_radius_edge_ratio=2, cell_size=0.1); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria); diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp index 21b2b0ae8b7..31b12b91429 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_example.cpp @@ -31,7 +31,7 @@ int main() // Mesh criteria Mesh_criteria criteria(facet_angle=30, facet_size=5, facet_distance=1.5, - cell_radius_edge=2, cell_size=7); + cell_radius_edge_ratio=2, cell_size=7); // Mesh generation and optimization in one call (sliver_bound is the // targeted dihedral angle in degree) diff --git a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp index 158029820a1..5f5062d2322 100644 --- a/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_optimization_lloyd_example.cpp @@ -31,7 +31,7 @@ int main() // Mesh criteria Mesh_criteria criteria(facet_angle=30, facet_distance=1.2, - cell_radius_edge=2); + cell_radius_edge_ratio=2); // Mesh generation and optimization in one call C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, diff --git a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp index 8ddc4e963d7..1cc6a6c5acf 100644 --- a/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp @@ -38,7 +38,7 @@ int main() // Mesh criteria (no cell_size set) Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008, - cell_radius_edge=3); + cell_radius_edge_ratio=3); // Mesh generation C3t3 c3t3 = CGAL::make_mesh_3(domain, criteria, no_perturb(), no_exude()); @@ -48,8 +48,8 @@ int main() c3t3.output_to_medit(medit_file); medit_file.close(); - // Set tetrahedron size (keep cell_radius_edge), ignore facets - Mesh_criteria new_criteria(cell_radius_edge=3, cell_size=0.03); + // Set tetrahedron size (keep cell_radius_edge_ratio), ignore facets + Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03); // Mesh refinement CGAL::refine_mesh_3(c3t3, domain, new_criteria); diff --git a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h index 5fd310f896d..50f0eb456cd 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Refine_facets_3.h @@ -562,8 +562,8 @@ before_insertion_impl(const Facet& facet, " Refinement point: %5%\n") % (&*facet.first) % facet.second - % facet.first->circumcenter() - % source_other_side.first->circumcenter() + % triangulation_ref_impl().dual(facet.first) + % triangulation_ref_impl().dual(source_other_side.first) % point % facet.first->vertex((facet.second + 1)&3)->point() % facet.first->vertex((facet.second + 2)&3)->point() diff --git a/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp b/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp deleted file mode 100644 index 6034c29817c..00000000000 --- a/Triangulation_2/examples/Triangulation_2/polygon_triangulation.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include -#include -#include -#include -#include - -struct FaceInfo2 -{ - FaceInfo2(){} - int nesting_level; - - bool in_domain(){ - return nesting_level%2 == 1; - } -}; - - -typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef CGAL::Triangulation_vertex_base_2 Vb; -typedef CGAL::Triangulation_face_base_with_info_2 Fbb; -typedef CGAL::Constrained_triangulation_face_base_2 Fb; -typedef CGAL::Triangulation_data_structure_2 TDS; -typedef CGAL::Exact_predicates_tag Itag; -typedef CGAL::Constrained_Delaunay_triangulation_2 CDT; -typedef CDT::Point Point; -typedef CGAL::Polygon_2 Polygon; - -void -mark_domains(CDT& ct, - CDT::Face_handle start, - int index, - std::list& border ) -{ - if(start->info().nesting_level != -1){ - return; - } - std::list queue; - queue.push_back(start); - - while(! queue.empty()){ - CDT::Face_handle fh = queue.front(); - queue.pop_front(); - if(fh->info().nesting_level == -1){ - fh->info().nesting_level = index; - for(int i = 0; i < 3; i++){ - CDT::Edge e(fh,i); - CDT::Face_handle n = fh->neighbor(i); - if(n->info().nesting_level == -1){ - if(ct.is_constrained(e)) border.push_back(e); - else queue.push_back(n); - } - } - } - } -} - -//explore set of facets connected with non constrained edges, -//and attribute to each such set a nesting level. -//We start from facets incident to the infinite vertex, with a nesting -//level of 0. Then we recursively consider the non-explored facets incident -//to constrained edges bounding the former set and increase the nesting level by 1. -//Facets in the domain are those with an odd nesting level. -void -mark_domains(CDT& cdt) -{ - for(CDT::All_faces_iterator it = cdt.all_faces_begin(); it != cdt.all_faces_end(); ++it){ - it->info().nesting_level = -1; - } - - int index = 0; - std::list border; - mark_domains(cdt, cdt.infinite_face(), index++, border); - while(! border.empty()){ - CDT::Edge e = border.front(); - border.pop_front(); - CDT::Face_handle n = e.first->neighbor(e.second); - if(n->info().nesting_level == -1){ - mark_domains(cdt, n, e.first->info().nesting_level+1, border); - } - } -} - -void insert_polygon(CDT& cdt,const Polygon& polygon){ - if ( polygon.is_empty() ) return; - CDT::Vertex_handle v_prev=cdt.insert(*CGAL::cpp0x::prev(polygon.vertices_end())); - for (Polygon::Vertex_iterator vit=polygon.vertices_begin(); - vit!=polygon.vertices_end();++vit) - { - CDT::Vertex_handle vh=cdt.insert(*vit); - cdt.insert_constraint(vh,v_prev); - v_prev=vh; - } -} - -int main( ) -{ - //construct two non-intersecting nested polygons - Polygon polygon1; - polygon1.push_back(Point(0,0)); - polygon1.push_back(Point(2,0)); - polygon1.push_back(Point(2,2)); - polygon1.push_back(Point(0,2)); - Polygon polygon2; - polygon2.push_back(Point(0.5,0.5)); - polygon2.push_back(Point(1.5,0.5)); - polygon2.push_back(Point(1.5,1.5)); - polygon2.push_back(Point(0.5,1.5)); - - //Insert the polyons into a constrained triangulation - CDT cdt; - insert_polygon(cdt,polygon1); - insert_polygon(cdt,polygon2); - - //Mark facets that are inside the domain bounded by the polygon - mark_domains(cdt); - - int count=0; - for (CDT::Finite_faces_iterator fit=cdt.finite_faces_begin(); - fit!=cdt.finite_faces_end();++fit) - { - if ( fit->info().in_domain() ) ++count; - } - - std::cout << "There are " << count << " facets in the domain." << std::endl; - - return 0; -} diff --git a/Triangulation_3/doc_tex/Triangulation_3_ref/RegularTriangulationTraits_3.tex b/Triangulation_3/doc_tex/Triangulation_3_ref/RegularTriangulationTraits_3.tex index eab9b4165a5..b0b492d6beb 100644 --- a/Triangulation_3/doc_tex/Triangulation_3_ref/RegularTriangulationTraits_3.tex +++ b/Triangulation_3/doc_tex/Triangulation_3_ref/RegularTriangulationTraits_3.tex @@ -48,6 +48,8 @@ point $p\in\R^3$ or the weighted point ${p}^{(w)}=(p,w_p)$. \ccTwo{RegularTriangulationTraits_3::Weighted_point_3xx}{} \ccNestedType{Weighted_point_3}{The weighted point type.} +\ccGlue +\ccNestedType{Bare_point}{The (un-weighted) point type.} \ccTwo{Regular}{} \ccNestedType{Power_test_3}