![Page 1: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/1.jpg)
Lucanus Simonson, Gyuszi Suto
![Page 2: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/2.jpg)
![Page 3: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/3.jpg)
![Page 4: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/4.jpg)
![Page 5: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/5.jpg)
![Page 6: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/6.jpg)
a cbd
void clip_and_subtract(polygon_set& d,polygon a, polygon b, rectangle c) {
d = (a & c) - b;}
![Page 7: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/7.jpg)
![Page 8: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/8.jpg)
![Page 9: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/9.jpg)
![Page 10: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/10.jpg)
![Page 11: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/11.jpg)
![Page 12: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/12.jpg)
![Page 13: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/13.jpg)
![Page 14: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/14.jpg)
![Page 15: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/15.jpg)
![Page 16: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/16.jpg)
![Page 17: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/17.jpg)
![Page 18: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/18.jpg)
![Page 19: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/19.jpg)
![Page 20: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/20.jpg)
![Page 21: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/21.jpg)
![Page 22: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/22.jpg)
![Page 23: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/23.jpg)
![Page 24: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/24.jpg)
![Page 25: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/25.jpg)
![Page 26: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/26.jpg)
![Page 27: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/27.jpg)
![Page 28: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/28.jpg)
![Page 29: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/29.jpg)
![Page 30: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/30.jpg)
![Page 31: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/31.jpg)
![Page 32: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/32.jpg)
![Page 33: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/33.jpg)
![Page 34: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/34.jpg)
+1
-1 +1
-1
-1 +1
![Page 35: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/35.jpg)
![Page 36: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/36.jpg)
![Page 37: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/37.jpg)
Decompose
Decompose
Merge Input Vertices
-1 -1
+1 +1
+1 -10,-1
0,+1 0,-1
0,+1
-1,0 +1,0
-1,0 +1,0
+1,0 -1,0
-1
+1 -1
+1
![Page 38: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/38.jpg)
0,-1
0,+1 0,-1
0,+1
-1,0
+1,0
+1,0 -1,0
+1,0
-1,0
![Page 39: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/39.jpg)
0,-1
0,+1 0,-1
0,+1
-1,0
+1,0
+1,0 -1,0
-1
+1
+1,0
-1,0
![Page 40: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/40.jpg)
0,-1
0,+1 0,-1
0,+1
-1,0
+1,0
+1,0 -1,0
+1
-1
-1
+1
+1,0
-1,0
![Page 41: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/41.jpg)
0,-1
0,+1 0,-1
0,+1
-1,0
+1,0
+1,0 -1,0
-1
+1
-1
+1
+1,0
-1,0
![Page 42: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/42.jpg)
0,-1
0,+1 0,-1
0,+1
-1,0
+1,0
+1,0 -1,0
+1
-1
-1
+1
+1,0
-1,0
+1
-1
![Page 43: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/43.jpg)
0,-1
0,+1 0,-1
0,+1
-1,0
+1,0
+1,0 -1,0
-1
+1
+1,0
-1,0
+2-1
-1+1
-1
+1
-1
![Page 44: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/44.jpg)
0,-1
0,+1 0,-1
0,+1
-1,0
+1,0
+1,0 -1,0
-1
+1
+1,0
-1,0
+1
-1
+1
-1
+1
-1
+2-1
-1
![Page 45: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/45.jpg)
Sweep-line Polygon Formation
-1
+1
+1
-1
+1
-1
+1
-1
+2-1
-1
![Page 46: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/46.jpg)
![Page 47: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/47.jpg)
![Page 48: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/48.jpg)
![Page 49: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/49.jpg)
![Page 50: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/50.jpg)
![Page 51: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/51.jpg)
![Page 52: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/52.jpg)
![Page 53: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/53.jpg)
![Page 54: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/54.jpg)
![Page 55: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/55.jpg)
//Segment 1: (x11,y11) to (x12, y12)//Segment 2: (x21,y21) to (x22, y22)y1 < y2 iff(x22 - x21)((x - x11)(y12 - y11) + y11(x12 - x 11)) <(x12 - x11)((x - x21)(y22 - y21) + y21(x22 - x 21))
![Page 56: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/56.jpg)
//Segment 1: (x11,y11) to (x12, y12)dx1 = x12 - x11; dy1 = y12 - y11;//Segment 2: (x21,y21) to (x22, y22)dx2 = x22 - x21; dy2 = y22 - y21;x = (x11 * dy1 * dx2 – x21 * dy2 * dx1 +
y21 * dx1 * dx2 - y11 * dx1 * dx2) / (dy1 * dx2 - dy2 * dx1);
y = (y11 * dx1 * dy2 - y21 * dx2 * dy1 + x21 * dy1 * dy2 - x11 * dy1 * dy2) / (dx1 * dy2 - dx2 * dy1);
![Page 57: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/57.jpg)
![Page 58: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/58.jpg)
![Page 59: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/59.jpg)
![Page 60: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/60.jpg)
![Page 61: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/61.jpg)
b aa result
void foo(list<CPolygon>& result, const list<CPolygon>& a, const list<CPolygon>& b) {
CBoundingBox domainExtent;gtl::extents(domainExtent, a);result += (b & domainExtent) ^ (a - 10);
}
![Page 62: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/62.jpg)
![Page 63: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/63.jpg)
template <typename T>struct point_traits {typedef T::coordinate_type coordinate_type;coordinate_type get(const T& p, orientation_2d orient) {
return p.get(orient);}template <typename T>struct point_mutable_traits {
void set(const T& p, orientation_2d orient, coordinate_type value) {
p.set(orient, value);}T construct(coordinate_type x, coordinate_type y) {
return T(x, y); }};
![Page 64: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/64.jpg)
template <typename T> struct is_integer {};template <> struct is_integer<int> { typedef int type; };template <typename T> struct is_float {};template <> struct is_float<float> { typedef float type; };
template <typename T>typename is_int<T>::type foo(T input);template <typename T>typename is_float<T>::type foo(T input);
![Page 65: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/65.jpg)
struct polygon_concept {};struct rectangle_concept {};template <typename T>struct is_a_polygon_concept{};template <> struct is_a_polygon_concept<rectangle_concept> {
typedef gtl_yes type; };
![Page 66: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/66.jpg)
PSpolygon_set_concept
PS45polygon_45_set_concept
PS90polygon_90_set_concept
PWHpolygon_with_holes_concept
Ppolygon_concept
PWH45polygon_45_with_holes_concept
P45polygon_45_concept
PWH90polygon_90_with_holes_concept
P90polygon_90_concept
Rrectangle_concept
PT3Dpoint_3d_concept
PTpoint_concept
Iinterval_concept
Ccoordinate_concept
AbbreviationConcept
![Page 67: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/67.jpg)
![Page 68: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/68.jpg)
![Page 69: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/69.jpg)
![Page 70: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/70.jpg)
operator=
operator-
operator&
void clip_and_subtract(polygon_set& d,polygon a, polygon b, rectangle c) {
d = (a & c) - b;}
![Page 71: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/71.jpg)
![Page 72: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/72.jpg)
![Page 73: GTL boostcon draft03 no animation - Boost C++ Libraries](https://reader031.vdocument.in/reader031/viewer/2022012014/6159723c531a466a9d7f3747/html5/thumbnails/73.jpg)
template <typename T> struct gtl_if {#ifdef WIN32typedef gtl_no type;
#endif};template <> struct gtl_if<gtl_yes> { typedef gtl_yes type; };