Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78255 - in sandbox/gtl: boost/polygon doc
From: sydorchuk.andriy_at_[hidden]
Date: 2012-04-29 11:06:00


Author: asydorchuk
Date: 2012-04-29 11:05:58 EDT (Sun, 29 Apr 2012)
New Revision: 78255
URL: http://svn.boost.org/trac/boost/changeset/78255

Log:
Finishing segment concept documentation page.

Text files modified:
   sandbox/gtl/boost/polygon/segment_concept.hpp | 128 ++++++++++++------------
   sandbox/gtl/boost/polygon/segment_data.hpp | 8
   sandbox/gtl/doc/gtl_segment_concept.htm | 210 ++++++++++++++++++++--------------------
   3 files changed, 174 insertions(+), 172 deletions(-)

Modified: sandbox/gtl/boost/polygon/segment_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/segment_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/segment_concept.hpp 2012-04-29 11:05:58 EDT (Sun, 29 Apr 2012)
@@ -112,26 +112,35 @@
 
   template <typename Segment, typename Point>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3<
       y_s_set,
       typename is_mutable_segment_concept<
         typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
>::type
>::type,
     void
>::type
- set(Segment& segment, direction_1d dir, const Point& value) {
- segment_mutable_traits<Segment>::set(segment, dir, value);
+ set(Segment& segment, direction_1d dir, const Point& point) {
+ segment_mutable_traits<Segment>::set(segment, dir, point);
   }
 
   struct y_s_construct : gtl_yes {};
 
   template <typename Segment, typename Point1, typename Point2>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_4<
       y_s_construct,
       typename is_mutable_segment_concept<
         typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point1>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point2>::type
>::type
>::type,
     Segment
@@ -174,8 +183,8 @@
>::type,
     Segment1
>::type &
- assign(Segment1& lvalue, const Segment2& rvalue) {
- return lvalue = copy_construct<Segment1>(rvalue);
+ assign(Segment1& segment1, const Segment2& segment2) {
+ return segment1 = copy_construct<Segment1>(segment2);
   }
 
   struct y_s_equivalence : gtl_yes {};
@@ -201,18 +210,20 @@
   struct y_s_on_above_or_below : gtl_yes {};
 
   //-1 for below, 0 for on and 1 for above
- template <typename Segment>
+ template <typename Segment, typename Point>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3<
       y_s_on_above_or_below,
       typename is_segment_concept<
         typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
>::type
>::type,
     bool
>::type
- on_above_or_below(const Segment& segment,
- const typename segment_point_type<Segment>::type& point) {
+ on_above_or_below(const Segment& segment, const Point& point) {
     typedef polygon_arbitrary_formation<
       typename segment_coordinate_type<Segment>::type
> paf;
@@ -225,24 +236,25 @@
 
   struct y_s_contains : gtl_yes {};
 
- template <typename Segment>
+ template <typename Segment, typename Point>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3<
       y_s_contains,
       typename is_segment_concept<
         typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
>::type
>::type,
     bool
>::type
- contains(const Segment& segment,
- const typename segment_point_type<Segment>::type& point,
- bool consider_touch = true ) {
- if(!on_above_or_below(segment, point)) {
+ contains(const Segment& segment, const Point& point, bool consider_touch = true ) {
+ if (!on_above_or_below(segment, point)) {
       rectangle_data<typename segment_coordinate_type<Segment>::type> rect;
       set_points(rect, low(segment), high(segment));
- if(area(rect) == 0.0) {
- if(!consider_touch) {
+ if (area(rect) == 0.0) {
+ if (!consider_touch) {
           return !equivalence(point, low(segment)) &&
                  !equivalence(point, high(segment));
         }
@@ -267,16 +279,13 @@
>::type,
     bool
>::type
- contains(const Segment1& segment1,
- const Segment2& segment2,
- bool consider_touch = true) {
+ contains(const Segment1& segment1, const Segment2& segment2, bool consider_touch = true) {
     return contains(segment1, get(segment2, LOW), consider_touch) &&
            contains(segment1, get(segment2, HIGH), consider_touch);
   }
 
   struct y_s_low : gtl_yes {};
 
- // get the low point
   template <typename Segment>
   typename enable_if<
     typename gtl_and<
@@ -293,7 +302,6 @@
 
   struct y_s_high : gtl_yes {};
 
- // get the high point
   template <typename Segment>
   typename enable_if<
     typename gtl_and<
@@ -310,7 +318,6 @@
 
   struct y_s_center : gtl_yes {};
 
- // get the center point
   template <typename Segment>
   typename enable_if<
     typename gtl_and<
@@ -329,37 +336,39 @@
 
   struct y_s_low2 : gtl_yes {};
 
- // set the low point to v
- template <typename Segment>
+ template <typename Segment, typename Point>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3<
       y_s_low2,
       typename is_mutable_segment_concept<
         typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
>::type
>::type,
     void
>::type
- low(Segment& segment,
- const typename segment_point_type<Segment>::type& point) {
+ low(Segment& segment, const Point& point) {
     set(segment, LOW, point);
   }
 
   struct y_s_high2 : gtl_yes {};
 
- // set the high coordinate to v
- template <typename Segment>
+ template <typename Segment, typename Point>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3<
       y_s_high2,
       typename is_mutable_segment_concept<
         typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
>::type
>::type,
     void
>::type
- high(Segment& segment,
- const typename segment_point_type<Segment>::type& point) {
+ high(Segment& segment, const Point& point) {
     set(segment, HIGH, point);
   }
 
@@ -381,7 +390,6 @@
 
   struct y_s_scale_up : gtl_yes {};
 
- // scale segment by factor
   template <typename Segment>
   typename enable_if<
     typename gtl_and<
@@ -465,7 +473,6 @@
 
   struct y_s_move : gtl_yes {};
 
- // move segment by delta
   template <typename Segment>
   typename enable_if<
     typename gtl_and<
@@ -486,19 +493,20 @@
 
   struct y_s_convolve : gtl_yes {};
 
- // convolve this with point
- template <typename Segment>
+ template <typename Segment, typename Point>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3<
       y_s_convolve,
       typename is_mutable_segment_concept<
         typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
>::type
>::type,
     Segment
>::type &
- convolve(Segment& segment,
- const typename segment_point_type<Segment>::type& point) {
+ convolve(Segment& segment, const Point& point) {
     typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
     low(segment, convolve(l, point));
     high(segment, convolve(h, point));
@@ -507,19 +515,20 @@
 
   struct y_s_deconvolve : gtl_yes {};
 
- // deconvolve this with point
- template <typename Segment>
+ template <typename Segment, typename Point>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3<
       y_s_deconvolve,
       typename is_mutable_segment_concept<
         typename geometry_concept<Segment>::type
+ >::type,
+ typename is_point_concept<
+ typename geometry_concept<Point>::type
>::type
>::type,
     Segment
>::type &
- deconvolve(Segment& segment,
- const typename segment_point_type<Segment>::type& point) {
+ deconvolve(Segment& segment, const Point& point) {
     typename segment_point_type<Segment>::type l = low(segment), h = high(segment);
     low(segment, deconvolve(l, point));
     high(segment, deconvolve(h, point));
@@ -528,7 +537,6 @@
 
   struct y_s_e_dist : gtl_yes {};
 
- // distance from a point to a segment
   template <typename Segment, typename Point>
   typename enable_if<
     typename gtl_and_3<
@@ -556,23 +564,22 @@
     Unit D = y2 - y1;
     Unit length_sq = C * C + D * D;
     Unit param = (A * C + B * D)/length_sq;
- if(param > 1.0) {
+ if (param > 1.0) {
       return euclidean_distance(high(segment), point);
- } else if(param < 0.0) {
+ } else if (param < 0.0) {
       return euclidean_distance(low(segment), point);
     }
     Unit denom = sqrt(length_sq);
- if(denom == 0.0)
+ if (denom == 0.0)
       return 0.0;
     Unit result = (A * D - C * B) / denom;
- if(result < 0.0)
+ if (result < 0.0)
       result *= -1;
     return result;
   }
 
   struct y_s_e_dist2 : gtl_yes {};
 
- // distance between two segments
   template <typename Segment1, typename Segment2>
   typename enable_if<
     typename gtl_and_3<
@@ -590,13 +597,12 @@
     typename segment_distance_type<Segment1>::type
         result1 = euclidean_distance(segment1, low(segment2)),
         result2 = euclidean_distance(segment1, high(segment2));
- if(result2 < result1) return result2;
+ if (result2 < result1) return result2;
     return result1;
   }
 
   struct y_s_e_intersects : gtl_yes {};
 
- // check if Interval b intersects `this` Interval
   template <typename Segment1, typename Segment2>
   typename enable_if<
     typename gtl_and_3<
@@ -610,12 +616,11 @@
>::type,
     bool
>::type
- intersects(const Segment1& segment1,
- const Segment2& segment2,
+ intersects(const Segment1& segment1, const Segment2& segment2,
              bool consider_touch = true) {
- if(consider_touch) {
- if(low(segment1) == low(segment2) || low(segment1) == high(segment2) ||
- high(segment1) == low(segment2) || high(segment1) == high(segment2))
+ if (consider_touch) {
+ if (low(segment1) == low(segment2) || low(segment1) == high(segment2) ||
+ high(segment1) == low(segment2) || high(segment1) == high(segment2))
         return true;
     }
     typedef polygon_arbitrary_formation<
@@ -632,7 +637,6 @@
 
   struct y_s_e_bintersect : gtl_yes {};
 
- // check if Interval b partially overlaps `this` Interval
   template <typename Segment1, typename Segment2>
   typename enable_if<
     typename gtl_and_3<
@@ -656,7 +660,6 @@
 
   struct y_s_abuts1 : gtl_yes {};
 
- // check if they are end to end
   template <typename Segment1, typename Segment2>
   typename enable_if<
     typename gtl_and_3<
@@ -677,7 +680,6 @@
 
   struct y_s_abuts2 : gtl_yes {};
 
- // check if they are end to end
   template <typename Segment1, typename Segment2>
   typename enable_if<
     typename gtl_and_3<
@@ -730,7 +732,7 @@
     assign(h2, high(segment2));
     typename paf::half_edge he1(l1, h1), he2(l2, h2);
     typename paf::compute_intersection_pack pack;
- if(pack.compute_intersection(pt, he1, he2, projected, round_closest)) {
+ if (pack.compute_intersection(pt, he1, he2, projected, round_closest)) {
       assign(intersection, pt);
       return true;
     }

Modified: sandbox/gtl/boost/polygon/segment_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/segment_data.hpp (original)
+++ sandbox/gtl/boost/polygon/segment_data.hpp 2012-04-29 11:05:58 EDT (Sun, 29 Apr 2012)
@@ -59,16 +59,16 @@
 
     inline point_type low() const { return points_[0]; }
 
- inline point_type& low(const point_type& low) {
+ inline segment_data& low(const point_type& point) {
       points_[0] = low;
       return *this;
     }
 
     inline point_type high() const {return points_[1]; }
 
- inline point_type& high(const point_type& high) {
- points_[1] = high;
- return *this;
+ inline segment_data& high(const point_type& point) {
+ points_[1] = point;
+ return *this;
     }
 
     inline bool operator==(const segment_data& that) const {

Modified: sandbox/gtl/doc/gtl_segment_concept.htm
==============================================================================
--- sandbox/gtl/doc/gtl_segment_concept.htm (original)
+++ sandbox/gtl/doc/gtl_segment_concept.htm 2012-04-29 11:05:58 EDT (Sun, 29 Apr 2012)
@@ -6,6 +6,8 @@
 --><title>Boost Polygon Library: Segment Concept</title>
 
 
+
+
   
 
   
@@ -15,7 +17,7 @@
 
   <tbody>
     <tr>
- <td style="background-color: rgb(238, 238, 238);" valign="top" nowrap="1">
+ <td style="background-color: rgb(238, 238, 238);" nowrap="1" valign="top">
       <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>
       <div style="margin: 5px;">
       <h3 class="navbar">Contents</h3>
@@ -107,7 +109,7 @@
 segment traits.&nbsp; Specialization of these traits is required for
 types that don't conform to the default behavior.</p>
       
- <p><span style="font-family: Courier New,Courier,monospace;"></span><span style="font-family: Courier New,Courier,monospace;">template &lt;typename Segment&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
+ <p><span style="font-family: Courier New,Courier,monospace;"><span style="font-family: Courier New,Courier,monospace;">template &lt;typename Segment&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
       <span style="font-family: Courier New,Courier,monospace;">struct segment_traits {</span><br style="font-family: Courier New,Courier,monospace;" />
       <span style="font-family: Courier New,Courier,monospace;">&nbsp; typedef typename Segment::coordinate_type coordinate_type;</span><br style="font-family: Courier New,Courier,monospace;" />
       <span style="font-family: Courier New,Courier,monospace;">&nbsp; typedef typename Segment::point_type point_type;</span><br style="font-family: Courier New,Courier,monospace;" />
@@ -133,7 +135,7 @@
 &nbsp;&nbsp;&nbsp; return Segment(p1, p2);<br />
 &nbsp; }<br />
 };<br />
- </span><span style="font-family: Courier New,Courier,monospace;" /></p>
+ </span><span style="font-family: Courier New,Courier,monospace;" /></span></p>
 
       <p> Example code custom_segment.cpp
 demonstrates how to map a user defined segment class to the library segment_concept.</p>
@@ -143,58 +145,58 @@
           <tr>
             <td width="586"><font face="Courier New">template
 &lt;typename Segment&gt;<br />point_type <b>get</b>(const Segment&amp; segment, direction_1d dir)</font></td>
- <td>Expects a model of segment.&nbsp; Returns the low or high endpoint of the segment, depending on
+ <td>Returns the low or high endpoint of an object that models a segment, depending on
 the direction_1d value.<font face="Courier New">&nbsp;</font></td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
 &lt;typename </font><font face="Courier New">Segment</font><font face="Courier New">, typename Point&gt;<br />
 void <b>set</b>(</font><font face="Courier New">Segment</font><font face="Courier New">&amp; segment, direction_1d dir,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const point_type&amp; </font><font face="Courier New">Point</font><font face="Courier New">)</font></td>
- <td>Expects
-a model of segment. Sets the low or high endpoint of the segment to the
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const Point&amp; </font><span style="font-family: Courier New;">point</span><font face="Courier New">)</font></td>
+ <td>Sets the low or high endpoint of an object that models a segment to an object that models a
 point, depending on the direction_1d&nbsp; value.</td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template &lt;typename Segment, typename Point1, typename Point2&gt;<br />
 Segment<b> construct</b>(const Point1&amp; low, const Point2&amp; high)</font></td>
- <td>Construct an object that is a model of segment given both endpoints.</td>
+ <td>Construct an object that is a model of segment given the two objects that are models of point.</td>
           </tr>
           <tr>
- <td style="vertical-align: top;"><font face="Courier New">template &lt;typename Segment1, typename </font><font face="Courier New">Segment2</font><font face="Courier New">&gt;<br /></font><font face="Courier New">Segment1</font><font face="Courier New"> <span style="font-weight: bold;">copy_construct</span>(const </font><font face="Courier New">Segment2</font><font face="Courier New">&gt;</font><font face="Courier New">&amp; segment)</font></td>
+ <td style="vertical-align: top;"><font face="Courier New">template &lt;typename Segment1, typename </font><font face="Courier New">Segment2</font><font face="Courier New">&gt;<br /></font><font face="Courier New">Segment1</font><font face="Courier New"> <span style="font-weight: bold;">copy_construct</span>(const </font><font face="Courier New">Segment2</font><font face="Courier New">&amp; segment)</font></td>
             <td style="vertical-align: middle; text-align: left;">Copy construct an object that is a model of segment given another segment.</td>
           </tr>
 <tr>
             <td width="586"><font face="Courier New">template
 &lt;typename </font><font face="Courier New">Segment1</font><font face="Courier New">, typename </font><font face="Courier New">Segment2&gt;</font><br />
- <font face="Courier New">Segment1</font><font face="Courier New">&amp; <b>assign</b>(</font><font face="Courier New">Segment1</font><font face="Courier New">&amp; lvalue, const </font><font face="Courier New">Segment2</font><font face="Courier New">&amp; rvalue)</font></td>
- <td>Copies data from right object that models segment into
-left object that models segment.</td>
+ <font face="Courier New">Segment1</font><font face="Courier New">&amp; <b>assign</b>(</font><font face="Courier New">Segment1</font><font face="Courier New">&amp; segment1,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const </font><font face="Courier New">Segment2</font><font face="Courier New">&amp; segment2)</font></td>
+ <td>Copies data from the right object that models segment into
+the left object that models segment.</td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
 &lt;typename </font><font face="Courier New">Segment1</font><font face="Courier New">, typename </font><font face="Courier New">Segment1</font><font face="Courier New">&gt;<br />
 bool <b>equivalence</b>(const </font><font face="Courier New">Segment1</font><font face="Courier New">&amp; segment1,<br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const </font><font face="Courier New">Segment1</font><font face="Courier New">&amp; segment2)</font></td>
- <td>Given two objects that model segment, compares and
+ <td>Given two objects that model a segment, compares and
 returns true if their low and high values are respectively equal to each
 other.</td>
           </tr>
           <tr>
- <td style="vertical-align: top;"><span style="font-family: Courier New,Courier,monospace;">template &lt;typename segment_type&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
- <span style="font-family: Courier New,Courier,monospace;">bool </span><span style="font-weight: bold; font-family: Courier New,Courier,monospace;">on_above_or_below</span><span style="font-family: Courier New,Courier,monospace;">(const segment_type&amp; segment,</span><br style="font-family: Courier New,Courier,monospace;" />
+ <td style="vertical-align: top;"><span style="font-family: Courier New,Courier,monospace;">template &lt;typename Segment, typename Point&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
+ <span style="font-family: Courier New,Courier,monospace;">bool </span><span style="font-weight: bold; font-family: Courier New,Courier,monospace;">on_above_or_below</span><span style="font-family: Courier New,Courier,monospace;">(const </span><span style="font-family: Courier New,Courier,monospace;">Segment</span><span style="font-family: Courier New,Courier,monospace;">&amp; segment,</span><br style="font-family: Courier New,Courier,monospace;" />
             <span style="font-family: Courier New,Courier,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-const point_type&amp; point)</span><br />
+const Point&amp; point)</span><br />
             </td>
- <td>Returns true if an object that is a model of segment and the given point are collinear, else false.<br />
+ <td>Returns false if an object that is a model of segment and an object that is a model of point are collinear, else true.<br />
             </td>
           </tr>
           <tr>
- <td style="vertical-align: top;"><span style="font-family: Courier New,Courier,monospace;">template &lt;typename </span><font face="Courier New">Segment</font><span style="font-family: Courier New,Courier,monospace;">&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
+ <td style="vertical-align: top;"><span style="font-family: Courier New,Courier,monospace;">template &lt;typename </span><font face="Courier New">Segment, typename Point</font><span style="font-family: Courier New,Courier,monospace;">&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
             <span style="font-family: Courier New,Courier,monospace;">bool </span><span style="font-weight: bold; font-family: Courier New,Courier,monospace;">contains</span><span style="font-family: Courier New,Courier,monospace;">(const </span><font face="Courier New">Segment</font><span style="font-family: Courier New,Courier,monospace;">&amp; segment,</span><br style="font-family: Courier New,Courier,monospace;" />
- <span style="font-family: Courier New,Courier,monospace;">&nbsp;&nbsp;&nbsp; point_type value,</span><span style="font-family: Courier New,Courier,monospace;"> bool consider_touch)</span><br />
+ <span style="font-family: Courier New,Courier,monospace;">&nbsp;&nbsp;&nbsp; const Point&amp; value,</span><span style="font-family: Courier New,Courier,monospace;"> bool consider_touch)</span><br />
             </td>
- <td>Returns true if an first object that is a model of segment contains the given point, else false.<br />
+ <td>Returns true if an object that is a model of segment contains an object that is a model of point, else false.<br />
             </td>
           </tr>
           <tr>
@@ -210,29 +212,29 @@
             <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename <span style="font-family: Courier New,Courier,monospace;">Segment</span>&gt;<br />
 point_type <span style="font-weight: bold;">low</span>(const <span style="font-family: Courier New,Courier,monospace;">Segment</span>&amp; segment)<br />
             </td>
- <td>Gets the low endpoint of an object that is a model of segment.<br />
+ <td>Returns the low endpoint of an object that is a model of segment.<br />
             </td>
           </tr>
           <tr>
             <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename <span style="font-family: Courier New,Courier,monospace;">Segment</span>&gt;<br />
 point_type <span style="font-weight: bold;">high</span>(const <span style="font-family: Courier New,Courier,monospace;">Segment</span>&amp; segment)</td>
- <td>Gets the high endpoint of an object that is a model of segment.<br />
+ <td>Returns the high endpoint of an object that is a model of segment.<br />
             </td>
           </tr>
           <tr>
             <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename <span style="font-family: Courier New,Courier,monospace;">Segment</span>&gt;<br />
 point_type <span style="font-weight: bold;">center</span>(const <span style="font-family: Courier New,Courier,monospace;">Segment</span>&amp; segment)</td>
- <td>Gets the centeral point of an object that is a model of segment.<br />
+ <td>Returns the central point of an object that is a model of segment.<br />
             </td>
           </tr>
           <tr>
- <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename <span style="font-family: Courier New,Courier,monospace;">Segment</span>&gt;<br />void <span style="font-weight: bold;">low</span>(<span style="font-family: Courier New,Courier,monospace;">Segment</span>&amp; segment, const point_type&amp; point)</td>
+ <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename <span style="font-family: Courier New,Courier,monospace;">Segment</span>, typename Point&gt;<br />void <span style="font-weight: bold;">low</span>(<span style="font-family: Courier New,Courier,monospace;">Segment</span>&amp; segment, const Point&amp; point)</td>
             <td>Sets the low endpoint of an object that is a model of segment.<br />
             </td>
           </tr>
           <tr>
- <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename <span style="font-family: Courier New,Courier,monospace;">Segment</span>&gt;<br />
-void <span style="font-weight: bold;">high</span>(<span style="font-family: Courier New,Courier,monospace;">Segment</span>&amp; segment, const point_type&amp; point)</td>
+ <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename <span style="font-family: Courier New,Courier,monospace;">Segment, typename Point</span>&gt;<br />
+void <span style="font-weight: bold;">high</span>(<span style="font-family: Courier New,Courier,monospace;">Segment</span>&amp; segment, const Point&amp; point)</td>
             <td>Sets the high endpoint of an object that is a model of segment.<br />
             </td>
           </tr>
@@ -240,7 +242,7 @@
             <td style="vertical-align: top;"><span style="font-family: Courier New,Courier,monospace;">template &lt;typename </span><span style="font-family: Courier New,Courier,monospace;">Segment</span><span style="font-family: Courier New,Courier,monospace;">&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
             <span style="font-family: Courier New,Courier,monospace;">distance_type <span style="font-weight: bold;">length</span>(const </span><span style="font-family: Courier New,Courier,monospace;">Segment</span><span style="font-family: Courier New,Courier,monospace;">&amp; segment)</span><br />
             </td>
- <td>Returns the length of an object that is a model of segment.<br />
+ <td>Returns length of an object that is a model of segment.<br />
             </td>
           </tr>
 
@@ -250,14 +252,14 @@
           <tr>
             <td width="586"><font face="Courier New">template
 &lt;typename </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&gt;<br /></font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>scale_up</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; </font><font face="Courier New">segment</font><font face="Courier New">, <br />&nbsp;&nbsp;&nbsp; unsigned_area_type factor)</font></td>
- <td>Multiplies x and y coordinates of both endpoints of an object that models segment by unsigned factor.</td>
+ <td>Multiplies x and y coordinates of both endpoints of an object that is a model of segment by unsigned factor.</td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
 &lt;typename </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&gt;<br />
             </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>scale_down</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; </font><font face="Courier New">segment</font><font face="Courier New">, <br />
 &nbsp;&nbsp;&nbsp; unsigned_area_type factor)</font></td>
- <td>Divides x and y coordinates of both endpoints of an object that models segment by unsigned factor.</td>
+ <td>Divides x and y coordinates of both endpoints of an object that is a model of segment by unsigned factor.</td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
@@ -265,16 +267,16 @@
             </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>scale</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; </font><font face="Courier New">segment</font><font face="Courier New">,<br />
 &nbsp;&nbsp;&nbsp; const scaling_type&amp; factor) </font></td>
             <td>Calls
-the scale member function of scaling type on the low and high endpoint of
-an object that models segment and updates the segment with the
-scaled points.</td>
+the scale member function of the scaling type on the low and high endpoint of
+an object that is a model of segment and updates the segment with the
+scaled endpoints.</td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
 &lt;typename </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">, typename Transform&gt;<br /></font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>transform</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; segment,<br />
 &nbsp;&nbsp;&nbsp; const </font><font face="Courier New">Transform</font><font face="Courier New">&amp; transform) </font></td>
             <td>Calls the transform member function of transform type
-on the low and high endpoints of an object that models segment and updates the segment with the transformed endpoints.</td>
+on the low and high endpoints of an object that is a model of segment and updates the segment with the transformed endpoints.</td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
@@ -282,64 +284,80 @@
             </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>move</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; segment, orientation_2d<br />
 &nbsp;&nbsp;&nbsp; coordinate_difference displacement)</font></td>
             <td>Adds displacement value to the coordinates of both endpoints of an object
-that models segment indicated by the orientation_2d.</td>
+that is a model of segment indicated by the orientation_2d.</td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
-&lt;</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&gt;<br />
- </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>convolve</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; segment, const point_type&amp; b)</font></td>
- <td>Convolves both endpoints of an object that models a segment with b.<br />
+&lt;</font><span style="font-family: Courier New,Courier,monospace;">Segment, Point</span><font face="Courier New">&gt;<br />
+ </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>convolve</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; segment, const Point&amp; point)</font></td>
+ <td>Convolves both endpoints of an object that models a segment with an object that models a point.<br />
 </td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
-&lt;</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&gt;<br />
- </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>deconvolve</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; segment, const point_type&amp; b)</font></td>
- <td>Deconvolves both endpoints of an object that models a segment with b. </td>
+&lt;</font><span style="font-family: Courier New,Courier,monospace;">Segment, Point</span><font face="Courier New">&gt;<br />
+ </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; <b>deconvolve</b>(</font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; segment, const Point&amp; point)</font></td>
+ <td>Deconvolves both endpoints of an object that models a segment with an object that models a point. </td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
 &lt;typename </font><span style="font-family: Courier New,Courier,monospace;">Segment, typename Point</span><font face="Courier New">&gt;<br />distance_type <b>euclidean_distance</b>(<br />
 &nbsp;&nbsp;&nbsp; const </font><span style="font-family: Courier New,Courier,monospace;">Segment</span><font face="Courier New">&amp; segment, const Point&amp; point)</font></td>
- <td>Returns the distance from an object that is a model of segment
+ <td>Returns distance from an object that is a model of segment
 to an object that is a model of point.</td>
           </tr>
           <tr>
             <td style="vertical-align: top;"><font face="Courier New">template
 &lt;typename Segment1, typename </font><font face="Courier New">Segment2</font><font face="Courier New">&gt;<br />distance_type <b>euclidean_distance</b>(<br />
 &nbsp;&nbsp;&nbsp; const </font><font face="Courier New">Segment1</font><font face="Courier New">&amp; segment1, const </font><font face="Courier New">Segment2</font><font face="Courier New">&amp; segment2)</font></td>
- <td style="vertical-align: middle;">Returns the distance between two objects that are models of segment.</td>
+ <td style="vertical-align: middle;">Returns distance between two objects that are models of segment.</td>
           </tr>
           <tr>
- <td style="vertical-align: top;"><br />
+ <td style="vertical-align: top;"><span style="font-family: Courier New,Courier,monospace;">template &lt;typename Segment1, typename Segment2&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
+ <span style="font-family: Courier New,Courier,monospace;">bool <span style="font-weight: bold;">intersects</span>(const Segment1&amp; segment1,</span><br style="font-family: Courier New,Courier,monospace;" />
+ <span style="font-family: Courier New,Courier,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const Segment2&amp; segment2)</span><br />
             </td>
- <td style="vertical-align: top;"><br />
+ <td>Returns true if two objects that model a segment intersect, else false.<br />
             </td>
           </tr>
           <tr>
- <td style="vertical-align: top;"><br />
+ <td style="vertical-align: top;"><span style="font-family: Courier New,Courier,monospace;">template &lt;typename Segment1, typename Segment2&gt;</span><br style="font-family: Courier New,Courier,monospace;" />
+
+ <span style="font-family: Courier New,Courier,monospace;">bool <span style="font-weight: bold;">boundaries_intersect</span>(<br />
+&nbsp;&nbsp;&nbsp; const Segment1&amp; segment1,</span><span style="font-family: Courier New,Courier,monospace;"> const Segment2&amp; segment2)</span>
             </td>
- <td style="vertical-align: top;"><br />
+ <td>Returns true if two objects that model a segment are collinear and overlap, else false.<br />
             </td>
           </tr>
           <tr>
- <td style="vertical-align: top;"><br />
- </td>
- <td style="vertical-align: top;"><br />
+ <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename Segment1, typename Segment2&gt;<br />
+
+bool <span style="font-weight: bold;">abuts</span>(const Segment1&amp; segment1,<br />
+
+&nbsp;&nbsp;&nbsp; const Segment2&amp; segment2, direction_1d dir)</td>
+ <td>Returns true if two objects that model a segment abut, depending on the direction_1d value.<br />
             </td>
           </tr>
- <tr>
- <td style="vertical-align: top;"><br />
+<tr>
+ <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename Segment1, typename Segment2&gt;<br />
+bool <span style="font-weight: bold;">abuts</span>(const Segment1&amp; segment1,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const Segment2&amp; segment2)<br />
             </td>
- <td style="vertical-align: top;"><br />
+ <td>Returns true if two objects that model a segment abut: either the first one to the second one or vice versa.<br />
             </td>
           </tr>
           <tr>
- <td style="vertical-align: top;"><br />
+ <td style="vertical-align: top; font-family: Courier New,Courier,monospace;">template &lt;typename Point, typename Segment1, typename Segment2&gt;<br />
+bool <span style="font-weight: bold;">intersection</span>(Point&amp; point,<br />
+&nbsp;&nbsp;&nbsp; const Segment1&amp; segment1, const Segment2&amp; segment2,<br />
+&nbsp;&nbsp;&nbsp; bool projected = false, bool round_closest = false)<br />
             </td>
- <td style="vertical-align: top;"><br />
+ <td>Returns
+true and computes the intersection point of the two objects that model
+a segment. If those don't intersect returns false.<br />
             </td>
           </tr>
+
 
           
           
@@ -373,7 +391,7 @@
           </tr>
 <tr>
             <td width="586"><font face="Courier New"><b>segment_data</b>()</font></td>
- <td>Default constructs the two endpoints of the segment.</td>
+ <td>Default constructor.</td>
           </tr>
           <tr>
             <td width="586"><font face="Courier New"><b>segment_data</b>(point_type low, point_type high)</font></td>
@@ -389,87 +407,69 @@
           </tr>
           <tr>
             <td width="586"><font face="Courier New">template
-&lt;typename T2&gt;<b><br />
- </b>point_data&amp; <b>operator=</b>(const T2&amp; that)
+&lt;typename Segment&gt;<b><br />
+ </b>segment_data&amp; <b>operator=</b>(const Segment&amp; that)
 const</font></td>
- <td>Assign from an object that is a model of point.</td>
+ <td>Assign from an object that is a model of segment.</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">template
-&lt;typename T2&gt;<b><br />
- </b>bool<b> operator==</b>(const T2&amp; that) const</font></td>
- <td>Compare equality to an object that is a model of point.</td>
+ <td width="586"><font face="Courier New">bool<b> operator==</b>(const segment_data&amp; that) const</font></td>
+ <td>Equality operator overload.</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">template
-&lt;typename T2&gt;<b> <br />
- </b>bool<b> operator!=</b>(const T2&amp; that) const</font></td>
- <td>Compare inequality to an object that is a model of
-point.</td>
+ <td width="586"><font face="Courier New"><b> </b>bool<b> operator!=</b>(const segment_data&amp; that) const</font></td>
+ <td>Inequality operator overload.</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">template
-&lt;typename T2&gt;<b> <br />
- </b>bool<b> operator&lt;</b>(const T2&amp; that) const</font></td>
- <td>Compares y coordinates then x coordinates to break ties.</td>
+ <td width="586"><font face="Courier New"><b> </b>bool<b> operator&lt;</b>(const segment_data&amp; that) const</font></td>
+ <td>Less operator overload. Compares low endpoint then high endpoint to break ties.<br />
+</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">template
-&lt;typename T2&gt;<b> <br />
- </b>bool<b> operator&lt;=</b>(const T2&amp; that) const</font></td>
- <td>Compares y coordinates then x coordinates to break ties.</td>
+ <td width="586"><font face="Courier New"><b> </b>bool<b> operator&lt;=</b>(const segment_data&amp; that) const</font></td>
+ <td>Less or equal operator overload. Compares low endpoint then high endpoint to break ties.<br />
+</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">template
-&lt;typename T2&gt;<b> <br />
- </b>bool<b> operator&gt;</b>(const T2&amp; that) const</font></td>
- <td>Compares low coordinates then high coordinates to break
-ties.</td>
+ <td width="586"><font face="Courier New"><b> </b>bool<b> operator&gt;</b>(const segment_data&amp; that) const</font></td>
+ <td>Greater operator overload. Compares low endpoint then high endpoint to break ties.<br />
+</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">template
-&lt;typename T2&gt;<b> <br />
- </b>bool<b> operator&gt;=</b>(const T2&amp; that) const</font></td>
- <td>Compares low coordinates then high coordinates to break
-ties.</td>
+ <td width="586"><font face="Courier New"><b> </b>bool<b> operator&gt;=</b>(const segment_data&amp; that) const</font></td>
+ <td>Greater or equal operator overload. Compares low endpoint then high endpoint to break ties.<br />
+</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">T <b>get</b>(orientation_2d
-orient) const</font></td>
- <td>Get the coordinate in the given orientation.</td>
+ <td width="586"><font face="Courier New">point_type <b>get</b>(direction_1d dir) const</font></td>
+ <td>Retrieves the low/high endpoint considering direction.</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">T <b>x</b>() const</font></td>
- <td>Get the coordinate in the horizontal orientation.</td>
+ <td width="586"><font face="Courier New">point_type <span style="font-weight: bold;">low</span>() const</font></td>
+ <td>Retrieves the low endpoint.</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">T <b>y</b>() const</font></td>
- <td>Get the coordinate in the vertical orientation.</td>
+ <td width="586"><font face="Courier New">point_type <span style="font-weight: bold;">high</span>() const</font></td>
+ <td>Retrieves the high endpoint.</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">void <b>set</b>(orientation_2d
-orient, T value)</font></td>
- <td>Sets the coordinate in the given orientation to the
-value.</td>
+ <td width="586"><font face="Courier New">void <b>set</b></font><font face="Courier New">(direction_1d dir</font><font face="Courier New">, const point_type&amp; point)</font></td>
+ <td>Sets the endpoint in the given direction.</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">void <b>x</b>(T
-value)</font></td>
- <td>Sets the coordinate in the horizontal orientation to
-the value.</td>
+ <td width="586"><font face="Courier New">segment_data&amp; <span style="font-weight: bold;">low</span>(const point_type&amp; point)</font></td>
+ <td>Sets the low endpoint.</td>
           </tr>
           <tr>
- <td width="586"><font face="Courier New">void <b>y</b>(T
-value)</font></td>
- <td>Sets the coordinate in the vertical orientation to the
-value.</td>
+ <td width="586"><font face="Courier New">segment_data&amp; <span style="font-weight: bold;">high(</span>const point_type&amp; point)</font></td>
+ <td>Sets the high endpoint.</td>
           </tr>
         </tbody>
       </table>
       </td>
     </tr>
     <tr>
- <td style="background-color: rgb(238, 238, 238);" valign="top" nowrap="1"> &nbsp;</td>
+ <td style="background-color: rgb(238, 238, 238);" nowrap="1" valign="top"> &nbsp;</td>
       <td style="padding-left: 10px; padding-right: 10px; padding-bottom: 10px;" valign="top" width="100%">
       <table class="docinfo" id="table3" frame="void" rules="none">
         <colgroup> <col class="docinfo-name" /><col class="docinfo-content" /> </colgroup> <tbody valign="top">


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk