gtl boostcon draft03 no animation - boost c++ libraries

73
Lucanus Simonson, Gyuszi Suto

Upload: others

Post on 03-Oct-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GTL boostcon draft03 no animation - Boost C++ Libraries

Lucanus Simonson, Gyuszi Suto

Page 2: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 3: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 4: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 5: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 6: GTL boostcon draft03 no animation - Boost C++ Libraries

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
Page 8: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 9: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 10: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 11: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 12: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 13: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 14: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 15: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 16: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 17: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 18: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 19: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 20: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 21: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 22: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 23: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 24: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 25: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 26: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 27: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 28: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 29: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 30: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 31: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 32: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 33: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 34: GTL boostcon draft03 no animation - Boost C++ Libraries

+1

-1 +1

-1

-1 +1

Page 35: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 36: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 37: GTL boostcon draft03 no animation - Boost C++ Libraries

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

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

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

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

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

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

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

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

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
Page 47: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 48: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 49: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 50: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 51: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 52: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 53: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 54: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 55: GTL boostcon draft03 no animation - Boost C++ Libraries

//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

//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
Page 58: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 59: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 60: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 61: GTL boostcon draft03 no animation - Boost C++ Libraries

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
Page 63: GTL boostcon draft03 no animation - Boost C++ Libraries

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

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

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

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
Page 68: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 69: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 70: GTL boostcon draft03 no animation - Boost C++ Libraries

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
Page 72: GTL boostcon draft03 no animation - Boost C++ Libraries
Page 73: GTL boostcon draft03 no animation - Boost C++ Libraries

template <typename T> struct gtl_if {#ifdef WIN32typedef gtl_no type;

#endif};template <> struct gtl_if<gtl_yes> { typedef gtl_yes type; };