|
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 <boost/gtl/gtl.hpp><br>
+<p><font face="Courier New">#include <boost/polygon/polygon.hpp><br>
#include <cassert><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>
<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>
<br>
-<br>//First we register it as a point with gtl<br>namespace gtl {<br>
+<br>//First we register it as a point with boost polygon<br>namespace boost {
+namespace polygon {<br>
template <><br>
-struct geometry_concept<CPoint> { typedef point_concept type; };<br>} <br>
-<br>//Then we specialize the gtl point traits for our point type<br>namespace gtl {<br>
+struct geometry_concept<CPoint> { typedef point_concept type; };<br> <br>
+<br> //Then we specialize the gtl point traits for our point type<br>
template <><br>
struct point_traits<CPoint> {<br>
@@ -128,7 +129,7 @@
return retval;<br>
}<br>
-};<br>}<br>
+};<br>} }<br>
<br>//Now lets see if the CPoint works with the library functions<br>int main() {<br>
test_point<CPoint>(); //yay! All your testing is done for you.<br>
return 0;<br>}<br>
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 @@
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>
template <><br>
struct geometry_concept<CPoint> { typedef point_concept type; };<br>
template <><br>
@@ -92,14 +92,14 @@
return retval;<br>
}<br>
};<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<CPoint><br>
typedef std::list<CPoint> 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>
//first register CPolygon as a polygon_concept type<br>
template <><br>
struct geometry_concept<CPolygon>{ typedef polygon_concept type; };<br>
@@ -144,7 +144,7 @@
}<br>
<br>
};<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 @@
int y;<br>
};<br>
<br>
-namespace gtl {<br>
+namespace boost { namespace polygon {<br>
template <><br>
struct geometry_concept<CPoint> { typedef point_concept type; };<br>
template <><br>
@@ -83,13 +83,13 @@
return retval;<br>
}<br>
};<br>
-}<br>
+} }<br>
<br>
//the CPolygon example<br>
typedef std::list<CPoint> 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>
//first register CPolygon as a polygon_concept type<br>
template <><br>
struct geometry_concept<CPolygon>{ typedef polygon_concept type; };<br>
@@ -138,7 +138,7 @@
}<br>
<br>
};<br>
-}<br>
+} }<br>
<br>
//OK, finally we get to declare our own polygon set type<br>
typedef std::deque<CPolygon> 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>
//first we register CPolygonSet as a polygon set<br>
template <><br>
struct geometry_concept<CPolygonSet> { typedef polygon_set_concept type;
@@ -198,7 +198,7 @@
//extra<br>
}<br>
};<br>
-}<br>
+} }<br>
<br>
int main() {<br>
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