Merge remote-tracking branch 'cgal/5.6.x-branch' into cgal/6.0.x-branch

This commit is contained in:
Sébastien Loriot 2025-02-19 07:18:41 +01:00
commit f7629fa682
4 changed files with 42 additions and 4 deletions

View File

@ -154,10 +154,13 @@ public:
(*it)->set_removable(false); (*it)->set_removable(false);
++it; ++it;
for(; it != ite; ++it){ for(; it != ite; ++it){
if((std::next(it) != ite) && (std::prev(it)== std::next(it))){ if(std::next(it) != ite){
Vertex_handle vp = *std::prev(it), vn = *std::next(it);
if(vp == vn){
(*it)->set_removable(false); (*it)->set_removable(false);
} }
} }
}
it = std::prev(it); it = std::prev(it);
(*it)->set_removable(false); (*it)->set_removable(false);
} }

View File

@ -8,5 +8,6 @@ project(Polyline_simplification_2_Tests)
find_package(CGAL REQUIRED) find_package(CGAL REQUIRED)
create_single_source_cgal_program( "issue-5774.cpp" ) create_single_source_cgal_program( "issue-5774.cpp" )
create_single_source_cgal_program( "issue-8735.cpp" )
create_single_source_cgal_program( "simplify_polygon_test.cpp" ) create_single_source_cgal_program( "simplify_polygon_test.cpp" )
create_single_source_cgal_program( "simplify_polyline_with_duplicate_points.cpp" ) create_single_source_cgal_program( "simplify_polyline_with_duplicate_points.cpp" )

View File

@ -0,0 +1,34 @@
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polyline_simplification_2/simplify.h>
#include <vector>
namespace PS = CGAL::Polyline_simplification_2;
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef PS::Vertex_base_2<K> Vb;
typedef CGAL::Constrained_triangulation_face_base_2<K> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;
typedef CGAL::Constrained_Delaunay_triangulation_2<K, TDS , CGAL::Exact_predicates_tag> CDT;
typedef CGAL::Constrained_triangulation_plus_2<CDT> CT;
typedef CT::Point Point;
typedef PS::Stop_above_cost_threshold Stop;
typedef PS::Squared_distance_cost Cost;
int main()
{
double tolerance = 100;
CT ct;
std::vector<CT::Point> pts;
pts.push_back(CT::Point(0, 0));
pts.push_back(CT::Point(2, 0));
pts.push_back(CT::Point(1, 0));
pts.push_back(CT::Point(3, 0));
pts.push_back(CT::Point(4, 1));
tolerance = 100;
ct.insert_constraint(pts.begin(), pts.end(), false);
PS::simplify(ct, Cost(), Stop(tolerance * tolerance), false);
return 0;
}

View File

@ -75,7 +75,7 @@ public:
all_iterator all_iterator
, typename all_list::iterator , typename all_list::iterator
, T , T
> , std::bidirectional_iterator_tag>
{ {
public: public:
all_iterator() {} all_iterator() {}
@ -91,7 +91,7 @@ public:
skip_iterator skip_iterator
, typename skip_list::iterator , typename skip_list::iterator
, T , T
> , std::bidirectional_iterator_tag>
{ {
public: public:
skip_iterator() {} skip_iterator() {}