Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54797 - in sandbox/gtl/boost/polygon: . detail
From: lucanus.j.simonson_at_[hidden]
Date: 2009-07-08 12:30:29


Author: ljsimons
Date: 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
New Revision: 54797
URL: http://svn.boost.org/trac/boost/changeset/54797

Log:
ported code to MSVC8
Text files modified:
   sandbox/gtl/boost/polygon/detail/boolean_op.hpp | 126 ---------
   sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp | 207 ++++++++-------
   sandbox/gtl/boost/polygon/detail/iterator_points_to_compact.hpp | 2
   sandbox/gtl/boost/polygon/detail/max_cover.hpp | 6
   sandbox/gtl/boost/polygon/detail/polygon_45_formation.hpp | 276 +++++++++++----------
   sandbox/gtl/boost/polygon/detail/polygon_45_set_view.hpp | 126 +++++----
   sandbox/gtl/boost/polygon/detail/polygon_45_touch.hpp | 50 +-
   sandbox/gtl/boost/polygon/detail/polygon_90_set_view.hpp | 124 +++++----
   sandbox/gtl/boost/polygon/detail/polygon_90_touch.hpp | 20
   sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp | 147 ++++++-----
   sandbox/gtl/boost/polygon/detail/polygon_formation.hpp | 10
   sandbox/gtl/boost/polygon/detail/property_merge.hpp | 46 +-
   sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp | 505 ++++++++++++++++++++-------------------
   sandbox/gtl/boost/polygon/gtl_boost_unit_test.cpp | 340 +++++++++++++++++++++++++-
   sandbox/gtl/boost/polygon/interval_concept.hpp | 231 +++++++++++------
   sandbox/gtl/boost/polygon/interval_data.hpp | 6
   sandbox/gtl/boost/polygon/isotropy.hpp | 83 ++++-
   sandbox/gtl/boost/polygon/point_3d_concept.hpp | 81 ++++-
   sandbox/gtl/boost/polygon/point_concept.hpp | 132 ++++++----
   sandbox/gtl/boost/polygon/point_data.hpp | 5
   sandbox/gtl/boost/polygon/polygon.hpp | 2
   sandbox/gtl/boost/polygon/polygon_45_data.hpp | 14
   sandbox/gtl/boost/polygon/polygon_45_set_concept.hpp | 6
   sandbox/gtl/boost/polygon/polygon_45_set_data.hpp | 70 +---
   sandbox/gtl/boost/polygon/polygon_45_with_holes_data.hpp | 4
   sandbox/gtl/boost/polygon/polygon_90_data.hpp | 47 ---
   sandbox/gtl/boost/polygon/polygon_90_set_concept.hpp | 22
   sandbox/gtl/boost/polygon/polygon_90_set_data.hpp | 4
   sandbox/gtl/boost/polygon/polygon_90_set_traits.hpp | 12
   sandbox/gtl/boost/polygon/polygon_90_with_holes_data.hpp | 4
   sandbox/gtl/boost/polygon/polygon_data.hpp | 14
   sandbox/gtl/boost/polygon/polygon_set_concept.hpp | 97 ++++---
   sandbox/gtl/boost/polygon/polygon_set_data.hpp | 11
   sandbox/gtl/boost/polygon/polygon_traits.hpp | 87 +++---
   sandbox/gtl/boost/polygon/polygon_with_holes_data.hpp | 50 ---
   sandbox/gtl/boost/polygon/rectangle_concept.hpp | 352 ++++++++++++++++++++-------
   sandbox/gtl/boost/polygon/rectangle_data.hpp | 6
   sandbox/gtl/boost/polygon/transform.hpp | 4
   38 files changed, 1885 insertions(+), 1444 deletions(-)

Modified: sandbox/gtl/boost/polygon/detail/boolean_op.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/boolean_op.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/boolean_op.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -252,128 +252,6 @@
     return BinaryCount<T>() - *this;
   }
 
- //self contained unit test for BooleanOr algorithm
- template <typename Unit>
- inline bool testBooleanOr() {
- BooleanOp<int, Unit> booleanOr;
- //test one rectangle
- std::vector<std::pair<interval_data<Unit>, int> > container;
- booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
- if(container.size() != 2) {
- std::cout << "Test one rectangle, wrong output size\n";
- return false;
- }
- if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
- std::cout << "Test one rectangle, first output wrong: Interval(" <<
- container[0].first << "), " << container[0].second << std::endl;
- }
- if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
- std::cout << "Test one rectangle, second output wrong: Interval(" <<
- container[1].first << "), " << container[1].second << std::endl;
- }
-
- //test two rectangles
- container.clear();
- booleanOr = BooleanOp<int, Unit>();
- booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(5, 15), 1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(5, 15), -1);
- if(container.size() != 4) {
- std::cout << "Test two rectangles, wrong output size\n";
- for(unsigned int i = 0; i < container.size(); ++i){
- std::cout << container[i].first << "), " << container[i].second << std::endl;
- }
- return false;
- }
- if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
- std::cout << "Test two rectangles, first output wrong: Interval(" <<
- container[0].first << "), " << container[0].second << std::endl;
- }
- if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(10, 15), 1)) {
- std::cout << "Test two rectangles, second output wrong: Interval(" <<
- container[1].first << "), " << container[1].second << std::endl;
- }
- if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 5), -1)) {
- std::cout << "Test two rectangles, third output wrong: Interval(" <<
- container[2].first << "), " << container[2].second << std::endl;
- }
- if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(5, 15), -1)) {
- std::cout << "Test two rectangles, fourth output wrong: Interval(" <<
- container[3].first << "), " << container[3].second << std::endl;
- }
-
- //test two rectangles
- container.clear();
- booleanOr = BooleanOp<int, Unit>();
- booleanOr.processInterval(container, interval_data<Unit>(5, 15), 1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(5, 15), -1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
- if(container.size() != 4) {
- std::cout << "Test other two rectangles, wrong output size\n";
- for(unsigned int i = 0; i < container.size(); ++i){
- std::cout << container[i].first << "), " << container[i].second << std::endl;
- }
- return false;
- }
- if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(5, 15), 1)) {
- std::cout << "Test other two rectangles, first output wrong: Interval(" <<
- container[0].first << "), " << container[0].second << std::endl;
- }
- if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 5), 1)) {
- std::cout << "Test other two rectangles, second output wrong: Interval(" <<
- container[1].first << "), " << container[1].second << std::endl;
- }
- if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(10, 15), -1)) {
- std::cout << "Test other two rectangles, third output wrong: Interval(" <<
- container[2].first << "), " << container[2].second << std::endl;
- }
- if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
- std::cout << "Test other two rectangles, fourth output wrong: Interval(" <<
- container[3].first << "), " << container[3].second << std::endl;
- }
-
- //test two nonoverlapping rectangles
- container.clear();
- booleanOr = BooleanOp<int, Unit>();
- booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(15, 25), 1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
- booleanOr.advanceScan();
- booleanOr.processInterval(container, interval_data<Unit>(15, 25), -1);
- if(container.size() != 4) {
- std::cout << "Test two nonoverlapping rectangles, wrong output size\n";
- return false;
- }
- if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
- std::cout << "Test two nonoverlapping rectangles, first output wrong: Interval(" <<
- container[0].first << "), " << container[0].second << std::endl;
- }
- if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(15, 25), 1)) {
- std::cout << "Test two nonoverlapping rectangles, second output wrong: Interval(" <<
- container[1].first << "), " << container[1].second << std::endl;
- }
- if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
- std::cout << "Test two nonoverlapping rectangles, third output wrong: Interval(" <<
- container[2].first << "), " << container[2].second << std::endl;
- }
- if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(15, 25), -1)) {
- std::cout << "Test two nonoverlapping rectangles, fourth output wrong: Interval(" <<
- container[3].first << "), " << container[3].second << std::endl;
- }
- return true;
- }
 
   template <class T, typename Unit, typename iterator_type_1, typename iterator_type_2>
   inline void applyBooleanBinaryOp(std::vector<std::pair<Unit, std::pair<Unit, int> > >& output,
@@ -457,7 +335,7 @@
         interval_data<Unit> ivl(prevPosition, curPosition);
         container.clear();
         boolean.processInterval(container, ivl, count);
- for(unsigned int i = 0; i < container.size(); ++i) {
+ for(std::size_t i = 0; i < container.size(); ++i) {
           std::pair<interval_data<Unit>, int>& element = container[i];
           if(!output.empty() && output.back().first == prevCoord &&
              output.back().second.first == element.first.low() &&
@@ -524,7 +402,7 @@
           interval_data<Unit> ivl(prevY, y);
           container.clear();
           booleanOr.processInterval(container, ivl, count_type(count));
- for(unsigned int i = 0; i < container.size(); ++i) {
+ for(std::size_t i = 0; i < container.size(); ++i) {
             std::pair<interval_data<Unit>, int>& element = container[i];
             if(!output.empty() && output.back().first == prevPos &&
                output.back().second.first == element.first.low() &&

Modified: sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -571,7 +571,7 @@
           }
           //std::cout << "Below Count: " << countBelow << std::endl;
           Scan45Count count(countBelow);
- unsigned int numEdges = 0;
+ std::size_t numEdges = 0;
           iterator eraseItrs[3];
           while(lowIter != scanData_.end() &&
                 lowIter->evalAtX(x_) == vertex.first.y()) {
@@ -590,13 +590,13 @@
           }
           //before we erase the elements we need to decide if they should be written out
           CountType currentCount = countBelow;
- for(unsigned int i = 0; i < numEdges; ++i) {
+ for(std::size_t i = 0; i < numEdges; ++i) {
             output_functor f;
             f(output, currentCount, eraseItrs[i]->count, crossPoint, eraseItrs[i]->rise, LOW);
             currentCount = eraseItrs[i]->count;
           }
           //schedule erase of the elements
- for(unsigned int i = 0; i < numEdges; ++i) {
+ for(std::size_t i = 0; i < numEdges; ++i) {
             eraseVec.push_back(eraseItrs[i]);
           }
          
@@ -612,7 +612,7 @@
         }
         //erase crossing elements
         std::vector<iterator> searchVec;
- for(unsigned int i = 0; i < eraseVec.size(); ++i) {
+ for(std::size_t i = 0; i < eraseVec.size(); ++i) {
           if(eraseVec[i] != scanData_.begin()) {
             iterator searchItr = eraseVec[i];
             --searchItr;
@@ -622,7 +622,7 @@
           }
           scanData_.erase(eraseVec[i]);
         }
- for(unsigned int i = 0; i < searchVec.size(); ++i) {
+ for(std::size_t i = 0; i < searchVec.size(); ++i) {
           findCross_(searchVec[i]);
         }
       }
@@ -632,14 +632,14 @@
         Scan45Vector vec;
         swap(vec, crossVector_);
         iT mergeEnd = inputBegin;
- unsigned int mergeCount = 0;
+ std::size_t mergeCount = 0;
         while(mergeEnd != inputEnd &&
               (*mergeEnd).first.x() == x_) {
           ++mergeCount;
           ++mergeEnd;
         }
         crossVector_.reserve((std::max)(vec.capacity(), vec.size() + mergeCount));
- for(unsigned int i = 0; i < vec.size(); ++i){
+ for(std::size_t i = 0; i < vec.size(); ++i){
           while(inputBegin != mergeEnd &&
                 (*inputBegin).first.y() < vec[i].first.y()) {
             crossVector_.push_back(*inputBegin);
@@ -849,16 +849,17 @@
       }
     };
 
- template <typename CountType>
- static inline void print45Data(const std::set<Scan45ElementT<CountType>,
- lessScan45Element<CountType> >& data) {
- typename std::set<Scan45ElementT<CountType>, lessScan45Element<CountType> >::const_iterator iter;
- for(iter = data.begin(); iter != data.end(); ++iter) {
- std::cout << iter->x << " " << iter->y << " " << iter->rise << std::endl;
- }
- }
+ //template <typename CountType>
+ //static inline void print45Data(const std::set<Scan45ElementT<CountType>,
+ // lessScan45Element<CountType> >& data) {
+ // typename std::set<Scan45ElementT<CountType>, lessScan45Element<CountType> >::const_iterator iter;
+ // for(iter = data.begin(); iter != data.end(); ++iter) {
+ // std::cout << iter->x << " " << iter->y << " " << iter->rise << std::endl;
+ // }
+ //}
 
- static inline bool testScan45Data() {
+ template <typename streamtype>
+ static inline bool testScan45Data(streamtype& stdcout) {
       Unit x = 0;
       int justBefore = false;
       lessScan45Element<Count2> lessElm(&x, &justBefore);
@@ -875,8 +876,8 @@
       //now at 14 24 26 36
       typename Scan45Data::iterator itrB = testData.lower_bound(Scan45Element(4, 29, -1));
       typename Scan45Data::iterator itr2 = testData.lower_bound(Scan45Element(4, 14, -1));
- if(itr1 != itr2) std::cout << "test1 failed\n";
- if(itrA == itrB) std::cout << "test2 failed\n";
+ if(itr1 != itr2) stdcout << "test1 failed\n";
+ if(itrA == itrB) stdcout << "test2 failed\n";
       //remove crossing elements
       testData.erase(itr20);
       testData.erase(itr30);
@@ -885,19 +886,20 @@
       itr30 = testData.insert(testData.end(), Scan45Element(0, 30, -1));
       //now at 15 25 25 35
       typename Scan45Data::iterator itr = testData.begin();
- if(itr != itr10) std::cout << "test3 failed\n";
+ if(itr != itr10) stdcout << "test3 failed\n";
       ++itr;
- if(itr != itr30) std::cout << "test4 failed\n";
+ if(itr != itr30) stdcout << "test4 failed\n";
       ++itr;
- if(itr != itr20) std::cout << "test5 failed\n";
+ if(itr != itr20) stdcout << "test5 failed\n";
       ++itr;
- if(itr != itr40) std::cout << "test6 failed\n";
- std::cout << "done testing Scan45Data\n";
+ if(itr != itr40) stdcout << "test6 failed\n";
+ stdcout << "done testing Scan45Data\n";
       return true;
     }
    
- static inline bool testScan45Rect() {
- std::cout << "testing Scan45Rect\n";
+ template <typename stream_type>
+ static inline bool testScan45Rect(stream_type& stdcout) {
+ stdcout << "testing Scan45Rect\n";
       Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
       std::vector<Vertex45 > result;
       typedef std::pair<Point, Scan45Count> Scan45Vertex;
@@ -909,9 +911,9 @@
       vertices.push_back(Scan45Vertex(Point(0,10), Scan45Count(Count2(0, 0), ncount, Count2(0, 0), ncount)));
       vertices.push_back(Scan45Vertex(Point(10,0), Scan45Count(Count2(0, 0), ncount, Count2(0, 0), ncount)));
       vertices.push_back(Scan45Vertex(Point(10,10), Scan45Count(Count2(0, 0), count, Count2(0, 0), count)));
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
- std::cout << "done scanning\n";
+ stdcout << "done scanning\n";
       // result size == 8
       // result == 0 0 0 1
       // result == 0 0 2 1
@@ -931,22 +933,23 @@
       reference.push_back(Vertex45(Point(10, 10), 2, 1));
       reference.push_back(Vertex45(Point(10, 10), 0, 1));
       if(result != reference) {
- std::cout << "result size == " << result.size() << std::endl;
- for(unsigned int i = 0; i < result.size(); ++i) {
+ stdcout << "result size == " << result.size() << std::endl;
+ for(std::size_t i = 0; i < result.size(); ++i) {
           //std::cout << "result == " << result[i]<< std::endl;
         }
- std::cout << "reference size == " << reference.size() << std::endl;
- for(unsigned int i = 0; i < reference.size(); ++i) {
+ stdcout << "reference size == " << reference.size() << std::endl;
+ for(std::size_t i = 0; i < reference.size(); ++i) {
           //std::cout << "reference == " << reference[i]<< std::endl;
         }
         return false;
       }
- std::cout << "done testing Scan45Rect\n";
+ stdcout << "done testing Scan45Rect\n";
       return true;
     }
 
- static inline bool testScan45P1() {
- std::cout << "testing Scan45P1\n";
+ template <typename stream_type>
+ static inline bool testScan45P1(stream_type& stdcout) {
+ stdcout << "testing Scan45P1\n";
       Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
       std::vector<Vertex45 > result;
       typedef std::pair<Point, Scan45Count> Scan45Vertex;
@@ -958,9 +961,9 @@
       vertices.push_back(Scan45Vertex(Point(0,10), Scan45Count(Count2(0, 0), Count2(0, 0), ncount, ncount)));
       vertices.push_back(Scan45Vertex(Point(10,10), Scan45Count(Count2(0, 0), Count2(0, 0), ncount, ncount)));
       vertices.push_back(Scan45Vertex(Point(10,20), Scan45Count(Count2(0, 0), Count2(0, 0), count, count)));
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
- std::cout << "done scanning\n";
+ stdcout << "done scanning\n";
       // result size == 8
       // result == 0 0 1 1
       // result == 0 0 2 1
@@ -980,22 +983,23 @@
       reference.push_back(Vertex45(Point(10, 20), 2, 1));
       reference.push_back(Vertex45(Point(10, 20), 1, 1));
       if(result != reference) {
- std::cout << "result size == " << result.size() << std::endl;
- for(unsigned int i = 0; i < result.size(); ++i) {
+ stdcout << "result size == " << result.size() << std::endl;
+ for(std::size_t i = 0; i < result.size(); ++i) {
           //std::cout << "result == " << result[i]<< std::endl;
         }
- std::cout << "reference size == " << reference.size() << std::endl;
- for(unsigned int i = 0; i < reference.size(); ++i) {
+ stdcout << "reference size == " << reference.size() << std::endl;
+ for(std::size_t i = 0; i < reference.size(); ++i) {
           //std::cout << "reference == " << reference[i]<< std::endl;
         }
         return false;
       }
- std::cout << "done testing Scan45P1\n";
+ stdcout << "done testing Scan45P1\n";
       return true;
     }
 
- static inline bool testScan45P2() {
- std::cout << "testing Scan45P2\n";
+ template <typename stream_type>
+ static inline bool testScan45P2(stream_type& stdcout) {
+ stdcout << "testing Scan45P2\n";
       Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
       std::vector<Vertex45 > result;
       typedef std::pair<Point, Scan45Count> Scan45Vertex;
@@ -1007,9 +1011,9 @@
       vertices.push_back(Scan45Vertex(Point(10,0), Scan45Count(Count2(0, 0), ncount, count, Count2(0, 0))));
       vertices.push_back(Scan45Vertex(Point(10,10), Scan45Count(Count2(0, 0), ncount, count, Count2(0, 0))));
       vertices.push_back(Scan45Vertex(Point(20,10), Scan45Count(Count2(0, 0), count, ncount, Count2(0, 0))));
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
- std::cout << "done scanning\n";
+ stdcout << "done scanning\n";
       // result size == 8
       // result == 0 0 0 1
       // result == 0 0 1 -1
@@ -1029,22 +1033,23 @@
       reference.push_back(Vertex45(Point(20, 10), 1, -1));
       reference.push_back(Vertex45(Point(20, 10), 0, 1));
       if(result != reference) {
- std::cout << "result size == " << result.size() << std::endl;
- for(unsigned int i = 0; i < result.size(); ++i) {
- //std::cout << "result == " << result[i]<< std::endl;
- }
- std::cout << "reference size == " << reference.size() << std::endl;
- for(unsigned int i = 0; i < reference.size(); ++i) {
- //std::cout << "reference == " << reference[i]<< std::endl;
+ stdcout << "result size == " << result.size() << std::endl;
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ //stdcout << "result == " << result[i]<< std::endl;
+ }
+ stdcout << "reference size == " << reference.size() << std::endl;
+ for(std::size_t i = 0; i < reference.size(); ++i) {
+ //stdcout << "reference == " << reference[i]<< std::endl;
         }
         return false;
       }
- std::cout << "done testing Scan45P2\n";
+ stdcout << "done testing Scan45P2\n";
       return true;
     }
 
- static inline bool testScan45And() {
- std::cout << "testing Scan45And\n";
+ template <typename streamtype>
+ static inline bool testScan45And(streamtype& stdcout) {
+ stdcout << "testing Scan45And\n";
       Scan45<Count2, boolean_op_45_output_functor<1> > scan45;
       std::vector<Vertex45 > result;
       typedef std::pair<Point, Scan45Count> Scan45Vertex;
@@ -1063,9 +1068,9 @@
       vertices.push_back(Scan45Vertex(Point(12,2), Scan45Count(Count2(0, 0), ncount, Count2(0, 0), ncount)));
       vertices.push_back(Scan45Vertex(Point(12,12), Scan45Count(Count2(0, 0), count, Count2(0, 0), count)));
       sortScan45Vector(vertices);
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
- std::cout << "done scanning\n";
+ stdcout << "done scanning\n";
       //result size == 8
       //result == 2 2 0 1
       //result == 2 2 2 1
@@ -1085,22 +1090,23 @@
       reference.push_back(Vertex45(Point(10, 10), 2, 1));
       reference.push_back(Vertex45(Point(10, 10), 0, 1));
       if(result != reference) {
- std::cout << "result size == " << result.size() << std::endl;
- for(unsigned int i = 0; i < result.size(); ++i) {
- //std::cout << "result == " << result[i]<< std::endl;
- }
- std::cout << "reference size == " << reference.size() << std::endl;
- for(unsigned int i = 0; i < reference.size(); ++i) {
- //std::cout << "reference == " << reference[i]<< std::endl;
+ stdcout << "result size == " << result.size() << std::endl;
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ //stdcout << "result == " << result[i]<< std::endl;
+ }
+ stdcout << "reference size == " << reference.size() << std::endl;
+ for(std::size_t i = 0; i < reference.size(); ++i) {
+ //stdcout << "reference == " << reference[i]<< std::endl;
         }
         return false;
       }
- std::cout << "done testing Scan45And\n";
+ stdcout << "done testing Scan45And\n";
       return true;
     }
 
- static inline bool testScan45Star1() {
- std::cout << "testing Scan45Star1\n";
+ template <typename stream_type>
+ static inline bool testScan45Star1(stream_type& stdcout) {
+ stdcout << "testing Scan45Star1\n";
       Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
       std::vector<Vertex45 > result;
       typedef std::pair<Point, Scan45Count> Scan45Vertex;
@@ -1117,9 +1123,9 @@
       vertices.push_back(Scan45Vertex(Point(4,0), Scan45Count(Count2(0, 0), Count2(0, 0), count, count)));
       vertices.push_back(Scan45Vertex(Point(4,16), Scan45Count(ncount, Count2(0, 0), Count2(0, 0), ncount)));
       sortScan45Vector(vertices);
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
- std::cout << "done scanning\n";
+ stdcout << "done scanning\n";
       // result size == 24
       // result == 0 8 -1 1
       // result == 0 8 1 -1
@@ -1146,16 +1152,17 @@
       // result == 12 8 1 -1
       // result == 12 8 -1 1
       if(result.size() != 24) {
- //std::cout << "result size == " << result.size() << std::endl;
- //std::cout << "reference size == " << 24 << std::endl;
+ //stdcout << "result size == " << result.size() << std::endl;
+ //stdcout << "reference size == " << 24 << std::endl;
         return false;
       }
- std::cout << "done testing Scan45Star1\n";
+ stdcout << "done testing Scan45Star1\n";
       return true;
     }
 
- static inline bool testScan45Star2() {
- std::cout << "testing Scan45Star2\n";
+ template <typename stream_type>
+ static inline bool testScan45Star2(stream_type& stdcout) {
+ stdcout << "testing Scan45Star2\n";
       Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
       std::vector<Vertex45 > result;
       typedef std::pair<Point, Scan45Count> Scan45Vertex;
@@ -1172,9 +1179,9 @@
       vertices.push_back(Scan45Vertex(Point(16,8), Scan45Count(Count2(0, 0), count, ncount, Count2(0, 0))));
       vertices.push_back(Scan45Vertex(Point(8,0), Scan45Count(ncount, Count2(0, 0), count, Count2(0, 0))));
       sortScan45Vector(vertices);
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
- std::cout << "done scanning\n";
+ stdcout << "done scanning\n";
       // result size == 24
       // result == 0 4 0 1
       // result == 0 4 1 -1
@@ -1205,12 +1212,13 @@
         //std::cout << "reference size == " << 24 << std::endl;
         return false;
       }
- std::cout << "done testing Scan45Star2\n";
+ stdcout << "done testing Scan45Star2\n";
       return true;
     }
 
- static inline bool testScan45Star3() {
- std::cout << "testing Scan45Star3\n";
+ template <typename stream_type>
+ static inline bool testScan45Star3(stream_type& stdcout) {
+ stdcout << "testing Scan45Star3\n";
       Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
       std::vector<Vertex45 > result;
       typedef std::pair<Point, Scan45Count> Scan45Vertex;
@@ -1232,9 +1240,9 @@
       vertices.push_back(Scan45Vertex(Point(4,0), Scan45Count(Count2(0, 0), Count2(0, 0), count, count)));
       vertices.push_back(Scan45Vertex(Point(4,16), Scan45Count(ncount, Count2(0, 0), Count2(0, 0), ncount)));
       sortScan45Vector(vertices);
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
- std::cout << "done scanning\n";
+ stdcout << "done scanning\n";
       // result size == 28
       // result == 0 8 -1 1
       // result == 0 8 1 -1
@@ -1270,12 +1278,14 @@
         return false;
       }
 
- std::cout << "done testing Scan45Star3\n";
+ stdcout << "done testing Scan45Star3\n";
       return true;
     }
 
- static inline bool testScan45Star4() {
- std::cout << "testing Scan45Star4\n";
+
+ template <typename stream_type>
+ static inline bool testScan45Star4(stream_type& stdcout) {
+ stdcout << "testing Scan45Star4\n";
       Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
       std::vector<Vertex45 > result;
       typedef std::pair<Point, Scan45Count> Scan45Vertex;
@@ -1297,9 +1307,9 @@
       vertices.push_back(Scan45Vertex(Point(16,8), Scan45Count(Count2(0, 0), count, ncount, Count2(0, 0))));
       vertices.push_back(Scan45Vertex(Point(8,0), Scan45Count(ncount, Count2(0, 0), count, Count2(0, 0))));
       sortScan45Vector(vertices);
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
- std::cout << "done scanning\n";
+ stdcout << "done scanning\n";
       // result size == 28
       // result == 0 4 0 1
       // result == 0 4 1 -1
@@ -1330,24 +1340,25 @@
       // result == 16 12 2 1
       // result == 16 12 0 1
       if(result.size() != 28) {
- //std::cout << "result size == " << result.size() << std::endl;
- //std::cout << "reference size == " << 28 << std::endl;
+ //stdcout << "result size == " << result.size() << std::endl;
+ //stdcout << "reference size == " << 28 << std::endl;
         return false;
       }
 
- std::cout << "done testing Scan45Star4\n";
+ stdcout << "done testing Scan45Star4\n";
       return true;
     }
 
- static inline bool testScan45() {
- if(!testScan45Rect()) return false;
- if(!testScan45P1()) return false;
- if(!testScan45P2()) return false;
- if(!testScan45And()) return false;
- if(!testScan45Star1()) return false;
- if(!testScan45Star2()) return false;
- if(!testScan45Star3()) return false;
- if(!testScan45Star4()) return false;
+ template <typename stream_type>
+ static inline bool testScan45(stream_type& stdcout) {
+ if(!testScan45Rect(stdcout)) return false;
+ if(!testScan45P1(stdcout)) return false;
+ if(!testScan45P2(stdcout)) return false;
+ if(!testScan45And(stdcout)) return false;
+ if(!testScan45Star1(stdcout)) return false;
+ if(!testScan45Star2(stdcout)) return false;
+ if(!testScan45Star3(stdcout)) return false;
+ if(!testScan45Star4(stdcout)) return false;
       return true;
     }
 

Modified: sandbox/gtl/boost/polygon/detail/iterator_points_to_compact.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/iterator_points_to_compact.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/iterator_points_to_compact.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -23,7 +23,7 @@
   typedef const coordinate_type& reference; //immutable
 
   inline iterator_points_to_compact() : iter_(), iterEnd_(), orient_(), coord_() {}
- explicit inline iterator_points_to_compact(iT iter, iT iterEnd) :
+ inline iterator_points_to_compact(iT iter, iT iterEnd) :
     iter_(iter), iterEnd_(iterEnd), orient_(HORIZONTAL), coord_() {}
   inline iterator_points_to_compact(const iterator_points_to_compact& that) :
     iter_(that.iter_), iterEnd_(that.iterEnd_), orient_(that.orient_), coord_(that.coord_) {}

Modified: sandbox/gtl/boost/polygon/detail/max_cover.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/max_cover.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/max_cover.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -204,7 +204,7 @@
     //edges are in sorted order
     template <class iT>
     static inline void computeDag(iT beginNode, iT endNode, orientation_2d orient,
- unsigned int size) {
+ std::size_t size) {
       std::vector<EdgeAssociation> leadingEdges;
       leadingEdges.reserve(size);
       for(iT iter = beginNode; iter != endNode; ++iter) {
@@ -263,10 +263,10 @@
           return;
         }
         nodes.reserve(rects.size());
- for(unsigned int i = 0; i < rects.size(); ++i) { nodes.push_back(Node(rects[i])); }
+ for(std::size_t i = 0; i < rects.size(); ++i) { nodes.push_back(Node(rects[i])); }
       }
       computeDag(nodes.begin(), nodes.end(), orient, nodes.size());
- for(unsigned int i = 0; i < nodes.size(); ++i) {
+ for(std::size_t i = 0; i < nodes.size(); ++i) {
         getMaxCover(outputContainer, &(nodes[i]), orient);
       }
     }

Modified: sandbox/gtl/boost/polygon/detail/polygon_45_formation.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/polygon_45_formation.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/polygon_45_formation.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -362,9 +362,9 @@
         holesList_.clear();
       }
 
- inline void print() {
- std::cout << this << " " << tailp_ << " " << otherTailp_ << " " << holesList_.size() << " " << head_ << std::endl;
- }
+// inline void print() {
+// std::cout << this << " " << tailp_ << " " << otherTailp_ << " " << holesList_.size() << " " << head_ << std::endl;
+// }
 
       static inline std::pair<ActiveTail45*, ActiveTail45*> createActiveTail45sAsPair(Point point, bool solid,
                                                                                       ActiveTail45* phole, bool fractureHoles) {
@@ -869,8 +869,9 @@
    
     };
 
- static inline bool testPolygon45FormationRect() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygon45FormationRect(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       Polygon45Formation pf(true);
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -884,16 +885,17 @@
       data.push_back(Vertex45(Point(10, 10), 0, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygon45FormationP1() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygon45FormationP1(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       Polygon45Formation pf(true);
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -907,17 +909,18 @@
       data.push_back(Vertex45(Point(10, 20), 1, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
     //polygon45set class
 
- static inline bool testPolygon45FormationP2() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygon45FormationP2(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       Polygon45Formation pf(true);
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -931,17 +934,18 @@
       data.push_back(Vertex45(Point(20, 10), 0, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
     //polygon45set class
 
- static inline bool testPolygon45FormationStar1() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygon45FormationStar1(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       Polygon45Formation pf(true);
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -995,16 +999,17 @@
       data.push_back(Vertex45(Point(12, 8), -1, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygon45FormationStar2() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygon45FormationStar2(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       Polygon45Formation pf(true);
       std::vector<Polygon45> polys;
       Scan45 scan45;
@@ -1022,21 +1027,22 @@
       vertices.push_back(Scan45Vertex(Point(16,8), Scan45Count(Count2(0, 0), count, ncount, Count2(0, 0))));
       vertices.push_back(Scan45Vertex(Point(8,0), Scan45Count(ncount, Count2(0, 0), count, Count2(0, 0))));
       sortScan45Vector(vertices);
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
    
       std::sort(result.begin(), result.end());
       pf.scan(polys, result.begin(), result.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygon45FormationStarHole1() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygon45FormationStarHole1(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       Polygon45Formation pf(true);
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1098,16 +1104,17 @@
 
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygon45FormationStarHole2() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygon45FormationStarHole2(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       Polygon45Formation pf(false);
       std::vector<Polygon45WithHoles> polys;
       std::vector<Vertex45> data;
@@ -1169,16 +1176,17 @@
 
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygon45Formation() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygon45Formation(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       Polygon45Formation pf(false);
       std::vector<Polygon45WithHoles> polys;
       std::vector<Vertex45> data;
@@ -1212,11 +1220,11 @@
 
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
@@ -1625,8 +1633,9 @@
    
     };
 
- static inline bool testPolygon45TilingRect() {
- std::cout << "testing polygon tiling\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingRect(stream_type& stdcout) {
+ stdcout << "testing polygon tiling\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1640,16 +1649,17 @@
       data.push_back(Vertex45(Point(10, 10), 0, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingP1() {
- std::cout << "testing polygon tiling\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingP1(stream_type& stdcout) {
+ stdcout << "testing polygon tiling\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1663,16 +1673,17 @@
       data.push_back(Vertex45(Point(10, 20), 1, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingP2() {
- std::cout << "testing polygon tiling\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingP2(stream_type& stdcout) {
+ stdcout << "testing polygon tiling\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1686,16 +1697,17 @@
       data.push_back(Vertex45(Point(20, 10), 0, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingP3() {
- std::cout << "testing polygon tiling\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingP3(stream_type& stdcout) {
+ stdcout << "testing polygon tiling\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1711,16 +1723,17 @@
       data.push_back(Vertex45(Point(20, 20), 2, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingP4() {
- std::cout << "testing polygon tiling p4\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingP4(stream_type& stdcout) {
+ stdcout << "testing polygon tiling p4\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1736,16 +1749,17 @@
       data.push_back(Vertex45(Point(20, -10), 2, -1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingP5() {
- std::cout << "testing polygon tiling P5\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingP5(stream_type& stdcout) {
+ stdcout << "testing polygon tiling P5\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1768,16 +1782,17 @@
       data.push_back(Vertex45(Point(3, 2), 0, -1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingP6() {
- std::cout << "testing polygon tiling P6\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingP6(stream_type& stdcout) {
+ stdcout << "testing polygon tiling P6\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1801,16 +1816,17 @@
 
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingStar1() {
- std::cout << "testing polygon tiling star1\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingStar1(stream_type& stdcout) {
+ stdcout << "testing polygon tiling star1\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1864,16 +1880,17 @@
       data.push_back(Vertex45(Point(12, 8), -1, 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingStar2() {
- std::cout << "testing polygon tiling\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingStar2(stream_type& stdcout) {
+ stdcout << "testing polygon tiling\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
 
@@ -1892,21 +1909,22 @@
       vertices.push_back(Scan45Vertex(Point(16,8), Scan45Count(Count2(0, 0), count, ncount, Count2(0, 0))));
       vertices.push_back(Scan45Vertex(Point(8,0), Scan45Count(ncount, Count2(0, 0), count, Count2(0, 0))));
       sortScan45Vector(vertices);
- std::cout << "scanning\n";
+ stdcout << "scanning\n";
       scan45.scan(result, vertices.begin(), vertices.end());
    
       std::sort(result.begin(), result.end());
       pf.scan(polys, result.begin(), result.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingStarHole1() {
- std::cout << "testing polygon tiling star hole 1\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingStarHole1(stream_type& stdcout) {
+ stdcout << "testing polygon tiling star hole 1\n";
       Polygon45Tiling pf;
       std::vector<Polygon45> polys;
       std::vector<Vertex45> data;
@@ -1968,16 +1986,17 @@
 
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45TilingStarHole2() {
- std::cout << "testing polygon tiling star hole 2\n";
+ template <typename stream_type>
+ static inline bool testPolygon45TilingStarHole2(stream_type& stdcout) {
+ stdcout << "testing polygon tiling star hole 2\n";
       Polygon45Tiling pf;
       std::vector<Polygon45WithHoles> polys;
       std::vector<Vertex45> data;
@@ -2039,16 +2058,17 @@
 
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
 
- static inline bool testPolygon45Tiling() {
- std::cout << "testing polygon tiling\n";
+ template <typename stream_type>
+ static inline bool testPolygon45Tiling(stream_type& stdcout) {
+ stdcout << "testing polygon tiling\n";
       Polygon45Tiling pf;
       std::vector<Polygon45WithHoles> polys;
       std::vector<Vertex45> data;
@@ -2082,11 +2102,11 @@
 
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon tiling\n";
+ stdcout << "done testing polygon tiling\n";
       return true;
     }
   };
@@ -2110,7 +2130,7 @@
     //use default copy and assign
     inline iterator begin() const { return p_->getTail()->begin(); }
     inline iterator end() const { return p_->getTail()->end(); }
- inline unsigned int size() const { return 0; }
+ inline std::size_t size() const { return 0; }
     template<class iT>
     inline PolyLine45HoleData& set(iT inputBegin, iT inputEnd) {
       return *this;
@@ -2178,8 +2198,8 @@
     inline iteratorHoles end_holes() const { return iteratorHoles(p_->getHoles().end()); }
     inline ActiveTail45* yield() { return p_; }
     //stub out these four required functions that will not be used but are needed for the interface
- inline unsigned int size_holes() const { return 0; }
- inline unsigned int size() const { return 0; }
+ inline std::size_t size_holes() const { return 0; }
+ inline std::size_t size() const { return 0; }
     template<class iT>
     inline PolyLine45PolygonData& set(iT inputBegin, iT inputEnd) {
       return *this;

Modified: sandbox/gtl/boost/polygon/detail/polygon_45_set_view.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/polygon_45_set_view.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/polygon_45_set_view.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -166,8 +166,10 @@
   template <typename ltype, typename rtype, int op_type>
   struct geometry_concept<polygon_45_set_view<ltype, rtype, op_type> > { typedef polygon_45_set_concept type; };
 
+ struct y_ps45_b : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3<
+ typename enable_if< typename gtl_and_4< y_ps45_b,
     typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
     typename is_polygon_45_or_90_set_type<geometry_type_2>::type,
     typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type,
@@ -177,27 +179,23 @@
       (lvalue, rvalue);
   }
   
+ struct y_ps45_p : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3< typename is_polygon_45_or_90_set_type<geometry_type_1>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename is_polygon_45_or_90_set_type<geometry_type_2>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, polygon_45_set_view<geometry_type_1, geometry_type_2, 0> >::type
+ typename enable_if< typename gtl_and_4< y_ps45_p,
+ typename gtl_if<typename is_polygon_45_or_90_set_type<geometry_type_1>::type>::type,
+ typename gtl_if<typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
+ typename gtl_if<typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type>::type,
+ polygon_45_set_view<geometry_type_1, geometry_type_2, 0> >::type
   operator+(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return polygon_45_set_view<geometry_type_1, geometry_type_2, 0>
       (lvalue, rvalue);
   }
   
+ struct y_ps45_s : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3< typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_4< y_ps45_s, typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
                                            typename is_polygon_45_or_90_set_type<geometry_type_2>::type,
                                            typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type,
                        polygon_45_set_view<geometry_type_1, geometry_type_2, 1> >::type
@@ -205,9 +203,23 @@
     return polygon_45_set_view<geometry_type_1, geometry_type_2, 1>
       (lvalue, rvalue);
   }
-
+
+ struct y_ps45_a : gtl_yes {};
+#if 0
+ template <typename geometry_type_1, typename geometry_type_2>
+ typename enable_if< typename gtl_and_4< y_ps45_a, typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
+ typename is_polygon_45_or_90_set_type<geometry_type_2>::type,
+ typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type,
+ polygon_45_set_view<geometry_type_1, geometry_type_2, 1> >::type
+ operator&(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
+ return polygon_45_set_view<geometry_type_1, geometry_type_2, 1>
+ (lvalue, rvalue);
+ }
+#endif
+ struct y_ps45_x : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3< typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_4< y_ps45_x, typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
                                            typename is_polygon_45_or_90_set_type<geometry_type_2>::type,
                                            typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type,
                        polygon_45_set_view<geometry_type_1, geometry_type_2, 2> >::type
@@ -216,43 +228,43 @@
       (lvalue, rvalue);
   }
   
+ struct y_ps45_m : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3< typename is_polygon_45_or_90_set_type<geometry_type_1>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename is_polygon_45_or_90_set_type<geometry_type_2>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, polygon_45_set_view<geometry_type_1, geometry_type_2, 3> >::type
+ typename enable_if< typename gtl_and_4< y_ps45_m,
+ typename gtl_if<typename is_polygon_45_or_90_set_type<geometry_type_1>::type>::type,
+ typename gtl_if<typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
+ typename gtl_if<typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type>::type,
+ polygon_45_set_view<geometry_type_1, geometry_type_2, 3> >::type
   operator-(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return polygon_45_set_view<geometry_type_1, geometry_type_2, 3>
       (lvalue, rvalue);
   }
   
+ struct y_ps45_pe : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_4<y_ps45_pe, typename is_mutable_polygon_45_set_type<geometry_type_1>::type, gtl_yes,
                                          typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator+=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op_45<geometry_type_1, geometry_type_2, 0>(lvalue, rvalue);
   }
 
+ struct y_ps45_be : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3<y_ps45_be, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
                                          typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator|=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op_45<geometry_type_1, geometry_type_2, 0>(lvalue, rvalue);
   }
 
+ struct y_ps45_se : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3< y_ps45_se,
     typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
     typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
@@ -260,33 +272,41 @@
     return self_assignment_boolean_op_45<geometry_type_1, geometry_type_2, 1>(lvalue, rvalue);
   }
 
+ struct y_ps45_ae : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3<y_ps45_ae, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
                                          typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator&=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op_45<geometry_type_1, geometry_type_2, 1>(lvalue, rvalue);
   }
 
+ struct y_ps45_xe : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
+ typename gtl_and_3<y_ps45_xe, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
                       typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
     geometry_type_1>::type &
   operator^=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op_45<geometry_type_1, geometry_type_2, 2>(lvalue, rvalue);
   }
 
+ struct y_ps45_me : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3<y_ps45_me, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
                                          typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator-=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op_45<geometry_type_1, geometry_type_2, 3>(lvalue, rvalue);
   }
 
+ struct y_ps45_rpe : gtl_yes {};
+
   template <typename geometry_type_1, typename coordinate_type_1>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3< y_ps45_rpe, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
                                          typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
                                                                 coordinate_concept>::type>::type,
                        geometry_type_1>::type &
@@ -294,8 +314,10 @@
     return resize(lvalue, rvalue);
   }
 
+ struct y_ps45_rme : gtl_yes {};
+
   template <typename geometry_type_1, typename coordinate_type_1>
- typename enable_if< typename gtl_and< typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>::type,
+ typename enable_if< typename gtl_and_3<y_ps45_rme, typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>::type,
                                          typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
                                                                 coordinate_concept>::type>::type,
                        geometry_type_1>::type &
@@ -303,16 +325,12 @@
     return resize(lvalue, -rvalue);
   }
 
+ struct y_ps45_rp : gtl_yes {};
+
   template <typename geometry_type_1, typename coordinate_type_1>
- typename enable_if< typename gtl_and< typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
- coordinate_concept>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
+ typename enable_if< typename gtl_and_3<y_ps45_rp, typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>::type,
+ typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
+ coordinate_concept>::type>
   ::type, geometry_type_1>::type
   operator+(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
     geometry_type_1 retval(lvalue);
@@ -320,16 +338,12 @@
     return retval;
   }
 
+ struct y_ps45_rm : gtl_yes {};
+
   template <typename geometry_type_1, typename coordinate_type_1>
- typename enable_if< typename gtl_and< typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
- coordinate_concept>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
+ typename enable_if< typename gtl_and_3<y_ps45_rm, typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>::type,
+ typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
+ coordinate_concept>::type>
   ::type, geometry_type_1>::type
   operator-(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
     geometry_type_1 retval(lvalue);

Modified: sandbox/gtl/boost/polygon/detail/polygon_45_touch.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/polygon_45_touch.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/polygon_45_touch.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -19,8 +19,8 @@
     static inline void merge_property_maps(property_map& mp, const property_map& mp2, bool subtract = false) {
       property_map newmp;
       newmp.reserve(mp.size() + mp2.size());
- unsigned int i = 0;
- unsigned int j = 0;
+ std::size_t i = 0;
+ std::size_t j = 0;
       while(i != mp.size() && j != mp2.size()) {
         if(mp[i].first < mp2[j].first) {
           newmp.push_back(mp[i]);
@@ -158,30 +158,30 @@
       }
     };
     
- template <typename TSD>
- static void print_tsd(TSD& tsd) {
- for(unsigned int i = 0; i < tsd.size(); ++i) {
- std::cout << tsd[i].first << ": ";
- for(unsigned int r = 0; r < 4; ++r) {
- std::cout << r << " { ";
- for(std::vector<std::pair<int, int> >::iterator itr = tsd[i].second[r].counts.begin();
- itr != tsd[i].second[r].counts.end(); ++itr) {
- std::cout << itr->first << "," << itr->second << " ";
- } std::cout << "} ";
- }
- } std::cout << std::endl;
- }
+// template <typename TSD>
+// static void print_tsd(TSD& tsd) {
+// for(std::size_t i = 0; i < tsd.size(); ++i) {
+// std::cout << tsd[i].first << ": ";
+// for(unsigned int r = 0; r < 4; ++r) {
+// std::cout << r << " { ";
+// for(std::vector<std::pair<int, int> >::iterator itr = tsd[i].second[r].counts.begin();
+// itr != tsd[i].second[r].counts.end(); ++itr) {
+// std::cout << itr->first << "," << itr->second << " ";
+// } std::cout << "} ";
+// }
+// } std::cout << std::endl;
+// }
 
- template <typename T>
- static void print_scanline(T& t) {
- for(typename T::iterator itr = t.begin(); itr != t.end(); ++itr) {
- std::cout << itr->x << "," << itr->y << " " << itr->rise << " ";
- for(std::vector<std::pair<int, int> >::iterator itr2 = itr->count.counts.begin();
- itr2 != itr->count.counts.end(); ++itr2) {
- std::cout << itr2->first << ":" << itr2->second << " ";
- } std::cout << std::endl;
- }
- }
+// template <typename T>
+// static void print_scanline(T& t) {
+// for(typename T::iterator itr = t.begin(); itr != t.end(); ++itr) {
+// std::cout << itr->x << "," << itr->y << " " << itr->rise << " ";
+// for(std::vector<std::pair<int, int> >::iterator itr2 = itr->count.counts.begin();
+// itr2 != itr->count.counts.end(); ++itr2) {
+// std::cout << itr2->first << ":" << itr2->second << " ";
+// } std::cout << std::endl;
+// }
+// }
 
     template <typename graph_type>
     static void performTouch(graph_type& graph, TouchSetData& tsd) {

Modified: sandbox/gtl/boost/polygon/detail/polygon_90_set_view.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/polygon_90_set_view.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/polygon_90_set_view.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -223,8 +223,10 @@
     return lvalue_;
   }
   
+ struct y_ps90_b : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3< y_ps90_b,
     typename is_polygon_90_set_type<geometry_type_1>::type,
     typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryOr> >::type
@@ -235,19 +237,13 @@
        boolean_op::BinaryOr());
   }
   
+ struct y_ps90_p : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
   typename enable_if<
- typename gtl_and<
- typename is_polygon_90_set_type<geometry_type_1>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type,
- typename is_polygon_90_set_type<geometry_type_2>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type,
+ typename gtl_and_3< y_ps90_p,
+ typename gtl_if<typename is_polygon_90_set_type<geometry_type_1>::type>::type,
+ typename gtl_if<typename is_polygon_90_set_type<geometry_type_2>::type>::type>::type,
     polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryOr> >::type
   operator+(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryOr>
@@ -256,8 +252,10 @@
        boolean_op::BinaryOr());
   }
   
+ struct y_ps90_s : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3< y_ps90_s,
     typename is_polygon_90_set_type<geometry_type_1>::type,
     typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd> >::type
@@ -268,8 +266,10 @@
        boolean_op::BinaryAnd());
   }
   
+ struct y_ps90_a : gtl_yes {};
+#if 0
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_if<typename gtl_and<
+ typename enable_if< typename gtl_if<typename gtl_and_3< y_ps90_a,
     typename is_polygon_90_set_type<geometry_type_1>::type,
     typename is_polygon_90_set_type<geometry_type_2>::type>::type>::type,
                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd> >::type
@@ -279,9 +279,11 @@
        polygon_90_set_traits<geometry_type_1>::orient(lvalue),
        boolean_op::BinaryAnd());
   }
+#endif
+ struct y_ps90_x : gtl_yes {};
 
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3< y_ps90_x,
     typename is_polygon_90_set_type<geometry_type_1>::type,
     typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryXor> >::type
@@ -292,18 +294,12 @@
        boolean_op::BinaryXor());
   }
   
+ struct y_ps90_m : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and<
- typename is_polygon_90_set_type<geometry_type_1>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
-::type,
- typename is_polygon_90_set_type<geometry_type_2>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
-::type,
+ typename enable_if< typename gtl_and_3< y_ps90_m,
+ typename gtl_if<typename is_polygon_90_set_type<geometry_type_1>::type>::type,
+ typename gtl_if<typename is_polygon_90_set_type<geometry_type_2>::type>::type>::type,
                        polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryNot> >::type
   operator-(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryNot>
@@ -312,8 +308,10 @@
        boolean_op::BinaryNot());
   }
   
+ struct y_ps90_pe : gtl_yes {};
+
   template <typename coordinate_type_1, typename geometry_type_2>
- typename enable_if< typename is_polygon_90_set_type<geometry_type_2>::type,
+ typename enable_if< typename gtl_and< y_ps90_pe, typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        polygon_90_set_data<coordinate_type_1> >::type &
   operator+=(polygon_90_set_data<coordinate_type_1>& lvalue, const geometry_type_2& rvalue) {
     lvalue.insert(polygon_90_set_traits<geometry_type_2>::begin(rvalue), polygon_90_set_traits<geometry_type_2>::end(rvalue),
@@ -321,64 +319,80 @@
     return lvalue;
   }
   
+ struct y_ps90_be : gtl_yes {};
   //
   template <typename coordinate_type_1, typename geometry_type_2>
- typename enable_if< typename is_polygon_90_set_type<geometry_type_2>::type,
+ typename enable_if< typename gtl_and< y_ps90_be, typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        polygon_90_set_data<coordinate_type_1> >::type &
   operator|=(polygon_90_set_data<coordinate_type_1>& lvalue, const geometry_type_2& rvalue) {
     return lvalue += rvalue;
   }
 
+ struct y_ps90_pe2 : gtl_yes {};
+
   //normal self assignment boolean operations
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3< y_ps90_pe2, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator+=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryOr>(lvalue, rvalue);
   }
 
+ struct y_ps90_be2 : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3<y_ps90_be2, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator|=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryOr>(lvalue, rvalue);
   }
 
+ struct y_ps90_se : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3<y_ps90_se, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator*=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd>(lvalue, rvalue);
   }
+
+ struct y_ps90_ae : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3<y_ps90_ae, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator&=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd>(lvalue, rvalue);
   }
 
+ struct y_ps90_xe : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3<y_ps90_xe, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator^=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryXor>(lvalue, rvalue);
   }
 
+ struct y_ps90_me : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3< y_ps90_me, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
                                          typename is_polygon_90_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator-=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryNot>(lvalue, rvalue);
   }
 
+ struct y_ps90_rpe : gtl_yes {};
+
   template <typename geometry_type_1, typename coordinate_type_1>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3<y_ps90_rpe,
     typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
     typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
                        geometry_type_1>::type &
@@ -386,8 +400,10 @@
     return resize(lvalue, rvalue);
   }
 
+ struct y_ps90_rme : gtl_yes {};
+
   template <typename geometry_type_1, typename coordinate_type_1>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3<y_ps90_rme,
     typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
     typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
                        geometry_type_1>::type &
@@ -395,38 +411,26 @@
     return resize(lvalue, -rvalue);
   }
 
+ struct y_ps90_rp : gtl_yes {};
+
   template <typename geometry_type_1, typename coordinate_type_1>
- typename enable_if< typename gtl_and<
- typename is_mutable_polygon_90_set_type<geometry_type_1>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
-::type,
- typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type,
- geometry_type_1>::type
+ typename enable_if< typename gtl_and_3<y_ps90_rp,
+ typename gtl_if<typename is_mutable_polygon_90_set_type<geometry_type_1>::type>::type,
+ typename gtl_if<typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type>::type,
+ geometry_type_1>::type
   operator+(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
     geometry_type_1 retval(lvalue);
     retval += rvalue;
     return retval;
   }
 
+ struct y_ps90_rm : gtl_yes {};
+
   template <typename geometry_type_1, typename coordinate_type_1>
- typename enable_if< typename gtl_and<
- typename is_mutable_polygon_90_set_type<geometry_type_1>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
-::type,
- typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type,
- geometry_type_1>::type
+ typename enable_if< typename gtl_and_3<y_ps90_rm,
+ typename gtl_if<typename is_mutable_polygon_90_set_type<geometry_type_1>::type>::type,
+ typename gtl_if<typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type>::type,
+ geometry_type_1>::type
   operator-(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
     geometry_type_1 retval(lvalue);
     retval -= rvalue;

Modified: sandbox/gtl/boost/polygon/detail/polygon_90_touch.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/polygon_90_touch.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/polygon_90_touch.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -269,16 +269,16 @@
         nextItr_ = highItr;
       }
 
- inline void print() const {
- for(typename ScanData::const_iterator itr = scanData_.begin(); itr != scanData_.end(); ++itr) {
- std::cout << itr->first << ": ";
- for(std::set<int>::const_iterator sitr = itr->second.begin();
- sitr != itr->second.end(); ++sitr){
- std::cout << *sitr << " ";
- }
- std::cout << std::endl;
- }
- }
+// inline void print() const {
+// for(typename ScanData::const_iterator itr = scanData_.begin(); itr != scanData_.end(); ++itr) {
+// std::cout << itr->first << ": ";
+// for(std::set<int>::const_iterator sitr = itr->second.begin();
+// sitr != itr->second.end(); ++sitr){
+// std::cout << *sitr << " ";
+// }
+// std::cout << std::endl;
+// }
+// }
    
     private:
       inline typename ScanData::iterator lookup_(Unit pos){

Modified: sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -878,7 +878,7 @@
       }
 
       inline void print() {
- std::cout << this << " " << tailp_ << " " << otherTailp_ << " " << holesList_.size() << " " << head_ << std::endl;
+ //std::cout << this << " " << tailp_ << " " << otherTailp_ << " " << holesList_.size() << " " << head_ << std::endl;
       }
 
       static inline std::pair<active_tail_arbitrary*, active_tail_arbitrary*> createActiveTailsAsPair(Point point, bool solid,
@@ -954,7 +954,7 @@
       tmp.reserve(count.size());
       tmp.push_back(count[0]);
       //merge duplicates
- for(unsigned int i = 1; i < count.size(); ++i) {
+ for(std::size_t i = 1; i < count.size(); ++i) {
         if(!equal_slope(pt.get(HORIZONTAL), pt.get(VERTICAL), tmp[i-1].first, count[i].first)) {
           tmp.push_back(count[i]);
         } else {
@@ -1079,11 +1079,11 @@
       counts.reserve(counts_from_scanline.size());
       tails.reserve(counts_from_scanline.size());
       incoming.reserve(incoming_count.size());
- for(unsigned int i = 0; i < counts_from_scanline.size(); ++i) {
+ for(std::size_t i = 0; i < counts_from_scanline.size(); ++i) {
         counts.push_back(counts_from_scanline[i].first.second);
         tails.push_back(counts_from_scanline[i].second);
       }
- for(unsigned int i = 0; i < incoming_count.size(); ++i) {
+ for(std::size_t i = 0; i < incoming_count.size(); ++i) {
         incoming.push_back(incoming_count[i].second);
         if(incoming_count[i].first < point) {
           incoming.back() = 0;
@@ -1104,7 +1104,7 @@
       }
       //assert size = size_less_1 + 1
       //std::cout << tails.size() << " " << incoming.size() << " " << counts_from_scanline.size() << " " << incoming_count.size() << std::endl;
- // for(unsigned int i = 0; i < counts.size(); ++i) {
+ // for(std::size_t i = 0; i < counts.size(); ++i) {
       // std::cout << counts_from_scanline[i].first.first.first.get(HORIZONTAL) << ",";
       // std::cout << counts_from_scanline[i].first.first.first.get(VERTICAL) << " ";
       // std::cout << counts_from_scanline[i].first.first.second.get(HORIZONTAL) << ",";
@@ -1338,16 +1338,16 @@
 
     static inline void print(const vertex_arbitrary_count& count) {
       for(unsigned i = 0; i < count.size(); ++i) {
- std::cout << count[i].first.get(HORIZONTAL) << ",";
- std::cout << count[i].first.get(VERTICAL) << ":";
- std::cout << count[i].second << " ";
- } std::cout << std::endl;
+ //std::cout << count[i].first.get(HORIZONTAL) << ",";
+ //std::cout << count[i].first.get(VERTICAL) << ":";
+ //std::cout << count[i].second << " ";
+ } //std::cout << std::endl;
     }
 
     static inline void print(const scanline_data& data) {
       for(typename scanline_data::const_iterator itr = data.begin(); itr != data.end(); ++itr){
- std::cout << itr->first.pt << ", " << itr->first.other_pt << "; ";
- } std::cout << std::endl;
+ //std::cout << itr->first.pt << ", " << itr->first.other_pt << "; ";
+ } //std::cout << std::endl;
     }
 
     template <class cT, class iT>
@@ -1408,7 +1408,7 @@
         //compact_vertex_arbitrary_count(currentPoint, incoming);
         vertex_arbitrary_count tmp;
         tmp.reserve(incoming.size());
- for(unsigned int i = 0; i < incoming.size(); ++i) {
+ for(std::size_t i = 0; i < incoming.size(); ++i) {
           if(currentPoint < incoming[i].first) {
             tmp.push_back(incoming[i]);
           }
@@ -1498,8 +1498,9 @@
       
   public: //test functions
       
- static inline bool testPolygonArbitraryFormationRect() {
- std::cout << "testing polygon formation\n";
+ template <typename stream_type>
+ static inline bool testPolygonArbitraryFormationRect(stream_type& stdcout) {
+ stdcout << "testing polygon formation\n";
       polygon_arbitrary_formation pf(true);
       std::vector<polygon_data<Unit> > polys;
       std::vector<vertex_half_edge> data;
@@ -1513,16 +1514,17 @@
       data.push_back(vertex_half_edge(Point(10, 10), Point(0, 10), 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygonArbitraryFormationP1() {
- std::cout << "testing polygon formation P1\n";
+ template <typename stream_type>
+ static inline bool testPolygonArbitraryFormationP1(stream_type& stdcout) {
+ stdcout << "testing polygon formation P1\n";
       polygon_arbitrary_formation pf(true);
       std::vector<polygon_data<Unit> > polys;
       std::vector<vertex_half_edge> data;
@@ -1536,16 +1538,17 @@
       data.push_back(vertex_half_edge(Point(10, 20), Point(0, 10), 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygonArbitraryFormationP2() {
- std::cout << "testing polygon formation P2\n";
+ template <typename stream_type>
+ static inline bool testPolygonArbitraryFormationP2(stream_type& stdcout) {
+ stdcout << "testing polygon formation P2\n";
       polygon_arbitrary_formation pf(true);
       std::vector<polygon_data<Unit> > polys;
       std::vector<vertex_half_edge> data;
@@ -1559,17 +1562,18 @@
       data.push_back(vertex_half_edge(Point(2, 4), Point(2, -4), 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
 
- static inline bool testPolygonArbitraryFormationPolys() {
- std::cout << "testing polygon formation polys\n";
+ template <typename stream_type>
+ static inline bool testPolygonArbitraryFormationPolys(stream_type& stdcout) {
+ stdcout << "testing polygon formation polys\n";
       polygon_arbitrary_formation pf(false);
       std::vector<polygon_with_holes_data<Unit> > polys;
       polygon_arbitrary_formation pf2(true);
@@ -1604,21 +1608,22 @@
 
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
       pf2.scan(polys2, data.begin(), data.end());
- std::cout << "result size: " << polys2.size() << std::endl;
- for(unsigned int i = 0; i < polys2.size(); ++i) {
- std::cout << polys2[i] << std::endl;
+ stdcout << "result size: " << polys2.size() << std::endl;
+ for(std::size_t i = 0; i < polys2.size(); ++i) {
+ stdcout << polys2[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygonArbitraryFormationSelfTouch1() {
- std::cout << "testing polygon formation self touch 1\n";
+ template <typename stream_type>
+ static inline bool testPolygonArbitraryFormationSelfTouch1(stream_type& stdcout) {
+ stdcout << "testing polygon formation self touch 1\n";
       polygon_arbitrary_formation pf(true);
       std::vector<polygon_data<Unit> > polys;
       std::vector<vertex_half_edge> data;
@@ -1650,16 +1655,17 @@
       
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygonArbitraryFormationSelfTouch2() {
- std::cout << "testing polygon formation self touch 2\n";
+ template <typename stream_type>
+ static inline bool testPolygonArbitraryFormationSelfTouch2(stream_type& stdcout) {
+ stdcout << "testing polygon formation self touch 2\n";
       polygon_arbitrary_formation pf(true);
       std::vector<polygon_data<Unit> > polys;
       std::vector<vertex_half_edge> data;
@@ -1689,16 +1695,17 @@
       
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygonArbitraryFormationSelfTouch3() {
- std::cout << "testing polygon formation self touch 3\n";
+ template <typename stream_type>
+ static inline bool testPolygonArbitraryFormationSelfTouch3(stream_type& stdcout) {
+ stdcout << "testing polygon formation self touch 3\n";
       polygon_arbitrary_formation pf(true);
       std::vector<polygon_data<Unit> > polys;
       std::vector<vertex_half_edge> data;
@@ -1728,17 +1735,18 @@
       
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testPolygonArbitraryFormationColinear() {
- std::cout << "testing polygon formation colinear 3\n";
- std::cout << "Polygon Set Data { <-3 2, -2 2>:1 <-3 2, -1 4>:-1 <-2 2, 0 2>:1 <-1 4, 0 2>:-1 } \n";
+ template <typename stream_type>
+ static inline bool testPolygonArbitraryFormationColinear(stream_type& stdcout) {
+ stdcout << "testing polygon formation colinear 3\n";
+ stdcout << "Polygon Set Data { <-3 2, -2 2>:1 <-3 2, -1 4>:-1 <-2 2, 0 2>:1 <-1 4, 0 2>:-1 } \n";
       polygon_arbitrary_formation pf(true);
       std::vector<polygon_data<Unit> > polys;
       std::vector<vertex_half_edge> data;
@@ -1755,16 +1763,17 @@
       data.push_back(vertex_half_edge(Point(0, 2), Point(-1, 4), 1));
       std::sort(data.begin(), data.end());
       pf.scan(polys, data.begin(), data.end());
- std::cout << "result size: " << polys.size() << std::endl;
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ stdcout << "result size: " << polys.size() << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
       }
- std::cout << "done testing polygon formation\n";
+ stdcout << "done testing polygon formation\n";
       return true;
     }
 
- static inline bool testSegmentIntersection() {
- std::cout << "testing segment intersection\n";
+ template <typename stream_type>
+ static inline bool testSegmentIntersection(stream_type& stdcout) {
+ stdcout << "testing segment intersection\n";
       half_edge he1, he2;
       he1.first = Point(0, 0);
       he1.second = Point(10, 10);
@@ -1832,7 +1841,7 @@
     inline iterator end() const { return p_->getTail()->end(); }
     //inline compact_iterator_type begin_compact() const { return compact_iterator_type(begin()); }
     //inline compact_iterator_type end_compact() const { return compact_iterator_type(end()); }
- inline unsigned int size() const { return 0; }
+ inline std::size_t size() const { return 0; }
     template<class iT>
     inline poly_line_arbitrary_hole_data& set(iT inputBegin, iT inputEnd) {
       //assert this is not called
@@ -1907,8 +1916,8 @@
     inline iterator_holes_type end_holes() const { return iterator_holes_type(p_->getHoles().end()); }
     inline active_tail_arbitrary* yield() { return p_; }
     //stub out these four required functions that will not be used but are needed for the interface
- inline unsigned int size_holes() const { return 0; }
- inline unsigned int size() const { return 0; }
+ inline std::size_t size_holes() const { return 0; }
+ inline std::size_t size() const { return 0; }
     template<class iT>
     inline poly_line_arbitrary_polygon_data& set(iT inputBegin, iT inputEnd) {
       return *this;

Modified: sandbox/gtl/boost/polygon/detail/polygon_formation.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/polygon_formation.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/polygon_formation.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -576,7 +576,7 @@
     inline compact_iterator_type end_compact() const { return p_->end(); }
     inline iterator_type begin() const { return iterator_type(begin_compact(), end_compact()); }
     inline iterator_type end() const { return iterator_type(end_compact(), end_compact()); }
- inline unsigned int size() const { return 0; }
+ inline std::size_t size() const { return 0; }
     inline ActiveTail<Unit>* yield() { return p_; }
     template<class iT>
     inline PolyLineHoleData& set(iT inputBegin, iT inputEnd) {
@@ -636,8 +636,8 @@
     inline iteratorHoles end_holes() const { return iteratorHoles(p_->endHoles()); }
     inline ActiveTail<Unit>* yield() { return p_; }
     //stub out these four required functions that will not be used but are needed for the interface
- inline unsigned int size_holes() const { return 0; }
- inline unsigned int size() const { return 0; }
+ inline std::size_t size_holes() const { return 0; }
+ inline std::size_t size() const { return 0; }
     template<class iT>
     inline PolyLinePolygonWithHolesData& set(iT inputBegin, iT inputEnd) {
       return *this;
@@ -1229,7 +1229,7 @@
   template <typename Unit>
   inline void ActiveTail<Unit>::writeOutFigure(std::vector<Unit>& outVec, bool isHole) const {
     //we start writing out the polyLine that this active tail points to at its tail
- unsigned int size = outVec.size();
+ std::size_t size = outVec.size();
     outVec.push_back(0); //place holder for size
     PolyLine<Unit>* nextPolyLinep = 0;
     if(!isHole){
@@ -1686,7 +1686,7 @@
 
   template<bool orientT, typename Unit, typename polygon_concept_type>
   inline void ScanLineToPolygonItrs<orientT, Unit, polygon_concept_type>::clearOutput_() {
- for(unsigned int i = 0; i < outputPolygons_.size(); ++i) {
+ for(std::size_t i = 0; i < outputPolygons_.size(); ++i) {
       ActiveTail<Unit>* at1 = outputPolygons_[i].yield();
       const std::list<ActiveTail<Unit>*>& holes = at1->getHoles();
       for(typename std::list<ActiveTail<Unit>*>::const_iterator litr = holes.begin(); litr != holes.end(); ++litr) {

Modified: sandbox/gtl/boost/polygon/detail/property_merge.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/property_merge.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/property_merge.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -116,7 +116,7 @@
     //scanline
     bool firstIteration = true;
     scanlinePosition = scanline.end();
- for(unsigned int i = 0; i < data.size(); ++i) {
+ for(std::size_t i = 0; i < data.size(); ++i) {
       if(firstIteration) {
         mergeProperty(currentVertex.second, data[i].second);
         currentVertex.first = data[i].first;
@@ -191,24 +191,24 @@
 // }
   }
 
- static inline bool assertSorted(property_map& pset) {
- bool result = false;
- for(unsigned int i = 1; i < pset.size(); ++i) {
- if(pset[i] < pset[i-1]) {
- std::cout << "Out of Order Error ";
- result = true;
- }
- if(pset[i].first == pset[i-1].first) {
- std::cout << "Duplicate Property Error ";
- result = true;
- }
- if(pset[0].second == 0 || pset[1].second == 0) {
- std::cout << "Empty Property Error ";
- result = true;
- }
- }
- return result;
- }
+// static inline bool assertSorted(property_map& pset) {
+// bool result = false;
+// for(std::size_t i = 1; i < pset.size(); ++i) {
+// if(pset[i] < pset[i-1]) {
+// std::cout << "Out of Order Error ";
+// result = true;
+// }
+// if(pset[i].first == pset[i-1].first) {
+// std::cout << "Duplicate Property Error ";
+// result = true;
+// }
+// if(pset[0].second == 0 || pset[1].second == 0) {
+// std::cout << "Empty Property Error ";
+// result = true;
+// }
+// }
+// return result;
+// }
 
   static inline void setProperty(property_set& pset, property_map& pmap) {
     for(typename property_map::iterator itr = pmap.begin(); itr != pmap.end(); ++itr) {
@@ -272,7 +272,7 @@
       ++ritr;
     }
     lvalue.clear();
- for(unsigned int i = 0; i < tmpVector.size(); ++i) {
+ for(std::size_t i = 0; i < tmpVector.size(); ++i) {
       if(tmpVector[i].second != 0) {
         lvalue.push_back(tmpVector[i]);
       }
@@ -447,7 +447,7 @@
     //scanline
     bool firstIteration = true;
     scanlinePosition = scanline.end();
- for(unsigned int i = 0; i < data.size(); ++i) {
+ for(std::size_t i = 0; i < data.size(); ++i) {
       if(firstIteration) {
         mergeProperty(currentVertex.second, data[i].second);
         currentVertex.first = data[i].first;
@@ -514,7 +514,7 @@
     edge_property* previousEdgeP = &(output[0]);
     bool firstIteration = true;
     property_set ps;
- for(unsigned int i = 0; i < output.size(); ++i) {
+ for(std::size_t i = 0; i < output.size(); ++i) {
       edge_property& previousEdge = *previousEdgeP;
       edge_property& edge = output[i];
       if(previousEdge.first.high() == edge.first.low()) {
@@ -556,7 +556,7 @@
 
   template <typename Result>
   inline void writeOutput(coordinate_type x, Result& result, edge_property_vector& output) {
- for(unsigned int i = 0; i < output.size(); ++i) {
+ for(std::size_t i = 0; i < output.size(); ++i) {
       edge_property& edge = output[i];
       //edge.second.first is the property set on the left of the edge
       if(!edge.second.first.empty()) {

Modified: sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -71,7 +71,7 @@
                                      iT begin, iT end) {
       std::set<Point> pts;
       std::vector<std::pair<half_edge, segment_id> > data(begin, end);
- for(unsigned int i = 0; i < data.size(); ++i) {
+ for(std::size_t i = 0; i < data.size(); ++i) {
         if(data[i].first.second < data[i].first.first) {
           std::swap(data[i].first.first, data[i].first.second);
         }
@@ -132,7 +132,7 @@
         input_segments.push_back(std::make_pair((*begin).first, index++));
       }
       validate_scan(intermediate_segments, input_segments.begin(), input_segments.end());
- for(unsigned int i = 0; i < intermediate_segments.size(); ++i) {
+ for(std::size_t i = 0; i < intermediate_segments.size(); ++i) {
         output_segments.push_back(std::make_pair(intermediate_segments[i].first,
                                                  input_properties[intermediate_segments[i].second]));
         less_point lp;
@@ -166,7 +166,7 @@
                                    iT begin, iT end) {
 
       std::vector<std::pair<half_edge, segment_id> > data(begin, end);
- for(unsigned int i = 0; i < data.size(); ++i) {
+ for(std::size_t i = 0; i < data.size(); ++i) {
         if(data[i].first.second < data[i].first.first) {
           std::swap(data[i].first.first, data[i].first.second);
         }
@@ -299,13 +299,13 @@
     inline void lookup_and_remove(const half_edge& he, int id) {
       iterator remove_iter = lookup(he);
       if(remove_iter == edge_scanline_.end()) {
- std::cout << "failed to find removal segment in scanline\n";
+ //std::cout << "failed to find removal segment in scanline\n";
         return;
       }
       std::set<segment_id>& ids = (*remove_iter).second;
       std::set<segment_id>::iterator id_iter = ids.find(id);
       if(id_iter == ids.end()) {
- std::cout << "failed to find removal segment id in scanline set\n";
+ //std::cout << "failed to find removal segment id in scanline set\n";
         return;
       }
       ids.erase(id_iter);
@@ -461,7 +461,7 @@
       less_point lp;
       std::set<segment_id> vertical_ids;
       vertical_data_.clear();
- for(unsigned int i = 0; i < event_edges_.size(); ++i) {
+ for(std::size_t i = 0; i < event_edges_.size(); ++i) {
         segment_id id = event_edges_[i].second;
         const half_edge& he = event_edges_[i].first;
         //vertical half edges are handled during intersection processing because
@@ -485,7 +485,7 @@
             //half edge is end event
             std::set<segment_id>::iterator itr = vertical_ids.find(id);
             if(itr == vertical_ids.end()) {
- std::cout << "Failed to find end event id in vertical ids\n";
+ //std::cout << "Failed to find end event id in vertical ids\n";
             } else {
               vertical_ids.erase(itr);
               vertical_data_[he.first.get(HORIZONTAL)] = vertical_ids;
@@ -508,21 +508,22 @@
     }
 
   public:
- static inline bool test_validate_scan() {
+ template <typename stream_type>
+ static inline bool test_validate_scan(stream_type& stdcout) {
       std::vector<std::pair<half_edge, segment_id> > input, edges;
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(0, 10)), 0));
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(10, 10)), 1));
       std::pair<segment_id, segment_id> result;
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail1 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail1 " << result.first << " " << result.second << "\n";
         return false;
       }
       input.push_back(std::make_pair(half_edge(Point(0, 5), Point(5, 5)), 2));
       edges.clear();
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 " << result.first << " " << result.second << "\n";
         return false;
       }
       input.pop_back();
@@ -530,14 +531,14 @@
       edges.clear();
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail3 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail3 " << result.first << " " << result.second << "\n";
         return false;
       }
       input.push_back(std::make_pair(half_edge(Point(1, 0), Point(10, 11)), 4));
       edges.clear();
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail4 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail4 " << result.first << " " << result.second << "\n";
         return false;
       }
       input.pop_back();
@@ -545,27 +546,27 @@
       edges.clear();
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail5 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail5 " << result.first << " " << result.second << "\n";
         return false;
       }
       input.push_back(std::make_pair(half_edge(Point(0, 5), Point(0, 11)), 6));
       edges.clear();
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail6 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail6 " << result.first << " " << result.second << "\n";
         return false;
       }
       input.pop_back();
- for(unsigned int i = 0; i < input.size(); ++i) {
+ for(std::size_t i = 0; i < input.size(); ++i) {
         std::swap(input[i].first.first, input[i].first.second);
       }
       edges.clear();
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail5 2 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail5 2 " << result.first << " " << result.second << "\n";
         return false;
       }
- for(unsigned int i = 0; i < input.size(); ++i) {
+ for(std::size_t i = 0; i < input.size(); ++i) {
         input[i].first.first = Point(input[i].first.first.get(HORIZONTAL) * -1,
                                      input[i].first.first.get(VERTICAL) * -1);
         input[i].first.second = Point(input[i].first.second.get(HORIZONTAL) * -1,
@@ -573,9 +574,9 @@
       }
       edges.clear();
       validate_scan(edges, input.begin(), input.end());
- std::cout << edges.size() << std::endl;
+ stdcout << edges.size() << std::endl;
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail5 3 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail5 3 " << result.first << " " << result.second << "\n";
         return false;
       }
       input.clear();
@@ -584,7 +585,7 @@
       input.push_back(std::make_pair(half_edge(Point(2, 4), Point(6, 7)), 1));
             validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 1 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 1 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -595,7 +596,7 @@
       input.push_back(std::make_pair(half_edge(Point(0, 6), Point(7, 4)), 1));
             validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 2 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 2 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -606,7 +607,7 @@
       input.push_back(std::make_pair(half_edge(Point(3, 6), Point(2, 3)), 1));
             validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 3 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 3 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -617,7 +618,7 @@
       input.push_back(std::make_pair(half_edge(Point(6, 0), Point(2, 0)), 1));
             validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 4 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 4 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -628,7 +629,7 @@
       input.push_back(std::make_pair(half_edge(Point(-17291260 - -17208131, -10200000 - -10191869), Point(-17075000 - -17208131, -10200000 - -10191869)), 1));
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 5 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 5 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -639,7 +640,7 @@
       input.push_back(std::make_pair(half_edge(Point(-17291260, -10200000), Point(-17075000, -10200000)), 1));
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 6 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 6 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -651,7 +652,7 @@
       validate_scan(edges, input.begin(), input.end());
       print(edges);
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 7 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 7 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -662,7 +663,7 @@
       input.push_back(std::make_pair(half_edge(Point(-5223510, -290340), Point(-9858140, -290340)), 1));
       validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 8 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 8 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -676,7 +677,7 @@
       input.push_back(std::make_pair(half_edge(Point(4, 1), Point(5, 5)), 3));
             validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail4 1 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail4 1 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -690,7 +691,7 @@
       input.push_back(std::make_pair(half_edge(Point(4, 1), Point(5, 3)), 3));
             validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail4 2 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail4 2 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -702,7 +703,7 @@
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(2, -1)), 1));
             validate_scan(edges, input.begin(), input.end());
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail2 5 " << result.first << " " << result.second << "\n";
+ stdcout << "s fail2 5 " << result.first << " " << result.second << "\n";
         print(input);
         print(edges);
         return false;
@@ -740,7 +741,7 @@
         edges.clear();
         validate_scan(edges, input.begin(), input.end());
         if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "s fail9 " << outer << ": " << result.first << " " << result.second << "\n";
+ stdcout << "s fail9 " << outer << ": " << result.first << " " << result.second << "\n";
           print(input);
           print(edges);
           return false;
@@ -750,66 +751,67 @@
     }
 
     static void print(const std::pair<half_edge, segment_id>& segment) {
- std::cout << segment.first.first << " " << segment.first.second << ": " << segment.second << "; ";
+ //std::cout << segment.first.first << " " << segment.first.second << ": " << segment.second << "; ";
     }
     static void print(const std::vector<std::pair<half_edge, segment_id> >& vec) {
- for(unsigned int i = 0; i < vec.size(); ++ i) {
- print(vec[i]);
- } std::cout << std::endl;
+ //for(std::size_t i = 0; i < vec.size(); ++ i) {
+ // print(vec[i]);
+ //} std::cout << std::endl;
     }
 
- static inline bool test_verify_scan() {
+ template <typename stream_type>
+ static inline bool test_verify_scan(stream_type& stdcout) {
       std::vector<std::pair<half_edge, segment_id> > edges;
       edges.push_back(std::make_pair(half_edge(Point(0, 0), Point(0, 10)), 0));
       edges.push_back(std::make_pair(half_edge(Point(0, 0), Point(10, 10)), 1));
       std::pair<segment_id, segment_id> result;
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "fail1\n";
+ stdcout << "fail1\n";
         return false;
       }
       edges.push_back(std::make_pair(half_edge(Point(0, 5), Point(5, 5)), 2));
       if(verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "fail2\n";
+ stdcout << "fail2\n";
         return false;
       }
       edges.pop_back();
       edges.push_back(std::make_pair(half_edge(Point(1, 0), Point(11, 11)), 3));
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "fail3\n";
+ stdcout << "fail3\n";
         return false;
       }
       edges.push_back(std::make_pair(half_edge(Point(1, 0), Point(10, 11)), 4));
       if(verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "fail4\n";
+ stdcout << "fail4\n";
         return false;
       }
       edges.pop_back();
       edges.push_back(std::make_pair(half_edge(Point(1, 2), Point(11, 11)), 5));
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "fail5 " << result.first << " " << result.second << "\n";
+ stdcout << "fail5 " << result.first << " " << result.second << "\n";
         return false;
       }
       edges.push_back(std::make_pair(half_edge(Point(0, 5), Point(0, 11)), 6));
       if(verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "fail6 " << result.first << " " << result.second << "\n";
+ stdcout << "fail6 " << result.first << " " << result.second << "\n";
         return false;
       }
       edges.pop_back();
- for(unsigned int i = 0; i < edges.size(); ++i) {
+ for(std::size_t i = 0; i < edges.size(); ++i) {
         std::swap(edges[i].first.first, edges[i].first.second);
       }
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "fail5 2 " << result.first << " " << result.second << "\n";
+ stdcout << "fail5 2 " << result.first << " " << result.second << "\n";
         return false;
       }
- for(unsigned int i = 0; i < edges.size(); ++i) {
+ for(std::size_t i = 0; i < edges.size(); ++i) {
         edges[i].first.first = Point(edges[i].first.first.get(HORIZONTAL) * -1,
                                      edges[i].first.first.get(VERTICAL) * -1);
         edges[i].first.second = Point(edges[i].first.second.get(HORIZONTAL) * -1,
                                      edges[i].first.second.get(VERTICAL) * -1);
       }
       if(!verify_scan(result, edges.begin(), edges.end())) {
- std::cout << "fail5 3 " << result.first << " " << result.second << "\n";
+ stdcout << "fail5 3 " << result.first << " " << result.second << "\n";
         return false;
       }
       return true;
@@ -964,7 +966,7 @@
           }
           //iteratively add intertion element counts to count from below
           //and write them to insertion set
- for(unsigned int i = 0; i < insertion_elements.size(); ++i) {
+ for(std::size_t i = 0; i < insertion_elements.size(); ++i) {
             if(i == 0) {
               merge_property_maps(insertion_elements[i].second, vertical_properties_below);
               write_out(result, rf, insertion_elements[i].first, insertion_elements[i].second, vertical_properties_below);
@@ -1085,18 +1087,18 @@
       remove_retired_edges_from_scanline();
     }
 
- inline void print_scanline() {
- std::cout << "scanline at " << x_ << ": ";
- for(iterator itr = scan_data_.begin(); itr != scan_data_.end(); ++itr) {
- const scanline_element& se = *itr;
- const half_edge& he = se.first;
- const property_map& mp = se.second;
- std::cout << he.first << ", " << he.second << " ( ";
- for(unsigned int i = 0; i < mp.size(); ++i) {
- std::cout << mp[i].first << ":" << mp[i].second << " ";
- } std::cout << ") ";
- } std::cout << std::endl;
- }
+ //inline void print_scanline() {
+ // std::cout << "scanline at " << x_ << ": ";
+ // for(iterator itr = scan_data_.begin(); itr != scan_data_.end(); ++itr) {
+ // const scanline_element& se = *itr;
+ // const half_edge& he = se.first;
+ // const property_map& mp = se.second;
+ // std::cout << he.first << ", " << he.second << " ( ";
+ // for(std::size_t i = 0; i < mp.size(); ++i) {
+ // std::cout << mp[i].first << ":" << mp[i].second << " ";
+ // } std::cout << ") ";
+ // } std::cout << std::endl;
+ //}
 
     static inline void merge_property_maps(property_map& mp, const property_map& mp2) {
       property_map newmp;
@@ -1136,7 +1138,7 @@
       property_map newmp;
       newmp.reserve(mp.size() +1);
       bool consumed = false;
- for(unsigned int i = 0; i < mp.size(); ++i) {
+ for(std::size_t i = 0; i < mp.size(); ++i) {
         if(!consumed && prop_data.first == mp[i].first) {
           consumed = true;
           int count = prop_data.second + mp[i].second;
@@ -1189,7 +1191,8 @@
         result.push_back(std::make_pair(he, std::make_pair(ps_left, ps_right)));
       }
     };
- static inline bool test_scanline() {
+ template <typename stream_type>
+ static inline bool test_scanline(stream_type& stdcout) {
       std::vector<std::pair<half_edge, std::pair<property_set, property_set> > > result;
       std::vector<std::pair<half_edge, std::pair<property_type, int> > > input;
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(0, 10)), std::make_pair(0, 1)));
@@ -1199,10 +1202,10 @@
       scanline sl;
       test_functor tf;
       sl.scan(result, tf, input.begin(), input.end());
- std::cout << "scanned\n";
- for(unsigned int i = 0; i < result.size(); ++i) {
- std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
- } std::cout << std::endl;
+ stdcout << "scanned\n";
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
+ } stdcout << std::endl;
       input.clear();
       result.clear();
       input.push_back(std::make_pair(half_edge(Point(-1, -1), Point(10, 0)), std::make_pair(0, 1)));
@@ -1211,10 +1214,10 @@
       input.push_back(std::make_pair(half_edge(Point(10, 0), Point(11, 11)), std::make_pair(0, 1)));
       scanline sl2;
       sl2.scan(result, tf, input.begin(), input.end());
- std::cout << "scanned\n";
- for(unsigned int i = 0; i < result.size(); ++i) {
- std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
- } std::cout << std::endl;
+ stdcout << "scanned\n";
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
+ } stdcout << std::endl;
       input.clear();
       result.clear();
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(0, 10)), std::make_pair(0, 1)));
@@ -1227,10 +1230,10 @@
       input.push_back(std::make_pair(half_edge(Point(10, 0), Point(10, 10)), std::make_pair(0, -1)));
       scanline sl3;
       sl3.scan(result, tf, input.begin(), input.end());
- std::cout << "scanned\n";
- for(unsigned int i = 0; i < result.size(); ++i) {
- std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
- } std::cout << std::endl;
+ stdcout << "scanned\n";
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
+ } stdcout << std::endl;
       input.clear();
       result.clear();
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(0, 10)), std::make_pair(0, 1)));
@@ -1243,10 +1246,10 @@
       input.push_back(std::make_pair(half_edge(Point(10, 0), Point(10, 10)), std::make_pair(0, -1)));
       scanline sl4;
       sl4.scan(result, tf, input.begin(), input.end());
- std::cout << "scanned\n";
- for(unsigned int i = 0; i < result.size(); ++i) {
- std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
- } std::cout << std::endl;
+ stdcout << "scanned\n";
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
+ } stdcout << std::endl;
       input.clear();
       result.clear();
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(10, 0)), std::make_pair(0, 1)));
@@ -1259,10 +1262,10 @@
       input.push_back(std::make_pair(half_edge(Point(10, 0), Point(10, 10)), std::make_pair(0, -1)));
       scanline sl5;
       sl5.scan(result, tf, input.begin(), input.end());
- std::cout << "scanned\n";
- for(unsigned int i = 0; i < result.size(); ++i) {
- std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
- } std::cout << std::endl;
+ stdcout << "scanned\n";
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
+ } stdcout << std::endl;
       input.clear();
       result.clear();
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(10, 0)), std::make_pair(0, 1)));
@@ -1275,10 +1278,10 @@
       input.push_back(std::make_pair(half_edge(Point(10, 0), Point(10, 10)), std::make_pair(0, -1)));
       scanline sl6;
       sl6.scan(result, tf, input.begin(), input.end());
- std::cout << "scanned\n";
- for(unsigned int i = 0; i < result.size(); ++i) {
- std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
- } std::cout << std::endl;
+ stdcout << "scanned\n";
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
+ } stdcout << std::endl;
       input.clear();
       result.clear();
       input.push_back(std::make_pair(half_edge(Point(0, 0), Point(10, 0)), std::make_pair(0, 1)));
@@ -1299,10 +1302,10 @@
       input.push_back(std::make_pair(half_edge(Point(10, 20), Point(10, 30)), std::make_pair(0, -1)));
       scanline sl7;
       sl7.scan(result, tf, input.begin(), input.end());
- std::cout << "scanned\n";
- for(unsigned int i = 0; i < result.size(); ++i) {
- std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
- } std::cout << std::endl;
+ stdcout << "scanned\n";
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
+ } stdcout << std::endl;
       input.clear();
       result.clear();
       input.push_back(std::make_pair(half_edge(Point(-1, -1), Point(10, 0)), std::make_pair(0, 1))); //a
@@ -1319,10 +1322,10 @@
       input.push_back(std::make_pair(half_edge(Point(30, 0), Point(30, 10)), std::make_pair(0, -1))); //c
       scanline sl8;
       sl8.scan(result, tf, input.begin(), input.end());
- std::cout << "scanned\n";
- for(unsigned int i = 0; i < result.size(); ++i) {
- std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
- } std::cout << std::endl;
+ stdcout << "scanned\n";
+ for(std::size_t i = 0; i < result.size(); ++i) {
+ stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
+ } stdcout << std::endl;
       return true;
     }
 
@@ -1423,23 +1426,23 @@
       std::pair<int, int> offenders;
       std::vector<std::pair<half_edge, int> > lines;
       int count = 0;
- for(unsigned int i = 0; i < pmd.size(); ++i) {
+ for(std::size_t i = 0; i < pmd.size(); ++i) {
         lines.push_back(std::make_pair(pmd[i].first, count++));
       }
       if(!line_intersection<Unit>::verify_scan(offenders, lines.begin(), lines.end())) {
- std::cout << "Intersection failed!\n";
- std::cout << offenders.first << " " << offenders.second << std::endl;
+ //stdcout << "Intersection failed!\n";
+ //stdcout << offenders.first << " " << offenders.second << std::endl;
         return false;
       }
       std::vector<Point> pts;
- for(unsigned int i = 0; i < lines.size(); ++i) {
+ for(std::size_t i = 0; i < lines.size(); ++i) {
         pts.push_back(lines[i].first.first);
         pts.push_back(lines[i].first.second);
       }
       std::sort(pts.begin(), pts.end());
- for(unsigned int i = 0; i < pts.size(); i+=2) {
+ for(std::size_t i = 0; i < pts.size(); i+=2) {
         if(pts[i] != pts[i+1]) {
- std::cout << "Non-closed figures after line intersection!\n";
+ //stdcout << "Non-closed figures after line intersection!\n";
           return false;
         }
       }
@@ -1575,7 +1578,8 @@
 
   public:
     //test functions
- static std::ostream& print (std::ostream& o, const property_map& c)
+ template <typename stream_type>
+ static stream_type& print (stream_type& o, const property_map& c)
     {
       o << "count: {";
       for(typename property_map::const_iterator itr = c.begin(); itr != c.end(); ++itr) {
@@ -1585,14 +1589,16 @@
     }
 
 
- static std::ostream& print (std::ostream& o, const half_edge& he)
+ template <typename stream_type>
+ static stream_type& print (stream_type& o, const half_edge& he)
     {
       o << "half edge: (";
       o << (he.first);
       return o << ", " << (he.second) << ") ";
     }
 
- static std::ostream& print (std::ostream& o, const vertex_property& c)
+ template <typename stream_type>
+ static stream_type& print (stream_type& o, const vertex_property& c)
     {
       o << "vertex property: {";
       print(o, c.first);
@@ -1600,33 +1606,37 @@
       return o;
     }
 
- static std::ostream& print (std::ostream& o, const std::vector<vertex_property>& hev)
+ template <typename stream_type>
+ static stream_type& print (stream_type& o, const std::vector<vertex_property>& hev)
     {
       o << "vertex properties: {";
- for(unsigned int i = 0; i < hev.size(); ++i) {
+ for(std::size_t i = 0; i < hev.size(); ++i) {
         print(o, (hev[i])) << " ";
       }
       return o << "} ";
     }
 
- static std::ostream& print (std::ostream& o, const std::vector<half_edge>& hev)
+ template <typename stream_type>
+ static stream_type& print (stream_type& o, const std::vector<half_edge>& hev)
     {
       o << "half edges: {";
- for(unsigned int i = 0; i < hev.size(); ++i) {
+ for(std::size_t i = 0; i < hev.size(); ++i) {
         print(o, (hev[i])) << " ";
       }
       return o << "} ";
     }
 
- static std::ostream& print (std::ostream& o, const vertex_data& v)
+ template <typename stream_type>
+ static stream_type& print (stream_type& o, const vertex_data& v)
     {
       return print(o << "vertex: <" << (v.first) << ", ", (v.second)) << "> ";
     }
 
- static std::ostream& print (std::ostream& o, const std::vector<vertex_data>& vv)
+ template <typename stream_type>
+ static stream_type& print (stream_type& o, const std::vector<vertex_data>& vv)
     {
       o << "vertices: {";
- for(unsigned int i = 0; i < vv.size(); ++i) {
+ for(std::size_t i = 0; i < vv.size(); ++i) {
         print(o, (vv[i])) << " ";
       }
       return o << "} ";
@@ -1634,7 +1644,8 @@
 
 
 
- static inline bool test_insertion() {
+ template <typename stream_type>
+ static inline bool test_insertion(stream_type& stdcout) {
       property_merge si;
       rectangle_data<Unit> rect;
       xl(rect, 0);
@@ -1643,7 +1654,7 @@
       yh(rect, 11);
 
       si.insert(rect, 333);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       
       Point pts[4] = {Point(0, 0), Point(10,-3), Point(13, 8), Point(0, 0) };
       polygon_data<Unit> poly;
@@ -1651,30 +1662,31 @@
       poly.set(pts, pts+3);
       si2.insert(poly, 444);
       si2.sort_property_merge_data();
- print(std::cout, si2.pmd) << std::endl;
+ print(stdcout, si2.pmd) << std::endl;
       property_merge si3;
       poly.set(pts, pts+4);
       si3.insert(poly, 444);
       si3.sort_property_merge_data();
- std::cout << (si2.pmd == si3.pmd) << std::endl;
+ stdcout << (si2.pmd == si3.pmd) << std::endl;
       std::reverse(pts, pts+4);
       property_merge si4;
       poly.set(pts, pts+4);
       si4.insert(poly, 444);
       si4.sort_property_merge_data();
- print(std::cout, si4.pmd) << std::endl;
- std::cout << (si2.pmd == si4.pmd) << std::endl;
+ print(stdcout, si4.pmd) << std::endl;
+ stdcout << (si2.pmd == si4.pmd) << std::endl;
       std::reverse(pts, pts+3);
       property_merge si5;
       poly.set(pts, pts+4);
       si5.insert(poly, 444);
       si5.sort_property_merge_data();
- std::cout << (si2.pmd == si5.pmd) << std::endl;
+ stdcout << (si2.pmd == si5.pmd) << std::endl;
       
       return true;
     }
 
- static inline bool test_merge() {
+ template <typename stream_type>
+ static inline bool test_merge(stream_type& stdcout) {
       property_merge si;
       rectangle_data<Unit> rect;
       xl(rect, 0);
@@ -1685,15 +1697,15 @@
       si.insert(rect, 333);
       std::map<std::set<property_type>, polygon_set_data<Unit> > result;
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       polygon_set_data<Unit> psd = (*(result.begin())).second;
       std::vector<polygon_data<Unit> > polys;
       psd.get(polys);
       if(polys.size() != 1) {
- std::cout << "fail merge 1\n";
+ stdcout << "fail merge 1\n";
         return false;
       }
- std::cout << (polys[0]) << std::endl;
+ stdcout << (polys[0]) << std::endl;
       si.clear();
       std::vector<Point> pts;
       pts.push_back(Point(0, 0));
@@ -1710,13 +1722,13 @@
       si.insert(poly, 444);
       result.clear();
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
       polys.clear();
       psd.get(polys);
       if(polys.size() != 1) {
- std::cout << "fail merge 2\n";
+ stdcout << "fail merge 2\n";
         return false;
       }
       //Polygon { -4 -1, 3 3, -2 3 }
@@ -1736,17 +1748,17 @@
       si.insert(poly, 444);
       result.clear();
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
       polys.clear();
       psd.get(polys);
       if(polys.size() != 1) {
- std::cout << "fail merge 3\n";
+ stdcout << "fail merge 3\n";
         return false;
       }
- std::cout << "Polygon { -2 2, -2 2, 1 4 } \n";
- std::cout << "Polygon { 2 4, 2 -4, -3 1 } \n";
+ stdcout << "Polygon { -2 2, -2 2, 1 4 } \n";
+ stdcout << "Polygon { 2 4, 2 -4, -3 1 } \n";
       si.clear();
       pts.clear();
       pts.push_back(Point(-2, 2));
@@ -1762,18 +1774,18 @@
       si.insert(poly, 444);
       result.clear();
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
       polys.clear();
       psd.get(polys);
       if(polys.size() != 1) {
- std::cout << "fail merge 4\n";
+ stdcout << "fail merge 4\n";
         return false;
       }
- std::cout << (polys[0]) << std::endl;
- std::cout << "Polygon { -4 0, -2 -3, 3 -4 } \n";
- std::cout << "Polygon { -1 1, 1 -2, -4 -3 } \n";
+ stdcout << (polys[0]) << std::endl;
+ stdcout << "Polygon { -4 0, -2 -3, 3 -4 } \n";
+ stdcout << "Polygon { -1 1, 1 -2, -4 -3 } \n";
       si.clear();
       pts.clear();
       pts.push_back(Point(-4, 0));
@@ -1789,17 +1801,17 @@
       si.insert(poly, 444);
       result.clear();
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
       polys.clear();
       psd.get(polys);
       if(polys.size() != 1) {
- std::cout << "fail merge 5\n";
+ stdcout << "fail merge 5\n";
         return false;
       }
- std::cout << "Polygon { 2 2, -2 0, 0 1 } \n";
- std::cout << "Polygon { 4 -2, 3 -1, 2 3 } \n";
+ stdcout << "Polygon { 2 2, -2 0, 0 1 } \n";
+ stdcout << "Polygon { 4 -2, 3 -1, 2 3 } \n";
       si.clear();
       pts.clear();
       pts.push_back(Point(2, 2));
@@ -1815,20 +1827,20 @@
       si.insert(poly, 444);
       result.clear();
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       if(!result.empty()) {
         psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         polys.clear();
         psd.get(polys);
         if(polys.size() != 1) {
- std::cout << "fail merge 6\n";
+ stdcout << "fail merge 6\n";
           return false;
         }
- std::cout << (polys[0]) << std::endl;
+ stdcout << (polys[0]) << std::endl;
       }
- std::cout << "Polygon { 0 2, 3 -1, 4 1 } \n";
- std::cout << "Polygon { -4 3, 3 3, 4 2 } \n";
+ stdcout << "Polygon { 0 2, 3 -1, 4 1 } \n";
+ stdcout << "Polygon { -4 3, 3 3, 4 2 } \n";
       si.clear();
       pts.clear();
       pts.push_back(Point(0, 2));
@@ -1844,20 +1856,20 @@
       si.insert(poly, 444);
       result.clear();
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       if(!result.empty()) {
         psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         polys.clear();
         psd.get(polys);
         if(polys.size() == 0) {
- std::cout << "fail merge 7\n";
+ stdcout << "fail merge 7\n";
           return false;
         }
- std::cout << (polys[0]) << std::endl;
+ stdcout << (polys[0]) << std::endl;
       }
-std::cout << "Polygon { 1 -2, -1 4, 3 -2 } \n";
-std::cout << "Polygon { 0 -3, 3 1, -3 -4 } \n";
+stdcout << "Polygon { 1 -2, -1 4, 3 -2 } \n";
+stdcout << "Polygon { 0 -3, 3 1, -3 -4 } \n";
       si.clear();
       pts.clear();
       pts.push_back(Point(1, -2));
@@ -1873,20 +1885,20 @@
       si.insert(poly, 444);
       result.clear();
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       if(!result.empty()) {
         psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         polys.clear();
         psd.get(polys);
         if(polys.size() == 0) {
- std::cout << "fail merge 8\n";
+ stdcout << "fail merge 8\n";
           return false;
         }
- std::cout << (polys[0]) << std::endl;
+ stdcout << (polys[0]) << std::endl;
       }
-std::cout << "Polygon { 2 2, 3 0, -3 4 } \n";
-std::cout << "Polygon { -2 -2, 0 0, -1 -1 } \n";
+stdcout << "Polygon { 2 2, 3 0, -3 4 } \n";
+stdcout << "Polygon { -2 -2, 0 0, -1 -1 } \n";
       si.clear();
       pts.clear();
       pts.push_back(Point(2, 2));
@@ -1902,17 +1914,17 @@
       si.insert(poly, 444);
       result.clear();
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       if(!result.empty()) {
         psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         polys.clear();
         psd.get(polys);
         if(polys.size() == 0) {
- std::cout << "fail merge 9\n";
+ stdcout << "fail merge 9\n";
           return false;
         }
- std::cout << (polys[0]) << std::endl;
+ stdcout << (polys[0]) << std::endl;
       }
       si.clear();
       pts.clear();
@@ -2010,10 +2022,10 @@
       result.clear();
       si.merge(result);
       si.verify();
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       if(!result.empty()) {
         psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         std::vector<Point> outpts;
         for(typename polygon_set_data<Unit>::iterator_type itr = psd.begin();
             itr != psd.end(); ++itr) {
@@ -2021,24 +2033,24 @@
           outpts.push_back((*itr).first.second);
         }
         std::sort(outpts.begin(), outpts.end());
- for(unsigned int i = 0; i < outpts.size(); i+=2) {
+ for(std::size_t i = 0; i < outpts.size(); i+=2) {
           if(outpts[i] != outpts[i+1]) {
- std::cout << "Polygon set not a closed figure\n";
- std::cout << i << std::endl;
- std::cout << outpts[i] << " " << outpts[i+1] << std::endl;
+ stdcout << "Polygon set not a closed figure\n";
+ stdcout << i << std::endl;
+ stdcout << outpts[i] << " " << outpts[i+1] << std::endl;
             return 0;
           }
         }
         polys.clear();
         psd.get(polys);
         if(polys.size() == 0) {
- std::cout << "fail merge 10\n";
+ stdcout << "fail merge 10\n";
           return false;
         }
- std::cout << (polys[0]) << std::endl;
+ stdcout << (polys[0]) << std::endl;
       }
       for(unsigned int i = 0; i < 10; ++i) {
- std::cout << "random case # " << i << std::endl;
+ stdcout << "random case # " << i << std::endl;
         si.clear();
         pts.clear();
         pts.push_back(Point(rand()%9-4, rand()%9-4));
@@ -2046,7 +2058,7 @@
         pts.push_back(Point(rand()%9-4, rand()%9-4));
         polygon_data<Unit> poly1;
         poly1.set(pts.begin(), pts.end());
- std::cout << poly1 << std::endl;
+ stdcout << poly1 << std::endl;
         si.insert(poly1, 444);
         pts.clear();
         pts.push_back(Point(rand()%9-4, rand()%9-4));
@@ -2054,14 +2066,14 @@
         pts.push_back(Point(rand()%9-4, rand()%9-4));
         polygon_data<Unit> poly2;
         poly2.set(pts.begin(), pts.end());
- std::cout << poly2 << std::endl;
+ stdcout << poly2 << std::endl;
         si.insert(poly2, 444);
         result.clear();
         si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
         if(!result.empty()) {
           psd = (*(result.begin())).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
           polys.clear();
           psd.get(polys);
           if(polys.size() == 0) {
@@ -2080,18 +2092,19 @@
             std::vector<polygon_data<Unit> > polys2;
             psd.get(polys2);
             if(!polys1.empty() || !polys2.empty()) {
- std::cout << "fail random merge " << i << std::endl;
+ stdcout << "fail random merge " << i << std::endl;
               return false;
             }
           }
         }
         if(!polys.empty())
- std::cout << polys.size() << ": " << (polys[0]) << std::endl;
+ stdcout << polys.size() << ": " << (polys[0]) << std::endl;
       }
       return true;
     }
 
- static inline bool check_rectangle_trio(rectangle_data<Unit> rect1, rectangle_data<Unit> rect2, rectangle_data<Unit> rect3) {
+ template <typename stream_type>
+ static inline bool check_rectangle_trio(rectangle_data<Unit> rect1, rectangle_data<Unit> rect2, rectangle_data<Unit> rect3, stream_type& stdcout) {
         property_merge si;
         std::map<std::set<property_type>, polygon_set_data<Unit> > result;
         std::vector<polygon_data<Unit> > polys;
@@ -2100,17 +2113,17 @@
         std::vector<polygon_data<Unit> > polys90;
         si.insert(rect1, 111);
         si90.insert(rect1, 111);
- std::cout << rect1 << std::endl;
+ stdcout << rect1 << std::endl;
         si.insert(rect2, 222);
         si90.insert(rect2, 222);
- std::cout << rect2 << std::endl;
+ stdcout << rect2 << std::endl;
         si.insert(rect3, 333);
         si90.insert(rect3, 333);
- std::cout << rect3 << std::endl;
+ stdcout << rect3 << std::endl;
         si.merge(result);
         si90.merge(result90);
         if(result.size() != result90.size()) {
- std::cout << "merge failed with size mismatch\n";
+ stdcout << "merge failed with size mismatch\n";
           return 0;
         }
         typename std::map<std::set<property_type>, polygon_90_set_data<Unit> >::iterator itr90 = result90.begin();
@@ -2118,8 +2131,8 @@
             itr != result.end(); ++itr) {
           for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
               set_itr != (*itr).first.end(); ++set_itr) {
- std::cout << (*set_itr) << " ";
- } std::cout << ") \n";
+ stdcout << (*set_itr) << " ";
+ } stdcout << ") \n";
           polygon_set_data<Unit> psd = (*itr).second;
           polygon_90_set_data<Unit> psd90 = (*itr90).second;
           polys.clear();
@@ -2127,21 +2140,21 @@
           psd.get(polys);
           psd90.get(polys90);
           if(polys.size() != polys90.size()) {
- std::cout << "merge failed with polygon count mismatch\n";
- std::cout << psd << std::endl;
- for(unsigned int j = 0; j < polys.size(); ++j) {
- std::cout << polys[j] << std::endl;
+ stdcout << "merge failed with polygon count mismatch\n";
+ stdcout << psd << std::endl;
+ for(std::size_t j = 0; j < polys.size(); ++j) {
+ stdcout << polys[j] << std::endl;
             }
- std::cout << "reference\n";
- for(unsigned int j = 0; j < polys90.size(); ++j) {
- std::cout << polys90[j] << std::endl;
+ stdcout << "reference\n";
+ for(std::size_t j = 0; j < polys90.size(); ++j) {
+ stdcout << polys90[j] << std::endl;
             }
             return 0;
           }
           bool failed = false;
- for(unsigned int j = 0; j < polys.size(); ++j) {
- std::cout << polys[j] << std::endl;
- std::cout << polys90[j] << std::endl;
+ for(std::size_t j = 0; j < polys.size(); ++j) {
+ stdcout << polys[j] << std::endl;
+ stdcout << polys90[j] << std::endl;
 #ifdef BOOST_POLYGON_ICC
 #pragma warning (disable:1572)
 #endif
@@ -2149,7 +2162,7 @@
 #ifdef BOOST_POLYGON_ICC
 #pragma warning (default:1572)
 #endif
- std::cout << "merge failed with area mismatch\n";
+ stdcout << "merge failed with area mismatch\n";
               failed = true;
             }
           }
@@ -2159,12 +2172,13 @@
         return true;
     }
 
- static inline bool test_manhattan_intersection() {
+ template <typename stream_type>
+ static inline bool test_manhattan_intersection(stream_type& stdcout) {
       rectangle_data<Unit> rect1, rect2, rect3;
       set_points(rect1, (Point(-1, 2)), (Point(1, 4)));
       set_points(rect2, (Point(-1, 2)), (Point(2, 3)));
       set_points(rect3, (Point(-3, 0)), (Point(4, 2)));
- if(!check_rectangle_trio(rect1, rect2, rect3)) {
+ if(!check_rectangle_trio(rect1, rect2, rect3, stdcout)) {
         return false;
       }
       for(unsigned int i = 0; i < 100; ++i) {
@@ -2174,18 +2188,19 @@
         property_merge_90<property_type, Unit> si90;
         std::map<std::set<property_type>, polygon_90_set_data<Unit> > result90;
         std::vector<polygon_data<Unit> > polys90;
- std::cout << "random case # " << i << std::endl;
+ stdcout << "random case # " << i << std::endl;
         set_points(rect1, (Point(rand()%9-4, rand()%9-4)), (Point(rand()%9-4, rand()%9-4)));
         set_points(rect2, (Point(rand()%9-4, rand()%9-4)), (Point(rand()%9-4, rand()%9-4)));
         set_points(rect3, (Point(rand()%9-4, rand()%9-4)), (Point(rand()%9-4, rand()%9-4)));
- if(!check_rectangle_trio(rect1, rect2, rect3)) {
+ if(!check_rectangle_trio(rect1, rect2, rect3, stdcout)) {
           return false;
         }
       }
       return true;
     }
 
- static inline bool test_intersection() {
+ template <typename stream_type>
+ static inline bool test_intersection(stream_type& stdcout) {
       property_merge si;
       rectangle_data<Unit> rect;
       xl(rect, 0);
@@ -2205,27 +2220,27 @@
       si.insert(rect, 555);
       std::map<std::set<property_type>, polygon_set_data<Unit> > result;
       si.merge(result);
- print(std::cout, si.pmd) << std::endl;
+ print(stdcout, si.pmd) << std::endl;
       for(typename std::map<std::set<property_type>, polygon_set_data<Unit> >::iterator itr = result.begin();
           itr != result.end(); ++itr) {
- std::cout << "( ";
+ stdcout << "( ";
         for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
             set_itr != (*itr).first.end(); ++set_itr) {
- std::cout << (*set_itr) << " ";
- } std::cout << ") \n";
+ stdcout << (*set_itr) << " ";
+ } stdcout << ") \n";
         polygon_set_data<Unit> psd = (*itr).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         std::vector<polygon_data<Unit> > polys;
         psd.get(polys);
- for(unsigned int i = 0; i < polys.size(); ++i) {
- std::cout << polys[i] << std::endl;
+ for(std::size_t i = 0; i < polys.size(); ++i) {
+ stdcout << polys[i] << std::endl;
         }
       }
       std::vector<Point> pts;
       std::vector<polygon_data<Unit> > polys;
       for(unsigned int i = 0; i < 10; ++i) {
         property_merge si2;
- std::cout << "random case # " << i << std::endl;
+ stdcout << "random case # " << i << std::endl;
         si.clear();
         pts.clear();
         pts.push_back(Point(rand()%9-4, rand()%9-4));
@@ -2233,7 +2248,7 @@
         pts.push_back(Point(rand()%9-4, rand()%9-4));
         polygon_data<Unit> poly1;
         poly1.set(pts.begin(), pts.end());
- std::cout << poly1 << std::endl;
+ stdcout << poly1 << std::endl;
         si.insert(poly1, 444);
         si2.insert(poly1, 333);
         pts.clear();
@@ -2242,7 +2257,7 @@
         pts.push_back(Point(rand()%9-4, rand()%9-4));
         polygon_data<Unit> poly2;
         poly2.set(pts.begin(), pts.end());
- std::cout << poly2 << std::endl;
+ stdcout << poly2 << std::endl;
         si.insert(poly2, 444);
         si2.insert(poly2, 444);
         pts.clear();
@@ -2251,45 +2266,45 @@
         pts.push_back(Point(rand()%9-4, rand()%9-4));
         polygon_data<Unit> poly3;
         poly3.set(pts.begin(), pts.end());
- std::cout << poly3 << std::endl;
+ stdcout << poly3 << std::endl;
         si.insert(poly3, 444);
         si2.insert(poly3, 555);
         result.clear();
         std::map<std::set<property_type>, polygon_set_data<Unit> > result2;
         si.merge(result);
         si2.merge(result2);
- std::cout << "merged result\n";
+ stdcout << "merged result\n";
       for(typename std::map<std::set<property_type>, polygon_set_data<Unit> >::iterator itr = result.begin();
           itr != result.end(); ++itr) {
- std::cout << "( ";
+ stdcout << "( ";
         for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
             set_itr != (*itr).first.end(); ++set_itr) {
- std::cout << (*set_itr) << " ";
- } std::cout << ") \n";
+ stdcout << (*set_itr) << " ";
+ } stdcout << ") \n";
         polygon_set_data<Unit> psd = (*itr).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         std::vector<polygon_data<Unit> > polys2;
         psd.get(polys2);
- for(unsigned int ii = 0; ii < polys2.size(); ++ii) {
- std::cout << polys2[ii] << std::endl;
+ for(std::size_t ii = 0; ii < polys2.size(); ++ii) {
+ stdcout << polys2[ii] << std::endl;
         }
       }
- std::cout << "intersected pmd\n";
- print(std::cout, si2.pmd) << std::endl;
- std::cout << "intersected result\n";
+ stdcout << "intersected pmd\n";
+ print(stdcout, si2.pmd) << std::endl;
+ stdcout << "intersected result\n";
       for(typename std::map<std::set<property_type>, polygon_set_data<Unit> >::iterator itr = result2.begin();
           itr != result2.end(); ++itr) {
- std::cout << "( ";
+ stdcout << "( ";
         for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
             set_itr != (*itr).first.end(); ++set_itr) {
- std::cout << (*set_itr) << " ";
- } std::cout << ") \n";
+ stdcout << (*set_itr) << " ";
+ } stdcout << ") \n";
         polygon_set_data<Unit> psd = (*itr).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         std::vector<polygon_data<Unit> > polys2;
         psd.get(polys2);
- for(unsigned int ii = 0; ii < polys2.size(); ++ii) {
- std::cout << polys2[ii] << std::endl;
+ for(std::size_t ii = 0; ii < polys2.size(); ++ii) {
+ stdcout << polys2[ii] << std::endl;
         }
       }
         si.clear();
@@ -2297,26 +2312,26 @@
             itr != result2.end(); ++itr) {
           polys.clear();
           (*itr).second.get(polys);
- for(unsigned int j = 0; j < polys.size(); ++j) {
+ for(std::size_t j = 0; j < polys.size(); ++j) {
             si.insert(polys[j], 444);
           }
         }
         result2.clear();
         si.merge(result2);
- std::cout << "remerged result\n";
+ stdcout << "remerged result\n";
       for(typename std::map<std::set<property_type>, polygon_set_data<Unit> >::iterator itr = result2.begin();
           itr != result2.end(); ++itr) {
- std::cout << "( ";
+ stdcout << "( ";
         for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
             set_itr != (*itr).first.end(); ++set_itr) {
- std::cout << (*set_itr) << " ";
- } std::cout << ") \n";
+ stdcout << (*set_itr) << " ";
+ } stdcout << ") \n";
         polygon_set_data<Unit> psd = (*itr).second;
- std::cout << psd << std::endl;
+ stdcout << psd << std::endl;
         std::vector<polygon_data<Unit> > polys2;
         psd.get(polys2);
- for(unsigned int ii = 0; ii < polys2.size(); ++ii) {
- std::cout << polys2[ii] << std::endl;
+ for(std::size_t ii = 0; ii < polys2.size(); ++ii) {
+ stdcout << polys2[ii] << std::endl;
         }
       }
       std::vector<polygon_data<Unit> > polys2;
@@ -2324,7 +2339,7 @@
       (*(result.begin())).second.get(polys);
       (*(result2.begin())).second.get(polys2);
       if(!(polys == polys2)) {
- std::cout << "failed intersection check # " << i << std::endl;
+ stdcout << "failed intersection check # " << i << std::endl;
           return false;
         }
       }
@@ -2482,8 +2497,8 @@
 
   };
 
- template <typename Unit>
- bool test_arbitrary_boolean_op() {
+ template <typename Unit, typename stream_type>
+ bool test_arbitrary_boolean_op(stream_type& stdcout) {
     polygon_set_data<Unit> psd;
     rectangle_data<Unit> rect;
     set_points(rect, point_data<Unit>(0, 0), point_data<Unit>(10, 10));
@@ -2497,32 +2512,32 @@
     polygon_set_data<Unit> psd3;
     abo.execute(psd3, psd.begin(), psd.end(), psd2.begin(), psd2.end(), arbitrary_boolean_op<Unit>::BOOLEAN_OR);
     psd3.get(pv);
- for(unsigned int i = 0; i < pv.size(); ++i) {
- std::cout << pv[i] << std::endl;
+ for(std::size_t i = 0; i < pv.size(); ++i) {
+ stdcout << pv[i] << std::endl;
     }
     pv.clear();
     abo.clear();
     psd3.clear();
     abo.execute(psd3, psd.begin(), psd.end(), psd2.begin(), psd2.end(), arbitrary_boolean_op<Unit>::BOOLEAN_AND);
     psd3.get(pv);
- for(unsigned int i = 0; i < pv.size(); ++i) {
- std::cout << pv[i] << std::endl;
+ for(std::size_t i = 0; i < pv.size(); ++i) {
+ stdcout << pv[i] << std::endl;
     }
     pv.clear();
     abo.clear();
     psd3.clear();
     abo.execute(psd3, psd.begin(), psd.end(), psd2.begin(), psd2.end(), arbitrary_boolean_op<Unit>::BOOLEAN_XOR);
     psd3.get(pv);
- for(unsigned int i = 0; i < pv.size(); ++i) {
- std::cout << pv[i] << std::endl;
+ for(std::size_t i = 0; i < pv.size(); ++i) {
+ stdcout << pv[i] << std::endl;
     }
     pv.clear();
     abo.clear();
     psd3.clear();
     abo.execute(psd3, psd.begin(), psd.end(), psd2.begin(), psd2.end(), arbitrary_boolean_op<Unit>::BOOLEAN_NOT);
     psd3.get(pv);
- for(unsigned int i = 0; i < pv.size(); ++i) {
- std::cout << pv[i] << std::endl;
+ for(std::size_t i = 0; i < pv.size(); ++i) {
+ stdcout << pv[i] << std::endl;
     }
     return true;
   }

Modified: sandbox/gtl/boost/polygon/gtl_boost_unit_test.cpp
==============================================================================
--- sandbox/gtl/boost/polygon/gtl_boost_unit_test.cpp (original)
+++ sandbox/gtl/boost/polygon/gtl_boost_unit_test.cpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -6,6 +6,7 @@
   http://www.boost.org/LICENSE_1_0.txt).
 */
 #define BOOST_POLYGON_NO_DEPS
+#include <iostream>
 #include "polygon.hpp"
 namespace gtl = boost::polygon;
 
@@ -14,6 +15,299 @@
 
 namespace boost { namespace polygon{
 
+template <class T>
+std::ostream& operator << (std::ostream& o, const interval_data<T>& i)
+{
+ return o << i.get(LOW) << ' ' << i.get(HIGH);
+}
+ template <class T>
+ std::ostream& operator << (std::ostream& o, const point_data<T>& r)
+ {
+ return o << r.get(HORIZONTAL) << ' ' << r.get(VERTICAL);
+ }
+ template <typename T>
+ std::ostream& operator<<(std::ostream& o, const polygon_45_data<T>& poly) {
+ o << "Polygon { ";
+ for(typename polygon_45_data<T>::iterator_type itr = poly.begin();
+ itr != poly.end(); ++itr) {
+ if(itr != poly.begin()) o << ", ";
+ o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
+ }
+ o << " } ";
+ return o;
+ }
+ template <typename Unit>
+ inline std::ostream& operator<< (std::ostream& o, const polygon_45_set_data<Unit>& p) {
+ o << "Polygon45Set ";
+ o << " " << !p.sorted() << " " << p.dirty() << " { ";
+ for(typename polygon_45_set_data<Unit>::iterator_type itr = p.begin();
+ itr != p.end(); ++itr) {
+ o << (*itr).pt << ":";
+ for(unsigned int i = 0; i < 4; ++i) {
+ o << (*itr).count[i] << ",";
+ } o << " ";
+ //o << (*itr).first << ":" << (*itr).second << "; ";
+ }
+ o << "} ";
+ return o;
+ }
+
+ template <typename Unit>
+ inline std::istream& operator>> (std::istream& i, polygon_45_set_data<Unit>& p) {
+ //TODO
+ return i;
+ }
+template <typename T>
+std::ostream& operator << (std::ostream& o, const polygon_90_data<T>& r)
+{
+ o << "Polygon { ";
+ for(typename polygon_90_data<T>::iterator_type itr = r.begin(); itr != r.end(); ++itr) {
+ o << *itr << ", ";
+ }
+ return o << "} ";
+}
+
+template <typename T>
+std::istream& operator >> (std::istream& i, polygon_90_data<T>& r)
+{
+ std::size_t size;
+ i >> size;
+ std::vector<T> vec;
+ vec.reserve(size);
+ for(std::size_t ii = 0; ii < size; ++ii) {
+ T coord;
+ i >> coord;
+ vec.push_back(coord);
+ }
+ r.set_compact(vec.begin(), vec.end());
+ return i;
+}
+
+template <typename T>
+std::ostream& operator << (std::ostream& o, const std::vector<polygon_90_data<T> >& r) {
+ o << r.size() << ' ';
+ for(std::size_t ii = 0; ii < r.size(); ++ii) {
+ o << (r[ii]);
+ }
+ return o;
+}
+template <typename T>
+std::istream& operator >> (std::istream& i, std::vector<polygon_90_data<T> >& r) {
+ std::size_t size;
+ i >> size;
+ r.clear();
+ r.reserve(size);
+ for(std::size_t ii = 0; ii < size; ++ii) {
+ polygon_90_data<T> tmp;
+ i >> tmp;
+ r.push_back(tmp);
+ }
+ return i;
+}
+ template <typename T>
+ std::ostream& operator<<(std::ostream& o, const polygon_data<T>& poly) {
+ o << "Polygon { ";
+ for(typename polygon_data<T>::iterator_type itr = poly.begin();
+ itr != poly.end(); ++itr) {
+ if(itr != poly.begin()) o << ", ";
+ o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
+ }
+ o << " } ";
+ return o;
+ }
+ template <typename T>
+ std::ostream& operator << (std::ostream& o, const polygon_set_data<T>& r)
+ {
+ o << "Polygon Set Data { ";
+ for(typename polygon_set_data<T>::iterator_type itr = r.begin(); itr != r.end(); ++itr) {
+ o << "<" << (*itr).first.first << ", " << (*itr).first.second << ">:" << (*itr).second << " ";
+ }
+ o << "} ";
+ return o;
+ }
+ template <typename T>
+ std::ostream& operator<<(std::ostream& o, const polygon_90_with_holes_data<T>& poly) {
+ o << "Polygon With Holes { ";
+ for(typename polygon_90_with_holes_data<T>::iterator_type itr = poly.begin();
+ itr != poly.end(); ++itr) {
+ if(itr != poly.begin()) o << ", ";
+ o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
+ } o << " { ";
+ for(typename polygon_90_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
+ itr != poly.end_holes(); ++itr) {
+ o << (*itr);
+ }
+ o << " } } ";
+ return o;
+ }
+ template <typename T>
+ std::ostream& operator<<(std::ostream& o, const polygon_45_with_holes_data<T>& poly) {
+ o << "Polygon With Holes { ";
+ for(typename polygon_45_with_holes_data<T>::iterator_type itr = poly.begin();
+ itr != poly.end(); ++itr) {
+ if(itr != poly.begin()) o << ", ";
+ o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
+ } o << " { ";
+ for(typename polygon_45_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
+ itr != poly.end_holes(); ++itr) {
+ o << (*itr);
+ }
+ o << " } } ";
+ return o;
+ }
+ template <typename T>
+ std::ostream& operator<<(std::ostream& o, const polygon_with_holes_data<T>& poly) {
+ o << "Polygon With Holes { ";
+ for(typename polygon_with_holes_data<T>::iterator_type itr = poly.begin();
+ itr != poly.end(); ++itr) {
+ if(itr != poly.begin()) o << ", ";
+ o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
+ } o << " { ";
+ for(typename polygon_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
+ itr != poly.end_holes(); ++itr) {
+ o << (*itr);
+ }
+ o << " } } ";
+ return o;
+ }
+template <class T>
+std::ostream& operator << (std::ostream& o, const rectangle_data<T>& r)
+{
+ return o << r.get(HORIZONTAL) << ' ' << r.get(VERTICAL);
+}
+
+
+ template <typename T>
+ typename enable_if<typename is_polygon_90_set_type<T>::type, void>::type
+ print_is_polygon_90_set_concept(const T& t) { std::cout << "is polygon 90 set concept\n"; }
+ template <typename T>
+ typename enable_if<typename is_mutable_polygon_90_set_type<T>::type, void>::type
+ print_is_mutable_polygon_90_set_concept(const T& t) { std::cout << "is mutable polygon 90 set concept\n"; }
+namespace boolean_op {
+ //self contained unit test for BooleanOr algorithm
+ template <typename Unit>
+ inline bool testBooleanOr() {
+ BooleanOp<int, Unit> booleanOr;
+ //test one rectangle
+ std::vector<std::pair<interval_data<Unit>, int> > container;
+ booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
+ if(container.size() != 2) {
+ std::cout << "Test one rectangle, wrong output size\n";
+ return false;
+ }
+ if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
+ std::cout << "Test one rectangle, first output wrong: Interval(" <<
+ container[0].first << "), " << container[0].second << std::endl;
+ }
+ if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
+ std::cout << "Test one rectangle, second output wrong: Interval(" <<
+ container[1].first << "), " << container[1].second << std::endl;
+ }
+
+ //test two rectangles
+ container.clear();
+ booleanOr = BooleanOp<int, Unit>();
+ booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(5, 15), 1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(5, 15), -1);
+ if(container.size() != 4) {
+ std::cout << "Test two rectangles, wrong output size\n";
+ for(std::size_t i = 0; i < container.size(); ++i){
+ std::cout << container[i].first << "), " << container[i].second << std::endl;
+ }
+ return false;
+ }
+ if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
+ std::cout << "Test two rectangles, first output wrong: Interval(" <<
+ container[0].first << "), " << container[0].second << std::endl;
+ }
+ if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(10, 15), 1)) {
+ std::cout << "Test two rectangles, second output wrong: Interval(" <<
+ container[1].first << "), " << container[1].second << std::endl;
+ }
+ if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 5), -1)) {
+ std::cout << "Test two rectangles, third output wrong: Interval(" <<
+ container[2].first << "), " << container[2].second << std::endl;
+ }
+ if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(5, 15), -1)) {
+ std::cout << "Test two rectangles, fourth output wrong: Interval(" <<
+ container[3].first << "), " << container[3].second << std::endl;
+ }
+
+ //test two rectangles
+ container.clear();
+ booleanOr = BooleanOp<int, Unit>();
+ booleanOr.processInterval(container, interval_data<Unit>(5, 15), 1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(5, 15), -1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
+ if(container.size() != 4) {
+ std::cout << "Test other two rectangles, wrong output size\n";
+ for(std::size_t i = 0; i < container.size(); ++i){
+ std::cout << container[i].first << "), " << container[i].second << std::endl;
+ }
+ return false;
+ }
+ if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(5, 15), 1)) {
+ std::cout << "Test other two rectangles, first output wrong: Interval(" <<
+ container[0].first << "), " << container[0].second << std::endl;
+ }
+ if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 5), 1)) {
+ std::cout << "Test other two rectangles, second output wrong: Interval(" <<
+ container[1].first << "), " << container[1].second << std::endl;
+ }
+ if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(10, 15), -1)) {
+ std::cout << "Test other two rectangles, third output wrong: Interval(" <<
+ container[2].first << "), " << container[2].second << std::endl;
+ }
+ if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
+ std::cout << "Test other two rectangles, fourth output wrong: Interval(" <<
+ container[3].first << "), " << container[3].second << std::endl;
+ }
+
+ //test two nonoverlapping rectangles
+ container.clear();
+ booleanOr = BooleanOp<int, Unit>();
+ booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(15, 25), 1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
+ booleanOr.advanceScan();
+ booleanOr.processInterval(container, interval_data<Unit>(15, 25), -1);
+ if(container.size() != 4) {
+ std::cout << "Test two nonoverlapping rectangles, wrong output size\n";
+ return false;
+ }
+ if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
+ std::cout << "Test two nonoverlapping rectangles, first output wrong: Interval(" <<
+ container[0].first << "), " << container[0].second << std::endl;
+ }
+ if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(15, 25), 1)) {
+ std::cout << "Test two nonoverlapping rectangles, second output wrong: Interval(" <<
+ container[1].first << "), " << container[1].second << std::endl;
+ }
+ if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
+ std::cout << "Test two nonoverlapping rectangles, third output wrong: Interval(" <<
+ container[2].first << "), " << container[2].second << std::endl;
+ }
+ if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(15, 25), -1)) {
+ std::cout << "Test two nonoverlapping rectangles, fourth output wrong: Interval(" <<
+ container[3].first << "), " << container[3].second << std::endl;
+ }
+ return true;
+ }
+}
+
   void test_assign() {
     using namespace gtl;
     std::vector<polygon_data<int> > ps;
@@ -2009,9 +2303,9 @@
      std::cout << polys1[i] << std::endl;
    }
 
- boolean_op_45<int>::testScan45();
- polygon_45_formation<int>::testPolygon45Formation();
- polygon_45_formation<int>::testPolygon45Tiling();
+ boolean_op_45<int>::testScan45(std::cout);
+ polygon_45_formation<int>::testPolygon45Formation(std::cout);
+ polygon_45_formation<int>::testPolygon45Tiling(std::cout);
 
   axis_transformation atr;
   transform(p, atr);
@@ -2059,23 +2353,23 @@
   std::cout << testPropertyMerge() << std::endl;
   std::cout << testPolygonAssign() << std::endl;
   std::cout << testPolygonWithHoles() << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationRect()) << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationP1()) << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationP2()) << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationPolys()) << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch1()) << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch2()) << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch3()) << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testSegmentIntersection()) << std::endl;
- std::cout << (property_merge<int, int>::test_insertion()) << std::endl;
- std::cout << (line_intersection<int>::test_verify_scan()) << std::endl;
- std::cout << (line_intersection<int>::test_validate_scan()) << std::endl;
- std::cout << (scanline<int, int>::test_scanline()) << std::endl;
- std::cout << (property_merge<int, int>::test_merge()) << std::endl;
- std::cout << (property_merge<int, int>::test_intersection()) << std::endl;
- std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationColinear()) << std::endl;
- std::cout << (property_merge<int, int>::test_manhattan_intersection()) << std::endl;
- std::cout << (test_arbitrary_boolean_op<int>()) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationRect(std::cout)) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationP1(std::cout)) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationP2(std::cout)) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationPolys(std::cout)) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch1(std::cout)) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch2(std::cout)) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch3(std::cout)) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testSegmentIntersection(std::cout)) << std::endl;
+ std::cout << (property_merge<int, int>::test_insertion(std::cout)) << std::endl;
+ std::cout << (line_intersection<int>::test_verify_scan(std::cout)) << std::endl;
+ std::cout << (line_intersection<int>::test_validate_scan(std::cout)) << std::endl;
+ std::cout << (scanline<int, int>::test_scanline(std::cout)) << std::endl;
+ std::cout << (property_merge<int, int>::test_merge(std::cout)) << std::endl;
+ std::cout << (property_merge<int, int>::test_intersection(std::cout)) << std::endl;
+ std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationColinear(std::cout)) << std::endl;
+ std::cout << (property_merge<int, int>::test_manhattan_intersection(std::cout)) << std::endl;
+ std::cout << (test_arbitrary_boolean_op<int>(std::cout)) << std::endl;
   }
   {
     polygon_set_data<int> psd;
@@ -2436,9 +2730,9 @@
     std::cout << is_45(polyWHoles) << " " << polyWHoles << std::endl;
     if(is_45(polyWHoles) != true) return 1;
 
- std::cout << (boolean_op_45<Unit>::testScan45()) << std::endl;
- std::cout << (polygon_45_formation<Unit>::testPolygon45Formation()) << std::endl;
- std::cout << (polygon_45_formation<Unit>::testPolygon45Tiling()) << std::endl;
+ std::cout << (boolean_op_45<Unit>::testScan45(std::cout)) << std::endl;
+ std::cout << (polygon_45_formation<Unit>::testPolygon45Formation(std::cout)) << std::endl;
+ std::cout << (polygon_45_formation<Unit>::testPolygon45Tiling(std::cout)) << std::endl;
 
 
     {

Modified: sandbox/gtl/boost/polygon/interval_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/interval_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/interval_concept.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -49,15 +49,18 @@
 
 
   template <typename T>
- typename enable_if<typename gtl_if<typename is_interval_concept<typename geometry_concept<T>::type>::type>::type,
- typename interval_coordinate_type<T>::type>::type
- get(const T& interval, direction_1d dir) {
+ typename interval_coordinate_type<T>::type
+ get(const T& interval, direction_1d dir,
+ typename enable_if<typename gtl_if<typename is_interval_concept<typename geometry_concept<T>::type>::type>::type>::type *ptr = 0
+ ) {
     return interval_traits<T>::get(interval, dir);
   }
 
   template <typename T, typename coordinate_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type, void>::type
- set(T& interval, direction_1d dir, coordinate_type value) {
+ void
+ set(T& interval, direction_1d dir, coordinate_type value,
+ typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type>::type *ptr = 0
+ ) {
     //this may need to be refined
     interval_mutable_traits<T>::set(interval, dir, value);
     if(high(interval) < low(interval))
@@ -65,38 +68,40 @@
   }
   
   template <typename T>
- typename enable_if<
- typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type,
- T>::type
- construct(typename interval_traits<T>::coordinate_type low_value, typename interval_traits<T>::coordinate_type high_value) {
+ 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 *ptr = 0
+ ) {
     if(low_value > high_value) std::swap(low_value, high_value);
     return interval_mutable_traits<T>::construct(low_value, high_value);
   }
   
   template <typename T, typename T2>
+ T
+ copy_construct(const T2& interval,
   typename enable_if< typename gtl_and<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type,
- typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
- T>::type
- copy_construct(const T2& interval) {
+ typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0
+ ) {
     return construct<T>
       (get(interval, LOW ),
        get(interval, HIGH));
   }
 
   template <typename T1, typename T2>
+ T1 &
+ assign(T1& lvalue, const T2& rvalue,
   typename enable_if< typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<T1>::type>::type,
- typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
- T1>::type &
- assign(T1& lvalue, const T2& rvalue) {
+ typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0) {
     lvalue = copy_construct<T1>(rvalue);
     return lvalue;
   }
 
   template <typename T, typename T2>
+ bool
+ equivalence(const T& interval1, const T2& interval2,
   typename enable_if< typename gtl_and< typename is_interval_concept<typename geometry_concept<T>::type>::type,
- typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
- bool>::type
- equivalence(const T& interval1, const T2& interval2) {
+ typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0
+ ) {
     return get(interval1, LOW) ==
       get(interval2, LOW) &&
       get(interval1, HIGH) ==
@@ -104,11 +109,12 @@
   }
   
   template <typename interval_type>
- typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- bool>::type
+ bool
   contains(const interval_type& interval,
            typename interval_traits<interval_type>::coordinate_type value,
- bool consider_touch = true) {
+ bool consider_touch = true,
+ typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
+ ) {
     if(consider_touch) {
       return value <= high(interval) && value >= low(interval);
     } else {
@@ -117,58 +123,67 @@
   }
   
   template <typename interval_type, typename interval_type_2>
- typename enable_if< typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
- bool>::type
+ bool
   contains(const interval_type& interval,
- const interval_type_2& value, bool consider_touch = true) {
+ const interval_type_2& value, bool consider_touch = true,
+ typename enable_if< typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type>::type *ptr = 0
+ ) {
     return contains(interval, get(value, LOW), consider_touch) &&
       contains(interval, get(value, HIGH), consider_touch);
   }
   
   // get the low coordinate
   template <typename interval_type>
- typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename interval_traits<interval_type>::coordinate_type >::type
- low(const interval_type& interval) { return get(interval, LOW); }
+ typename interval_traits<interval_type>::coordinate_type
+ low(const interval_type& interval,
+ typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
+ ) { return get(interval, LOW); }
 
   // get the high coordinate
   template <typename interval_type>
- typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename interval_traits<interval_type>::coordinate_type >::type
- high(const interval_type& interval) { return get(interval, HIGH); }
+ typename interval_traits<interval_type>::coordinate_type
+ high(const interval_type& interval,
+ typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
+ ) { return get(interval, HIGH); }
 
   // get the center coordinate
   template <typename interval_type>
- typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename interval_traits<interval_type>::coordinate_type >::type
- center(const interval_type& interval) { return (high(interval) + low(interval))/2; }
+ typename interval_traits<interval_type>::coordinate_type
+ center(const interval_type& interval,
+ typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
+ ) { return (high(interval) + low(interval))/2; }
 
   // set the low coordinate to v
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, void>::type
+ void
   low(interval_type& interval,
- typename interval_traits<interval_type>::coordinate_type v) {
- set(interval, LOW, v); }
+ typename interval_traits<interval_type>::coordinate_type v,
+ typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
+ ) { set(interval, LOW, v); }
   
   // set the high coordinate to v
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, void>::type
+ void
   high(interval_type& interval,
- typename interval_traits<interval_type>::coordinate_type v) {
- set(interval, HIGH, v); }
+ typename interval_traits<interval_type>::coordinate_type v,
+ typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
+ ) { set(interval, HIGH, v); }
   
   // get the magnitude of the interval
   template <typename interval_type>
- typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename interval_difference_type<interval_type>::type >::type
- delta(const interval_type& interval) {
+ typename interval_difference_type<interval_type>::type
+ delta(const interval_type& interval,
+ typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
+ ) {
     typedef typename coordinate_traits<typename interval_traits<interval_type>::coordinate_type>::coordinate_difference diffT;
     return (diffT)high(interval) - (diffT)low(interval); }
 
+ struct y_i_flip : gtl_yes {};
+
   // flip this about coordinate
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
+ typename enable_if<typename gtl_and<y_i_flip, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type, interval_type>::type &
   flip(interval_type& interval,
        typename interval_traits<interval_type>::coordinate_type axis = 0) {
     typename interval_traits<interval_type>::coordinate_type newLow, newHigh;
@@ -179,9 +194,11 @@
     return interval;
   }
 
+ struct y_i_scale_up : gtl_yes {};
+
   // scale interval by factor
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
+ typename enable_if<typename gtl_and<y_i_scale_up, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type, interval_type>::type &
   scale_up(interval_type& interval,
            typename coordinate_traits<typename interval_traits<interval_type>::coordinate_type>::unsigned_area_type factor) {
     typedef typename interval_traits<interval_type>::coordinate_type Unit;
@@ -191,8 +208,10 @@
     return interval;
   }
 
+ struct y_i_scale_down : gtl_yes {};
+
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
+ typename enable_if<typename gtl_and<y_i_scale_down, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type, interval_type>::type &
   scale_down(interval_type& interval,
              typename coordinate_traits<typename interval_traits<interval_type>::coordinate_type>::unsigned_area_type factor) {
     typedef typename interval_traits<interval_type>::coordinate_type Unit;
@@ -203,8 +222,10 @@
     return interval;
   }
 
+ struct y_i_scale : gtl_yes {};
+
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
+ typename enable_if<typename gtl_and<y_i_scale, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type, interval_type>::type &
   scale(interval_type& interval, double factor) {
     typedef typename interval_traits<interval_type>::coordinate_type Unit;
     Unit newHigh = scaling_policy<Unit>::round((double)(high(interval)) * factor);
@@ -215,9 +236,11 @@
   
   // move interval by delta
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
+ interval_type&
   move(interval_type& interval,
- typename interval_difference_type<interval_type>::type displacement) {
+ typename interval_difference_type<interval_type>::type displacement,
+ typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
+ ) {
     typedef typename coordinate_traits<typename interval_traits<interval_type>::coordinate_type>::coordinate_difference Unit;
     Unit len = delta(interval);
     low(interval, (Unit)low(interval) + displacement);
@@ -225,9 +248,11 @@
     return interval;
   }
   
+ struct y_i_convolve : gtl_yes {};
+
   // convolve this with b
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
+ typename enable_if<typename gtl_and<y_i_convolve, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type, interval_type>::type &
   convolve(interval_type& interval,
            typename interval_traits<interval_type>::coordinate_type b) {
     typedef typename interval_traits<interval_type>::coordinate_type Unit;
@@ -238,9 +263,11 @@
     return interval;
   }
 
+ struct y_i_deconvolve : gtl_yes {};
+
   // deconvolve this with b
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
+ typename enable_if<typename gtl_and<y_i_deconvolve, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type, interval_type>::type &
   deconvolve(interval_type& interval,
              typename interval_traits<interval_type>::coordinate_type b) {
     typedef typename interval_traits<interval_type>::coordinate_type Unit;
@@ -251,11 +278,14 @@
     return interval;
   }
 
+ struct y_i_convolve2 : gtl_yes {};
+
   // convolve this with b
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
+ typename gtl_and_3<y_i_convolve2,
+ typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     interval_type>::type &
   convolve(interval_type& interval,
            const interval_type_2& b) {
@@ -267,11 +297,14 @@
                          return interval;
   }
   
+ struct y_i_deconvolve2 : gtl_yes {};
+
   // deconvolve this with b
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
+ typename gtl_and_3< y_i_deconvolve2,
+ typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     interval_type>::type &
   deconvolve(interval_type& interval,
              const interval_type_2& b) {
@@ -283,11 +316,14 @@
     return interval;
   }
   
+ struct y_i_reconvolve : gtl_yes {};
+
   // reflected convolve this with b
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
+ typename gtl_and_3<y_i_reconvolve,
+ typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     interval_type>::type &
   reflected_convolve(interval_type& interval,
                      const interval_type_2& b) {
@@ -299,11 +335,14 @@
     return interval;
   }
   
+ struct y_i_redeconvolve : gtl_yes {};
+
   // reflected deconvolve this with b
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
+ typename gtl_and_3< y_i_redeconvolve,
+ typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     interval_type>::type &
   reflected_deconvolve(interval_type& interval,
                        const interval_type_2& b) {
@@ -315,9 +354,11 @@
     return interval;
   }
   
+ struct y_i_e_dist1 : gtl_yes {};
+
   // distance from a coordinate to an interval
   template <typename interval_type>
- typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename enable_if< typename gtl_and<y_i_e_dist1, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
                        typename interval_difference_type<interval_type>::type>::type
   euclidean_distance(const interval_type& interval,
                      typename interval_traits<interval_type>::coordinate_type position) {
@@ -325,13 +366,14 @@
     Unit dist[3] = {0, (Unit)low(interval) - (Unit)position, (Unit)position - (Unit)high(interval)};
     return dist[ (dist[1] > 0) + ((dist[2] > 0) << 1) ];
   }
-
+
+ struct y_i_e_dist2 : gtl_yes {};
   
   // distance between two intervals
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
+ typename gtl_and_3<y_i_e_dist2, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     typename interval_difference_type<interval_type>::type>::type
   euclidean_distance(const interval_type& interval,
                      const interval_type_2& b) {
@@ -340,11 +382,13 @@
     return dist[ (dist[1] > 0) + ((dist[2] > 0) << 1) ];
   }
   
+ struct y_i_e_intersects : gtl_yes {};
+
   // check if Interval b intersects `this` Interval
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
+ typename gtl_and_3<y_i_e_intersects, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     bool>::type
     intersects(const interval_type& interval, const interval_type_2& b,
                bool consider_touch = true) {
@@ -353,11 +397,13 @@
                            (low(interval) < high(b)) & (high(interval) > low(b));
   }
 
+ struct y_i_e_bintersect : gtl_yes {};
+
   // check if Interval b partially overlaps `this` Interval
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
+ typename gtl_and_3<y_i_e_bintersect, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     bool>::type
   boundaries_intersect(const interval_type& interval, const interval_type_2& b,
                        bool consider_touch = true) {
@@ -367,29 +413,34 @@
        contains(b, high(interval), consider_touch));
   }
 
+ struct y_i_abuts1 : gtl_yes {};
+
   // check if they are end to end
   template <typename interval_type, typename interval_type_2>
- typename enable_if< typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename enable_if< typename gtl_and_3<y_i_abuts1, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
                                          typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
                        bool>::type
   abuts(const interval_type& interval, const interval_type_2& b, direction_1d dir) {
     return dir.to_int() ? low(b) == high(interval) : low(interval) == high(b);
   }
 
+ struct y_i_abuts2 : gtl_yes {};
+
   // check if they are end to end
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
+ typename gtl_and_3<y_i_abuts2, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     bool>::type
   abuts(const interval_type& interval, const interval_type_2& b) {
     return abuts(interval, b, HIGH) || abuts(interval, b, LOW);
   }
 
+ struct y_i_intersect : gtl_yes {};
 
   // set 'this' interval to the intersection of 'this' and b
   template <typename interval_type, typename interval_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename enable_if< typename gtl_and_3<y_i_intersect, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
                                          typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
                        bool>::type
   intersect(interval_type& interval, const interval_type_2& b, bool consider_touch = true) {
@@ -406,10 +457,12 @@
     return valid;
   }
 
+ struct y_i_g_intersect : gtl_yes {};
+
   // set 'this' interval to the generalized intersection of 'this' and b
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename gtl_and_3<y_i_g_intersect, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     interval_type>::type &
   generalized_intersect(interval_type& interval, const interval_type_2& b) {
@@ -422,9 +475,11 @@
     return interval;
   }
 
+ struct y_i_bloat : gtl_yes {};
+
   // bloat the Interval
   template <typename interval_type>
- typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename enable_if< typename gtl_and<y_i_bloat, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
                        interval_type>::type &
   bloat(interval_type& interval, typename interval_traits<interval_type>::coordinate_type bloating) {
     low(interval, low(interval)-bloating);
@@ -432,27 +487,32 @@
     return interval;
   }
   
+ struct y_i_bloat2 : gtl_yes {};
+
   // bloat the specified side of `this` Interval
   template <typename interval_type>
- typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename enable_if< typename gtl_and<y_i_bloat2, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
                        interval_type>::type &
   bloat(interval_type& interval, direction_1d dir, typename interval_traits<interval_type>::coordinate_type bloating) {
     set(interval, dir, get(interval, dir) + dir.get_sign() * bloating);
     return interval;
   }
 
+ struct y_i_shrink : gtl_yes {};
 
   // shrink the Interval
   template <typename interval_type>
- typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename enable_if< typename gtl_and<y_i_shrink, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
                        interval_type>::type &
   shrink(interval_type& interval, typename interval_traits<interval_type>::coordinate_type shrinking) {
     return bloat(interval, -shrinking);
   }
 
+ struct y_i_shrink2 : gtl_yes {};
+
   // shrink the specified side of `this` Interval
   template <typename interval_type>
- typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename enable_if< typename gtl_and<y_i_shrink2, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
                        interval_type>::type &
   shrink(interval_type& interval, direction_1d dir, typename interval_traits<interval_type>::coordinate_type shrinking) {
     return bloat(interval, dir, -shrinking);
@@ -460,20 +520,23 @@
 
   // Enlarge `this` Interval to encompass the specified Interval
   template <typename interval_type, typename interval_type_2>
+ bool
+ encompass(interval_type& interval, const interval_type_2& b,
   typename enable_if<
     typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
- typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
- bool>::type
- encompass(interval_type& interval, const interval_type_2& b) {
+ typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type>::type *ptr = 0
+ ) {
     bool retval = !contains(interval, b, true);
     low(interval, (std::min)(low(interval), low(b)));
     high(interval, (std::max)(high(interval), high(b)));
     return retval;
   }
 
+ struct y_i_encompass : gtl_yes {};
+
   // Enlarge `this` Interval to encompass the specified Interval
   template <typename interval_type>
- typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename enable_if< typename gtl_and<y_i_encompass, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
                        bool>::type
   encompass(interval_type& interval, typename interval_traits<interval_type>::coordinate_type b) {
     bool retval = !contains(interval, b, true);
@@ -482,9 +545,11 @@
     return retval;
   }
 
+ struct y_i_get_half : gtl_yes {};
+
   // gets the half of the interval as an interval
   template <typename interval_type>
- typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type
+ typename enable_if<typename gtl_and<y_i_get_half, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type, interval_type>::type
   get_half(const interval_type& interval, direction_1d d1d) {
     typedef typename interval_traits<interval_type>::coordinate_type Unit;
     Unit c = (get(interval, LOW) + get(interval, HIGH)) / 2;
@@ -492,11 +557,13 @@
                                     (d1d == LOW) ? c : get(interval, HIGH));
   }
 
+ struct y_i_join_with : gtl_yes {};
+
   // returns true if the 2 intervals exactly touch at one value, like in l1 <= h1 == l2 <= h2
   // sets the argument to the joined interval
   template <typename interval_type, typename interval_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
+ typename gtl_and_3<y_i_join_with, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     bool>::type
   join_with(interval_type& interval, const interval_type_2& b) {

Modified: sandbox/gtl/boost/polygon/interval_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/interval_data.hpp (original)
+++ sandbox/gtl/boost/polygon/interval_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -50,12 +50,6 @@
   coordinate_type coords_[2];
 };
 
-
-template <class T>
-std::ostream& operator << (std::ostream& o, const interval_data<T>& i)
-{
- return o << i.get(LOW) << ' ' << i.get(HIGH);
-}
 }
 }
 #endif

Modified: sandbox/gtl/boost/polygon/isotropy.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/isotropy.hpp (original)
+++ sandbox/gtl/boost/polygon/isotropy.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -20,9 +20,15 @@
 #endif
 #ifdef BOOST_HAS_LONG_LONG
 #define BOOST_POLYGON_USE_LONG_LONG
+//typedef boost::long_long_type polygon_long_long_type;
+//typedef boost::ulong_long_type polygon_ulong_long_type;
+typedef long long polygon_long_long_type;
+typedef unsigned long long polygon_ulong_long_type;
 #endif
 #include <boost/utility/enable_if.hpp>
-
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/or.hpp>
 #else
 
 #ifdef WIN32
@@ -32,6 +38,9 @@
 #define BOOST_POLYGON_ICC
 #endif
 #define BOOST_POLYGON_USE_LONG_LONG
+typedef long long polygon_long_long_type;
+typedef unsigned long long polygon_ulong_long_type;
+
   namespace boost {
     template <bool B, class T = void>
     struct enable_if_c {
@@ -124,9 +133,9 @@
     typedef int coordinate_type;
     typedef long double area_type;
 #ifdef BOOST_POLYGON_USE_LONG_LONG
- typedef long long manhattan_area_type;
- typedef unsigned long long unsigned_area_type;
- typedef long long coordinate_difference;
+ typedef polygon_long_long_type manhattan_area_type;
+ typedef polygon_ulong_long_type unsigned_area_type;
+ typedef polygon_long_long_type coordinate_difference;
 #else
     typedef long manhattan_area_type;
     typedef unsigned long unsigned_area_type;
@@ -137,12 +146,12 @@
 
 #ifdef BOOST_POLYGON_USE_LONG_LONG
   template <>
- struct coordinate_traits<long long> {
- typedef long long coordinate_type;
+ struct coordinate_traits<polygon_long_long_type> {
+ typedef polygon_long_long_type coordinate_type;
     typedef long double area_type;
- typedef long long manhattan_area_type;
- typedef unsigned long long unsigned_area_type;
- typedef long long coordinate_difference;
+ typedef polygon_long_long_type manhattan_area_type;
+ typedef polygon_ulong_long_type unsigned_area_type;
+ typedef polygon_long_long_type coordinate_difference;
     typedef long double coordinate_distance;
   };
 #endif
@@ -183,8 +192,10 @@
 
   template <>
   struct geometry_concept<int> { typedef coordinate_concept type; };
+#ifdef BOOST_POLYGON_USE_LONG_LONG
   template <>
- struct geometry_concept<long long> { typedef coordinate_concept type; };
+ struct geometry_concept<polygon_long_long_type> { typedef coordinate_concept type; };
+#endif
   template <>
   struct geometry_concept<float> { typedef coordinate_concept type; };
   template <>
@@ -197,24 +208,46 @@
   struct requires<T1, T1, T3> {
     typedef T3 type;
   };
-
+#ifndef BOOST_POLYGON_NO_DEPS
+ struct gtl_no : mpl::bool_<false> {};
+ struct gtl_yes : mpl::bool_<true> {};
+ template <typename T, typename T2>
+ struct gtl_and : mpl::and_<T, T2> {};
+ template <typename T, typename T2, typename T3>
+ struct gtl_and_3 : mpl::and_<T, T2, T3> {};
+ template <typename T, typename T2, typename T3, typename T4>
+ struct gtl_and_4 : mpl::and_<T, T2, T3, T4> {};
+// template <typename T, typename T2>
+// struct gtl_or : mpl::or_<T, T2> {};
+// template <typename T, typename T2, typename T3>
+// struct gtl_or_3 : mpl::or_<T, T2, T3> {};
+// template <typename T, typename T2, typename T3, typename T4>
+// struct gtl_or_4 : mpl::or_<T, T2, T3, T4> {};
+#else
   struct gtl_no { static const bool value = false; };
   struct gtl_yes { typedef gtl_yes type;
     static const bool value = true; };
 
+ template <bool T, bool T2>
+ struct gtl_and_c { typedef gtl_no type; };
+ template <>
+ struct gtl_and_c<true, true> { typedef gtl_yes type; };
+
   template <typename T, typename T2>
- struct gtl_and { typedef gtl_no type; };
- template <typename T>
- struct gtl_and<T, T> { typedef T type; };
-
+ struct gtl_and : gtl_and_c<T::value, T2::value> {};
+ template <typename T, typename T2, typename T3>
+ struct gtl_and_3 { typedef typename gtl_and<
+ T, typename gtl_and<T2, T3>::type>::type type; };
+
+ template <typename T, typename T2, typename T3, typename T4>
+ struct gtl_and_4 { typedef typename gtl_and_3<
+ T, T2, typename gtl_and<T3, T4>::type>::type type; };
+#endif
   template <typename T, typename T2>
   struct gtl_or { typedef gtl_yes type; };
   template <typename T>
   struct gtl_or<T, T> { typedef T type; };
-
- template <typename T, typename T2, typename T3>
- struct gtl_and_3 { typedef typename gtl_and<
- T, typename gtl_and<T2, T3>::type>::type type; };
+
   template <typename T, typename T2, typename T3>
   struct gtl_or_3 { typedef typename gtl_or<
                       T, typename gtl_or<T2, T3>::type>::type type; };
@@ -222,7 +255,7 @@
   template <typename T, typename T2, typename T3, typename T4>
   struct gtl_or_4 { typedef typename gtl_or<
                       T, typename gtl_or_3<T2, T3, T4>::type>::type type; };
-
+
   template <typename T>
   struct gtl_not { typedef gtl_no type; };
   template <>
@@ -272,11 +305,13 @@
   struct area_type_by_domain<manhattan_domain, coordinate_type> {
     typedef typename coordinate_traits<coordinate_type>::manhattan_area_type type; };
 
+ struct y_c_edist : gtl_yes {};
+
   template <typename coordinate_type_1, typename coordinate_type_2>
- typename enable_if<
- typename gtl_and<typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type,
- typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
- typename coordinate_traits<coordinate_type_1>::coordinate_difference>::type
+ typename enable_if<
+ typename gtl_and_3<y_c_edist, typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type,
+ typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
+ typename coordinate_traits<coordinate_type_1>::coordinate_difference>::type
   euclidean_distance(const coordinate_type_1& lvalue, const coordinate_type_2& rvalue) {
     typedef typename coordinate_traits<coordinate_type_1>::coordinate_difference Unit;
     return (lvalue < rvalue) ? (Unit)rvalue - (Unit)lvalue : (Unit)lvalue - (Unit)rvalue;

Modified: sandbox/gtl/boost/polygon/point_3d_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/point_3d_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/point_3d_concept.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -59,26 +59,37 @@
       T, typename is_point_3d_concept<typename geometry_concept<T>::type>::type>::type type;
   };
 
+ struct y_p3d_get : gtl_yes {};
+
   template <typename T>
- typename enable_if< typename gtl_if<typename is_point_3d_concept<typename geometry_concept<T>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_p3d_get, typename gtl_if<typename is_point_3d_concept<typename geometry_concept<T>::type>::type>::type>::type,
                        typename point_3d_coordinate_type<T>::type >::type
   get(const T& point, orientation_3d orient) { return point_3d_traits<T>::get(point, orient); }
   
+ struct y_p3d_set : gtl_yes {};
+
   template <typename T, typename coordinate_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type, void>::type
+ typename enable_if< typename gtl_and<y_p3d_set, typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type>::type, void>::type
   set(T& point, orientation_3d orient, coordinate_type value) { point_3d_mutable_traits<T>::set(point, orient, value); }
+
+ struct y_p3d_set2 : gtl_yes {};
+
   template <typename T, typename coordinate_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type, void>::type
+ typename enable_if< typename gtl_and<y_p3d_set2, typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type>::type, void>::type
   set(T& point, orientation_2d orient, coordinate_type value) { point_3d_mutable_traits<T>::set(point, orient, value); }
 
+ struct y_p3d_construct : gtl_yes {};
+
   template <typename T, typename coordinate_type1, typename coordinate_type2, typename coordinate_type3>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type, T>::type
+ typename enable_if< typename gtl_and<y_p3d_construct, typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type>::type, T>::type
   construct(coordinate_type1 x_value, coordinate_type2 y_value, coordinate_type3 z_value) {
     return point_3d_mutable_traits<T>::construct(x_value, y_value, z_value); }
 
+ struct y_p3d_assign : gtl_yes {};
+
   template <typename point_3d_type_1, typename point_3d_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_point_3d_concept<typename geometry_concept<point_3d_type_1>::type>::type,
+ typename gtl_and_3<y_p3d_assign, typename is_mutable_point_3d_concept<typename geometry_concept<point_3d_type_1>::type>::type,
                       typename is_point_3d_concept<typename geometry_concept<point_3d_type_2>::type>::type>::type,
     point_3d_type_1>::type &
   assign(point_3d_type_1& lvalue, const point_3d_type_2& rvalue) {
@@ -88,32 +99,46 @@
     return lvalue;
   }
 
+ struct y_p3d_z : gtl_yes {};
+
   template <typename point_type>
- typename enable_if< typename is_point_3d_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if< typename gtl_and<y_p3d_z, typename is_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
                        typename point_3d_traits<point_type>::coordinate_type >::type
   z(const point_type& point) { return get(point, PROXIMAL); }
 
+ struct y_p3d_x : gtl_yes {};
+
   template <typename point_type, typename coordinate_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type, void>::type
+ typename enable_if< typename gtl_and<y_p3d_x, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type, void>::type
   x(point_type& point, coordinate_type value) { set(point, HORIZONTAL, value); }
+
+ struct y_p3d_y : gtl_yes {};
+
   template <typename point_type, typename coordinate_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type, void>::type
+ typename enable_if< typename gtl_and<y_p3d_y, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type, void>::type
   y(point_type& point, coordinate_type value) { set(point, VERTICAL, value); }
+
+ struct y_p3d_z2 : gtl_yes {};
+
   template <typename point_type, typename coordinate_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type, void>::type
+ typename enable_if< typename gtl_and<y_p3d_z2, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type, void>::type
   z(point_type& point, coordinate_type value) { set(point, PROXIMAL, value); }
 
+ struct y_p3d_equiv : gtl_yes {};
+
   template <typename T, typename T2>
   typename enable_if<
- typename gtl_and< typename gtl_same_type<point_3d_concept, typename geometry_concept<T>::type>::type,
+ typename gtl_and_3<y_p3d_equiv, typename gtl_same_type<point_3d_concept, typename geometry_concept<T>::type>::type,
                        typename gtl_same_type<point_3d_concept, typename geometry_concept<T2>::type>::type>::type,
     bool>::type
   equivalence(const T& point1, const T2& point2) {
     return x(point1) == x(point2) && y(point1) == y(point2) && z(point1) == z(point2);
   }
 
+ struct y_p3d_man_dist : gtl_yes {};
+
   template <typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and< typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_1>::type>::type,
+ typename enable_if< typename gtl_and_3<y_p3d_man_dist, typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_1>::type>::type,
                                           typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
                        typename point_3d_difference_type<point_type_1>::type>::type
   manhattan_distance(const point_type_1& point1, const point_type_2& point2) {
@@ -121,8 +146,10 @@
       + euclidean_distance(point1, point2, PROXIMAL);
   }
 
+ struct y_p3d_dist : gtl_yes {};
+
   template <typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and< typename is_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
+ typename enable_if< typename gtl_and_3<y_p3d_dist, typename is_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
                                           typename is_point_3d_concept<typename geometry_concept<point_type_2>::type>::type>::type,
                        typename point_3d_difference_type<point_type_1>::type>::type
   euclidean_distance(const point_type_1& point1, const point_type_2& point2, orientation_3d orient) {
@@ -132,8 +159,10 @@
     return return_value < 0 ? -return_value : return_value;
   }
 
+ struct y_p3d_dist2 : gtl_yes {};
+
   template <typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3< y_p3d_dist2,
     typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_1>::type>::type,
     typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
                        typename point_3d_distance_type<point_type_1>::type>::type
@@ -141,11 +170,13 @@
     typedef typename coordinate_traits<typename point_3d_traits<point_type_1>::coordinate_type>::coordinate_distance return_value;
     return_value pdist = (return_value)euclidean_distance(point1, point2, PROXIMAL);
     pdist *= pdist;
- return sqrt((return_value)distance_squared(point1, point2) + pdist);
+ return sqrt((double)(distance_squared(point1, point2) + pdist));
   }
   
+ struct y_p3d_convolve : gtl_yes {};
+
   template <typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3< y_p3d_convolve,
     typename is_mutable_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
     typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
                        point_type_1>::type &
@@ -156,9 +187,11 @@
     return lvalue;
   }
  
+ struct y_p3d_deconvolve : gtl_yes {};
+
   template <typename point_type_1, typename point_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
+ typename gtl_and_3<y_p3d_deconvolve, typename is_mutable_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
                        typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
     point_type_1>::type &
   deconvolve(point_type_1& lvalue, const point_type_2& rvalue) {
@@ -168,8 +201,10 @@
     return lvalue;
   }
 
+ struct y_p3d_scale_up : gtl_yes {};
+
   template <typename point_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if< typename gtl_and<y_p3d_scale_up, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
                        point_type>::type &
   scale_up(point_type& point,
            typename coordinate_traits<typename point_3d_traits<point_type>::coordinate_type>::unsigned_area_type factor) {
@@ -179,8 +214,10 @@
     return point;
   }
 
+ struct y_p3d_scale_down : gtl_yes {};
+
   template <typename point_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if< typename gtl_and<y_p3d_scale_down, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
                        point_type>::type &
   scale_down(point_type& point,
              typename coordinate_traits<typename point_3d_traits<point_type>::coordinate_type>::unsigned_area_type factor) {
@@ -192,8 +229,10 @@
     return point;
   }
 
+ struct y_p3d_scale : gtl_yes {};
+
   template <typename point_type, typename scaling_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if< typename gtl_and<y_p3d_scale, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
                        point_type>::type &
   scale(point_type& point,
         const scaling_type& scaling) {
@@ -206,8 +245,10 @@
     return point;
   }
 
+ struct y_p3d_transform : gtl_yes {};
+
   template <typename point_type, typename transformation_type>
- typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if< typename gtl_and<y_p3d_transform, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
                        point_type>::type &
   transform(point_type& point, const transformation_type& transformation) {
     typedef typename point_3d_traits<point_type>::coordinate_type Unit;

Modified: sandbox/gtl/boost/polygon/point_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/point_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/point_concept.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -63,68 +63,82 @@
   };
 
   template <typename T>
- typename enable_if< typename gtl_if<typename is_point_concept<typename geometry_concept<T>::type>::type>::type,
- typename point_coordinate_type<T>::type >::type
- get(const T& point, orientation_2d orient) {
+ typename point_coordinate_type<T>::type
+ get(const T& point, orientation_2d orient,
+ typename enable_if< typename gtl_if<typename is_point_concept<typename geometry_concept<T>::type>::type>::type>::type *ptr = 0
+ ) {
     return point_traits<T>::get(point, orient);
   }
   
   template <typename T, typename coordinate_type>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<T>::type>::type, void>::type
- set(T& point, orientation_2d orient, coordinate_type value) {
+ void
+ set(T& point, orientation_2d orient, coordinate_type value,
+ typename enable_if<typename is_mutable_point_concept<typename geometry_concept<T>::type>::type>::type *ptr = 0
+ ) {
     point_mutable_traits<T>::set(point, orient, value);
   }
   
   template <typename T, typename coordinate_type1, typename coordinate_type2>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<T>::type>::type,
- T>::type
- construct(coordinate_type1 x_value, coordinate_type2 y_value) {
+ T
+ construct(coordinate_type1 x_value, coordinate_type2 y_value,
+ typename enable_if<typename is_mutable_point_concept<typename geometry_concept<T>::type>::type>::type *ptr = 0
+ ) {
     return point_mutable_traits<T>::construct(x_value, y_value);
   }
 
   template <typename T1, typename T2>
+ T1&
+ assign(T1& lvalue, const T2& rvalue,
   typename enable_if< typename gtl_and< typename is_mutable_point_concept<typename geometry_concept<T1>::type>::type,
- typename is_point_concept<typename geometry_concept<T2>::type>::type>::type,
- T1>::type &
- assign(T1& lvalue, const T2& rvalue) {
+ typename is_point_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0
+ ) {
     set(lvalue, HORIZONTAL, get(rvalue, HORIZONTAL));
     set(lvalue, VERTICAL, get(rvalue, VERTICAL));
     return lvalue;
   }
 
+ struct y_p_x : gtl_yes {};
+
   template <typename point_type>
- typename enable_if< typename is_point_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if< typename gtl_and<y_p_x, typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
                        typename point_traits<point_type>::coordinate_type >::type
   x(const point_type& point) {
     return get(point, HORIZONTAL);
   }
 
+ struct y_p_y : gtl_yes {};
+
   template <typename point_type>
- typename enable_if< typename is_point_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if< typename gtl_and<y_p_y, typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
                        typename point_traits<point_type>::coordinate_type >::type
   y(const point_type& point) {
     return get(point, VERTICAL);
   }
 
+ struct y_p_sx : gtl_yes {};
+
   template <typename point_type, typename coordinate_type>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if<typename gtl_and<y_p_sx, typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type,
                       void>::type
   x(point_type& point, coordinate_type value) {
     set(point, HORIZONTAL, value);
   }
 
+ struct y_p_sy : gtl_yes {};
+
   template <typename point_type, typename coordinate_type>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
+ typename enable_if<typename gtl_and<y_p_sy, typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type,
                       void>::type
   y(point_type& point, coordinate_type value) {
     set(point, VERTICAL, value);
   }
 
   template <typename T, typename T2>
- typename enable_if< typename gtl_and<typename gtl_same_type<point_concept, typename geometry_concept<T>::type>::type,
- typename is_point_concept<typename geometry_concept<T2>::type>::type>::type,
- bool>::type
- equivalence(const T& point1, const T2& point2) {
+ bool
+ equivalence(const T& point1, const T2& point2,
+ typename enable_if< typename gtl_and<typename gtl_same_type<point_concept, typename geometry_concept<T>::type>::type,
+ typename is_point_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0
+ ) {
     typename point_traits<T>::coordinate_type x1 = x(point1);
     typename point_traits<T2>::coordinate_type x2 = get(point2, HORIZONTAL);
     typename point_traits<T>::coordinate_type y1 = get(point1, VERTICAL);
@@ -133,37 +147,42 @@
   }
 
   template <typename point_type_1, typename point_type_2>
+ typename point_difference_type<point_type_1>::type
+ manhattan_distance(const point_type_1& point1, const point_type_2& point2,
   typename enable_if< typename gtl_and<typename gtl_same_type<point_concept, typename geometry_concept<point_type_1>::type>::type,
- typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
- typename point_difference_type<point_type_1>::type>::type
- manhattan_distance(const point_type_1& point1, const point_type_2& point2) {
+ typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type>::type *ptr = 0) {
     return euclidean_distance(point1, point2, HORIZONTAL) + euclidean_distance(point1, point2, VERTICAL);
   }
   
+ struct y_i_ed1 : gtl_yes {};
+
   template <typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and<typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
- typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
- typename point_difference_type<point_type_1>::type>::type
+ typename enable_if< typename gtl_and_3<y_i_ed1, typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
+ typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
+ typename point_difference_type<point_type_1>::type>::type
   euclidean_distance(const point_type_1& point1, const point_type_2& point2, orientation_2d orient) {
     typename coordinate_traits<typename point_traits<point_type_1>::coordinate_type>::coordinate_difference return_value =
       get(point1, orient) - get(point2, orient);
     return return_value < 0 ? -return_value : return_value;
   }
   
+ struct y_i_ed2 : gtl_yes {};
+
   template <typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and<typename gtl_same_type<point_concept, typename geometry_concept<point_type_1>::type>::type,
- typename gtl_same_type<point_concept, typename geometry_concept<point_type_2>::type>::type>::type,
- typename point_distance_type<point_type_1>::type>::type
+ typename enable_if< typename gtl_and_3<y_i_ed2, typename gtl_same_type<point_concept, typename geometry_concept<point_type_1>::type>::type,
+ typename gtl_same_type<point_concept, typename geometry_concept<point_type_2>::type>::type>::type,
+ typename point_distance_type<point_type_1>::type>::type
   euclidean_distance(const point_type_1& point1, const point_type_2& point2) {
     typedef typename point_traits<point_type_1>::coordinate_type Unit;
- return sqrt((typename coordinate_traits<Unit>::coordinate_distance)(distance_squared(point1, point2)));
+ return sqrt((double)(distance_squared(point1, point2)));
   }
   
   template <typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and<typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
- typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
- typename point_difference_type<point_type_1>::type>::type
- distance_squared(const point_type_1& point1, const point_type_2& point2) {
+ typename point_difference_type<point_type_1>::type
+ distance_squared(const point_type_1& point1, const point_type_2& point2,
+ typename enable_if< typename gtl_and<typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
+ typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type>::type *ptr = 0
+ ) {
     typedef typename point_traits<point_type_1>::coordinate_type Unit;
     typename coordinate_traits<Unit>::coordinate_difference dx = euclidean_distance(point1, point2, HORIZONTAL);
     typename coordinate_traits<Unit>::coordinate_difference dy = euclidean_distance(point1, point2, VERTICAL);
@@ -173,27 +192,32 @@
   }
 
   template <typename point_type_1, typename point_type_2>
+ point_type_1 &
+ convolve(point_type_1& lvalue, const point_type_2& rvalue,
   typename enable_if< typename gtl_and<typename is_mutable_point_concept<typename geometry_concept<point_type_1>::type>::type,
- typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type, point_type_1>::type &
- convolve(point_type_1& lvalue, const point_type_2& rvalue) {
+ typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type>::type *ptr = 0
+ ) {
     x(lvalue, x(lvalue) + x(rvalue));
     y(lvalue, y(lvalue) + y(rvalue));
     return lvalue;
   }
   
   template <typename point_type_1, typename point_type_2>
+ point_type_1 &
+ deconvolve(point_type_1& lvalue, const point_type_2& rvalue,
   typename enable_if< typename gtl_and<typename is_mutable_point_concept<typename geometry_concept<point_type_1>::type>::type,
- typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type, point_type_1>::type &
- deconvolve(point_type_1& lvalue, const point_type_2& rvalue) {
+ typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type>::type *ptr = 0
+ ) {
     x(lvalue, x(lvalue) - x(rvalue));
     y(lvalue, y(lvalue) - y(rvalue));
     return lvalue;
   }
   
   template <typename point_type, typename coord_type>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
- point_type>::type &
- scale_up(point_type& point, coord_type factor) {
+ point_type &
+ scale_up(point_type& point, coord_type factor,
+ typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
+ ) {
     typedef typename point_traits<point_type>::coordinate_type Unit;
     x(point, x(point) * (Unit)factor);
     y(point, y(point) * (Unit)factor);
@@ -201,9 +225,10 @@
   }
 
   template <typename point_type, typename coord_type>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
- point_type>::type &
- scale_down(point_type& point, coord_type factor) {
+ point_type &
+ scale_down(point_type& point, coord_type factor,
+ typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
+ ) {
     typedef typename point_traits<point_type>::coordinate_type Unit;
     typedef typename coordinate_traits<Unit>::coordinate_distance dt;
     x(point, scaling_policy<Unit>::round((dt)(x(point)) / (dt)factor));
@@ -212,10 +237,11 @@
   }
 
   template <typename point_type, typename scaling_type>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
- point_type>::type &
+ point_type &
   scale(point_type& point,
- const scaling_type& scaling) {
+ const scaling_type& scaling,
+ typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
+ ) {
     typedef typename point_traits<point_type>::coordinate_type Unit;
     Unit x_(x(point)), y_(y(point));
     scaling.scale(x_, y_);
@@ -225,9 +251,10 @@
   }
 
   template <typename point_type, typename transformation_type>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
- point_type>::type &
- transform(point_type& point, const transformation_type& transformation) {
+ point_type &
+ transform(point_type& point, const transformation_type& transformation,
+ typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
+ ) {
     typedef typename point_traits<point_type>::coordinate_type Unit;
     Unit x_(x(point)), y_(y(point));
     transformation.transform(x_, y_);
@@ -237,10 +264,11 @@
   }
 
   template <typename point_type>
- typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
- point_type>::type &
+ point_type &
   move(point_type& point, orientation_2d orient,
- typename point_traits<point_type>::coordinate_type displacement) {
+ typename point_traits<point_type>::coordinate_type displacement,
+ typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
+ ) {
     typedef typename point_traits<point_type>::coordinate_type Unit;
     Unit v(get(point, orient));
     set(point, orient, v + displacement);

Modified: sandbox/gtl/boost/polygon/point_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/point_data.hpp (original)
+++ sandbox/gtl/boost/polygon/point_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -63,11 +63,6 @@
     coordinate_type coords_[2];
   };
 
- template <class T>
- std::ostream& operator << (std::ostream& o, const point_data<T>& r)
- {
- return o << r.get(HORIZONTAL) << ' ' << r.get(VERTICAL);
- }
 }
 }
 #endif

Modified: sandbox/gtl/boost/polygon/polygon.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -15,7 +15,7 @@
 #include <map>
 #include <set>
 #include <list>
-#include <iostream>
+//#include <iostream>
 #include <algorithm>
 #include <limits>
 #include <iterator>

Modified: sandbox/gtl/boost/polygon/polygon_45_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_45_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_45_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -46,7 +46,7 @@
 
   inline bool operator==(const polygon_45_data& that) const {
     if(coords_.size() != that.coords_.size()) return false;
- for(unsigned int i = 0; i < coords_.size(); ++i) {
+ for(std::size_t i = 0; i < coords_.size(); ++i) {
       if(coords_[i] != that.coords_[i]) return false;
     }
     return true;
@@ -66,17 +66,7 @@
   std::vector<point_data<coordinate_type> > coords_;
 };
 
- template <typename T>
- std::ostream& operator<<(std::ostream& o, const polygon_45_data<T>& poly) {
- o << "Polygon { ";
- for(typename polygon_45_data<T>::iterator_type itr = poly.begin();
- itr != poly.end(); ++itr) {
- if(itr != poly.begin()) o << ", ";
- o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
- }
- o << " } ";
- return o;
- }
+
 }
 }
 #endif

Modified: sandbox/gtl/boost/polygon/polygon_45_set_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_45_set_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_45_set_concept.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -137,7 +137,7 @@
     std::vector<p_type> polys;
     assign(polys, polygon_set);
     area_type retval = (area_type)0;
- for(unsigned int i = 0; i < polys.size(); ++i) {
+ for(std::size_t i = 0; i < polys.size(); ++i) {
       retval += area(polys[i]);
     }
     return retval;
@@ -156,7 +156,7 @@
     std::vector<std::set<int> > graph(polys.size()+1, std::set<int>());
     connectivity_extraction_45<Unit> ce;
     ce.insert(polygon_set_2);
- for(unsigned int i = 0; i < polys.size(); ++i){
+ for(std::size_t i = 0; i < polys.size(); ++i){
       ce.insert(polys[i]);
     }
     ce.extract(graph);
@@ -218,7 +218,7 @@
     assign(polys, polygon_set);
     clear(polygon_set);
     polygon_45_set_data<Unit> ps;
- for(unsigned int i = 0; i < polys.size(); ++i) {
+ for(std::size_t i = 0; i < polys.size(); ++i) {
       polygon_45_set_data<Unit> tmpPs;
       tmpPs.insert(polys[i]);
       bloat(tmpPs, bloating);

Modified: sandbox/gtl/boost/polygon/polygon_45_set_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_45_set_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_45_set_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -551,12 +551,12 @@
   // insert polygon set
   template <typename Unit>
   inline void polygon_45_set_data<Unit>::insert(const polygon_45_set_data<Unit>& polygon_set, bool is_hole) {
- unsigned int count = data_.size();
+ std::size_t count = data_.size();
     data_.insert(data_.end(), polygon_set.data_.begin(), polygon_set.data_.end());
     error_data_.insert(error_data_.end(), polygon_set.error_data_.begin(),
                        polygon_set.error_data_.end());
     if(is_hole) {
- for(unsigned int i = count; i < data_.size(); ++i) {
+ for(std::size_t i = count; i < data_.size(); ++i) {
         data_[i].count = data_[i].count.invert();
       }
     }
@@ -841,11 +841,11 @@
   void handleResizingEdge45_SQRT1OVER2(polygon_45_set_data<Unit>& sizingSet, point_data<Unit> first,
                                        point_data<Unit> second, Unit resizing, CornerOption corner) {
     if(first.x() == second.x()) {
- sizingSet.insert(rectangle_data<int>(first.x() - resizing, first.y(), first.x() + resizing, second.y()));
+ sizingSet.insert(rectangle_data<Unit>(first.x() - resizing, first.y(), first.x() + resizing, second.y()));
       return;
     }
     if(first.y() == second.y()) {
- sizingSet.insert(rectangle_data<int>(first.x(), first.y() - resizing, second.x(), first.y() + resizing));
+ sizingSet.insert(rectangle_data<Unit>(first.x(), first.y() - resizing, second.x(), first.y() + resizing));
       return;
     }
     std::vector<point_data<Unit> > pts;
@@ -1217,8 +1217,8 @@
         //scan event
         scan45.scan(eventOut, eventIn.begin(), eventIn.end());
         std::sort(eventOut.begin(), eventOut.end());
- unsigned int ptCount = 0;
- for(unsigned int i = 0; i < eventOut.size(); ++i) {
+ std::size_t ptCount = 0;
+ for(std::size_t i = 0; i < eventOut.size(); ++i) {
           if(!result_data.empty() &&
              result_data.back().pt == eventOut[i].pt) {
             result_data.back().count += eventOut[i];
@@ -1289,8 +1289,8 @@
     scan45.scan(eventOut, eventIn.begin(), eventIn.end());
     std::sort(eventOut.begin(), eventOut.end());
 
- unsigned int ptCount = 0;
- for(unsigned int i = 0; i < eventOut.size(); ++i) {
+ std::size_t ptCount = 0;
+ for(std::size_t i = 0; i < eventOut.size(); ++i) {
       if(!result_data.empty() &&
          result_data.back().pt == eventOut[i].pt) {
         result_data.back().count += eventOut[i];
@@ -1340,8 +1340,8 @@
         //scan event
         scan45.scan(eventOut, eventIn.begin(), eventIn.end());
         std::sort(eventOut.begin(), eventOut.end());
- unsigned int ptCount = 0;
- for(unsigned int i = 0; i < eventOut.size(); ++i) {
+ std::size_t ptCount = 0;
+ for(std::size_t i = 0; i < eventOut.size(); ++i) {
           if(!result_data.empty() &&
              result_data.back().pt == eventOut[i].pt) {
             result_data.back().count += eventOut[i];
@@ -1378,8 +1378,8 @@
     scan45.scan(eventOut, eventIn.begin(), eventIn.end());
     std::sort(eventOut.begin(), eventOut.end());
 
- unsigned int ptCount = 0;
- for(unsigned int i = 0; i < eventOut.size(); ++i) {
+ std::size_t ptCount = 0;
+ for(std::size_t i = 0; i < eventOut.size(); ++i) {
       if(!result_data.empty() &&
          result_data.back().pt == eventOut[i].pt) {
         result_data.back().count += eventOut[i];
@@ -1534,7 +1534,7 @@
           Data2 rvalue_data, lvalue_data, result_data;
           rvalue_data.reserve(rvalue.data_.size());
           lvalue_data.reserve(data_.size());
- for(unsigned int i = 0 ; i < data_.size(); ++i) {
+ for(std::size_t i = 0 ; i < data_.size(); ++i) {
             const Vertex45Compact& vi = data_[i];
             Vertex45Compact2 ci;
             ci.pt = point_data<Unit2>(x(vi.pt), y(vi.pt));
@@ -1542,7 +1542,7 @@
               ( vi.count[0], vi.count[1], vi.count[2], vi.count[3]);
             lvalue_data.push_back(ci);
           }
- for(unsigned int i = 0 ; i < rvalue.data_.size(); ++i) {
+ for(std::size_t i = 0 ; i < rvalue.data_.size(); ++i) {
             const Vertex45Compact& vi = rvalue.data_[i];
             Vertex45Compact2 ci;
             ci.pt = (point_data<Unit2>(x(vi.pt), y(vi.pt)));
@@ -1563,19 +1563,19 @@
             Data2 error_data_out;
             std::vector<rectangle_data<Unit2> > pos_error_rects;
             std::vector<rectangle_data<Unit2> > neg_error_rects;
- for(unsigned int i = 0; i < container.size(); ++i) {
+ for(std::size_t i = 0; i < container.size(); ++i) {
               get_error_rects(pos_error_rects, neg_error_rects, container[i]);
             }
- for(unsigned int i = 0; i < pos_error_rects.size(); ++i) {
+ for(std::size_t i = 0; i < pos_error_rects.size(); ++i) {
               insert_rectangle_into_vector_45(result_data, pos_error_rects[i], false);
               insert_rectangle_into_vector_45(error_data_out, pos_error_rects[i], false);
             }
- for(unsigned int i = 0; i < neg_error_rects.size(); ++i) {
+ for(std::size_t i = 0; i < neg_error_rects.size(); ++i) {
               insert_rectangle_into_vector_45(result_data, neg_error_rects[i], true);
               insert_rectangle_into_vector_45(error_data_out, neg_error_rects[i], false);
             }
             scale_down_vertex_45_compact_range_blindly(error_data_out.begin(), error_data_out.end(), 2);
- for(unsigned int i = 0 ; i < error_data_out.size(); ++i) {
+ for(std::size_t i = 0 ; i < error_data_out.size(); ++i) {
               const Vertex45Compact2& vi = error_data_out[i];
               Vertex45Compact ci;
               ci.pt = (point_data<Unit2>(x(vi.pt), y(vi.pt)));
@@ -1590,7 +1590,7 @@
           }
           scale_down_vertex_45_compact_range_blindly(result_data.begin(), result_data.end(), 2);
           //result.data_.reserve(result_data.size());
- for(unsigned int i = 0 ; i < result_data.size(); ++i) {
+ for(std::size_t i = 0 ; i < result_data.size(); ++i) {
             const Vertex45Compact2& vi = result_data[i];
             Vertex45Compact ci;
             ci.pt = (point_data<Unit2>(x(vi.pt), y(vi.pt)));
@@ -1645,7 +1645,7 @@
           typedef std::vector<Vertex45Compact2> Data2;
           Data2 lvalue_data, result_data;
           lvalue_data.reserve(data_.size());
- for(unsigned int i = 0 ; i < data_.size(); ++i) {
+ for(std::size_t i = 0 ; i < data_.size(); ++i) {
             const Vertex45Compact& vi = data_[i];
             Vertex45Compact2 ci;
             ci.pt = point_data<Unit2>(x(vi.pt), y(vi.pt));
@@ -1664,19 +1664,19 @@
             Data2 error_data_out;
             std::vector<rectangle_data<Unit2> > pos_error_rects;
             std::vector<rectangle_data<Unit2> > neg_error_rects;
- for(unsigned int i = 0; i < container.size(); ++i) {
+ for(std::size_t i = 0; i < container.size(); ++i) {
               get_error_rects(pos_error_rects, neg_error_rects, container[i]);
             }
- for(unsigned int i = 0; i < pos_error_rects.size(); ++i) {
+ for(std::size_t i = 0; i < pos_error_rects.size(); ++i) {
               insert_rectangle_into_vector_45(result_data, pos_error_rects[i], false);
               insert_rectangle_into_vector_45(error_data_out, pos_error_rects[i], false);
             }
- for(unsigned int i = 0; i < neg_error_rects.size(); ++i) {
+ for(std::size_t i = 0; i < neg_error_rects.size(); ++i) {
               insert_rectangle_into_vector_45(result_data, neg_error_rects[i], true);
               insert_rectangle_into_vector_45(error_data_out, neg_error_rects[i], false);
             }
             scale_down_vertex_45_compact_range_blindly(error_data_out.begin(), error_data_out.end(), 2);
- for(unsigned int i = 0 ; i < error_data_out.size(); ++i) {
+ for(std::size_t i = 0 ; i < error_data_out.size(); ++i) {
               const Vertex45Compact2& vi = error_data_out[i];
               Vertex45Compact ci;
               ci.pt = (point_data<Unit2>(x(vi.pt), y(vi.pt)));
@@ -1691,7 +1691,7 @@
           }
           scale_down_vertex_45_compact_range_blindly(result_data.begin(), result_data.end(), 2);
           //result.data_.reserve(result_data.size());
- for(unsigned int i = 0 ; i < result_data.size(); ++i) {
+ for(std::size_t i = 0 ; i < result_data.size(); ++i) {
             const Vertex45Compact2& vi = result_data[i];
             Vertex45Compact ci;
             ci.pt = (point_data<Unit2>(x(vi.pt), y(vi.pt)));
@@ -1713,27 +1713,7 @@
     is_manhattan_ = result.is_manhattan_;
   }
 
- template <typename Unit>
- inline std::ostream& operator<< (std::ostream& o, const polygon_45_set_data<Unit>& p) {
- o << "Polygon45Set ";
- o << " " << !p.sorted() << " " << p.dirty() << " { ";
- for(typename polygon_45_set_data<Unit>::iterator_type itr = p.begin();
- itr != p.end(); ++itr) {
- o << (*itr).pt << ":";
- for(unsigned int i = 0; i < 4; ++i) {
- o << (*itr).count[i] << ",";
- } o << " ";
- //o << (*itr).first << ":" << (*itr).second << "; ";
- }
- o << "} ";
- return o;
- }
 
- template <typename Unit>
- inline std::istream& operator>> (std::istream& i, polygon_45_set_data<Unit>& p) {
- //TODO
- return i;
- }
 }
 }
 #endif

Modified: sandbox/gtl/boost/polygon/polygon_45_with_holes_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_45_with_holes_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_45_with_holes_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -78,7 +78,7 @@
     return self_.end();
   }
 
- inline unsigned int size() const {
+ inline std::size_t size() const {
     return self_.size();
   }
 
@@ -92,7 +92,7 @@
     return holes_.end();
   }
 
- inline unsigned int size_holes() const {
+ inline std::size_t size_holes() const {
     return holes_.size();
   }
 

Modified: sandbox/gtl/boost/polygon/polygon_90_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_90_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_90_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -73,53 +73,6 @@
   std::vector<coordinate_type> coords_;
 };
 
-template <typename T>
-std::ostream& operator << (std::ostream& o, const polygon_90_data<T>& r)
-{
- o << "Polygon { ";
- for(typename polygon_90_data<T>::iterator_type itr = r.begin(); itr != r.end(); ++itr) {
- o << *itr << ", ";
- }
- return o << "} ";
-}
-
-template <typename T>
-std::istream& operator >> (std::istream& i, polygon_90_data<T>& r)
-{
- unsigned int size;
- i >> size;
- std::vector<T> vec;
- vec.reserve(size);
- for(unsigned int ii = 0; ii < size; ++ii) {
- T coord;
- i >> coord;
- vec.push_back(coord);
- }
- r.set_compact(vec.begin(), vec.end());
- return i;
-}
-
-template <typename T>
-std::ostream& operator << (std::ostream& o, const std::vector<polygon_90_data<T> >& r) {
- o << r.size() << ' ';
- for(unsigned int ii = 0; ii < r.size(); ++ii) {
- o << (r[ii]);
- }
- return o;
-}
-template <typename T>
-std::istream& operator >> (std::istream& i, std::vector<polygon_90_data<T> >& r) {
- unsigned int size;
- i >> size;
- r.clear();
- r.reserve(size);
- for(unsigned int ii = 0; ii < size; ++ii) {
- polygon_90_data<T> tmp;
- i >> tmp;
- r.push_back(tmp);
- }
- return i;
-}
 
 }
 }

Modified: sandbox/gtl/boost/polygon/polygon_90_set_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_90_set_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_90_set_concept.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -156,7 +156,7 @@
     std::vector<rectangle_type> rects;
     assign(rects, polygon_set);
     area_type retval = (area_type)0;
- for(unsigned int i = 0; i < rects.size(); ++i) {
+ for(std::size_t i = 0; i < rects.size(); ++i) {
       retval += (area_type)area(rects[i]);
     }
     return retval;
@@ -407,7 +407,7 @@
     assign(polys, polygon_set);
     clear(polygon_set);
     polygon_90_set_data<Unit> ps(scanline_orientation(polygon_set));
- for(unsigned int i = 0; i < polys.size(); ++i) {
+ for(std::size_t i = 0; i < polys.size(); ++i) {
       polygon_90_set_data<Unit> tmpPs(scanline_orientation(polygon_set));
       tmpPs.insert(polys[i]);
       bloat(tmpPs, west_bloating, east_bloating, south_bloating, north_bloating);
@@ -461,21 +461,23 @@
   }
 
   //move
- template <typename polygon_set_type, typename coord_type>
- typename enable_if< typename is_mutable_polygon_90_set_type<polygon_set_type>::type,
- polygon_set_type>::type &
+ template <typename polygon_set_type>
+ polygon_set_type&
   move(polygon_set_type& polygon_set,
- orientation_2d orient, coord_type displacement) {
+ orientation_2d orient, typename polygon_90_set_traits<polygon_set_type>::coordinate_type displacement,
+ typename enable_if< typename is_mutable_polygon_90_set_type<polygon_set_type>::type>::type *ptr = 0) {
     if(orient == HORIZONTAL)
       return move(polygon_set, displacement, 0);
     else
       return move(polygon_set, 0, displacement);
   }
 
- template <typename polygon_set_type, typename coord_type>
- typename enable_if< typename is_mutable_polygon_90_set_type<polygon_set_type>::type,
- polygon_set_type>::type &
- move(polygon_set_type& polygon_set, coord_type x_displacement, coord_type y_displacement) {
+ template <typename polygon_set_type>
+ polygon_set_type&
+ move(polygon_set_type& polygon_set, typename polygon_90_set_traits<polygon_set_type>::coordinate_type x_displacement,
+ typename polygon_90_set_traits<polygon_set_type>::coordinate_type y_displacement,
+ typename enable_if< typename is_mutable_polygon_90_set_type<polygon_set_type>::type>::type *ptr = 0
+ ) {
     typedef typename polygon_90_set_traits<polygon_set_type>::coordinate_type Unit;
     polygon_90_set_data<Unit> ps;
     assign(ps, polygon_set);

Modified: sandbox/gtl/boost/polygon/polygon_90_set_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_90_set_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_90_set_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -287,7 +287,7 @@
       else
         set_points(extents_rectangle, point_data<coordinate_type>(data_[0].first, data_[0].second.first),
                    point_data<coordinate_type>(data_[data_.size() - 1].first, data_[data_.size() - 1].second.first));
- for(unsigned int i = 1; i < data_.size() - 1; ++i) {
+ for(std::size_t i = 1; i < data_.size() - 1; ++i) {
         if(orient_ == HORIZONTAL)
           encompass(extents_rectangle, point_data<coordinate_type>(data_[i].second.first, data_[i].first));
         else
@@ -473,7 +473,7 @@
       std::vector<polygon_90_data<Unit> > polys;
       get(polys);
       std::vector<std::set<int> > graph(polys.size()+1, std::set<int>());
- for(unsigned int i = 0; i < polys.size(); ++i){
+ for(std::size_t i = 0; i < polys.size(); ++i){
         polygon_90_set_data<Unit> psTmp(that.orient_);
         psTmp.insert(polys[i]);
         psTmp.clean();

Modified: sandbox/gtl/boost/polygon/polygon_90_set_traits.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_90_set_traits.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_90_set_traits.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -350,12 +350,12 @@
   template <typename T>
   struct geometry_concept<polygon_90_set_data<T> > { typedef polygon_90_set_concept type; };
   
- template <typename T>
- typename enable_if<typename is_polygon_90_set_type<T>::type, void>::type
- print_is_polygon_90_set_concept(const T& t) { std::cout << "is polygon 90 set concept\n"; }
- template <typename T>
- typename enable_if<typename is_mutable_polygon_90_set_type<T>::type, void>::type
- print_is_mutable_polygon_90_set_concept(const T& t) { std::cout << "is mutable polygon 90 set concept\n"; }
+ //template <typename T>
+ //typename enable_if<typename is_polygon_90_set_type<T>::type, void>::type
+ //print_is_polygon_90_set_concept(const T& t) { std::cout << "is polygon 90 set concept\n"; }
+ //template <typename T>
+ //typename enable_if<typename is_mutable_polygon_90_set_type<T>::type, void>::type
+ //print_is_mutable_polygon_90_set_concept(const T& t) { std::cout << "is mutable polygon 90 set concept\n"; }
 }
 }
 #endif

Modified: sandbox/gtl/boost/polygon/polygon_90_with_holes_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_90_with_holes_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_90_with_holes_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -88,7 +88,7 @@
     return self_.end_compact();
   }
 
- inline unsigned int size() const {
+ inline std::size_t size() const {
     return self_.size();
   }
 
@@ -102,7 +102,7 @@
     return holes_.end();
   }
 
- inline unsigned int size_holes() const {
+ inline std::size_t size_holes() const {
     return holes_.size();
   }
 

Modified: sandbox/gtl/boost/polygon/polygon_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -44,7 +44,7 @@
 
   inline bool operator==(const polygon_data& that) const {
     if(coords_.size() != that.coords_.size()) return false;
- for(unsigned int i = 0; i < coords_.size(); ++i) {
+ for(std::size_t i = 0; i < coords_.size(); ++i) {
       if(coords_[i] != that.coords_[i]) return false;
     }
     return true;
@@ -63,17 +63,7 @@
 private:
   std::vector<point_data<coordinate_type> > coords_;
 };
- template <typename T>
- std::ostream& operator<<(std::ostream& o, const polygon_data<T>& poly) {
- o << "Polygon { ";
- for(typename polygon_data<T>::iterator_type itr = poly.begin();
- itr != poly.end(); ++itr) {
- if(itr != poly.begin()) o << ", ";
- o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
- }
- o << " } ";
- return o;
- }
+
 }
 }
 #endif

Modified: sandbox/gtl/boost/polygon/polygon_set_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_set_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_set_concept.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -133,7 +133,7 @@
     std::vector<p_type> polys;
     assign(polys, polygon_set);
     area_type retval = (area_type)0;
- for(unsigned int i = 0; i < polys.size(); ++i) {
+ for(std::size_t i = 0; i < polys.size(); ++i) {
       retval += area(polys[i]);
     }
     return retval;
@@ -219,8 +219,10 @@
     return polygon_set;
   }
 
+ struct yes_ps_ob : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3 < typename is_any_polygon_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_4 < yes_ps_ob, typename is_any_polygon_set_type<geometry_type_1>::type,
                                             typename is_any_polygon_set_type<geometry_type_2>::type,
                                             typename is_either_polygon_set_type<geometry_type_1, geometry_type_2>::type>::type,
                        polygon_set_view<geometry_type_1, geometry_type_2, 0> >::type
@@ -228,28 +230,24 @@
     return polygon_set_view<geometry_type_1, geometry_type_2, 0>
       (lvalue, rvalue);
   }
-
+
+ struct yes_ps_op : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3 < typename is_any_polygon_set_type<geometry_type_1>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename is_any_polygon_set_type<geometry_type_2>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename is_either_polygon_set_type<geometry_type_1, geometry_type_2>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, polygon_set_view<geometry_type_1, geometry_type_2, 0> >::type
+ typename enable_if< typename gtl_and_4 < yes_ps_op,
+ typename gtl_if<typename is_any_polygon_set_type<geometry_type_1>::type>::type,
+ typename gtl_if<typename is_any_polygon_set_type<geometry_type_2>::type>::type,
+ typename gtl_if<typename is_either_polygon_set_type<geometry_type_1, geometry_type_2>::type>::type>
+ ::type, polygon_set_view<geometry_type_1, geometry_type_2, 0> >::type
   operator+(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return polygon_set_view<geometry_type_1, geometry_type_2, 0>
       (lvalue, rvalue);
   }
   
+ struct yes_ps_os : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3 <
+ typename enable_if< typename gtl_and_4 < yes_ps_os,
     typename is_any_polygon_set_type<geometry_type_1>::type,
     typename is_any_polygon_set_type<geometry_type_2>::type,
     typename is_either_polygon_set_type<geometry_type_1, geometry_type_2>::type>::type,
@@ -258,9 +256,24 @@
     return polygon_set_view<geometry_type_1, geometry_type_2, 1>
       (lvalue, rvalue);
   }
-
+
+ struct yes_ps_oa : gtl_yes {};
+#if 0
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3 <
+ typename enable_if< typename gtl_and_4 < yes_ps_oa,
+ typename is_any_polygon_set_type<geometry_type_1>::type,
+ typename is_any_polygon_set_type<geometry_type_2>::type,
+ typename is_either_polygon_set_type<geometry_type_1, geometry_type_2>::type>::type,
+ polygon_set_view<geometry_type_1, geometry_type_2, 1> >::type
+ operator&(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
+ return polygon_set_view<geometry_type_1, geometry_type_2, 1>
+ (lvalue, rvalue);
+ }
+#endif
+ struct yes_ps_ox : gtl_yes {};
+
+ template <typename geometry_type_1, typename geometry_type_2>
+ typename enable_if< typename gtl_and_4 < yes_ps_ox,
     typename is_any_polygon_set_type<geometry_type_1>::type,
     typename is_any_polygon_set_type<geometry_type_2>::type,
     typename is_either_polygon_set_type<geometry_type_1, geometry_type_2>::type>::type,
@@ -270,69 +283,75 @@
       (lvalue, rvalue);
   }
   
+ struct yes_ps_om : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and_3 < typename is_any_polygon_set_type<geometry_type_1>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename is_any_polygon_set_type<geometry_type_2>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, typename is_either_polygon_set_type<geometry_type_1, geometry_type_2>::type>
-#ifdef BOOST_POLYGON_ICC
- ::type
-#endif
- ::type, polygon_set_view<geometry_type_1, geometry_type_2, 3> >::type
+ typename enable_if< typename gtl_and_4 < yes_ps_om,
+ typename gtl_if<typename is_any_polygon_set_type<geometry_type_1>::type>::type,
+ typename gtl_if<typename is_any_polygon_set_type<geometry_type_2>::type>::type,
+ typename gtl_if<typename is_either_polygon_set_type<geometry_type_1, geometry_type_2>::type>::type>
+ ::type, polygon_set_view<geometry_type_1, geometry_type_2, 3> >::type
   operator-(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return polygon_set_view<geometry_type_1, geometry_type_2, 3>
       (lvalue, rvalue);
   }
-
+
+ struct yes_ps_ope : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_4< yes_ps_ope, gtl_yes, typename is_mutable_polygon_set_type<geometry_type_1>::type,
                                          typename is_any_polygon_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator+=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, 0>(lvalue, rvalue);
   }
 
+ struct yes_ps_obe : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3< yes_ps_obe, typename is_mutable_polygon_set_type<geometry_type_1>::type,
                                          typename is_any_polygon_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator|=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, 0>(lvalue, rvalue);
   }
 
+ struct yes_ps_ose : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3< yes_ps_ose, typename is_mutable_polygon_set_type<geometry_type_1>::type,
                                          typename is_any_polygon_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator*=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, 1>(lvalue, rvalue);
   }
 
+ struct yes_ps_oae : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_polygon_set_type<geometry_type_1>::type,
+ typename gtl_and_3< yes_ps_oae, typename is_mutable_polygon_set_type<geometry_type_1>::type,
                       typename is_any_polygon_set_type<geometry_type_2>::type>::type,
     geometry_type_1>::type &
   operator&=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, 1>(lvalue, rvalue);
   }
 
+ struct yes_ps_oxe : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_polygon_set_type<geometry_type_1>::type,
+ typename enable_if< typename gtl_and_3< yes_ps_oxe, typename is_mutable_polygon_set_type<geometry_type_1>::type,
                                          typename is_any_polygon_set_type<geometry_type_2>::type>::type,
                        geometry_type_1>::type &
   operator^=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     return self_assignment_boolean_op<geometry_type_1, geometry_type_2, 2>(lvalue, rvalue);
   }
 
+ struct yes_ps_ome : gtl_yes {};
+
   template <typename geometry_type_1, typename geometry_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_polygon_set_type<geometry_type_1>::type,
+ typename gtl_and_3< yes_ps_ome, typename is_mutable_polygon_set_type<geometry_type_1>::type,
                       typename is_any_polygon_set_type<geometry_type_2>::type>::type,
     geometry_type_1>::type &
   operator-=(geometry_type_1& lvalue, const geometry_type_2& rvalue) {

Modified: sandbox/gtl/boost/polygon/polygon_set_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_set_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_set_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -415,16 +415,7 @@
     }
   };
 
- template <typename T>
- std::ostream& operator << (std::ostream& o, const polygon_set_data<T>& r)
- {
- o << "Polygon Set Data { ";
- for(typename polygon_set_data<T>::iterator_type itr = r.begin(); itr != r.end(); ++itr) {
- o << "<" << (*itr).first.first << ", " << (*itr).first.second << ">:" << (*itr).second << " ";
- }
- o << "} ";
- return o;
- }
+
 
   struct polygon_set_concept;
   template <typename T>

Modified: sandbox/gtl/boost/polygon/polygon_traits.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_traits.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_traits.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -25,7 +25,7 @@
     }
   
     // Get the number of sides of the polygon
- static inline unsigned int size(const T& t) {
+ static inline std::size_t size(const T& t) {
       return t.size();
     }
   
@@ -61,7 +61,7 @@
     }
   
     // Get the number of sides of the polygon
- static inline unsigned int size(const T& t) {
+ static inline std::size_t size(const T& t) {
       return t.size();
     }
   
@@ -93,7 +93,7 @@
     }
   
     // Get the number of sides of the polygon
- static inline unsigned int size(const T& t) {
+ static inline std::size_t size(const T& t) {
       return polygon_90_traits<T>::size(t);
     }
   
@@ -119,7 +119,7 @@
     }
 
     // Get the number of holes
- static inline unsigned int size_holes(const T& t) {
+ static inline std::size_t size_holes(const T& t) {
       return t.size_holes();
     }
   };
@@ -379,24 +379,25 @@
 
 /// \relatesalso polygon_90_concept
   template <typename T>
- typename enable_if<
- typename gtl_if<
+ typename polygon_90_traits<T>::compact_iterator_type
+ begin_compact(const T& polygon,
+ typename enable_if<
       typename gtl_and <typename is_polygon_with_holes_type<T>::type,
                         typename gtl_same_type<typename geometry_domain<typename geometry_concept<T>::type>::type,
- manhattan_domain>::type>::type>::type,
- typename polygon_90_traits<T>::compact_iterator_type>::type
- begin_compact(const T& polygon) {
+ manhattan_domain>::type>::type>::type *ptr = 0
+ ) {
     return polygon_90_traits<T>::begin_compact(polygon);
   }
   
 /// \relatesalso polygon_90_concept
   template <typename T>
- typename enable_if< typename gtl_if<
+ typename polygon_90_traits<T>::compact_iterator_type
+ end_compact(const T& polygon,
+ typename enable_if<
     typename gtl_and <typename is_polygon_with_holes_type<T>::type,
                       typename gtl_same_type<typename geometry_domain<typename geometry_concept<T>::type>::type,
- manhattan_domain>::type>::type>::type,
- typename polygon_90_traits<T>::compact_iterator_type>::type
- end_compact(const T& polygon) {
+ manhattan_domain>::type>::type>::type *ptr = 0
+ ) {
     return polygon_90_traits<T>::end_compact(polygon);
   }
   
@@ -421,7 +422,7 @@
   /// \relatesalso polygon_concept
   template <typename T>
   typename enable_if <typename is_polygon_with_holes_type<T>::type,
- unsigned int>::type
+ std::size_t>::type
   size(const T& polygon) {
     return polygon_traits<T>::size(polygon);
   }
@@ -447,7 +448,7 @@
 /// \relatesalso polygon_with_holes_concept
   template <typename T>
   typename enable_if <typename is_polygon_with_holes_type<T>::type,
- unsigned int>::type
+ std::size_t>::type
   size_holes(const T& polygon) {
     return polygon_with_holes_traits<T>::size_holes(polygon);
   }
@@ -737,7 +738,7 @@
               x(pt2, x(pt2) - halfdiff - (diff % 2));
               y(pt2, y(pt2) + halfdiff);
             } else{
- std::cout << "fail1\n";
+ //std::cout << "fail1\n";
             }
           } else {
             //previous edge is falling slope
@@ -750,7 +751,7 @@
               x(pt2, x(pt2) - halfdiff - (diff % 2));
               y(pt2, y(pt2) - halfdiff);
             } else {
- std::cout << "fail2\n";
+ //std::cout << "fail2\n";
             }
           }
           if(i == numPts - 1 && (diff % 2)) {
@@ -872,13 +873,14 @@
 
   //scale specifically 45
   template <typename polygon_type>
- typename enable_if<
+ polygon_type&
+ scale(polygon_type& polygon, double factor,
+ typename enable_if<
     typename gtl_and< typename is_any_mutable_polygon_without_holes_type<polygon_type>::type,
                       typename gtl_same_type
                       < forty_five_domain,
- typename geometry_domain<typename geometry_concept<polygon_type>::type>::type>::type>::type,
- polygon_type>::type &
- scale(polygon_type& polygon, double factor) {
+ typename geometry_domain<typename geometry_concept<polygon_type>::type>::type>::type>::type>::type *ptr = 0
+ ) {
     std::vector<typename std::iterator_traits<typename polygon_traits<polygon_type>::iterator_type>::value_type> points;
     points.reserve(size(polygon));
     for(typename polygon_traits<polygon_type>::iterator_type iter = begin_points(polygon);
@@ -892,8 +894,10 @@
   }
 
   template <typename T>
- typename enable_if< typename is_any_mutable_polygon_with_holes_type<T>::type, T>::type &
- scale(T& polygon, double factor) {
+ T&
+ scale(T& polygon, double factor,
+ typename enable_if< typename is_any_mutable_polygon_with_holes_type<T>::type>::type *ptr = 0
+ ) {
     typedef typename polygon_with_holes_traits<T>::hole_type hole_type;
     hole_type h;
     set_points(h, begin_points(polygon), end_points(polygon));
@@ -1035,12 +1039,11 @@
   }
 
   template <typename T>
+ typename polygon_traits<T>::coordinate_type
+ perimeter(const T& polygon,
   typename enable_if<
- typename gtl_if<
- typename is_polygon_with_holes_type<T>::type>::type,
- typename distance_type_by_domain<typename geometry_domain<typename geometry_concept<T>::type>::type,
- typename polygon_traits<T>::coordinate_type>::type>::type
- perimeter(const T& polygon) {
+ typename is_polygon_with_holes_type<T>::type>::type *ptr = 0
+ ) {
     typedef typename distance_type_by_domain
       <typename geometry_domain<typename geometry_concept<T>::type>::type, typename polygon_traits<T>::coordinate_type>::type Unit;
     typedef typename polygon_traits<T>::iterator_type iterator;
@@ -1084,9 +1087,9 @@
     iter_end = end_points(polygon);
     iter = begin_points(polygon);
     point_type prev_pt = *iter;
- unsigned int num = size(polygon);
- unsigned int counts[2] = {0, 0};
- for(unsigned int i = 0; i < num; ++i) {
+ std::size_t num = size(polygon);
+ std::size_t counts[2] = {0, 0};
+ for(std::size_t i = 0; i < num; ++i) {
       if(i == num-1) iter = begin_points(polygon);
       else ++iter;
       point_type current_pt = *iter;
@@ -1094,7 +1097,7 @@
          x(prev_pt)) {
         unsigned int index = x(current_pt) >
           x(point);
- unsigned int increment = 0;
+ std::size_t increment = 0;
         interval_data<coordinate_type> ivl(y(current_pt),
                                            y(prev_pt));
         if(contains(ivl, y(point), true)) {
@@ -1383,21 +1386,21 @@
 // typedef const hole_type* iterator_holes_type;
 // static inline iterator_holes_type begin_holes(const hole_type& t) { return &t; }
 // static inline iterator_holes_type end_holes(const hole_type& t) { return &t; }
-// static inline unsigned int size_holes(const hole_type& t) { return 0; }
+// static inline std::size_t size_holes(const hole_type& t) { return 0; }
 // };
 // template <typename T> struct polygon_with_holes_traits<polygon_45_data<T> > {
 // typedef polygon_45_data<T> hole_type;
 // typedef const hole_type* iterator_holes_type;
 // static inline iterator_holes_type begin_holes(const hole_type& t) { return &t; }
 // static inline iterator_holes_type end_holes(const hole_type& t) { return &t; }
-// static inline unsigned int size_holes(const hole_type& t) { return 0; }
+// static inline std::size_t size_holes(const hole_type& t) { return 0; }
 // };
 // template <typename T> struct polygon_with_holes_traits<polygon_data<T> > {
 // typedef polygon_data<T> hole_type;
 // typedef const hole_type* iterator_holes_type;
 // static inline iterator_holes_type begin_holes(const hole_type& t) { return &t; }
 // static inline iterator_holes_type end_holes(const hole_type& t) { return &t; }
-// static inline unsigned int size_holes(const hole_type& t) { return 0; }
+// static inline std::size_t size_holes(const hole_type& t) { return 0; }
 // };
   template <typename T> struct get_void {};
   template <> struct get_void<gtl_yes> { typedef void type; };
@@ -1408,7 +1411,7 @@
     typedef const hole_type* iterator_holes_type;
     static inline iterator_holes_type begin_holes(const hole_type& t) { return &t; }
     static inline iterator_holes_type end_holes(const hole_type& t) { return &t; }
- static inline unsigned int size_holes(const hole_type& t) { return 0; }
+ static inline std::size_t size_holes(const hole_type& t) { return 0; }
   };
 
   template <typename T>
@@ -1457,7 +1460,7 @@
     }
   
     /// Get the number of sides of the polygon
- inline unsigned int size() const {
+ inline std::size_t size() const {
       return polygon_traits<T>::size(*t);
     }
   
@@ -1494,7 +1497,7 @@
     }
   
     /// Get the number of sides of the polygon
- inline unsigned int size() const {
+ inline std::size_t size() const {
       return polygon_traits<T>::size(*t);
     }
   
@@ -1558,7 +1561,7 @@
     }
   
     /// Get the number of sides of the polygon
- inline unsigned int size() const {
+ inline std::size_t size() const {
       return polygon_traits<T>::size(*t);
     }
   
@@ -1578,7 +1581,7 @@
     }
   
     /// Get the number of sides of the polygon
- inline unsigned int size_holes() const {
+ inline std::size_t size_holes() const {
       return polygon_with_holes_traits<T>::size_holes(*t);
     }
   
@@ -1641,7 +1644,7 @@
     }
   
     /// Get the number of sides of the polygon
- inline unsigned int size() const {
+ inline std::size_t size() const {
       return polygon_traits<T>::size(*t);
     }
   
@@ -1661,7 +1664,7 @@
     }
   
     /// Get the number of sides of the polygon
- inline unsigned int size_holes() const {
+ inline std::size_t size_holes() const {
       return polygon_with_holes_traits<T>::size_holes(*t);
     }
   

Modified: sandbox/gtl/boost/polygon/polygon_with_holes_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/polygon_with_holes_data.hpp (original)
+++ sandbox/gtl/boost/polygon/polygon_with_holes_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -78,7 +78,7 @@
     return self_.end();
   }
 
- inline unsigned int size() const {
+ inline std::size_t size() const {
     return self_.size();
   }
 
@@ -92,7 +92,7 @@
     return holes_.end();
   }
 
- inline unsigned int size_holes() const {
+ inline std::size_t size_holes() const {
     return holes_.size();
   }
 
@@ -101,51 +101,7 @@
   std::list<hole_type> holes_;
   };
   
- template <typename T>
- std::ostream& operator<<(std::ostream& o, const polygon_90_with_holes_data<T>& poly) {
- o << "Polygon With Holes { ";
- for(typename polygon_90_with_holes_data<T>::iterator_type itr = poly.begin();
- itr != poly.end(); ++itr) {
- if(itr != poly.begin()) o << ", ";
- o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
- } o << " { ";
- for(typename polygon_90_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
- itr != poly.end_holes(); ++itr) {
- o << (*itr);
- }
- o << " } } ";
- return o;
- }
- template <typename T>
- std::ostream& operator<<(std::ostream& o, const polygon_45_with_holes_data<T>& poly) {
- o << "Polygon With Holes { ";
- for(typename polygon_45_with_holes_data<T>::iterator_type itr = poly.begin();
- itr != poly.end(); ++itr) {
- if(itr != poly.begin()) o << ", ";
- o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
- } o << " { ";
- for(typename polygon_45_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
- itr != poly.end_holes(); ++itr) {
- o << (*itr);
- }
- o << " } } ";
- return o;
- }
- template <typename T>
- std::ostream& operator<<(std::ostream& o, const polygon_with_holes_data<T>& poly) {
- o << "Polygon With Holes { ";
- for(typename polygon_with_holes_data<T>::iterator_type itr = poly.begin();
- itr != poly.end(); ++itr) {
- if(itr != poly.begin()) o << ", ";
- o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
- } o << " { ";
- for(typename polygon_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
- itr != poly.end_holes(); ++itr) {
- o << (*itr);
- }
- o << " } } ";
- return o;
- }
+
 }
 }
 #endif

Modified: sandbox/gtl/boost/polygon/rectangle_concept.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/rectangle_concept.hpp (original)
+++ sandbox/gtl/boost/polygon/rectangle_concept.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -84,76 +84,95 @@
   };
 
   template <typename T>
- typename enable_if< typename gtl_if<typename is_rectangle_concept<typename geometry_concept<T>::type>::type>::type,
- typename rectangle_interval_type<T>::type >::type
- get(const T& rectangle, orientation_2d orient) {
+ typename rectangle_interval_type<T>::type
+ get(const T& rectangle, orientation_2d orient,
+ typename enable_if< typename gtl_if<typename is_rectangle_concept<typename geometry_concept<T>::type>::type>::type>::type *ptr = 0
+ ) {
     return rectangle_traits<T>::get(rectangle, orient);
   }
 
+ struct y_r_h : gtl_yes {};
+
   template <typename T>
- typename enable_if< typename gtl_if<typename is_rectangle_concept<typename geometry_concept<T>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_h, typename gtl_if<typename is_rectangle_concept<typename geometry_concept<T>::type>::type>::type>::type,
                        typename rectangle_traits<T>::interval_type>::type
   horizontal(const T& rectangle) {
     return rectangle_traits<T>::get(rectangle, HORIZONTAL);
   }
 
+ struct y_r_v : gtl_yes {};
+
   template <typename T>
- typename enable_if< typename gtl_if<typename is_rectangle_concept<typename geometry_concept<T>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_v, typename gtl_if<typename is_rectangle_concept<typename geometry_concept<T>::type>::type>::type>::type,
                        typename rectangle_traits<T>::interval_type>::type
   vertical(const T& rectangle) {
     return rectangle_traits<T>::get(rectangle, VERTICAL);
   }
 
+ struct y_r_set : gtl_yes {};
+
   template <orientation_2d_enum orient, typename T, typename T2>
- typename enable_if< typename gtl_and<typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_set, typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
                                         typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
                        void>::type
   set(T& rectangle, const T2& interval) {
     rectangle_mutable_traits<T>::set(rectangle, orient, interval);
   }
 
+ struct y_r_set2 : gtl_yes {};
+
   template <typename T, typename T2>
- typename enable_if< typename gtl_and<typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_set2, typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
                                         typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
                        void>::type
   set(T& rectangle, orientation_2d orient, const T2& interval) {
     rectangle_mutable_traits<T>::set(rectangle, orient, interval);
   }
 
+ struct y_r_h2 : gtl_yes {};
+
   template <typename T, typename T2>
- typename enable_if< typename gtl_and<typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_h2, typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
                                         typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
                        void>::type
   horizontal(T& rectangle, const T2& interval) {
     rectangle_mutable_traits<T>::set(rectangle, HORIZONTAL, interval);
   }
 
+ struct y_r_v2 : gtl_yes {};
+
   template <typename T, typename T2>
   typename enable_if<
- typename gtl_and<typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
+ typename gtl_and_3<y_r_v2, typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
                      typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type, void>::type
   vertical(T& rectangle, const T2& interval) {
     rectangle_mutable_traits<T>::set(rectangle, VERTICAL, interval);
   }
 
+ struct y_r_construct : gtl_yes {};
+
   template <typename T, typename T2, typename T3>
- typename enable_if< typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
+ typename enable_if< typename gtl_and<y_r_construct, typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type>::type,
                        T>::type
   construct(const T2& interval_horizontal,
             const T3& interval_vertical) {
     return rectangle_mutable_traits<T>::construct(interval_horizontal, interval_vertical); }
   
+ struct y_r_construct2 : gtl_yes {};
+
   template <typename T, typename coord_type>
- typename enable_if< typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
+ typename enable_if< typename gtl_and<y_r_construct2, typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type>::type,
                        T>::type
   construct(coord_type xl, coord_type yl, coord_type xh, coord_type yh) {
     return rectangle_mutable_traits<T>::construct(interval_data<coord_type>(xl, xh),
                                                   interval_data<coord_type>(yl, yh));
   }
   
+ struct y_r_cconstruct : gtl_yes {};
+
   template <typename T, typename T2>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3<y_r_cconstruct,
       typename is_mutable_rectangle_concept<typename geometry_concept<T>::type>::type,
       typename is_rectangle_concept<typename geometry_concept<T2>::type>::type>::type,
     T>::type
@@ -161,9 +180,11 @@
     return construct<T> (get(rectangle, HORIZONTAL), get(rectangle, VERTICAL));
   }
   
+ struct y_r_assign : gtl_yes {};
+
   template <typename rectangle_type_1, typename rectangle_type_2>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3< y_r_assign,
       typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
       typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
     rectangle_type_1>::type &
@@ -173,9 +194,11 @@
     return lvalue;
   }
   
+ struct y_r_equiv : gtl_yes {};
+
   template <typename T, typename T2>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3< y_r_equiv,
       typename is_rectangle_concept<typename geometry_concept<T>::type>::type,
       typename is_rectangle_concept<typename geometry_concept<T2>::type>::type>::type,
     bool>::type
@@ -184,15 +207,19 @@
       equivalence(get(rect1, VERTICAL), get(rect2, VERTICAL));
   }
   
+ struct y_r_get : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_get, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        typename rectangle_coordinate_type<rectangle_type>::type>::type
   get(const rectangle_type& rectangle, orientation_2d orient, direction_1d dir) {
     return get(rectangle_traits<rectangle_type>::get(rectangle, orient), dir);
   }
   
+ struct y_r_set3 : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, void>::type
+ typename enable_if<typename gtl_and<y_r_set3, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type, void>::type
   set(rectangle_type& rectangle, orientation_2d orient, direction_1d dir,
       typename rectangle_traits<rectangle_type>::coordinate_type value) {
     typename rectangle_traits<rectangle_type>::interval_type ivl = get(rectangle, orient);
@@ -200,88 +227,114 @@
     set(rectangle, orient, ivl);
   }
 
+ struct y_r_xl : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_xl, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        typename rectangle_coordinate_type<rectangle_type>::type>::type
   xl(const rectangle_type& rectangle) {
     return get(rectangle, HORIZONTAL, LOW);
   }
 
+ struct y_r_xl2 : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, void>::type
+ typename enable_if<typename gtl_and<y_r_xl2, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type, void>::type
   xl(rectangle_type& rectangle, typename rectangle_traits<rectangle_type>::coordinate_type value) {
     return set(rectangle, HORIZONTAL, LOW, value);
   }
 
+ struct y_r_xh : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_xh, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        typename rectangle_coordinate_type<rectangle_type>::type>::type
   xh(const rectangle_type& rectangle) {
     return get(rectangle, HORIZONTAL, HIGH);
   }
 
+ struct y_r_xh2 : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, void>::type
+ typename enable_if<typename gtl_and<y_r_xh2, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type, void>::type
   xh(rectangle_type& rectangle, typename rectangle_traits<rectangle_type>::coordinate_type value) {
     return set(rectangle, HORIZONTAL, HIGH, value);
   }
 
+ struct y_r_yl : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_yl, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        typename rectangle_coordinate_type<rectangle_type>::type>::type
   yl(const rectangle_type& rectangle) {
     return get(rectangle, VERTICAL, LOW);
   }
+
+ struct y_r_yl2 : gtl_yes {};
 
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, void>::type
+ typename enable_if<typename gtl_and<y_r_yl2, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type, void>::type
   yl(rectangle_type& rectangle, typename rectangle_traits<rectangle_type>::coordinate_type value) {
     return set(rectangle, VERTICAL, LOW, value);
   }
 
+ struct y_r_yh : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_yh, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        typename rectangle_coordinate_type<rectangle_type>::type>::type
   yh(const rectangle_type& rectangle) {
     return get(rectangle, VERTICAL, HIGH);
   }
 
+ struct y_r_yh2 : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, void>::type
+ typename enable_if<typename gtl_and<y_r_yh2, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type, void>::type
   yh(rectangle_type& rectangle, typename rectangle_traits<rectangle_type>::coordinate_type value) {
     return set(rectangle, VERTICAL, HIGH, value);
   }
 
+ struct y_r_ll : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_ll, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        point_data<typename rectangle_traits<rectangle_type>::coordinate_type> >::type
   ll(const rectangle_type& rectangle) {
     return point_data<typename rectangle_traits<rectangle_type>::coordinate_type> (xl(rectangle), yl(rectangle));
   }
 
+ struct y_r_lr : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_lr, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        point_data<typename rectangle_traits<rectangle_type>::coordinate_type> >::type
   lr(const rectangle_type& rectangle) {
     return point_data<typename rectangle_traits<rectangle_type>::coordinate_type> (xh(rectangle), yl(rectangle));
   }
 
+ struct y_r_ul : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_ul, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        point_data<typename rectangle_traits<rectangle_type>::coordinate_type> >::type
   ul(const rectangle_type& rectangle) {
     return point_data<typename rectangle_traits<rectangle_type>::coordinate_type> (xl(rectangle), yh(rectangle));
   }
 
+ struct y_r_ur : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if< typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_ur, typename gtl_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        point_data<typename rectangle_traits<rectangle_type>::coordinate_type> >::type
   ur(const rectangle_type& rectangle) {
     return point_data<typename rectangle_traits<rectangle_type>::coordinate_type> (xh(rectangle), yh(rectangle));
   }
 
+ struct y_r_contains : gtl_yes {};
+
   template <typename rectangle_type, typename rectangle_type_2>
- typename enable_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_contains, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
                                          typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        bool>::type
   contains(const rectangle_type& rectangle, const rectangle_type_2 rectangle_contained,
@@ -290,8 +343,10 @@
       contains(vertical(rectangle), vertical(rectangle_contained), consider_touch);
   }
 
+ struct y_r_contains2 : gtl_yes {};
+
   template <typename rectangle_type, typename point_type>
- typename enable_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_contains2, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
                                          typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type, bool>::type
   contains(const rectangle_type& rectangle, const point_type point_contained,
            bool consider_touch = true) {
@@ -299,9 +354,11 @@
       contains(vertical(rectangle), y(point_contained), consider_touch);
   }
 
+ struct y_r_set_points : gtl_yes {};
+
   // set all four coordinates based upon two points
   template <typename rectangle_type, typename point_type_1, typename point_type_2>
- typename enable_if< typename gtl_and_3<
+ typename enable_if< typename gtl_and_4< y_r_set_points,
     typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
     typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
     typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
@@ -320,19 +377,23 @@
   
   // move rectangle by delta in orient
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, rectangle_type>::type &
+ rectangle_type&
   move(rectangle_type& rectangle, orientation_2d orient,
- typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::coordinate_difference delta) {
+ typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::coordinate_difference delta,
+ typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type *ptr = 0
+ ) {
     typename rectangle_traits<rectangle_type>::interval_type ivl = get(rectangle, orient);
     move(ivl, delta);
     set(rectangle, orient, ivl);
     return rectangle;
   }
 
+ struct y_r_convolve : gtl_yes {};
+
   // convolve this with b
   template <typename rectangle_type_1, typename rectangle_type_2>
   typename enable_if<
- typename gtl_and<
+ typename gtl_and_3< y_r_convolve,
       typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
       typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
     rectangle_type_1>::type &
@@ -345,9 +406,11 @@
     return rectangle;
   }
   
+ struct y_r_deconvolve : gtl_yes {};
+
   // deconvolve this with b
   template <typename rectangle_type_1, typename rectangle_type_2>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3< y_r_deconvolve,
     typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
     typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        rectangle_type_1>::type &
@@ -359,10 +422,12 @@
     return rectangle;
   }
   
+ struct y_r_reconvolve : gtl_yes {};
+
   // reflectedConvolve this with b
   template <typename rectangle_type_1, typename rectangle_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename gtl_and_3<y_r_reconvolve, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                       typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
     rectangle_type_1>::type &
   reflected_convolve(rectangle_type_1& rectangle, const rectangle_type_2& convolution_rectangle) {
@@ -373,11 +438,13 @@
     return rectangle;
   }
   
+ struct y_r_redeconvolve : gtl_yes {};
+
   // reflectedDeconvolve this with b
   // deconvolve this with b
   template <typename rectangle_type_1, typename rectangle_type_2>
   typename enable_if<
- typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename gtl_and_3<y_r_redeconvolve, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                       typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
     rectangle_type_1>::type &
   reflected_deconvolve(rectangle_type_1& rectangle, const rectangle_type_2& convolution_rectangle) {
@@ -388,9 +455,11 @@
     return rectangle;
   }
   
+ struct y_r_convolve2 : gtl_yes {};
+
   // convolve with point
   template <typename rectangle_type, typename point_type>
- typename enable_if< typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_convolve2, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
                                          typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
                        rectangle_type>::type &
   convolve(rectangle_type& rectangle, const point_type& convolution_point) {
@@ -401,10 +470,12 @@
     return rectangle;
   }
 
+ struct y_r_deconvolve2 : gtl_yes {};
+
   // deconvolve with point
   template <typename rectangle_type, typename point_type>
   typename enable_if<
- typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename gtl_and_3<y_r_deconvolve2, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
                       typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type, rectangle_type>::type &
   deconvolve(rectangle_type& rectangle, const point_type& convolution_point) {
     typename rectangle_traits<rectangle_type>::interval_type ivl = horizontal(rectangle);
@@ -414,35 +485,43 @@
     return rectangle;
   }
 
+ struct y_r_delta : gtl_yes {};
+
   // get the magnitude of the interval range depending on orient
   template <typename rectangle_type>
- typename enable_if< typename gtl_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_delta, typename gtl_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        typename rectangle_difference_type<rectangle_type>::type>::type
   delta(const rectangle_type& rectangle, orientation_2d orient) {
     return delta(get(rectangle, orient));
   }
 
+ struct y_r_area : gtl_yes {};
+
   // get the area of the rectangle
   template <typename rectangle_type>
- typename enable_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_area, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
                        typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::manhattan_area_type>::type
   area(const rectangle_type& rectangle) {
     typedef typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::manhattan_area_type area_type;
     return (area_type)delta(rectangle, HORIZONTAL) * (area_type)delta(rectangle, VERTICAL);
   }
 
+ struct y_r_go : gtl_yes {};
+
   // returns the orientation of the longest side
   template <typename rectangle_type>
- typename enable_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_go, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
                       orientation_2d>::type
   guess_orientation(const rectangle_type& rectangle) {
     return delta(rectangle, HORIZONTAL) >= delta(rectangle, VERTICAL) ?
       HORIZONTAL : VERTICAL;
   }
 
+ struct y_r_half_p : gtl_yes {};
+
   // get the half perimeter of the rectangle
   template <typename rectangle_type>
- typename enable_if< typename gtl_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ typename enable_if< typename gtl_and<y_r_half_p, typename gtl_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type>::type,
                        typename rectangle_difference_type<rectangle_type>::type>::type
   half_perimeter(const rectangle_type& rectangle) {
     return delta(rectangle, HORIZONTAL) + delta(rectangle, VERTICAL);
@@ -450,19 +529,22 @@
    
   // get the perimeter of the rectangle
   template <typename rectangle_type>
- typename enable_if< typename gtl_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
- typename rectangle_difference_type<rectangle_type>::type>::type
- perimeter(const rectangle_type& rectangle) {
+ typename rectangle_difference_type<rectangle_type>::type
+ perimeter(const rectangle_type& rectangle,
+ typename enable_if< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type *ptr = 0
+ ) {
     return 2 * half_perimeter(rectangle);
   }
 
+ struct y_r_intersects : gtl_yes {};
+
   // check if Rectangle b intersects `this` Rectangle
   // [in] b Rectangle that will be checked
   // [in] considerTouch If true, return true even if b touches the boundary
   // [ret] . true if `t` intersects b
   template <typename rectangle_type_1, typename rectangle_type_2>
   typename enable_if<
- typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename gtl_and_3<y_r_intersects, typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                       typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
     bool>::type
   intersects(const rectangle_type_1& rectangle, const rectangle_type_2& b, bool consider_touch = true) {
@@ -470,13 +552,15 @@
       intersects(vertical(rectangle), vertical(b), consider_touch);
   }
 
+ struct y_r_b_intersect : gtl_yes {};
+
   // Check if boundaries of Rectangle b and `this` Rectangle intersect
   // [in] b Rectangle that will be checked
   // [in] considerTouch If true, return true even if p is on the foundary
   // [ret] . true if `t` contains p
   template <typename rectangle_type_1, typename rectangle_type_2>
   typename enable_if<
- typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename gtl_and_3<y_r_b_intersect, typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                       typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
     bool>::type
   boundaries_intersect(const rectangle_type_1& rectangle, const rectangle_type_2& b,
@@ -486,9 +570,11 @@
             !(contains(b, rectangle, !consider_touch)));
   }
     
+ struct y_r_b_abuts : gtl_yes {};
+
   // check if b is touching 'this' on the end specified by dir
   template <typename rectangle_type_1, typename rectangle_type_2>
- typename enable_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_b_abuts, typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                                          typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        bool>::type
   abuts(const rectangle_type_1& rectangle, const rectangle_type_2& b,
@@ -501,9 +587,11 @@
                  get(b, orientation_2d(dir).get_perpendicular()), true);
   }
   
+ struct y_r_b_abuts2 : gtl_yes {};
+
   // check if they are touching in the given orientation
   template <typename rectangle_type_1, typename rectangle_type_2>
- typename enable_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_b_abuts2, typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                                          typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        bool>::type
   abuts(const rectangle_type_1& rectangle, const rectangle_type_2& b,
@@ -514,19 +602,23 @@
                  get(b, orient.get_perpendicular()), true);
   }
 
+ struct y_r_b_abuts3 : gtl_yes {};
+
   // check if they are touching but not overlapping
   template <typename rectangle_type_1, typename rectangle_type_2>
- typename enable_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_b_abuts3, typename is_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                                          typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        bool>::type
   abuts(const rectangle_type_1& rectangle, const rectangle_type_2& b) {
     return abuts(rectangle, b, HORIZONTAL) || abuts(rectangle, b, VERTICAL);
   }
 
+ struct y_r_b_intersect2 : gtl_yes {};
+
   // intersect rectangle with interval on orient
   template <typename rectangle_type, typename interval_type>
   typename enable_if<
- typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename gtl_and_3<y_r_b_intersect2, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
                       typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
     bool>::type
   intersect(rectangle_type& rectangle, const interval_type& b,
@@ -539,9 +631,11 @@
     return false;
   }
 
+ struct y_r_b_intersect3 : gtl_yes {};
+
   // clip rectangle to b
   template <typename rectangle_type_1, typename rectangle_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_b_intersect3, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                                          typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        bool>::type
   intersect(rectangle_type_1& rectangle, const rectangle_type_2& b, bool consider_touch = true) {
@@ -553,9 +647,11 @@
     return false;
   }
 
+ struct y_r_g_intersect : gtl_yes {};
+
   // Sets this to the generalized intersection of this and the given rectangle
   template <typename rectangle_type_1, typename rectangle_type_2>
- typename enable_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3<y_r_g_intersect,
     typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
     typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        rectangle_type_1>::type &
@@ -569,9 +665,11 @@
     return rectangle;
   }
 
+ struct y_r_bloat : gtl_yes {};
+
   // bloat the interval specified by orient by bloating
   template <typename rectangle_type>
- typename enable_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_bloat, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
                       rectangle_type>::type &
   bloat(rectangle_type& rectangle, orientation_2d orient,
         typename rectangle_traits<rectangle_type>::coordinate_type bloating) {
@@ -581,9 +679,11 @@
     return rectangle;
   }
 
+ struct y_r_bloat2 : gtl_yes {};
+
   // bloat the Rectangle by bloating
   template <typename rectangle_type>
- typename enable_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_bloat2, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
                       rectangle_type>::type &
   bloat(rectangle_type& rectangle,
         typename rectangle_traits<rectangle_type>::coordinate_type bloating) {
@@ -591,9 +691,11 @@
     return bloat(rectangle, VERTICAL, bloating);
   }
 
+ struct y_r_bloat3 : gtl_yes {};
+
   // bloat the interval cooresponding to orient by bloating in dir direction
   template <typename rectangle_type>
- typename enable_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_bloat3, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
                       rectangle_type>::type &
   bloat(rectangle_type& rectangle, direction_2d dir,
         typename rectangle_traits<rectangle_type>::coordinate_type bloating) {
@@ -603,37 +705,45 @@
     return rectangle;
   }
 
+ struct y_r_shrink : gtl_yes {};
+
   // shrink the interval specified by orient by bloating
   template <typename rectangle_type>
- typename enable_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_shrink, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
                       rectangle_type>::type &
   shrink(rectangle_type& rectangle, orientation_2d orient,
          typename rectangle_traits<rectangle_type>::coordinate_type shrinking) {
     return bloat(rectangle, orient, -shrinking);
   }
 
+ struct y_r_shrink2 : gtl_yes {};
+
   // shrink the Rectangle by bloating
   template <typename rectangle_type>
- typename enable_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_shrink2, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
                       rectangle_type>::type &
   shrink(rectangle_type& rectangle,
          typename rectangle_traits<rectangle_type>::coordinate_type shrinking) {
     return bloat(rectangle, -shrinking);
   }
 
+ struct y_r_shrink3 : gtl_yes {};
+
   // shrink the interval cooresponding to orient by bloating in dir direction
   template <typename rectangle_type>
- typename enable_if<typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename enable_if<typename gtl_and<y_r_shrink3, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
                       rectangle_type>::type &
   shrink(rectangle_type& rectangle, direction_2d dir,
          typename rectangle_traits<rectangle_type>::coordinate_type shrinking) {
     return bloat(rectangle, dir, -shrinking);
   }
 
+ struct y_r_encompass : gtl_yes {};
+
   // encompass interval on orient
   template <typename rectangle_type, typename interval_type>
   typename enable_if<
- typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename gtl_and_3<y_r_encompass, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
                       typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
     bool>::type
   encompass(rectangle_type& rectangle, const interval_type& b,
@@ -646,25 +756,34 @@
     return false;
   }
 
+ struct y_r_encompass2 : gtl_yes {};
+
   // enlarge rectangle to encompass the Rectangle b
   template <typename rectangle_type_1, typename rectangle_type_2>
- typename enable_if< typename gtl_and<
- typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
- typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
- bool>::type
- encompass(rectangle_type_1& rectangle, const rectangle_type_2& b) {
+ bool
+ encompass(rectangle_type_1& rectangle, const rectangle_type_2& b,
+ typename enable_if< typename gtl_and_3<y_r_encompass2,
+ typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type >::type>::type *ptr = 0
+ ) {
     //note that operator | is intentional because both should be called regardless
     return encompass(rectangle, horizontal(b), HORIZONTAL) |
       encompass(rectangle, vertical(b), VERTICAL);
   }
 
+ struct y_r_encompass3 : gtl_yes {};
+
   // enlarge rectangle to encompass the point b
   template <typename rectangle_type_1, typename point_type>
   typename enable_if<
- typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename gtl_and_3<y_r_encompass3, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                       typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
     bool>::type
- encompass(rectangle_type_1& rectangle, const point_type& b) {
+ encompass(rectangle_type_1& rectangle, const point_type& b,
+ typename enable_if<
+ typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type>::type *ptr = 0
+ ) {
     typename rectangle_traits<rectangle_type_1>::interval_type hivl, vivl;
     hivl = horizontal(rectangle);
     vivl = vertical(rectangle);
@@ -677,10 +796,12 @@
     return retval;
   }
 
+ struct y_r_center : gtl_yes {};
+
   // returns the center of the rectangle
   template <typename point_type, typename rectangle_type>
   typename enable_if<
- typename gtl_and< typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
+ typename gtl_and_3<y_r_center, typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
                       typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
     bool>::type
   center(point_type& center_point, const rectangle_type& rectangle) {
@@ -689,9 +810,11 @@
     return true;
   }
 
+ struct y_r_get_corner : gtl_yes {};
+
   template <typename point_type, typename rectangle_type>
   typename enable_if<
- typename gtl_and< typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
+ typename gtl_and_3<y_r_get_corner, typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
                       typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
     bool>::type
   get_corner(point_type& corner_point, const rectangle_type& rectangle, direction_2d direction_facing, direction_1d direction_turning) {
@@ -703,16 +826,21 @@
     return true;
   }
 
+ struct y_r_get_half : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, rectangle_type>::type
+ typename enable_if<typename gtl_and<y_r_get_half, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ rectangle_type>::type
   get_half(const rectangle_type& rectangle, direction_2d dir) {
     rectangle_type retval(rectangle);
     set(retval, orientation_2d(dir), get_half(get(rectangle, orientation_2d(dir)), direction_1d(dir)));
     return retval;
   }
 
+ struct y_r_join_with : gtl_yes {};
+
   template <typename rectangle_type_1, typename rectangle_type_2>
- typename enable_if< typename gtl_and< typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_join_with, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type_1>::type>::type,
                                          typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        bool>::type
   join_with(rectangle_type_1& rectangle, const rectangle_type_2& b) {
@@ -732,28 +860,34 @@
     }
     return false;
   }
+
+ struct y_r_eda2 : gtl_yes {};
 
   template <typename rectangle_type, typename point_type>
- typename enable_if< typename gtl_if< typename gtl_and<
+ typename enable_if< typename gtl_and_3<y_r_eda2,
     typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
- typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type>::type,
- typename rectangle_difference_type<rectangle_type>::type>::type
+ typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
+ typename rectangle_difference_type<rectangle_type>::type>::type
   euclidean_distance(const rectangle_type& lvalue, const point_type& rvalue, orientation_2d orient) {
     return euclidean_distance(get(lvalue, orient), get(rvalue, orient));
   }
 
+ struct y_r_eda : gtl_yes {};
+
   template <typename rectangle_type, typename rectangle_type_2>
   typename enable_if<
- typename gtl_if< typename gtl_and<
+ typename gtl_and_3<y_r_eda,
       typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
- typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type>::type,
- typename rectangle_difference_type<rectangle_type>::type>::type
+ typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
+ typename rectangle_difference_type<rectangle_type>::type>::type
   euclidean_distance(const rectangle_type& lvalue, const rectangle_type_2& rvalue, orientation_2d orient) {
     return euclidean_distance(get(lvalue, orient), get(rvalue, orient));
   }
 
+ struct y_r_sed : gtl_yes {};
+
   template <typename rectangle_type, typename point_type>
- typename enable_if< typename gtl_if< typename gtl_and<
+ typename enable_if< typename gtl_if< typename gtl_and_3<y_r_sed,
     typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
     typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type>::type,
                        typename rectangle_difference_type<rectangle_type>::type>::type
@@ -764,10 +898,12 @@
     return (xdist * xdist) + (ydist * ydist);
   }
 
+ struct y_r_sed2 : gtl_yes {};
+
   template <typename rectangle_type, typename rectangle_type_2>
   typename enable_if<
- typename gtl_if< typename gtl_and< typename is_rectangle_concept< typename geometry_concept<rectangle_type>::type>::type,
- typename is_rectangle_concept< typename geometry_concept<rectangle_type_2>::type>::type>::type>::type,
+ typename gtl_and_3<y_r_sed2, typename is_rectangle_concept< typename geometry_concept<rectangle_type>::type>::type,
+ typename is_rectangle_concept< typename geometry_concept<rectangle_type_2>::type>::type>::type,
     typename rectangle_difference_type<rectangle_type>::type>::type
   square_euclidean_distance(const rectangle_type& lvalue, const rectangle_type_2& rvalue) {
     typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::coordinate_difference xdist, ydist;
@@ -776,28 +912,34 @@
     return (xdist * xdist) + (ydist * ydist);
   }
 
+ struct y_r_edist : gtl_yes {};
+
   template <typename rectangle_type, typename point_type>
- typename enable_if< typename gtl_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
- typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_edist, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
                        typename rectangle_distance_type<rectangle_type>::type>::type
   euclidean_distance(rectangle_type& lvalue, const point_type& rvalue) {
- return sqrt((typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::coordinate_distance)
+ return sqrt((double)
                 (square_euclidean_distance(lvalue, rvalue)));
   }
 
+ struct y_r_edist2 : gtl_yes {};
+
   template <typename rectangle_type, typename rectangle_type_2>
- typename enable_if< typename gtl_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
- typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type>::type,
+ typename enable_if< typename gtl_and_3<y_r_edist2, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
                        typename rectangle_distance_type<rectangle_type>::type>::type
   euclidean_distance(const rectangle_type& lvalue, const rectangle_type_2& rvalue) {
- return sqrt((typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::coordinate_distance)
- (square_euclidean_distance(lvalue, rvalue)));
+ double val = (int)square_euclidean_distance(lvalue, rvalue);
+ return sqrt(val);
   }
 
+ struct y_r_mdist : gtl_yes {};
+
   template <typename rectangle_type, typename point_type>
   typename enable_if<
- typename gtl_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
- typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type>::type,
+ typename gtl_and_3<y_r_mdist, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
     typename rectangle_difference_type<rectangle_type>::type>::type
   manhattan_distance(rectangle_type& lvalue, const point_type& rvalue) {
     typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::coordinate_difference xdist, ydist;
@@ -806,10 +948,12 @@
     return xdist + ydist;
   }
 
+ struct y_r_mdist2 : gtl_yes {};
+
   template <typename rectangle_type, typename rectangle_type_2>
   typename enable_if<
- typename gtl_if< typename gtl_and< typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
- typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type>::type,
+ typename gtl_and_3<y_r_mdist2, typename is_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type,
+ typename is_rectangle_concept<typename geometry_concept<rectangle_type_2>::type>::type>::type,
     typename rectangle_difference_type<rectangle_type>::type>::type
   manhattan_distance(const rectangle_type& lvalue, const rectangle_type_2& rvalue) {
     typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::coordinate_difference xdist, ydist;
@@ -818,17 +962,23 @@
     return xdist + ydist;
   }
 
+ struct y_r_scale_up : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, rectangle_type>::type &
+ typename enable_if<typename gtl_and<y_r_scale_up, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ rectangle_type>::type &
   scale_up(rectangle_type& rectangle,
            typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::unsigned_area_type factor) {
     horizontal(rectangle, scale_up(horizontal(rectangle), factor));
     vertical(rectangle, scale_up(vertical(rectangle), factor));
     return rectangle;
   }
-
+
+ struct y_r_scale_down : gtl_yes {};
+
   template <typename rectangle_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, rectangle_type>::type &
+ typename enable_if<typename gtl_and<y_r_scale_down, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ rectangle_type>::type &
   scale_down(rectangle_type& rectangle,
              typename coordinate_traits<typename rectangle_traits<rectangle_type>::coordinate_type>::unsigned_area_type factor) {
     horizontal(rectangle, scale_down(horizontal(rectangle), factor));
@@ -836,8 +986,11 @@
     return rectangle;
   }
 
+ struct y_r_scale : gtl_yes {};
+
   template <typename rectangle_type, typename scaling_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, rectangle_type>::type &
+ typename enable_if<typename gtl_and<y_r_scale, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ rectangle_type>::type &
   scale(rectangle_type& rectangle, const scaling_type& scaling) {
     point_data<typename rectangle_traits<rectangle_type>::coordinate_type> llp(xl(rectangle), yl(rectangle));
     point_data<typename rectangle_traits<rectangle_type>::coordinate_type> urp(xl(rectangle), yl(rectangle));
@@ -846,9 +999,12 @@
     set_points(rectangle, llp, urp);
     return rectangle;
   }
-
+
+ struct y_r_transform : gtl_yes {};
+
   template <typename rectangle_type, typename transformation_type>
- typename enable_if<typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type, rectangle_type>::type &
+ typename enable_if<typename gtl_and<y_r_transform, typename is_mutable_rectangle_concept<typename geometry_concept<rectangle_type>::type>::type>::type,
+ rectangle_type>::type &
   transform(rectangle_type& rectangle, const transformation_type& transformation) {
     point_data<typename rectangle_traits<rectangle_type>::coordinate_type> llp(xl(rectangle), yl(rectangle));
     point_data<typename rectangle_traits<rectangle_type>::coordinate_type> urp(xh(rectangle), yh(rectangle));

Modified: sandbox/gtl/boost/polygon/rectangle_data.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/rectangle_data.hpp (original)
+++ sandbox/gtl/boost/polygon/rectangle_data.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -57,11 +57,7 @@
   interval_data<coordinate_type> ranges_[2];
 };
 
-template <class T>
-std::ostream& operator << (std::ostream& o, const rectangle_data<T>& r)
-{
- return o << r.get(HORIZONTAL) << ' ' << r.get(VERTICAL);
-}
+
 }
 }
 #endif

Modified: sandbox/gtl/boost/polygon/transform.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/transform.hpp (original)
+++ sandbox/gtl/boost/polygon/transform.hpp 2009-07-08 12:30:25 EDT (Wed, 08 Jul 2009)
@@ -322,8 +322,8 @@
   // get the inverse axis_transformation of this
   axis_transformation inverse() const;
 
- friend std::ostream& operator<< (std::ostream& o, const axis_transformation& r);
- friend std::istream& operator>> (std::istream& i, axis_transformation& r);
+ //friend std::ostream& operator<< (std::ostream& o, const axis_transformation& r);
+ //friend std::istream& operator>> (std::istream& i, axis_transformation& r);
 
 private:
   ATR atr_;


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