gtl_polygon_90_set_concept.htm 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:(null)1="http://www.w3.org/TR/REC-html40" lang="en"><head><!--
  3. Copyright 2009-2010 Intel Corporation
  4. license banner
  5. --><title>Boost Polygon Library: Polygon 90 Set Concept</title>
  6. <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" /><!-- <link type="text/css" rel="stylesheet" href="adobe_source.css"> --></head><body>
  7. <table style="margin: 0pt; padding: 0pt; width: 100%;" border="0" cellpadding="0" cellspacing="0">
  8. <tbody>
  9. <tr>
  10. <td style="background-color: rgb(238, 238, 238);" nowrap="1" valign="top">
  11. <div style="padding: 5px;" align="center"> <img src="images/boost.png" border="0" height="86" width="277" /><a title="www.boost.org home page" href="http://www.boost.org/" tabindex="2" style="border: medium none ;"> </a> </div>
  12. <div style="margin: 5px;">
  13. <h3 class="navbar">Contents</h3>
  14. <ul>
  15. <li><a href="index.htm">Boost.Polygon Main Page</a></li>
  16. <li><a href="gtl_design_overview.htm">Design Overview</a></li>
  17. <li><a href="gtl_isotropy.htm">Isotropy</a></li>
  18. <li><a href="gtl_coordinate_concept.htm">Coordinate Concept</a></li>
  19. <li><a href="gtl_interval_concept.htm">Interval Concept</a></li>
  20. <li><a href="gtl_point_concept.htm">Point Concept</a></li>
  21. <li><a href="gtl_segment_concept.htm">Segment Concept</a></li>
  22. <li><a href="gtl_rectangle_concept.htm">Rectangle Concept</a></li>
  23. <li><a href="gtl_polygon_90_concept.htm">Polygon 90 Concept</a></li>
  24. <li><a href="gtl_polygon_90_with_holes_concept.htm">Polygon 90
  25. With Holes Concept</a></li>
  26. <li><a href="gtl_polygon_45_concept.htm">Polygon 45 Concept</a></li>
  27. <li><a href="gtl_polygon_45_with_holes_concept.htm">Polygon 45
  28. With Holes Concept</a></li>
  29. <li><a href="gtl_polygon_concept.htm">Polygon Concept</a></li>
  30. <li><a href="gtl_polygon_with_holes_concept.htm">Polygon With
  31. Holes Concept</a></li>
  32. <li>Polygon 90 Set Concept</li>
  33. <li><a href="gtl_polygon_45_set_concept.htm">Polygon 45 Set
  34. Concept</a></li>
  35. <li><a href="gtl_polygon_set_concept.htm">Polygon Set Concept</a></li>
  36. <li><a href="gtl_connectivity_extraction_90.htm">Connectivity
  37. Extraction 90</a></li>
  38. <li><a href="gtl_connectivity_extraction_45.htm">Connectivity
  39. Extraction 45</a></li>
  40. <li><a href="gtl_connectivity_extraction.htm">Connectivity
  41. Extraction</a></li>
  42. <li><a href="gtl_property_merge_90.htm">Property Merge 90</a></li>
  43. <li><a href="gtl_property_merge_45.htm">Property Merge 45</a></li>
  44. <li><a href="gtl_property_merge.htm">Property Merge</a></li>
  45. <li><a href="voronoi_main.htm">Voronoi Main Page<br />
  46. </a></li>
  47. <li><a href="voronoi_benchmark.htm">Voronoi Benchmark</a><br />
  48. </li>
  49. <li><a href="voronoi_builder.htm">Voronoi Builder</a></li>
  50. <li><a href="voronoi_diagram.htm">Voronoi Diagram</a></li>
  51. </ul>
  52. <h3 class="navbar">Other Resources</h3>
  53. <ul>
  54. <li><a href="GTL_boostcon2009.pdf">GTL Boostcon 2009 Paper</a></li>
  55. <li><a href="GTL_boostcon_draft03.pdf">GTL Boostcon 2009
  56. Presentation</a></li>
  57. <li><a href="analysis.htm">Performance Analysis</a></li>
  58. <li><a href="gtl_tutorial.htm">Layout Versus Schematic Tutorial</a></li>
  59. <li><a href="gtl_minkowski_tutorial.htm">Minkowski Sum Tutorial</a></li>
  60. <li><a href="voronoi_basic_tutorial.htm">Voronoi Basic Tutorial</a></li>
  61. <li><a href="voronoi_advanced_tutorial.htm">Voronoi Advanced
  62. Tutorial</a></li>
  63. </ul>
  64. </div>
  65. <h3 class="navbar">Polygon Sponsor</h3>
  66. <div style="padding: 5px;" align="center"> <img src="images/intlogo.gif" border="0" height="51" width="127" /><a title="www.adobe.com home page" href="http://www.adobe.com/" tabindex="2" style="border: medium none ;"> </a> </div>
  67. </td>
  68. <td style="padding-left: 10px; padding-right: 10px; padding-bottom: 10px;" valign="top" width="100%">
  69. <!-- End Header --><br />
  70. <p>
  71. </p>
  72. <h1>Polygon 90 Set Concept</h1>
  73. <p> </p>
  74. <p>The polygon_90_set concept tag is <font face="Courier New">
  75. polygon_90_set_concept</font></p>
  76. <p> <font face="Times New Roman">The semantic of a
  77. polygon_90_set is zero or more Manhattan geometry regions.</font></p>
  78. <p> <font face="Times New Roman">The motivation for providing
  79. the polygon_90_set_concept is that it is a very common special case of
  80. planar geometry which afford the implementation of a variety of
  81. optimizations on the general planar geometry algorithms.&nbsp;
  82. Manhattan geometry processing by the polygon_90_set_concept can be 100X
  83. faster than arbitrary angle polygon manipulation.&nbsp; Because the
  84. performance benefits are so large and the special case is important
  85. enough, the library provides these performance benefits for those
  86. application domains that require them.</font></p>
  87. <p>Users are recommended to use std::vector and std::list of user
  88. defined polygons or library provided
  89. polygon_90_set_data&lt;coordinate_type&gt; objects.&nbsp; Lists and
  90. vectors of models of polygon_90_concept or
  91. polygon_90_with_holes_concept or rectangle_concept are automatically
  92. models of polygon_90_set_concept.</p>
  93. <h2>Operators</h2>
  94. <p>The return type of some operators is the <font face="Courier New">polygon_90_set_view</font> operator template
  95. type.&nbsp; This type is itself a model of the polygon_90_set concept,
  96. but furthermore can be used as an argument to the <font face="Courier New">polygon_90_set_data</font> constructor and
  97. assignment operator.&nbsp; The operator template exists to eliminate
  98. temp copies of intermediate results when Boolean operators are chained
  99. together.</p>
  100. <p>Operators are declared inside the namespace <font face="Courier New">boost::polygon::operators</font>.</p>
  101. <table id="table3" border="1" width="100%">
  102. <tbody>
  103. <tr>
  104. <td width="586"><font face="Courier New">template
  105. &lt;typename T1, typename T2&gt;<br />
  106. polygon_90_set_view <b>operator</b>|(const T1&amp; l, const T2&amp; r)</font></td>
  107. <td>Boolean OR operation (polygon set union).&nbsp; Accepts
  108. two objects that model polygon_90_set or one of its refinements.&nbsp;
  109. Returns an operator template that performs the operation on demand when
  110. chained or or nested in a library function call such as assign().&nbsp;
  111. O( n log n) runtime complexity and O(n) memory wrt vertices +
  112. intersections.</td>
  113. </tr>
  114. <tr>
  115. <td width="586"><font face="Courier New">template
  116. &lt;typename T1, typename T2&gt;<br />
  117. polygon_90_set_view <b>operator</b>+(const T1&amp; l, const T2&amp; r)</font></td>
  118. <td>Same as operator|.&nbsp; The plus sign is also used for
  119. OR operations in Boolean logic expressions.&nbsp; O( n log n) runtime
  120. complexity and O(n) memory wrt vertices + intersections.</td>
  121. </tr>
  122. <tr>
  123. <td width="586"><font face="Courier New">template
  124. &lt;typename T1, typename T2&gt;<br />
  125. polygon_90_set_view <b>operator</b>&amp;(const T1&amp; l, const
  126. T2&amp; r)</font></td>
  127. <td>Boolean AND operation (polygon set intersection).&nbsp;
  128. Accepts two objects that model polygon_90_set or one of its
  129. refinements.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  130. vertices + intersections.</td>
  131. </tr>
  132. <tr>
  133. <td width="586"><font face="Courier New">template
  134. &lt;typename T1, typename T2&gt;<br />
  135. polygon_90_set_view <b>operator</b>*(const T1&amp; l, const T2&amp; r)</font></td>
  136. <td>Same as operator&amp;.&nbsp; The multiplication symbol
  137. is also used for AND operations in Boolean logic expressions.&nbsp; O(
  138. n log n) runtime complexity and O(n) memory wrt vertices +
  139. intersections.</td>
  140. </tr>
  141. <tr>
  142. <td width="586"><font face="Courier New">template
  143. &lt;typename T1, typename T2&gt;<br />
  144. polygon_90_set_view <b>operator</b>^(const T1&amp; l, const T2&amp; r)</font></td>
  145. <td>Boolean XOR operation (polygon set
  146. disjoint-union).&nbsp; Accepts two objects that model polygon_90_set or
  147. one of its refinements.&nbsp; O( n log n) runtime complexity and O(n)
  148. memory wrt vertices + intersections.&nbsp; O( n log n) runtime
  149. complexity and O(n) memory wrt vertices + intersections.</td>
  150. </tr>
  151. <tr>
  152. <td width="586"><font face="Courier New">template
  153. &lt;typename T1, typename T2&gt;<br />
  154. polygon_90_set_view <b>operator</b>-(const T1&amp; l, const T2&amp; r)</font></td>
  155. <td>Boolean SUBTRACT operation (polygon set
  156. difference).&nbsp; Accepts two objects that model polygon_90_set or one
  157. of its refinements.&nbsp; O( n log n) runtime complexity and O(n)
  158. memory wrt vertices + intersections.</td>
  159. </tr>
  160. <tr>
  161. <td width="586"><font face="Courier New">template
  162. &lt;typename T1, typename T2&gt;<br />
  163. T1&amp; <b>operator</b>|=(const T1&amp; l, const T2&amp; r)</font></td>
  164. <td>Same as operator|, but with self assignment, left
  165. operand must model polygon_90_set and not one of it's
  166. refinements.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  167. vertices + intersections.</td>
  168. </tr>
  169. <tr>
  170. <td width="586"><font face="Courier New">template
  171. &lt;typename T1, typename T2&gt;<br />
  172. T1&amp; <b>operator</b>+=(T1&amp; l, const T2&amp; r)</font></td>
  173. <td>Same as operator+, but with self assignment, left
  174. operand must model polygon_90_set and not one of it's
  175. refinements.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  176. vertices + intersections.</td>
  177. </tr>
  178. <tr>
  179. <td width="586"><font face="Courier New">template
  180. &lt;typename T1, typename T2&gt;<br />
  181. T1&amp; <b>operator</b>&amp;=(const T1&amp; l, const T2&amp; r)</font></td>
  182. <td>Same as operator&amp;, but with self assignment, left
  183. operand must model polygon_90_set and not one of it's
  184. refinements.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  185. vertices + intersections.</td>
  186. </tr>
  187. <tr>
  188. <td width="586"><font face="Courier New">template
  189. &lt;typename T1, typename T2&gt;<br />
  190. T1&amp; <b>operator</b>*=(T1&amp; l, const T2&amp; r)</font></td>
  191. <td>Same as operator*, but with self assignment, left
  192. operand must model polygon_90_set and not one of it's
  193. refinements.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  194. vertices + intersections.</td>
  195. </tr>
  196. <tr>
  197. <td width="586"><font face="Courier New">template
  198. &lt;typename T1, typename T2&gt;<br />
  199. T1&amp; <b>operator</b>^=(const T1&amp; l, const T2&amp; r)</font></td>
  200. <td>Same as operator^, but with self assignment, left
  201. operand must model polygon_90_set and not one of it's
  202. refinements.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  203. vertices + intersections.</td>
  204. </tr>
  205. <tr>
  206. <td width="586"><font face="Courier New">template
  207. &lt;typename T1, typename T2&gt;<br />
  208. T1&amp; <b>operator</b>-=(T1&amp; l, const T2&amp; r)</font></td>
  209. <td>Same as operator-, but with self assignment, left
  210. operand must model polygon_90_set and not one of it's
  211. refinements.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  212. vertices + intersections.</td>
  213. </tr>
  214. <tr>
  215. <td width="586"><font face="Courier New">template
  216. &lt;typename T1&gt;<br />
  217. T1 <b>operator</b>+(const T1&amp;, coordinate_type bloating)</font></td>
  218. <td>Performs resize operation, inflating by bloating
  219. ammount.&nbsp; If negative the result is a shrink instead of
  220. bloat.&nbsp; Note: returns result by value.&nbsp; O( n log n) runtime
  221. complexity and O(n) memory wrt vertices + intersections.</td>
  222. </tr>
  223. <tr>
  224. <td width="586"><font face="Courier New">template
  225. &lt;typename T1, typename T2&gt;<br />
  226. T1 <b>operator</b>-(const T1&amp;, coordinate_type shrinking)</font></td>
  227. <td>Performs resize operation, deflating by bloating
  228. ammount.&nbsp; If negative the result is a bloat instead of
  229. shrink.&nbsp; Note: returns result by value.&nbsp; O( n log n) runtime
  230. complexity and O(n) memory wrt vertices + intersections.</td>
  231. </tr>
  232. <tr>
  233. <td width="586"><font face="Courier New">template
  234. &lt;typename T1, typename T2&gt;<br />
  235. T1&amp; <b>operator</b>+=(const T1&amp;, coordinate_type bloating)</font></td>
  236. <td>Performs resize operation, inflating by bloating
  237. ammount.&nbsp; If negative the result is a shrink instead of
  238. bloat.&nbsp; Returns reference to modified argument.&nbsp; O( n log n)
  239. runtime complexity and O(n) memory wrt vertices + intersections.</td>
  240. </tr>
  241. <tr>
  242. <td width="586"><font face="Courier New">template
  243. &lt;typename T1, typename T2&gt;<br />
  244. T1&amp; <b>operator</b>-=(const T1&amp;, coordinate_type shrinking)</font></td>
  245. <td>Performs resize operation, deflating by bloating
  246. ammount.&nbsp; If negative the result is a bloat instead of
  247. shrink.&nbsp; Returns reference to modified argument.&nbsp; O( n log n)
  248. runtime complexity and O(n) memory wrt vertices + intersections.</td>
  249. </tr>
  250. </tbody>
  251. </table>
  252. <h2>Functions</h2>
  253. <table id="table1" border="1" width="100%">
  254. <tbody>
  255. <tr>
  256. <td width="586"><font face="Courier New">template
  257. &lt;typename T1, typename T2&gt;<br />
  258. T1&amp; <b>assign</b>(T1&amp; lvalue, const T2&amp; rvalue)</font></td>
  259. <td>Eliminates overlaps in geometry and copies from an
  260. object that models polygon_90_set or any of its refinements into an
  261. object that models polygon_90_set.&nbsp; O( n log n) runtime complexity
  262. and O(n) memory wrt vertices + intersections.</td>
  263. </tr>
  264. <tr>
  265. <td width="586"><font face="Courier New">template
  266. &lt;typename T1, typename T2&gt;<br />
  267. bool <b>equivalence</b>(const T1&amp; lvalue, const T2&amp; rvalue) </font></td>
  268. <td>Returns true if an object that models polygon_90_set or
  269. one of its refinements covers the exact same geometric regions as
  270. another object that models polygon_90_set or one of its
  271. refinements.&nbsp; For example: two of polygon_90 objects.&nbsp; O( n
  272. log n) runtime complexity and O(n) memory wrt vertices + intersections.</td>
  273. </tr>
  274. <tr>
  275. <td width="586"><font face="Courier New">template
  276. &lt;typename output_container_type, typename T&gt;<br />
  277. void <b>get_rectangles</b>(output_container_type&amp; output, <br />
  278. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  279. const T&amp; polygon_set)</font></td>
  280. <td>Output container is expected to be a standard
  281. container.&nbsp; Slices geometry of an object that models
  282. polygon_90_set or one of its refinements into non overlapping
  283. rectangles and appends them to the output.&nbsp; O( n log n) runtime
  284. complexity and O(n) memory wrt vertices + intersections. </td>
  285. </tr>
  286. <tr>
  287. <td width="586"><font face="Courier New">template
  288. &lt;typename output_container_type, typename T&gt;<br />
  289. void <b>get_max_rectangles</b>(output_container_type&amp; output, <br />
  290. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  291. const T&amp; polygon_set)</font></td>
  292. <td>Output container is expected to be a standard
  293. container.&nbsp; Given an object that models polygon_90_set or one of
  294. its refinements finds all overlapping rectangles that are maximal in
  295. area and appends them to the output.&nbsp; Expected n log n runtime,
  296. worst case quadratic rutnime.</td>
  297. </tr>
  298. <tr>
  299. <td width="586"><font face="Courier New">template
  300. &lt;typename polygon_set_type&gt;<br />
  301. void <b>clear</b>(polygon_set_type&amp; polygon_set)</font></td>
  302. <td>Makes the object empty of geometry.</td>
  303. </tr>
  304. <tr>
  305. <td width="586"><font face="Courier New">template
  306. &lt;typename polygon_set_type&gt;<br />
  307. bool <b>empty</b>(const polygon_set_type&amp; polygon_set)</font></td>
  308. <td>Checks whether the object is empty of geometry.&nbsp;
  309. Polygons that are completely covered by holes will result in empty
  310. returning true.&nbsp; O( n log n) runtime complexity and O(n) memory
  311. wrt vertices + intersections. </td>
  312. </tr>
  313. <tr>
  314. <td width="586"><font face="Courier New">template
  315. &lt;typename T, typename rectangle_type&gt;<br />
  316. bool <b>extents</b>(rectangle_type&amp; extents_rectangle, <br />
  317. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  318. const T&amp; polygon_set)</font></td>
  319. <td>Computes bounding box of an object that models
  320. polygon_90_set and stores it in an object that models rectangle.&nbsp;
  321. If the polygon set is empty returns false.&nbsp; If there are holes
  322. outside of shells they do not contribute to the extents of the polygon
  323. set.&nbsp; O( n log n) runtime complexity and O(n) memory wrt vertices
  324. + intersections. </td>
  325. </tr>
  326. <tr>
  327. <td width="586"><font face="Courier New">template
  328. &lt;typename T&gt;<br />
  329. manhattan_area_type <b>area</b>(const T&amp; polygon_set)</font></td>
  330. <td>Computes the area covered by geometry in an object that
  331. models polygon_90_set.&nbsp; O( n log n) runtime complexity and O(n)
  332. memory wrt vertices + intersections. </td>
  333. </tr>
  334. <tr>
  335. <td width="586"><font face="Courier New">template
  336. &lt;typename T1, typename T2&gt;<br />
  337. T1&amp; <b>interact</b>(T1&amp; a, const T2&amp; b)</font></td>
  338. <td>Given an object that models polygon_90_set and an
  339. object that models polygon_90_set or one of its refinements, modifies a
  340. to retain only regions that overlap or touch regions in b.&nbsp; O( n
  341. log n) runtime complexity and O(n) memory wrt vertices + intersections.
  342. </td>
  343. </tr>
  344. <tr>
  345. <td width="586"><font face="Courier New">template
  346. &lt;typename T&gt;<br />
  347. T&amp; <b>self_intersect</b>(T&amp; polygon_set)</font></td>
  348. <td>Given an object that models polygon_90_set that has
  349. self overlapping regions, modifies the argument to contain only the
  350. regions of overlap.&nbsp; O( n log n) runtime complexity and O(n)
  351. memory wrt vertices + intersections. </td>
  352. </tr>
  353. <tr>
  354. <td width="586"><font face="Courier New">template
  355. &lt;typename T&gt;<br />
  356. T&amp; <b>self_xor</b>(T&amp; polygon_set)</font></td>
  357. <td>Given an object that models polygon_90_set that has
  358. self overlapping regions, modifies the argument to contain only the
  359. regions that do not overlap.&nbsp; O( n log n) runtime complexity and
  360. O(n) memory wrt vertices + intersections. </td>
  361. </tr>
  362. <tr>
  363. <td width="586"><font face="Courier New">template
  364. &lt;typename T&gt;<br />
  365. T&amp; <b>bloat</b>(T&amp; polygon_set, unsigned_area_type bloating)</font></td>
  366. <td>Same as getting all the rectangles, bloating them and
  367. putting them back.&nbsp; O( n log n) runtime complexity and O(n) memory
  368. wrt vertices + intersections. </td>
  369. </tr>
  370. <tr>
  371. <td width="586"><font face="Courier New">template
  372. &lt;typename T&gt;<br />
  373. T&amp; <b>bloat</b>(T&amp; polygon_set, orientation_2d orient,<br />
  374. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  375. bloating)</font></td>
  376. <td>Same as getting all the rectangles, bloating them and
  377. putting them back.&nbsp; O( n log n) runtime complexity and O(n) memory
  378. wrt vertices + intersections. </td>
  379. </tr>
  380. <tr>
  381. <td width="586"><font face="Courier New">template
  382. &lt;typename T&gt;<br />
  383. T&amp; <b>bloat</b>(T&amp; polygon_set, orientation_2d orient,<br />
  384. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  385. low_bloating,<br />
  386. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  387. high_bloating)</font></td>
  388. <td>Same as getting all the rectangles, bloating them and
  389. putting them back.&nbsp; O( n log n) runtime complexity and O(n) memory
  390. wrt vertices + intersections. </td>
  391. </tr>
  392. <tr>
  393. <td width="586"><font face="Courier New">template
  394. &lt;typename T&gt;<br />
  395. T&amp; <b>bloat</b>(T&amp; polygon_set, direction_2d dir,<br />
  396. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  397. bloating)</font></td>
  398. <td>Same as getting all the rectangles, bloating them and
  399. putting them back.&nbsp; O( n log n) runtime complexity and O(n) memory
  400. wrt vertices + intersections. </td>
  401. </tr>
  402. <tr>
  403. <td width="586"><font face="Courier New">template
  404. &lt;typename T&gt;<br />
  405. T&amp; <b>bloat</b>(T&amp; polygon_set, <br />
  406. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  407. west_bloating,<br />
  408. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  409. east_bloating,<br />
  410. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  411. south_bloating,<br />
  412. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  413. north_bloating)</font></td>
  414. <td>Same as getting all the rectangles, bloating them and
  415. putting them back.&nbsp; O( n log n) runtime complexity and O(n) memory
  416. wrt vertices + intersections. </td>
  417. </tr>
  418. <tr>
  419. <td width="586"><font face="Courier New">template
  420. &lt;typename T&gt;<br />
  421. T&amp; <b>shrink</b>(T&amp; polygon_set, unsigned_area_type shrinking)</font></td>
  422. <td>Same as getting all the rectangles of the inverse,
  423. bloating them and overwriting the polygon set with the resulting
  424. regions then negating.&nbsp; O( n log n) runtime complexity and O(n)
  425. memory wrt vertices + intersections. </td>
  426. </tr>
  427. <tr>
  428. <td width="586"><font face="Courier New">template
  429. &lt;typename T&gt;<br />
  430. T&amp; <b>shrink</b>(T&amp; polygon_set, orientation_2d orient,<br />
  431. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  432. unsigned_area_type shrinking)</font></td>
  433. <td>Same as getting all the rectangles of the inverse,
  434. bloating them and overwriting the polygon set with the resulting
  435. regions then negating.&nbsp; O( n log n) runtime complexity and O(n)
  436. memory wrt vertices + intersections. </td>
  437. </tr>
  438. <tr>
  439. <td width="586"><font face="Courier New">template
  440. &lt;typename T&gt;<br />
  441. T&amp; <b>shrink</b>(T&amp; polygon_set, orientation_2d orient,<br />
  442. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  443. unsigned_area_type low_shrinking,<br />
  444. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  445. unsigned_area_type high_shrinking)</font></td>
  446. <td>Same as getting all the rectangles of the inverse,
  447. bloating them and overwriting the polygon set with the resulting
  448. regions then negating.&nbsp; O( n log n) runtime complexity and O(n)
  449. memory wrt vertices + intersections. </td>
  450. </tr>
  451. <tr>
  452. <td width="586"><font face="Courier New">template
  453. &lt;typename T&gt;<br />
  454. T&amp; <b>shrink</b>(T&amp; polygon_set, direction_2d dir,<br />
  455. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  456. unsigned_area_type shrinking)</font></td>
  457. <td>Same as getting all the rectangles of the inverse,
  458. bloating them and overwriting the polygon set with the resulting
  459. regions then negating.&nbsp; O( n log n) runtime complexity and O(n)
  460. memory wrt vertices + intersections. </td>
  461. </tr>
  462. <tr>
  463. <td width="586"><font face="Courier New">template
  464. &lt;typename T&gt;<br />
  465. T&amp; <b>shrink</b>(T&amp; polygon_set, <br />
  466. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  467. unsigned_area_type west_shrinking,<br />
  468. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  469. unsigned_area_type east_shrinking,<br />
  470. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  471. unsigned_area_type south_shrinking,<br />
  472. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  473. unsigned_area_type north_shrinking)</font></td>
  474. <td>Same as getting all the rectangles of the inverse,
  475. bloating them and overwriting the polygon set with the resulting
  476. regions then negating.&nbsp; O( n log n) runtime complexity and O(n)
  477. memory wrt vertices + intersections. </td>
  478. </tr>
  479. <tr>
  480. <td width="586"><font face="Courier New">template
  481. &lt;typename T, typename coord_type&gt;<br />
  482. T&amp; <b>resize</b>(T&amp; polygon_set, coord_type resizing)</font></td>
  483. <td>Same as bloat if resizing is positive, same as shrink
  484. if resizing is negative.</td>
  485. </tr>
  486. <tr>
  487. <td width="586"><font face="Courier New">template
  488. &lt;typename T, typename coord_type&gt;<br />
  489. T&amp; <b>resize</b>(polygon_set_type&amp; polygon_set, <br />
  490. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coord_type west,
  491. coord_type east, <br />
  492. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coord_type
  493. south, coord_type north)</font></td>
  494. <td>Same as bloat if resizing is positive, same as shrink
  495. if resizing is negative.&nbsp; O( n log n) runtime complexity and O(n)
  496. memory wrt vertices + intersections. </td>
  497. </tr>
  498. <tr>
  499. <td width="586"><font face="Courier New">template
  500. &lt;typename T&gt;<br />
  501. T&amp; <b>grow_and</b>(T&amp; polygon_set, unsigned_area_type bloating)</font></td>
  502. <td>Same as bloating non-overlapping regions and then
  503. applying self intersect to retain only the overlaps introduced by the
  504. bloat.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  505. vertices + intersections. </td>
  506. </tr>
  507. <tr>
  508. <td width="586"><font face="Courier New">template
  509. &lt;typename T&gt;<br />
  510. T&amp; <b>grow_and</b>(T&amp; polygon_set, orientation_2d orient,<br />
  511. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  512. unsigned_area_type bloating)</font></td>
  513. <td>Same as bloating non-overlapping regions and then
  514. applying self intersect to retain only the overlaps introduced by the
  515. bloat.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  516. vertices + intersections. </td>
  517. </tr>
  518. <tr>
  519. <td width="586"><font face="Courier New">template
  520. &lt;typename T&gt;<br />
  521. T&amp; <b>grow_and</b>(T&amp; polygon_set, orientation_2d orient,<br />
  522. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  523. unsigned_area_type low_bloating,<br />
  524. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  525. unsigned_area_type high_bloating)</font></td>
  526. <td>Same as bloating non-overlapping regions and then
  527. applying self intersect to retain only the overlaps introduced by the
  528. bloat.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  529. vertices + intersections. </td>
  530. </tr>
  531. <tr>
  532. <td width="586"><font face="Courier New">template
  533. &lt;typename T&gt;<br />
  534. T&amp; <b>grow_and</b>(T&amp; polygon_set, direction_2d dir,<br />
  535. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  536. unsigned_area_type bloating)</font></td>
  537. <td>Same as bloating non-overlapping regions and then
  538. applying self intersect to retain only the overlaps introduced by the
  539. bloat.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  540. vertices + intersections. </td>
  541. </tr>
  542. <tr>
  543. <td width="586"><font face="Courier New">template
  544. &lt;typename T&gt;<br />
  545. T&amp; <b>grow_and</b>(T&amp; polygon_set, <br />
  546. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  547. unsigned_area_type west_bloating,<br />
  548. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  549. unsigned_area_type east_bloating,<br />
  550. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  551. unsigned_area_type south_bloating,<br />
  552. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  553. unsigned_area_type north_bloating)</font></td>
  554. <td>Same as bloating non-overlapping regions and then
  555. applying self intersect to retain only the overlaps introduced by the
  556. bloat.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  557. vertices + intersections. </td>
  558. </tr>
  559. <tr>
  560. <td width="586"><font face="Courier New">template
  561. &lt;typename T&gt;<br />
  562. T&amp; <b>scale_up</b>(T&amp; polygon_set, unsigned_area_type factor)</font></td>
  563. <td>Scales geometry up by unsigned factor.&nbsp; O( n log
  564. n) runtime complexity and O(n) memory wrt vertices + intersections. </td>
  565. </tr>
  566. <tr>
  567. <td width="586"><font face="Courier New">template
  568. &lt;typename T&gt;<br />
  569. T&amp; <b>scale_down</b>(T&amp; polygon_set, unsigned_area_type factor)</font></td>
  570. <td>Scales geometry down by unsigned factor.&nbsp; O( n log
  571. n) runtime complexity and O(n) memory wrt vertices + intersections. </td>
  572. </tr>
  573. <tr>
  574. <td width="586"><font face="Courier New">template
  575. &lt;typename T, typename scaling_type&gt;<br />
  576. T&amp; <b>scale</b>(polygon_set_type&amp; polygon_set, <br />
  577. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const
  578. scaling_type&amp; scaling)</font></td>
  579. <td>Scales geometry by applying scaling.scale() on all
  580. vertices.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  581. vertices + intersections. </td>
  582. </tr>
  583. <tr>
  584. <td width="586"><font face="Courier New">template
  585. &lt;typename T, typename coord_type&gt;<br />
  586. T&amp; <b>move</b>(T&amp; polygon_set,<br />
  587. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; orientation_2d orient,
  588. coord_type displacement)</font></td>
  589. <td>Moves geometry by displacement amount in the
  590. orientation.&nbsp;&nbsp;&nbsp; O( n log n) runtime complexity and O(n)
  591. memory wrt vertices + intersections. </td>
  592. </tr>
  593. <tr>
  594. <td width="586"><font face="Courier New">template
  595. &lt;typename T, typename coord_type&gt;<br />
  596. T&amp; <b>move</b>(T&amp; polygon_set, coord_type x_displacement, <br />
  597. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coord_type y_displacement)</font></td>
  598. <td>Moves the geometry by x_dispacement in x and
  599. y_displacement in y.&nbsp; Note: for consistency should be
  600. convolve(polygon_set, point).&nbsp; O( n log n) runtime complexity and
  601. O(n) memory wrt vertices + intersections. </td>
  602. </tr>
  603. <tr>
  604. <td width="586"><font face="Courier New">template
  605. &lt;typename T, typename transformation_type&gt;<br />
  606. T&amp; <b>transform</b>(T&amp; polygon_set,<br />
  607. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  608. const transformation_type&amp; transformation)</font></td>
  609. <td>Applies transformation.transform() on all
  610. vertices.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  611. vertices + intersections. </td>
  612. </tr>
  613. <tr>
  614. <td width="586"><font face="Courier New">template
  615. &lt;typename T&gt;<br />
  616. T&amp; <b>keep</b>(T&amp; polygon_set, <br />
  617. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type min_area,<br />
  618. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type max_area,<br />
  619. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type min_width,<br />
  620. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type max_width,<br />
  621. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  622. min_height,<br />
  623. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unsigned_area_type
  624. max_height)</font></td>
  625. <td>Retains only regions that satisfy the min/max criteria
  626. in the argument list.&nbsp; Note: useful for visualization to cull too
  627. small polygons.&nbsp; O( n log n) runtime complexity and O(n) memory
  628. wrt vertices + intersections. </td>
  629. </tr>
  630. </tbody>
  631. </table>
  632. <h1>Polygon 90 Set Data Object</h1>
  633. <p> </p>
  634. <p>The polygon 90 set data type encapsulates the internal data
  635. format that serves as the input to the sweep-line algorithm that
  636. implements polygon-clipping boolean operations.&nbsp; It also
  637. internally keeps track of whether that data has been sorted or scanned
  638. and maintains the invariant that when its flags indicate that the data
  639. is sorted or scanned the data has not been changed to violate that
  640. assumption.&nbsp; Using the Polygon 90 Set Data type directly can be
  641. more efficient than using lists and vectors of polygons in the
  642. functions above because of the invariants it can enforce which provide
  643. the opportunity to maintain the data is sorted form rather than going
  644. all the way out to polygons then resorting those vertices for a
  645. subsequent operation.</p>
  646. <p>The declaration of Polygon 90 Set Data is the following:</p>
  647. <p><font face="Courier New">template &lt;typename T&gt;<br />
  648. class polygon_90_set_data;</font></p>
  649. <p>The class is parameterized on the coordinate data type.&nbsp;
  650. Algorithms that benefit from knowledge of the invariants enforced by
  651. the class are implemented as member functions to provide them access to
  652. information about those invariants.&nbsp; </p>
  653. <h2>Member Functions</h2>
  654. <table id="table2" border="1" width="100%">
  655. <tbody>
  656. <tr>
  657. <td width="586"><font face="Courier New"><b>polygon_90_set_data</b>()</font></td>
  658. <td>Default constructor.&nbsp; Scanning orientation
  659. defaults to HORIZONTAL</td>
  660. </tr>
  661. <tr>
  662. <td width="586"><font face="Courier New"><b>polygon_90_set_data</b>(orientation_2d
  663. orient)</font></td>
  664. <td>Construct with scanning orientation.</td>
  665. </tr>
  666. <tr>
  667. <td width="586"><font face="Courier New">template
  668. &lt;typename iT&gt;<br />
  669. <b>polygon_90_set_data</b>(orientation_2d orient, <br />
  670. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  671. iT input_begin, iT input_end)</font></td>
  672. <td>Construct with scanning orientation from an iterator
  673. range of insertable objects.</td>
  674. </tr>
  675. <tr>
  676. <td width="586"><font face="Courier New"> <b>polygon_90_set_data</b>(const
  677. polygon_90_set_data&amp; that)</font></td>
  678. <td>Copy construct.</td>
  679. </tr>
  680. <tr>
  681. <td width="586"><font face="Courier New">template
  682. &lt;typename l, typename r, typename op&gt;<br />
  683. <b>polygon_90_set_data</b>(const
  684. polygon_90_set_view&lt;l,r,op&gt;&amp; t)</font></td>
  685. <td>Copy construct from a Boolean operator template.</td>
  686. </tr>
  687. <tr>
  688. <td width="586"><font face="Courier New">
  689. <b>polygon_90_set_data</b>(orientation_2d orient, <br />
  690. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  691. const polygon_90_set_data&amp; that)</font></td>
  692. <td>Construct with scanning orientation and copy from
  693. another polygon set.</td>
  694. </tr>
  695. <tr>
  696. <td width="586"><font face="Courier New">polygon_90_set_data&amp;
  697. <br />
  698. <b>operator=</b>(const polygon_90_set_data&amp; that)</font></td>
  699. <td>Assignment from another polygon set, may change
  700. scanning orientation.</td>
  701. </tr>
  702. <tr>
  703. <td width="586"><font face="Courier New">template
  704. &lt;typename l, typename r, typename op&gt;<br />
  705. polygon_90_set_data&amp; <br />
  706. <b>operator=</b>(const polygon_90_set_view&lt;l, r,
  707. op&gt;&amp; that)</font></td>
  708. <td>Assignment from a Boolean operator template.</td>
  709. </tr>
  710. <tr>
  711. <td width="586"><font face="Courier New">template
  712. &lt;typename geometry_object&gt;<br />
  713. polygon_90_set_data&amp; <b>operator=</b>(const geometry_object&amp;
  714. geo)</font></td>
  715. <td>Assignment from an insertable object.</td>
  716. </tr>
  717. <tr>
  718. <td width="586"><font face="Courier New">
  719. template &lt;typename iT&gt;<br />
  720. void <b>insert</b>(iT input_begin, iT input_end)</font></td>
  721. <td>Insert objects of an iterator range.&nbsp; Linear wrt.
  722. inserted vertices.</td>
  723. </tr>
  724. <tr>
  725. <td width="586"><font face="Courier New">
  726. void <b>insert</b>(const polygon_90_set_data&amp; polygon_set)</font></td>
  727. <td>Insert a polygon set.&nbsp; Linear wrt. inserted
  728. vertices.</td>
  729. </tr>
  730. <tr>
  731. <td width="586"><font face="Courier New">
  732. template &lt;typename geometry_type&gt;<br />
  733. void <b>insert</b>(const geometry_type&amp; geometry_object, <br />
  734. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool
  735. is_hole = false)</font></td>
  736. <td>Insert a geometry object, if is_hole is true then the
  737. inserted region is subtractive rather than additive.&nbsp; Linear wrt.
  738. inserted vertices.</td>
  739. </tr>
  740. <tr>
  741. <td width="586"><font face="Courier New">template
  742. &lt;typename output_container&gt;<br />
  743. void <b>get</b>(output_container&amp; output) const</font></td>
  744. <td>Expects a standard container of geometry objects.&nbsp;
  745. Will scan and eliminate overlaps.&nbsp; Converts polygon set geometry
  746. to objects of that type and appends them to the container.&nbsp;
  747. Polygons will be output with counterclockwise winding, hole polygons
  748. will be output with clockwise winding.&nbsp; The last vertex of an
  749. output polygon is not the duplicate of the first, and the number of
  750. points is equal to the number of edges.&nbsp; O( n log n) runtime
  751. complexity and O(n) memory wrt vertices + intersections.</td>
  752. </tr>
  753. <tr>
  754. <td style="vertical-align: top;"><font face="Courier New">template
  755. &lt;typename output_container&gt;<br />
  756. void <b>get</b>(output_container&amp; output, size_t k) const</font></td>
  757. <td style="vertical-align: top;">Expects a standard
  758. container of geometry objects.&nbsp; Will scan and eliminate
  759. overlaps.&nbsp; Converts polygon set geometry to objects of that type
  760. and appends them to the container.&nbsp; The resulting polygons will
  761. have at most k vertices. For Manhattan data k should be at least 4 .
  762. Polygons will be output with counterclockwise winding, hole polygons
  763. will be output with clockwise winding.&nbsp; The last vertex of an
  764. output polygon is not the duplicate of the first, and the number of
  765. points is equal to the number of edges.&nbsp; O( n log n) runtime
  766. complexity and O(n) memory wrt vertices + intersections.<br />
  767. </td>
  768. </tr>
  769. <tr>
  770. <td width="586"><font face="Courier New">template
  771. &lt;typename output_container&gt;<br />
  772. void <b>get_polygons</b>(output_container&amp; output) const</font></td>
  773. <td>Expects a standard container of polygon objects.&nbsp;
  774. Will scan and eliminate overlaps.&nbsp; Converts polygon set geometry
  775. to polygons and appends them to the container.&nbsp; Polygons will have
  776. holes fractured out to the outer boundary along the positive direction
  777. of the scanline orientation of the polygon set.&nbsp; O( n log n)
  778. runtime complexity and O(n) memory wrt vertices + intersections.</td>
  779. </tr>
  780. <tr>
  781. <td width="586"><font face="Courier New">template
  782. &lt;typename output_container&gt;<br />
  783. void <b>get_rectangles</b>(output_container&amp; output) const</font></td>
  784. <td>Expects a standard container of rectangle
  785. objects.&nbsp; Will scan and eliminate overlaps.&nbsp; Slices polygon
  786. set geometry to rectangles along the scanning orientation and appends
  787. them to the container.&nbsp; O( n log n) runtime complexity and O(n)
  788. memory wrt vertices + intersections.</td>
  789. </tr>
  790. <tr>
  791. <td width="586"><font face="Courier New">
  792. template &lt;typename output_container&gt;<br />
  793. void <b>get_rectangles</b>(output_container&amp; output, <br />
  794. &nbsp; orientation_2d slicing_orientation) const </font> </td>
  795. <td>Expects a standard container of rectangle
  796. objects.&nbsp; Will scan and eliminate overlaps.&nbsp; Slices polygon
  797. set geometry to rectangles along the given orientation and appends them
  798. to the container.&nbsp; O( n log n) runtime complexity and O(n) memory
  799. wrt vertices + intersections.</td>
  800. </tr>
  801. <tr>
  802. <td width="586"><font face="Courier New">
  803. bool <b>operator==</b>(const polygon_90_set_data&amp; p) const</font></td>
  804. <td>Once scanned the data representation of geometry within
  805. a polygon set is in a mathematically canonical form.&nbsp; Comparison
  806. between two sets is therefore a linear time operation once they are in
  807. the scanned state. Will scan and eliminate overlaps in both polygon
  808. sets.&nbsp; O( n log n) runtime complexity and O(n) memory wrt vertices
  809. + intersections the first time, linear subsequently.</td>
  810. </tr>
  811. <tr>
  812. <td width="586"><font face="Courier New">bool <b>operator!=</b>(const
  813. polygon_90_set_data&amp; p) const</font></td>
  814. <td>Inverse logic of equivalence operator.</td>
  815. </tr>
  816. <tr>
  817. <td width="586"><font face="Courier New">void <b>clear</b>()</font></td>
  818. <td>Make the polygon set empty.&nbsp; Note: does not
  819. de-allocate memory.&nbsp; Use shrink to fit idiom and assign default
  820. constructed polygon set to de-allocate.</td>
  821. </tr>
  822. <tr>
  823. <td width="586"><font face="Courier New">bool <b>empty</b>()
  824. const </font> </td>
  825. <td>Check whether the polygon set contains no
  826. geometry.&nbsp; Will scan and eliminate overlaps because subtractive
  827. regions might make the polygon set empty.&nbsp; O( n log n) runtime
  828. complexity and O(n) memory wrt vertices + intersections the first time,
  829. linear subsequently.</td>
  830. </tr>
  831. <tr>
  832. <td width="586"><font face="Courier New">orientation_2d <b>orient</b>()
  833. const</font></td>
  834. <td>Get the scanning orientation.&nbsp; Depending on the
  835. data it is sometimes more efficient to scan in a specific
  836. orientation.&nbsp; This is particularly true of Manhattan geometry
  837. data.&nbsp; Constant time.</td>
  838. </tr>
  839. <tr>
  840. <td width="586"><font face="Courier New">void <b>clean</b>()
  841. const</font></td>
  842. <td>Scan and eliminate overlaps.&nbsp; O( n log n) runtime
  843. complexity and O(n) memory wrt vertices + intersections the first time,
  844. constant time subsequently.</td>
  845. </tr>
  846. <tr>
  847. <td width="586"><font face="Courier New">template
  848. &lt;typename input_iterator_type&gt;<br />
  849. void <b>set</b>(input_iterator_type input_begin, <br />
  850. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; input_iterator_type
  851. input_end, <br />
  852. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; orientation_2d orient)
  853. </font> </td>
  854. <td>Overwrite geometry in polygon set with insertable
  855. objects in the iterator range.&nbsp; Also sets the scanning orientation
  856. to that specified.</td>
  857. </tr>
  858. <tr>
  859. <td width="586"><font face="Courier New">template
  860. &lt;typename rectangle_type&gt;<br />
  861. bool <b>extents</b>(rectangle_type&amp; extents_rectangle) const</font></td>
  862. <td>Given an object that models rectangle, scans and
  863. eliminates overlaps in the polygon set because subtractive regions may
  864. alter its extents then computes the bounding box and assigns it to
  865. extents_rectangle.&nbsp; O( n log n) runtime complexity and O(n) memory
  866. wrt vertices + intersections the first time, linear subsequently.</td>
  867. </tr>
  868. <tr>
  869. <td width="586"><font face="Courier New">polygon_90_set_data&amp;<br />
  870. <b>bloat</b>(unsigned_area_type west_bloating,<br />
  871. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  872. unsigned_area_type east_bloating,<br />
  873. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  874. unsigned_area_type south_bloating,<br />
  875. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  876. unsigned_area_type north_bloating) </font></td>
  877. <td>Scans to eliminate overlaps and subtractive
  878. regions.&nbsp; Inserts rectangles of width specified by bloating values
  879. to the indicated side of geometry within the polygon set and fills
  880. corners with rectangles of the length and width specified for the
  881. adjacent sides.&nbsp; O( n log n) runtime complexity and O(n) memory
  882. wrt vertices + intersections.</td>
  883. </tr>
  884. <tr>
  885. <td width="586"><font face="Courier New">polygon_90_set_data&amp;<br />
  886. <b>shrink</b>(unsigned_area_type west_shrinking,<br />
  887. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  888. unsigned_area_type east_shrinking,<br />
  889. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  890. unsigned_area_type south_shrinking,<br />
  891. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  892. unsigned_area_type north_shrinking)</font></td>
  893. <td>Scans to eliminate overlaps and subtractive
  894. regions.&nbsp; Inserts subtractiive rectangles of width specified by
  895. bloating values to the indicated side of geometry within the polygon
  896. set and subtractive rectangle at convex corners of the length and width
  897. specified for the adjacent sides.&nbsp; Scans to eliminate overlapping
  898. subtractive regions.&nbsp; O( n log n) runtime complexity and O(n)
  899. memory wrt vertices + intersections.</td>
  900. </tr>
  901. <tr>
  902. <td width="586"><font face="Courier New">polygon_90_set_data&amp;<br />
  903. <b>resize</b>(coordinate_type west, coordinate_type east, <br />
  904. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coordinate_type south,
  905. coordinate_type north)</font></td>
  906. <td>Call bloat or shrink or shrink then bloat depending on
  907. whether the resizing values are positive or negative.&nbsp; O( n log n)
  908. runtime complexity and O(n) memory wrt vertices + intersections.</td>
  909. </tr>
  910. <tr>
  911. <td width="586"><font face="Courier New">polygon_90_set_data&amp;
  912. <b>move</b>(coordinate_type x_delta, <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  913. coordinate_type y_delta) </font> </td>
  914. <td>Add x_delta to x values and y_delta to y values of
  915. vertices stored within the polygon set.&nbsp; Linear wrt. vertices.</td>
  916. </tr>
  917. <tr>
  918. <td width="586"><font face="Courier New">template
  919. &lt;typename transformation_type&gt;<br />
  920. polygon_90_set_data&amp; <br />
  921. <b>transform</b>(const transformation_type&amp;
  922. transformation) </font> </td>
  923. <td>Applies transformation.transform() on vertices stored
  924. within the polygon set.&nbsp; Linear wrt. vertices.</td>
  925. </tr>
  926. <tr>
  927. <td width="586"><font face="Courier New">polygon_90_set_data&amp;
  928. <b>scale_up</b>(unsigned_area_type factor)</font></td>
  929. <td>Scales vertices stored within the polygon set up by
  930. factor.&nbsp; Linear wrt. vertices.</td>
  931. </tr>
  932. <tr>
  933. <td width="586">
  934. <p><font face="Courier New">polygon_90_set_data&amp; <b>scale_down</b>(unsigned_area_type
  935. factor)</font>&nbsp;</p>
  936. </td>
  937. <td>Scales vertices stored within the polygon set down by
  938. factor.&nbsp; Linear wrt. vertices.</td>
  939. </tr>
  940. <tr>
  941. <td width="586"><font face="Courier New">template
  942. &lt;typename scaling_type&gt;<br />
  943. polygon_90_set_data&amp;<br />
  944. <b>scale</b>(const
  945. anisotropic_scale_factor&lt;scaling_type&gt;&amp; f)</font></td>
  946. <td>Scales vertices stored within the polygon set by
  947. applying f.scale().&nbsp; Linear wrt. vertices.</td>
  948. </tr>
  949. <tr>
  950. <td width="586"><font face="Courier New">polygon_90_set_data&amp;
  951. <b>scale</b>(double factor) </font></td>
  952. <td>Scales vertices stored within the polygon set by
  953. floating point factor.&nbsp; Linear wrt. vertices.</td>
  954. </tr>
  955. <tr>
  956. <td width="586"><font face="Courier New">polygon_90_set_data&amp;
  957. <b>self_xor</b>()</font></td>
  958. <td>Retain only non-overlapping regions of geometry within
  959. polygon set.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  960. vertices + intersections.</td>
  961. </tr>
  962. <tr>
  963. <td width="586"><font face="Courier New">polygon_90_set_data&amp;
  964. <b>self_intersect</b>()</font></td>
  965. <td>Retain only overlapping regions of geometry within a
  966. polygon set.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  967. vertices + intersections.</td>
  968. </tr>
  969. <tr>
  970. <td width="586"><font face="Courier New">polygon_90_set_data&amp;<br />
  971. <b>interact</b>(const polygon_90_set_data&amp; that)</font></td>
  972. <td>Retain only regions that touch or overlap regions in
  973. argument.&nbsp; O( n log n) runtime complexity and O(n) memory wrt
  974. vertices + intersections.</td>
  975. </tr>
  976. </tbody>
  977. </table>
  978. </td>
  979. </tr>
  980. <tr>
  981. <td style="background-color: rgb(238, 238, 238);" nowrap="1" valign="top"> &nbsp;</td>
  982. <td style="padding-left: 10px; padding-right: 10px; padding-bottom: 10px;" valign="top" width="100%">
  983. <table class="docinfo" id="table4" frame="void" rules="none">
  984. <colgroup> <col class="docinfo-name" /><col class="docinfo-content" /> </colgroup> <tbody valign="top">
  985. <tr>
  986. <th class="docinfo-name">Copyright:</th>
  987. <td>Copyright © Intel Corporation 2008-2010.</td>
  988. </tr>
  989. <tr class="field">
  990. <th class="docinfo-name">License:</th>
  991. <td class="field-body">Distributed under the Boost Software
  992. License, Version 1.0. (See accompanying file <tt class="literal"> <span class="pre">LICENSE_1_0.txt</span></tt> or copy at <a class="reference" target="_top" href="http://www.boost.org/LICENSE_1_0.txt">
  993. http://www.boost.org/LICENSE_1_0.txt</a>)</td>
  994. </tr>
  995. </tbody>
  996. </table>
  997. </td>
  998. </tr>
  999. </tbody>
  1000. </table>
  1001. </body></html>