Skip to content
Open
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
887da91
Make x monotone curve 2 a template parameter of polycurve basic traits
sgiraudot Mar 17, 2021
4445460
First version of lightweight polyline traits + example
sgiraudot Mar 17, 2021
7237ec8
Create Construct_curve_2 functor and use it in example
sgiraudot Mar 17, 2021
31a2c9b
Handle polygon conversion with lightweight traits
sgiraudot Mar 18, 2021
e35aea8
Rebase
sgiraudot Mar 18, 2021
2aaa0cd
First functional version of line cache
sgiraudot Mar 29, 2021
bfbd08f
Clean up lightweight polyline class
sgiraudot Mar 30, 2021
e90da1f
Use indices and separated containers instead of zip iterator
sgiraudot Mar 30, 2021
721d065
Some clean up
sgiraudot Mar 31, 2021
b9141a4
Do not use sweep to insert PWH
sgiraudot Mar 31, 2021
41246df
Use unsigned indices
sgiraudot Mar 31, 2021
65d08f8
Document and clean up
sgiraudot Mar 31, 2021
7caf6b3
Add missing return statements
sgiraudot Apr 1, 2021
0fcb807
Use lightweight traits as default in free BSO functions
sgiraudot Apr 1, 2021
15dbc92
Fix overlap orientation
sgiraudot Apr 8, 2021
83a7235
Allow chosing sweep or not for interting PWH in GPS
sgiraudot Apr 8, 2021
0329f82
Fix std::function type using const ref and no value
sgiraudot Apr 8, 2021
46f7e55
Replace lightweight by caching
sgiraudot Apr 14, 2021
182b566
Distinguish types of Curve_2 / X_monotone_curve_2 and directly insert…
sgiraudot Apr 14, 2021
09fc6cb
Use traits reference and do not construct kernel from scratch + minor…
sgiraudot Apr 14, 2021
5f2448b
Fix Single const iterator
sgiraudot Apr 20, 2021
f8df8cd
Never store refs to traits in polylines
sgiraudot Apr 20, 2021
7ad01c0
Fix style + cleaning
sgiraudot Apr 20, 2021
1fbcaaa
Cleaned up Arr_polyline_traits_2 doc; Introduced Arr_caching_polyline…
efifogel Apr 28, 2021
00dc92c
Added polylines_caching.cpp
efifogel Apr 28, 2021
5875155
Enhanced
efifogel Apr 28, 2021
1e902e4
Added support for testing the caching polyline traits
efifogel Apr 29, 2021
f5313a5
Use consistent naming
sgiraudot Apr 29, 2021
72b164f
Define constrcut x monotone curve 2 in caching traits
sgiraudot Apr 29, 2021
9763ddf
Fix concepts Construct_curve_2/x_monotone_curve_2
sgiraudot Apr 29, 2021
e6b86cd
Add Approximate_2 functor to caching polyline subtraits
sgiraudot Apr 29, 2021
85fd419
Add comment about hacky optimization
sgiraudot Apr 29, 2021
b0d08a4
Added a constructore of an x-monotone polyline from a range of points
efifogel May 3, 2021
17a5f91
Fixed the test of the caching-polyline traits to retain the points th…
efifogel May 3, 2021
5f021fe
Small textual fixes related to "comprise"
efifogel May 3, 2021
5823911
Added precondintion
efifogel May 3, 2021
5fdadbc
Added missing documentation
efifogel May 3, 2021
84d42b8
Fixed types of Curve_2 and X_monotone_curve_2
efifogel May 3, 2021
13a5109
Small fixes
efifogel May 3, 2021
fa36a32
Fixed testing of caching polyline traits
efifogel May 11, 2021
1afc180
Fix default value of duplicate_first
sgiraudot May 11, 2021
a7d0a4f
Fix Split_2
sgiraudot May 11, 2021
de43b6f
Disable some tests and clean error messages
sgiraudot May 17, 2021
b7412a9
Fix merge category + add missing precondition in Split_2
sgiraudot May 17, 2021
e7728dc
Disable assertions test for caching polylines
sgiraudot May 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//! \file examples/Arrangement_on_surface_2/polylines_caching.cpp
// Constructing an arrangement of polylines with caching traits

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Arr_caching_polyline_traits_2.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Polygon_2.h>
#include <boost/function_output_iterator.hpp>
#include <vector>
#include <list>

#include "arr_print.h"

using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
using Point_2 = Kernel::Point_2;
using Line_2 = Kernel::Line_2;
using Point_2_vector = std::vector<Point_2>;
using Polygon_2 = CGAL::Polygon_2<Kernel>;

int main()
{
// Using a vector of points
{
using Geom_traits_2 = CGAL::Arr_caching_polyline_traits_2<Kernel, Point_2_vector>;
using Arrangement_2 = CGAL::Arrangement_2<Geom_traits_2>;
using Curve_2 = typename Geom_traits_2::Curve_2;
using X_monotone_curve_2 = typename Geom_traits_2::X_monotone_curve_2;

Geom_traits_2 traits;
Arrangement_2 arr(&traits);

Point_2_vector points;
points.push_back(Point_2(1, 3));
points.push_back(Point_2(0, 2));
points.push_back(Point_2(1, 0));
points.push_back(Point_2(2, 1));
points.push_back(Point_2(3, 0));
points.push_back(Point_2(4, 1));
points.push_back(Point_2(5, 0));
points.push_back(Point_2(6, 2));
points.push_back(Point_2(5, 3));
points.push_back(Point_2(4, 2));

auto construct_curve_2 = traits.construct_curve_2_object();
Curve_2 curve = construct_curve_2(points);
insert (arr, curve);
}

// Using a Polygon_2
{
using Geom_traits_2 = CGAL::Arr_caching_polyline_traits_2<Kernel, Polygon_2>;
using Arrangement_2 = CGAL::Arrangement_2<Geom_traits_2>;

using Curve_2 = typename Geom_traits_2::Curve_2;
using X_monotone_curve_2 = typename Geom_traits_2::X_monotone_curve_2;

Geom_traits_2 traits;
Arrangement_2 arr(&traits);

Polygon_2 polygon;
polygon.push_back (Point_2(0, 0));
polygon.push_back (Point_2(2, 4));
polygon.push_back (Point_2(3, 0));
polygon.push_back (Point_2(4, 4));
polygon.push_back (Point_2(6, 0));

auto construct_curve_2 = traits.construct_curve_2_object();
Curve_2 curve = construct_curve_2(polygon);
insert (arr, curve);
}

return EXIT_SUCCESS;
}
Loading