Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55934 - in sandbox/gtl: boost/polygon doc
From: lucanus.j.simonson_at_[hidden]
Date: 2009-08-31 17:45:32


Author: ljsimons
Date: 2009-08-31 17:45:31 EDT (Mon, 31 Aug 2009)
New Revision: 55934
URL: http://svn.boost.org/trac/boost/changeset/55934

Log:
fixed examples and MSVC9 syntax errors
Text files modified:
   sandbox/gtl/boost/polygon/interval_concept.hpp | 14 +++++++-------
   sandbox/gtl/doc/gtl_connectivity_extraction_usage.htm | 3 ++-
   sandbox/gtl/doc/gtl_custom_point.htm | 9 +++++----
   sandbox/gtl/doc/gtl_custom_polygon.htm | 14 +++++++-------
   sandbox/gtl/doc/gtl_custom_polygon_set.htm | 14 +++++++-------
   5 files changed, 28 insertions(+), 26 deletions(-)

Modified: sandbox/gtl/boost/polygon/interval_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/interval_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/interval_concept.hpp 2009-08-31 17:45:31 EDT (Mon, 31 Aug 2009)
@@ -67,10 +67,10 @@
       interval_mutable_traits<T>::set(interval, dir.backward(), value);
   }
   
- template <typename T>
+ template <typename T, typename T2, typename T3>
   T
- construct(typename interval_traits<T>::coordinate_type low_value, typename interval_traits<T>::coordinate_type high_value,
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type>::type * = 0
+ construct(T2 low_value, T3 high_value,
+ typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type>::type * = 0
   ) {
     if(low_value > high_value) std::swap(low_value, high_value);
     return interval_mutable_traits<T>::construct(low_value, high_value);
@@ -108,13 +108,13 @@
       get(interval2, HIGH);
   }
   
+ struct y_i_contains : gtl_yes {};
+
   template <typename interval_type>
- bool
+ typename enable_if< typename gtl_and< y_i_contains, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type >::type, bool>::type
   contains(const interval_type& interval,
            typename interval_traits<interval_type>::coordinate_type value,
- bool consider_touch = true,
- typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type * = 0
- ) {
+ bool consider_touch = true ) {
     if(consider_touch) {
       return value <= high(interval) && value >= low(interval);
     } else {

Modified: sandbox/gtl/doc/gtl_connectivity_extraction_usage.htm
==============================================================================
--- sandbox/gtl/doc/gtl_connectivity_extraction_usage.htm (original)
+++ sandbox/gtl/doc/gtl_connectivity_extraction_usage.htm 2009-08-31 17:45:31 EDT (Mon, 31 Aug 2009)
@@ -7,8 +7,9 @@
 
 <body>
 
-<p><font face="Courier New">#include &lt;boost/gtl/gtl.hpp&gt;<br>
+<p><font face="Courier New">#include &lt;boost/polygon/polygon.hpp&gt;<br>
 #include &lt;cassert&gt;<br>
+namespace gtl = boost::polygon;<br>
 <br>
 //This function works with both the 90 and 45 versions<br>
 //of connectivity extraction algroithm<br>

Modified: sandbox/gtl/doc/gtl_custom_point.htm
==============================================================================
--- sandbox/gtl/doc/gtl_custom_point.htm (original)
+++ sandbox/gtl/doc/gtl_custom_point.htm 2009-08-31 17:45:31 EDT (Mon, 31 Aug 2009)
@@ -66,10 +66,11 @@
 int y;<br>};<br>&nbsp; &nbsp;
 <br>//There, nice a simple...but wait, it doesn't do anything<br>//how do we use it to do all the things a point needs to do?<br>&nbsp; &nbsp;
 <br>&nbsp; &nbsp;
-<br>//First we register it as a point with gtl<br>namespace gtl {<br>&nbsp;&nbsp;&nbsp;
+<br>//First we register it as a point with boost polygon<br>namespace boost {
+namespace polygon {<br>&nbsp;&nbsp;&nbsp;
 template &lt;&gt;<br>&nbsp; &nbsp;
-struct geometry_concept&lt;CPoint&gt; { typedef point_concept type; };<br>} <br>&nbsp; &nbsp;
-<br>//Then we specialize the gtl point traits for our point type<br>namespace gtl {<br>&nbsp; &nbsp;
+struct geometry_concept&lt;CPoint&gt; { typedef point_concept type; };<br>&nbsp;<br>&nbsp; &nbsp;
+<br>&nbsp;&nbsp;&nbsp; //Then we specialize the gtl point traits for our point type<br>&nbsp; &nbsp;
 template &lt;&gt;<br>&nbsp; &nbsp;
 struct point_traits&lt;CPoint&gt; {<br>&nbsp; &nbsp;
 &nbsp; &nbsp;
@@ -128,7 +129,7 @@
 return retval;<br>&nbsp; &nbsp;
 &nbsp; &nbsp;
 }<br>&nbsp; &nbsp;
-};<br>}<br>&nbsp; &nbsp;
+};<br>} }<br>&nbsp; &nbsp;
 <br>//Now lets see if the CPoint works with the library functions<br>int main() {<br>&nbsp; &nbsp;
 test_point&lt;CPoint&gt;(); //yay! All your testing is done for you.<br>&nbsp; &nbsp;
 return 0;<br>}<br>&nbsp; &nbsp;

Modified: sandbox/gtl/doc/gtl_custom_polygon.htm
==============================================================================
--- sandbox/gtl/doc/gtl_custom_polygon.htm (original)
+++ sandbox/gtl/doc/gtl_custom_polygon.htm 2009-08-31 17:45:31 EDT (Mon, 31 Aug 2009)
@@ -59,9 +59,9 @@
 &nbsp; int y;<br>
 };<br>
 <br>
-//we have to get CPoint working with gtl to make our polygon<br>
-//that uses CPoint working with gtl<br>
-namespace gtl {<br>
+//we have to get CPoint working with boost polygon to make our polygon<br>
+//that uses CPoint working with boost polygon<br>
+namespace boost { namespace polygon {<br>
 &nbsp; template &lt;&gt;<br>
 &nbsp; struct geometry_concept&lt;CPoint&gt; { typedef point_concept type; };<br>
 &nbsp; template &lt;&gt;<br>
@@ -92,14 +92,14 @@
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return retval;<br>
 &nbsp;&nbsp;&nbsp; }<br>
 &nbsp; };<br>
-}<br>
+} }<br>
 <br>
 //I'm lazy and use the stl everywhere to avoid writing my own classes<br>
 //my toy polygon is a std::list&lt;CPoint&gt;<br>
 typedef std::list&lt;CPoint&gt; CPolygon;<br>
 <br>
-//we need to specialize our polygon concept mapping in gtl<br>
-namespace gtl {<br>
+//we need to specialize our polygon concept mapping in boost polygon<br>
+namespace boost { namespace polygon {<br>
 &nbsp; //first register CPolygon as a polygon_concept type<br>
 &nbsp; template &lt;&gt;<br>
 &nbsp; struct geometry_concept&lt;CPolygon&gt;{ typedef polygon_concept type; };<br>
@@ -144,7 +144,7 @@
 &nbsp;&nbsp;&nbsp; }<br>
 <br>
 &nbsp; };<br>
-}<br>
+} }<br>
 <br>
 //now there's nothing left to do but test that our polygon<br>
 //works with library interfaces<br>

Modified: sandbox/gtl/doc/gtl_custom_polygon_set.htm
==============================================================================
--- sandbox/gtl/doc/gtl_custom_polygon_set.htm (original)
+++ sandbox/gtl/doc/gtl_custom_polygon_set.htm 2009-08-31 17:45:31 EDT (Mon, 31 Aug 2009)
@@ -51,7 +51,7 @@
 &nbsp; int y;<br>
 };<br>
 <br>
-namespace gtl {<br>
+namespace boost { namespace polygon {<br>
 &nbsp; template &lt;&gt;<br>
 &nbsp; struct geometry_concept&lt;CPoint&gt; { typedef point_concept type; };<br>
 &nbsp; template &lt;&gt;<br>
@@ -83,13 +83,13 @@
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return retval;<br>
 &nbsp;&nbsp;&nbsp; }<br>
 &nbsp; };<br>
-}<br>
+} }<br>
 <br>
 //the CPolygon example<br>
 typedef std::list&lt;CPoint&gt; CPolygon;<br>
 <br>
-//we need to specialize our polygon concept mapping in gtl<br>
-namespace gtl {<br>
+//we need to specialize our polygon concept mapping in boost polygon<br>
+namespace boost { namespace polygon {<br>
 &nbsp; //first register CPolygon as a polygon_concept type<br>
 &nbsp; template &lt;&gt;<br>
 &nbsp; struct geometry_concept&lt;CPolygon&gt;{ typedef polygon_concept type; };<br>
@@ -138,7 +138,7 @@
 &nbsp;&nbsp;&nbsp; }<br>
 <br>
 &nbsp; };<br>
-}<br>
+} }<br>
 <br>
 //OK, finally we get to declare our own polygon set type<br>
 typedef std::deque&lt;CPolygon&gt; CPolygonSet;<br>
@@ -147,7 +147,7 @@
 //because it is a standard container there is a shortcut<br>
 //for mapping it to polygon set concept, but I'll do it<br>
 //the long way that you would use in the general case.<br>
-namespace gtl {<br>
+namespace boost { namespace polygon {<br>
 &nbsp; //first we register CPolygonSet as a polygon set<br>
 &nbsp; template &lt;&gt;<br>
 &nbsp; struct geometry_concept&lt;CPolygonSet&gt; { typedef polygon_set_concept type;
@@ -198,7 +198,7 @@
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //extra<br>
 &nbsp;&nbsp;&nbsp; }<br>
 &nbsp; };<br>
-}<br>
+} }<br>
 <br>
 int main() {<br>
 &nbsp; long long c1 = clock();<br>


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