Changeset 54797


Ignore:
Timestamp:
Jul 8, 2009, 4:30:25 PM (9 years ago)
Author:
Lucanus Simonson
Message:

ported code to MSVC8

Location:
sandbox/gtl/boost/polygon
Files:
38 edited

Legend:

Unmodified
Added
Removed
  • sandbox/gtl/boost/polygon/detail/boolean_op.hpp

    r54345 r54797  
    253253  }
    254254
    255   //self contained unit test for BooleanOr algorithm
    256   template <typename Unit>
    257   inline bool testBooleanOr() {
    258     BooleanOp<int, Unit> booleanOr;
    259     //test one rectangle
    260     std::vector<std::pair<interval_data<Unit>, int> > container;
    261     booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
    262     booleanOr.advanceScan();
    263     booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
    264     if(container.size() != 2) {
    265       std::cout << "Test one rectangle, wrong output size\n";
    266       return false;
    267     }
    268     if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
    269       std::cout << "Test one rectangle, first output wrong: Interval(" <<
    270         container[0].first << "), " << container[0].second << std::endl;
    271     }
    272     if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
    273       std::cout << "Test one rectangle, second output wrong: Interval(" <<
    274         container[1].first << "), " << container[1].second << std::endl;
    275     }
    276 
    277     //test two rectangles
    278     container.clear();
    279     booleanOr = BooleanOp<int, Unit>();
    280     booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
    281     booleanOr.advanceScan();
    282     booleanOr.processInterval(container, interval_data<Unit>(5, 15), 1);
    283     booleanOr.advanceScan();
    284     booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
    285     booleanOr.advanceScan();
    286     booleanOr.processInterval(container, interval_data<Unit>(5, 15), -1);
    287     if(container.size() != 4) {
    288       std::cout << "Test two rectangles, wrong output size\n";
    289       for(unsigned int i = 0; i < container.size(); ++i){
    290               std::cout << container[i].first << "), " << container[i].second << std::endl;
    291       }
    292       return false;
    293     }
    294     if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
    295             std::cout << "Test two rectangles, first output wrong: Interval(" <<
    296         container[0].first << "), " << container[0].second << std::endl;
    297     }
    298     if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(10, 15), 1)) {
    299             std::cout << "Test two rectangles, second output wrong: Interval(" <<
    300         container[1].first << "), " << container[1].second << std::endl;
    301     }
    302     if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 5), -1)) {
    303             std::cout << "Test two rectangles, third output wrong: Interval(" <<
    304         container[2].first << "), " << container[2].second << std::endl;
    305     }
    306     if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(5, 15), -1)) {
    307             std::cout << "Test two rectangles, fourth output wrong: Interval(" <<
    308         container[3].first << "), " << container[3].second << std::endl;
    309     }
    310 
    311     //test two rectangles
    312     container.clear();
    313     booleanOr = BooleanOp<int, Unit>();
    314     booleanOr.processInterval(container, interval_data<Unit>(5, 15), 1);
    315     booleanOr.advanceScan();
    316     booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
    317     booleanOr.advanceScan();
    318     booleanOr.processInterval(container, interval_data<Unit>(5, 15), -1);
    319     booleanOr.advanceScan();
    320     booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
    321     if(container.size() != 4) {
    322             std::cout << "Test other two rectangles, wrong output size\n";
    323       for(unsigned int i = 0; i < container.size(); ++i){
    324               std::cout << container[i].first << "), " << container[i].second << std::endl;
    325       }
    326       return false;
    327     }
    328     if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(5, 15), 1)) {
    329             std::cout << "Test other two rectangles, first output wrong: Interval(" <<
    330         container[0].first << "), " << container[0].second << std::endl;
    331     }
    332     if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 5), 1)) {
    333             std::cout << "Test other two rectangles, second output wrong: Interval(" <<
    334         container[1].first << "), " << container[1].second << std::endl;
    335     }
    336     if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(10, 15), -1)) {
    337             std::cout << "Test other two rectangles, third output wrong: Interval(" <<
    338         container[2].first << "), " << container[2].second << std::endl;
    339     }
    340     if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
    341             std::cout << "Test other two rectangles, fourth output wrong: Interval(" <<
    342         container[3].first << "), " << container[3].second << std::endl;
    343     }
    344 
    345     //test two nonoverlapping rectangles
    346     container.clear();
    347     booleanOr = BooleanOp<int, Unit>();
    348     booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
    349     booleanOr.advanceScan();
    350     booleanOr.processInterval(container, interval_data<Unit>(15, 25), 1);
    351     booleanOr.advanceScan();
    352     booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
    353     booleanOr.advanceScan();
    354     booleanOr.processInterval(container, interval_data<Unit>(15, 25), -1);
    355     if(container.size() != 4) {
    356             std::cout << "Test two nonoverlapping rectangles, wrong output size\n";
    357       return false;
    358     }
    359     if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
    360             std::cout << "Test two nonoverlapping rectangles, first output wrong: Interval(" <<
    361         container[0].first << "), " << container[0].second << std::endl;
    362     }
    363     if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(15, 25), 1)) {
    364             std::cout << "Test two nonoverlapping rectangles, second output wrong: Interval(" <<
    365         container[1].first << "), " << container[1].second << std::endl;
    366     }
    367     if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
    368             std::cout << "Test two nonoverlapping rectangles, third output wrong: Interval(" <<
    369         container[2].first << "), " << container[2].second << std::endl;
    370     }
    371     if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(15, 25), -1)) {
    372             std::cout << "Test two nonoverlapping rectangles, fourth output wrong: Interval(" <<
    373         container[3].first << "), " << container[3].second << std::endl;
    374     }
    375     return true;
    376   }
    377255
    378256  template <class T, typename Unit, typename iterator_type_1, typename iterator_type_2>
     
    458336        container.clear();
    459337        boolean.processInterval(container, ivl, count);
    460         for(unsigned int i = 0; i < container.size(); ++i) {
     338        for(std::size_t i = 0; i < container.size(); ++i) {
    461339          std::pair<interval_data<Unit>, int>& element = container[i];
    462340          if(!output.empty() && output.back().first == prevCoord &&
     
    525403          container.clear();
    526404          booleanOr.processInterval(container, ivl, count_type(count));
    527           for(unsigned int i = 0; i < container.size(); ++i) {
     405          for(std::size_t i = 0; i < container.size(); ++i) {
    528406            std::pair<interval_data<Unit>, int>& element = container[i];
    529407            if(!output.empty() && output.back().first == prevPos &&
  • sandbox/gtl/boost/polygon/detail/boolean_op_45.hpp

    r54345 r54797  
    572572          //std::cout << "Below Count: " << countBelow << std::endl;
    573573          Scan45Count count(countBelow);
    574           unsigned int numEdges = 0;
     574          std::size_t numEdges = 0;
    575575          iterator eraseItrs[3];
    576576          while(lowIter != scanData_.end() &&
     
    591591          //before we erase the elements we need to decide if they should be written out
    592592          CountType currentCount = countBelow;
    593           for(unsigned int i = 0; i < numEdges; ++i) {
     593          for(std::size_t i = 0; i < numEdges; ++i) {
    594594            output_functor f;
    595595            f(output, currentCount, eraseItrs[i]->count, crossPoint, eraseItrs[i]->rise, LOW);
     
    597597          }
    598598          //schedule erase of the elements
    599           for(unsigned int i = 0; i < numEdges; ++i) {
     599          for(std::size_t i = 0; i < numEdges; ++i) {
    600600            eraseVec.push_back(eraseItrs[i]);
    601601          }
     
    613613        //erase crossing elements
    614614        std::vector<iterator> searchVec;
    615         for(unsigned int i = 0; i < eraseVec.size(); ++i) {
     615        for(std::size_t i = 0; i < eraseVec.size(); ++i) {
    616616          if(eraseVec[i] != scanData_.begin()) {
    617617            iterator searchItr = eraseVec[i];
     
    623623          scanData_.erase(eraseVec[i]);
    624624        }
    625         for(unsigned int i = 0; i < searchVec.size(); ++i) {
     625        for(std::size_t i = 0; i < searchVec.size(); ++i) {
    626626          findCross_(searchVec[i]);
    627627        }
     
    633633        swap(vec, crossVector_);
    634634        iT mergeEnd = inputBegin;
    635         unsigned int mergeCount = 0;
     635        std::size_t mergeCount = 0;
    636636        while(mergeEnd != inputEnd &&
    637637              (*mergeEnd).first.x() == x_) {
     
    640640        }
    641641        crossVector_.reserve((std::max)(vec.capacity(), vec.size() + mergeCount));
    642         for(unsigned int i = 0; i < vec.size(); ++i){
     642        for(std::size_t i = 0; i < vec.size(); ++i){
    643643          while(inputBegin != mergeEnd &&
    644644                (*inputBegin).first.y() < vec[i].first.y()) {
     
    850850    };
    851851
    852     template <typename CountType>
    853     static inline void print45Data(const std::set<Scan45ElementT<CountType>,
    854                                    lessScan45Element<CountType> >& data) {
    855       typename std::set<Scan45ElementT<CountType>, lessScan45Element<CountType> >::const_iterator iter;
    856       for(iter = data.begin(); iter != data.end(); ++iter) {
    857         std::cout << iter->x << " " << iter->y << " " << iter->rise << std::endl;
    858       }
    859     }
    860 
    861     static inline bool testScan45Data() {
     852    //template <typename CountType>
     853    //static inline void print45Data(const std::set<Scan45ElementT<CountType>,
     854    //                               lessScan45Element<CountType> >& data) {
     855    //  typename std::set<Scan45ElementT<CountType>, lessScan45Element<CountType> >::const_iterator iter;
     856    //  for(iter = data.begin(); iter != data.end(); ++iter) {
     857    //    std::cout << iter->x << " " << iter->y << " " << iter->rise << std::endl;
     858    //  }
     859    //}
     860
     861    template <typename streamtype>
     862    static inline bool testScan45Data(streamtype& stdcout) {
    862863      Unit x = 0;
    863864      int justBefore = false;
     
    876877      typename Scan45Data::iterator itrB = testData.lower_bound(Scan45Element(4, 29, -1));
    877878      typename Scan45Data::iterator itr2 = testData.lower_bound(Scan45Element(4, 14, -1));
    878       if(itr1 != itr2) std::cout << "test1 failed\n";
    879       if(itrA == itrB) std::cout << "test2 failed\n";
     879      if(itr1 != itr2) stdcout << "test1 failed\n";
     880      if(itrA == itrB) stdcout << "test2 failed\n";
    880881      //remove crossing elements
    881882      testData.erase(itr20);
     
    886887      //now at 15 25 25 35
    887888      typename Scan45Data::iterator itr = testData.begin();
    888       if(itr != itr10) std::cout << "test3 failed\n";
     889      if(itr != itr10) stdcout << "test3 failed\n";
    889890      ++itr;
    890       if(itr != itr30) std::cout << "test4 failed\n";
     891      if(itr != itr30) stdcout << "test4 failed\n";
    891892      ++itr;
    892       if(itr != itr20) std::cout << "test5 failed\n";
     893      if(itr != itr20) stdcout << "test5 failed\n";
    893894      ++itr;
    894       if(itr != itr40) std::cout << "test6 failed\n";
    895       std::cout << "done testing Scan45Data\n";
     895      if(itr != itr40) stdcout << "test6 failed\n";
     896      stdcout << "done testing Scan45Data\n";
    896897      return true;
    897898    }
    898899   
    899     static inline bool testScan45Rect() {
    900       std::cout << "testing Scan45Rect\n";
     900    template <typename stream_type>
     901    static inline bool testScan45Rect(stream_type& stdcout) {
     902      stdcout << "testing Scan45Rect\n";
    901903      Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
    902904      std::vector<Vertex45 > result;
     
    910912      vertices.push_back(Scan45Vertex(Point(10,0), Scan45Count(Count2(0, 0), ncount, Count2(0, 0), ncount)));
    911913      vertices.push_back(Scan45Vertex(Point(10,10), Scan45Count(Count2(0, 0), count, Count2(0, 0), count)));
    912       std::cout << "scanning\n";
     914      stdcout << "scanning\n";
    913915      scan45.scan(result, vertices.begin(), vertices.end());
    914       std::cout << "done scanning\n";
     916      stdcout << "done scanning\n";
    915917      // result size == 8
    916918      // result == 0 0 0 1
     
    932934      reference.push_back(Vertex45(Point(10, 10), 0, 1));
    933935      if(result != reference) {
    934         std::cout << "result size == " << result.size() << std::endl;
    935         for(unsigned int i = 0; i < result.size(); ++i) {
     936        stdcout << "result size == " << result.size() << std::endl;
     937        for(std::size_t i = 0; i < result.size(); ++i) {
    936938          //std::cout << "result == " << result[i]<< std::endl;
    937939        }
    938         std::cout << "reference size == " << reference.size() << std::endl;
    939         for(unsigned int i = 0; i < reference.size(); ++i) {
     940        stdcout << "reference size == " << reference.size() << std::endl;
     941        for(std::size_t i = 0; i < reference.size(); ++i) {
    940942          //std::cout << "reference == " << reference[i]<< std::endl;
    941943        }
    942944        return false;
    943945      }
    944       std::cout << "done testing Scan45Rect\n";
     946      stdcout << "done testing Scan45Rect\n";
    945947      return true;
    946948    }
    947949
    948     static inline bool testScan45P1() {
    949       std::cout << "testing Scan45P1\n";
     950    template <typename stream_type>
     951    static inline bool testScan45P1(stream_type& stdcout) {
     952      stdcout << "testing Scan45P1\n";
    950953      Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
    951954      std::vector<Vertex45 > result;
     
    959962      vertices.push_back(Scan45Vertex(Point(10,10), Scan45Count(Count2(0, 0), Count2(0, 0), ncount, ncount)));
    960963      vertices.push_back(Scan45Vertex(Point(10,20), Scan45Count(Count2(0, 0), Count2(0, 0), count, count)));
    961       std::cout << "scanning\n";
     964      stdcout << "scanning\n";
    962965      scan45.scan(result, vertices.begin(), vertices.end());
    963       std::cout << "done scanning\n";
     966      stdcout << "done scanning\n";
    964967      // result size == 8
    965968      // result == 0 0 1 1
     
    981984      reference.push_back(Vertex45(Point(10, 20), 1, 1));
    982985      if(result != reference) {
    983         std::cout << "result size == " << result.size() << std::endl;
    984         for(unsigned int i = 0; i < result.size(); ++i) {
     986        stdcout << "result size == " << result.size() << std::endl;
     987        for(std::size_t i = 0; i < result.size(); ++i) {
    985988          //std::cout << "result == " << result[i]<< std::endl;
    986989        }
    987         std::cout << "reference size == " << reference.size() << std::endl;
    988         for(unsigned int i = 0; i < reference.size(); ++i) {
     990        stdcout << "reference size == " << reference.size() << std::endl;
     991        for(std::size_t i = 0; i < reference.size(); ++i) {
    989992          //std::cout << "reference == " << reference[i]<< std::endl;
    990993        }
    991994        return false;
    992995      }
    993       std::cout << "done testing Scan45P1\n";
     996      stdcout << "done testing Scan45P1\n";
    994997      return true;
    995998    }
    996999
    997     static inline bool testScan45P2() {
    998       std::cout << "testing Scan45P2\n";
     1000    template <typename stream_type>
     1001    static inline bool testScan45P2(stream_type& stdcout) {
     1002      stdcout << "testing Scan45P2\n";
    9991003      Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
    10001004      std::vector<Vertex45 > result;
     
    10081012      vertices.push_back(Scan45Vertex(Point(10,10), Scan45Count(Count2(0, 0), ncount, count, Count2(0, 0))));
    10091013      vertices.push_back(Scan45Vertex(Point(20,10), Scan45Count(Count2(0, 0), count, ncount, Count2(0, 0))));
    1010       std::cout << "scanning\n";
     1014      stdcout << "scanning\n";
    10111015      scan45.scan(result, vertices.begin(), vertices.end());
    1012       std::cout << "done scanning\n";
     1016      stdcout << "done scanning\n";
    10131017      // result size == 8
    10141018      // result == 0 0 0 1
     
    10301034      reference.push_back(Vertex45(Point(20, 10), 0, 1));
    10311035      if(result != reference) {
    1032         std::cout << "result size == " << result.size() << std::endl;
    1033         for(unsigned int i = 0; i < result.size(); ++i) {
    1034           //std::cout << "result == " << result[i]<< std::endl;
    1035         }
    1036         std::cout << "reference size == " << reference.size() << std::endl;
    1037         for(unsigned int i = 0; i < reference.size(); ++i) {
    1038           //std::cout << "reference == " << reference[i]<< std::endl;
     1036        stdcout << "result size == " << result.size() << std::endl;
     1037        for(std::size_t i = 0; i < result.size(); ++i) {
     1038          //stdcout << "result == " << result[i]<< std::endl;
     1039        }
     1040        stdcout << "reference size == " << reference.size() << std::endl;
     1041        for(std::size_t i = 0; i < reference.size(); ++i) {
     1042          //stdcout << "reference == " << reference[i]<< std::endl;
    10391043        }
    10401044        return false;
    10411045      }
    1042       std::cout << "done testing Scan45P2\n";
     1046      stdcout << "done testing Scan45P2\n";
    10431047      return true;
    10441048    }
    10451049
    1046     static inline bool testScan45And() {
    1047       std::cout << "testing Scan45And\n";
     1050    template <typename streamtype>
     1051    static inline bool testScan45And(streamtype& stdcout) {
     1052      stdcout << "testing Scan45And\n";
    10481053      Scan45<Count2, boolean_op_45_output_functor<1> > scan45;
    10491054      std::vector<Vertex45 > result;
     
    10641069      vertices.push_back(Scan45Vertex(Point(12,12), Scan45Count(Count2(0, 0), count, Count2(0, 0), count)));
    10651070      sortScan45Vector(vertices);
    1066       std::cout << "scanning\n";
     1071      stdcout << "scanning\n";
    10671072      scan45.scan(result, vertices.begin(), vertices.end());
    1068       std::cout << "done scanning\n";
     1073      stdcout << "done scanning\n";
    10691074      //result size == 8
    10701075      //result == 2 2 0 1
     
    10861091      reference.push_back(Vertex45(Point(10, 10), 0, 1));
    10871092      if(result != reference) {
    1088         std::cout << "result size == " << result.size() << std::endl;
    1089         for(unsigned int i = 0; i < result.size(); ++i) {
    1090           //std::cout << "result == " << result[i]<< std::endl;
    1091         }
    1092         std::cout << "reference size == " << reference.size() << std::endl;
    1093         for(unsigned int i = 0; i < reference.size(); ++i) {
    1094           //std::cout << "reference == " << reference[i]<< std::endl;
     1093        stdcout << "result size == " << result.size() << std::endl;
     1094        for(std::size_t i = 0; i < result.size(); ++i) {
     1095          //stdcout << "result == " << result[i]<< std::endl;
     1096        }
     1097        stdcout << "reference size == " << reference.size() << std::endl;
     1098        for(std::size_t i = 0; i < reference.size(); ++i) {
     1099          //stdcout << "reference == " << reference[i]<< std::endl;
    10951100        }
    10961101        return false;
    10971102      }
    1098       std::cout << "done testing Scan45And\n";
     1103      stdcout << "done testing Scan45And\n";
    10991104      return true;
    11001105    }
    11011106
    1102     static inline bool testScan45Star1() {
    1103       std::cout << "testing Scan45Star1\n";
     1107    template <typename stream_type>
     1108    static inline bool testScan45Star1(stream_type& stdcout) {
     1109      stdcout << "testing Scan45Star1\n";
    11041110      Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
    11051111      std::vector<Vertex45 > result;
     
    11181124      vertices.push_back(Scan45Vertex(Point(4,16), Scan45Count(ncount, Count2(0, 0), Count2(0, 0), ncount)));
    11191125      sortScan45Vector(vertices);
    1120       std::cout << "scanning\n";
     1126      stdcout << "scanning\n";
    11211127      scan45.scan(result, vertices.begin(), vertices.end());
    1122       std::cout << "done scanning\n";
     1128      stdcout << "done scanning\n";
    11231129      // result size == 24
    11241130      // result == 0 8 -1 1
     
    11471153      // result == 12 8 -1 1
    11481154      if(result.size() != 24) {
    1149         //std::cout << "result size == " << result.size() << std::endl;
    1150         //std::cout << "reference size == " << 24 << std::endl;
     1155        //stdcout << "result size == " << result.size() << std::endl;
     1156        //stdcout << "reference size == " << 24 << std::endl;
    11511157        return false;
    11521158      }
    1153       std::cout << "done testing Scan45Star1\n";
     1159      stdcout << "done testing Scan45Star1\n";
    11541160      return true;
    11551161    }
    11561162
    1157     static inline bool testScan45Star2() {
    1158       std::cout << "testing Scan45Star2\n";
     1163    template <typename stream_type>
     1164    static inline bool testScan45Star2(stream_type& stdcout) {
     1165      stdcout << "testing Scan45Star2\n";
    11591166      Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
    11601167      std::vector<Vertex45 > result;
     
    11731180      vertices.push_back(Scan45Vertex(Point(8,0), Scan45Count(ncount, Count2(0, 0), count, Count2(0, 0))));
    11741181      sortScan45Vector(vertices);
    1175       std::cout << "scanning\n";
     1182      stdcout << "scanning\n";
    11761183      scan45.scan(result, vertices.begin(), vertices.end());
    1177       std::cout << "done scanning\n";
     1184      stdcout << "done scanning\n";
    11781185      // result size == 24
    11791186      // result == 0 4 0 1
     
    12061213        return false;
    12071214      }
    1208       std::cout << "done testing Scan45Star2\n";
     1215      stdcout << "done testing Scan45Star2\n";
    12091216      return true;
    12101217    }
    12111218
    1212     static inline bool testScan45Star3() {
    1213       std::cout << "testing Scan45Star3\n";
     1219    template <typename stream_type>
     1220    static inline bool testScan45Star3(stream_type& stdcout) {
     1221      stdcout << "testing Scan45Star3\n";
    12141222      Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
    12151223      std::vector<Vertex45 > result;
     
    12331241      vertices.push_back(Scan45Vertex(Point(4,16), Scan45Count(ncount, Count2(0, 0), Count2(0, 0), ncount)));
    12341242      sortScan45Vector(vertices);
    1235       std::cout << "scanning\n";
     1243      stdcout << "scanning\n";
    12361244      scan45.scan(result, vertices.begin(), vertices.end());
    1237       std::cout << "done scanning\n";
     1245      stdcout << "done scanning\n";
    12381246      // result size == 28
    12391247      // result == 0 8 -1 1
     
    12711279      }
    12721280
    1273       std::cout << "done testing Scan45Star3\n";
     1281      stdcout << "done testing Scan45Star3\n";
    12741282      return true;
    12751283    }
    12761284
    1277     static inline bool testScan45Star4() {
    1278       std::cout << "testing Scan45Star4\n";
     1285   
     1286    template <typename stream_type>
     1287    static inline bool testScan45Star4(stream_type& stdcout) {
     1288      stdcout << "testing Scan45Star4\n";
    12791289      Scan45<Count2, boolean_op_45_output_functor<0> > scan45;
    12801290      std::vector<Vertex45 > result;
     
    12981308      vertices.push_back(Scan45Vertex(Point(8,0), Scan45Count(ncount, Count2(0, 0), count, Count2(0, 0))));
    12991309      sortScan45Vector(vertices);
    1300       std::cout << "scanning\n";
     1310      stdcout << "scanning\n";
    13011311      scan45.scan(result, vertices.begin(), vertices.end());
    1302       std::cout << "done scanning\n";
     1312      stdcout << "done scanning\n";
    13031313      // result size == 28
    13041314      // result == 0 4 0 1
     
    13311341      // result == 16 12 0 1
    13321342      if(result.size() != 28) {
    1333         //std::cout << "result size == " << result.size() << std::endl;
    1334         //std::cout << "reference size == " << 28 << std::endl;
     1343        //stdcout << "result size == " << result.size() << std::endl;
     1344        //stdcout << "reference size == " << 28 << std::endl;
    13351345        return false;
    13361346      }
    13371347
    1338       std::cout << "done testing Scan45Star4\n";
     1348      stdcout << "done testing Scan45Star4\n";
    13391349      return true;
    13401350    }
    13411351
    1342     static inline bool testScan45() {
    1343       if(!testScan45Rect()) return false;
    1344       if(!testScan45P1()) return false;
    1345       if(!testScan45P2()) return false;
    1346       if(!testScan45And()) return false;
    1347       if(!testScan45Star1()) return false;
    1348       if(!testScan45Star2()) return false;
    1349       if(!testScan45Star3()) return false;
    1350       if(!testScan45Star4()) return false;
     1352    template <typename stream_type>
     1353    static inline bool testScan45(stream_type& stdcout) {
     1354      if(!testScan45Rect(stdcout)) return false;
     1355      if(!testScan45P1(stdcout)) return false;
     1356      if(!testScan45P2(stdcout)) return false;
     1357      if(!testScan45And(stdcout)) return false;
     1358      if(!testScan45Star1(stdcout)) return false;
     1359      if(!testScan45Star2(stdcout)) return false;
     1360      if(!testScan45Star3(stdcout)) return false;
     1361      if(!testScan45Star4(stdcout)) return false;
    13511362      return true;
    13521363    }
  • sandbox/gtl/boost/polygon/detail/iterator_points_to_compact.hpp

    r54345 r54797  
    2424
    2525  inline iterator_points_to_compact() : iter_(), iterEnd_(), orient_(), coord_() {}
    26   explicit inline iterator_points_to_compact(iT iter, iT iterEnd) :
     26  inline iterator_points_to_compact(iT iter, iT iterEnd) :
    2727    iter_(iter), iterEnd_(iterEnd), orient_(HORIZONTAL), coord_() {}
    2828  inline iterator_points_to_compact(const iterator_points_to_compact& that) :
  • sandbox/gtl/boost/polygon/detail/max_cover.hpp

    r54345 r54797  
    205205    template <class iT>
    206206    static inline void computeDag(iT beginNode, iT endNode, orientation_2d orient,
    207                            unsigned int size) {
     207                                  std::size_t size) {
    208208      std::vector<EdgeAssociation> leadingEdges;
    209209      leadingEdges.reserve(size);
     
    264264        }
    265265        nodes.reserve(rects.size());
    266         for(unsigned int i = 0; i < rects.size(); ++i) { nodes.push_back(Node(rects[i])); }
     266        for(std::size_t i = 0; i < rects.size(); ++i) { nodes.push_back(Node(rects[i])); }
    267267      }
    268268      computeDag(nodes.begin(), nodes.end(), orient, nodes.size());
    269       for(unsigned int i = 0; i < nodes.size(); ++i) {
     269      for(std::size_t i = 0; i < nodes.size(); ++i) {
    270270        getMaxCover(outputContainer, &(nodes[i]), orient);
    271271      }
  • sandbox/gtl/boost/polygon/detail/polygon_45_formation.hpp

    r54345 r54797  
    363363      }
    364364
    365       inline void print() {
    366         std::cout << this << " " << tailp_ << " " << otherTailp_ << " " << holesList_.size() << " " << head_ << std::endl;
    367       }
     365//       inline void print() {
     366//         std::cout << this << " " << tailp_ << " " << otherTailp_ << " " << holesList_.size() << " " << head_ << std::endl;
     367//       }
    368368
    369369      static inline std::pair<ActiveTail45*, ActiveTail45*> createActiveTail45sAsPair(Point point, bool solid,
     
    870870    };
    871871
    872     static inline bool testPolygon45FormationRect() {
    873       std::cout << "testing polygon formation\n";
     872    template <typename stream_type>
     873    static inline bool testPolygon45FormationRect(stream_type& stdcout) {
     874      stdcout << "testing polygon formation\n";
    874875      Polygon45Formation pf(true);
    875876      std::vector<Polygon45> polys;
     
    885886      std::sort(data.begin(), data.end());
    886887      pf.scan(polys, data.begin(), data.end());
    887       std::cout << "result size: " << polys.size() << std::endl;
    888       for(unsigned int i = 0; i < polys.size(); ++i) {
    889         std::cout << polys[i] << std::endl;
    890       }
    891       std::cout << "done testing polygon formation\n";
     888      stdcout << "result size: " << polys.size() << std::endl;
     889      for(std::size_t i = 0; i < polys.size(); ++i) {
     890        stdcout << polys[i] << std::endl;
     891      }
     892      stdcout << "done testing polygon formation\n";
    892893      return true;
    893894    }
    894895
    895     static inline bool testPolygon45FormationP1() {
    896       std::cout << "testing polygon formation\n";
     896    template <typename stream_type>
     897    static inline bool testPolygon45FormationP1(stream_type& stdcout) {
     898      stdcout << "testing polygon formation\n";
    897899      Polygon45Formation pf(true);
    898900      std::vector<Polygon45> polys;
     
    908910      std::sort(data.begin(), data.end());
    909911      pf.scan(polys, data.begin(), data.end());
    910       std::cout << "result size: " << polys.size() << std::endl;
    911       for(unsigned int i = 0; i < polys.size(); ++i) {
    912         std::cout << polys[i] << std::endl;
    913       }
    914       std::cout << "done testing polygon formation\n";
     912      stdcout << "result size: " << polys.size() << std::endl;
     913      for(std::size_t i = 0; i < polys.size(); ++i) {
     914        stdcout << polys[i] << std::endl;
     915      }
     916      stdcout << "done testing polygon formation\n";
    915917      return true;
    916918    }
    917919    //polygon45set class
    918920
    919     static inline bool testPolygon45FormationP2() {
    920       std::cout << "testing polygon formation\n";
     921    template <typename stream_type>
     922    static inline bool testPolygon45FormationP2(stream_type& stdcout) {
     923      stdcout << "testing polygon formation\n";
    921924      Polygon45Formation pf(true);
    922925      std::vector<Polygon45> polys;
     
    932935      std::sort(data.begin(), data.end());
    933936      pf.scan(polys, data.begin(), data.end());
    934       std::cout << "result size: " << polys.size() << std::endl;
    935       for(unsigned int i = 0; i < polys.size(); ++i) {
    936         std::cout << polys[i] << std::endl;
    937       }
    938       std::cout << "done testing polygon formation\n";
     937      stdcout << "result size: " << polys.size() << std::endl;
     938      for(std::size_t i = 0; i < polys.size(); ++i) {
     939        stdcout << polys[i] << std::endl;
     940      }
     941      stdcout << "done testing polygon formation\n";
    939942      return true;
    940943    }
    941944    //polygon45set class
    942945
    943     static inline bool testPolygon45FormationStar1() {
    944       std::cout << "testing polygon formation\n";
     946    template <typename stream_type>
     947    static inline bool testPolygon45FormationStar1(stream_type& stdcout) {
     948      stdcout << "testing polygon formation\n";
    945949      Polygon45Formation pf(true);
    946950      std::vector<Polygon45> polys;
     
    9961000      std::sort(data.begin(), data.end());
    9971001      pf.scan(polys, data.begin(), data.end());
    998       std::cout << "result size: " << polys.size() << std::endl;
    999       for(unsigned int i = 0; i < polys.size(); ++i) {
    1000         std::cout << polys[i] << std::endl;
    1001       }
    1002       std::cout << "done testing polygon formation\n";
     1002      stdcout << "result size: " << polys.size() << std::endl;
     1003      for(std::size_t i = 0; i < polys.size(); ++i) {
     1004        stdcout << polys[i] << std::endl;
     1005      }
     1006      stdcout << "done testing polygon formation\n";
    10031007      return true;
    10041008    }
    10051009
    1006     static inline bool testPolygon45FormationStar2() {
    1007       std::cout << "testing polygon formation\n";
     1010    template <typename stream_type>
     1011    static inline bool testPolygon45FormationStar2(stream_type& stdcout) {
     1012      stdcout << "testing polygon formation\n";
    10081013      Polygon45Formation pf(true);
    10091014      std::vector<Polygon45> polys;
     
    10231028      vertices.push_back(Scan45Vertex(Point(8,0), Scan45Count(ncount, Count2(0, 0), count, Count2(0, 0))));
    10241029      sortScan45Vector(vertices);
    1025       std::cout << "scanning\n";
     1030      stdcout << "scanning\n";
    10261031      scan45.scan(result, vertices.begin(), vertices.end());
    10271032   
    10281033      std::sort(result.begin(), result.end());
    10291034      pf.scan(polys, result.begin(), result.end());
    1030       std::cout << "result size: " << polys.size() << std::endl;
    1031       for(unsigned int i = 0; i < polys.size(); ++i) {
    1032         std::cout << polys[i] << std::endl;
    1033       }
    1034       std::cout << "done testing polygon formation\n";
     1035      stdcout << "result size: " << polys.size() << std::endl;
     1036      for(std::size_t i = 0; i < polys.size(); ++i) {
     1037        stdcout << polys[i] << std::endl;
     1038      }
     1039      stdcout << "done testing polygon formation\n";
    10351040      return true;
    10361041    }
    10371042
    1038     static inline bool testPolygon45FormationStarHole1() {
    1039       std::cout << "testing polygon formation\n";
     1043    template <typename stream_type>
     1044    static inline bool testPolygon45FormationStarHole1(stream_type& stdcout) {
     1045      stdcout << "testing polygon formation\n";
    10401046      Polygon45Formation pf(true);
    10411047      std::vector<Polygon45> polys;
     
    10991105      std::sort(data.begin(), data.end());
    11001106      pf.scan(polys, data.begin(), data.end());
    1101       std::cout << "result size: " << polys.size() << std::endl;
    1102       for(unsigned int i = 0; i < polys.size(); ++i) {
    1103         std::cout << polys[i] << std::endl;
    1104       }
    1105       std::cout << "done testing polygon formation\n";
     1107      stdcout << "result size: " << polys.size() << std::endl;
     1108      for(std::size_t i = 0; i < polys.size(); ++i) {
     1109        stdcout << polys[i] << std::endl;
     1110      }
     1111      stdcout << "done testing polygon formation\n";
    11061112      return true;
    11071113    }
    11081114
    1109     static inline bool testPolygon45FormationStarHole2() {
    1110       std::cout << "testing polygon formation\n";
     1115    template <typename stream_type>
     1116    static inline bool testPolygon45FormationStarHole2(stream_type& stdcout) {
     1117      stdcout << "testing polygon formation\n";
    11111118      Polygon45Formation pf(false);
    11121119      std::vector<Polygon45WithHoles> polys;
     
    11701177      std::sort(data.begin(), data.end());
    11711178      pf.scan(polys, data.begin(), data.end());
    1172       std::cout << "result size: " << polys.size() << std::endl;
    1173       for(unsigned int i = 0; i < polys.size(); ++i) {
    1174         std::cout << polys[i] << std::endl;
    1175       }
    1176       std::cout << "done testing polygon formation\n";
     1179      stdcout << "result size: " << polys.size() << std::endl;
     1180      for(std::size_t i = 0; i < polys.size(); ++i) {
     1181        stdcout << polys[i] << std::endl;
     1182      }
     1183      stdcout << "done testing polygon formation\n";
    11771184      return true;
    11781185    }
    11791186
    1180     static inline bool testPolygon45Formation() {
    1181       std::cout << "testing polygon formation\n";
     1187    template <typename stream_type>
     1188    static inline bool testPolygon45Formation(stream_type& stdcout) {
     1189      stdcout << "testing polygon formation\n";
    11821190      Polygon45Formation pf(false);
    11831191      std::vector<Polygon45WithHoles> polys;
     
    12131221      std::sort(data.begin(), data.end());
    12141222      pf.scan(polys, data.begin(), data.end());
    1215       std::cout << "result size: " << polys.size() << std::endl;
    1216       for(unsigned int i = 0; i < polys.size(); ++i) {
    1217         std::cout << polys[i] << std::endl;
    1218       }
    1219       std::cout << "done testing polygon formation\n";
     1223      stdcout << "result size: " << polys.size() << std::endl;
     1224      for(std::size_t i = 0; i < polys.size(); ++i) {
     1225        stdcout << polys[i] << std::endl;
     1226      }
     1227      stdcout << "done testing polygon formation\n";
    12201228      return true;
    12211229    }
     
    16261634    };
    16271635
    1628     static inline bool testPolygon45TilingRect() {
    1629       std::cout << "testing polygon tiling\n";
     1636    template <typename stream_type>
     1637    static inline bool testPolygon45TilingRect(stream_type& stdcout) {
     1638      stdcout << "testing polygon tiling\n";
    16301639      Polygon45Tiling pf;
    16311640      std::vector<Polygon45> polys;
     
    16411650      std::sort(data.begin(), data.end());
    16421651      pf.scan(polys, data.begin(), data.end());
    1643       std::cout << "result size: " << polys.size() << std::endl;
    1644       for(unsigned int i = 0; i < polys.size(); ++i) {
    1645         std::cout << polys[i] << std::endl;
    1646       }
    1647       std::cout << "done testing polygon tiling\n";
     1652      stdcout << "result size: " << polys.size() << std::endl;
     1653      for(std::size_t i = 0; i < polys.size(); ++i) {
     1654        stdcout << polys[i] << std::endl;
     1655      }
     1656      stdcout << "done testing polygon tiling\n";
    16481657      return true;
    16491658    }
    16501659
    1651     static inline bool testPolygon45TilingP1() {
    1652       std::cout << "testing polygon tiling\n";
     1660    template <typename stream_type>
     1661    static inline bool testPolygon45TilingP1(stream_type& stdcout) {
     1662      stdcout << "testing polygon tiling\n";
    16531663      Polygon45Tiling pf;
    16541664      std::vector<Polygon45> polys;
     
    16641674      std::sort(data.begin(), data.end());
    16651675      pf.scan(polys, data.begin(), data.end());
    1666       std::cout << "result size: " << polys.size() << std::endl;
    1667       for(unsigned int i = 0; i < polys.size(); ++i) {
    1668         std::cout << polys[i] << std::endl;
    1669       }
    1670       std::cout << "done testing polygon tiling\n";
     1676      stdcout << "result size: " << polys.size() << std::endl;
     1677      for(std::size_t i = 0; i < polys.size(); ++i) {
     1678        stdcout << polys[i] << std::endl;
     1679      }
     1680      stdcout << "done testing polygon tiling\n";
    16711681      return true;
    16721682    }
    16731683
    1674     static inline bool testPolygon45TilingP2() {
    1675       std::cout << "testing polygon tiling\n";
     1684    template <typename stream_type>
     1685    static inline bool testPolygon45TilingP2(stream_type& stdcout) {
     1686      stdcout << "testing polygon tiling\n";
    16761687      Polygon45Tiling pf;
    16771688      std::vector<Polygon45> polys;
     
    16871698      std::sort(data.begin(), data.end());
    16881699      pf.scan(polys, data.begin(), data.end());
    1689       std::cout << "result size: " << polys.size() << std::endl;
    1690       for(unsigned int i = 0; i < polys.size(); ++i) {
    1691         std::cout << polys[i] << std::endl;
    1692       }
    1693       std::cout << "done testing polygon tiling\n";
     1700      stdcout << "result size: " << polys.size() << std::endl;
     1701      for(std::size_t i = 0; i < polys.size(); ++i) {
     1702        stdcout << polys[i] << std::endl;
     1703      }
     1704      stdcout << "done testing polygon tiling\n";
    16941705      return true;
    16951706    }
    16961707
    1697     static inline bool testPolygon45TilingP3() {
    1698       std::cout << "testing polygon tiling\n";
     1708    template <typename stream_type>
     1709    static inline bool testPolygon45TilingP3(stream_type& stdcout) {
     1710      stdcout << "testing polygon tiling\n";
    16991711      Polygon45Tiling pf;
    17001712      std::vector<Polygon45> polys;
     
    17121724      std::sort(data.begin(), data.end());
    17131725      pf.scan(polys, data.begin(), data.end());
    1714       std::cout << "result size: " << polys.size() << std::endl;
    1715       for(unsigned int i = 0; i < polys.size(); ++i) {
    1716         std::cout << polys[i] << std::endl;
    1717       }
    1718       std::cout << "done testing polygon tiling\n";
     1726      stdcout << "result size: " << polys.size() << std::endl;
     1727      for(std::size_t i = 0; i < polys.size(); ++i) {
     1728        stdcout << polys[i] << std::endl;
     1729      }
     1730      stdcout << "done testing polygon tiling\n";
    17191731      return true;
    17201732    }
    17211733
    1722     static inline bool testPolygon45TilingP4() {
    1723       std::cout << "testing polygon tiling p4\n";
     1734    template <typename stream_type>
     1735    static inline bool testPolygon45TilingP4(stream_type& stdcout) {
     1736      stdcout << "testing polygon tiling p4\n";
    17241737      Polygon45Tiling pf;
    17251738      std::vector<Polygon45> polys;
     
    17371750      std::sort(data.begin(), data.end());
    17381751      pf.scan(polys, data.begin(), data.end());
    1739       std::cout << "result size: " << polys.size() << std::endl;
    1740       for(unsigned int i = 0; i < polys.size(); ++i) {
    1741         std::cout << polys[i] << std::endl;
    1742       }
    1743       std::cout << "done testing polygon tiling\n";
     1752      stdcout << "result size: " << polys.size() << std::endl;
     1753      for(std::size_t i = 0; i < polys.size(); ++i) {
     1754        stdcout << polys[i] << std::endl;
     1755      }
     1756      stdcout << "done testing polygon tiling\n";
    17441757      return true;
    17451758    }
    17461759
    1747     static inline bool testPolygon45TilingP5() {
    1748       std::cout << "testing polygon tiling P5\n";
     1760    template <typename stream_type>
     1761    static inline bool testPolygon45TilingP5(stream_type& stdcout) {
     1762      stdcout << "testing polygon tiling P5\n";
    17491763      Polygon45Tiling pf;
    17501764      std::vector<Polygon45> polys;
     
    17691783      std::sort(data.begin(), data.end());
    17701784      pf.scan(polys, data.begin(), data.end());
    1771       std::cout << "result size: " << polys.size() << std::endl;
    1772       for(unsigned int i = 0; i < polys.size(); ++i) {
    1773         std::cout << polys[i] << std::endl;
    1774       }
    1775       std::cout << "done testing polygon tiling\n";
     1785      stdcout << "result size: " << polys.size() << std::endl;
     1786      for(std::size_t i = 0; i < polys.size(); ++i) {
     1787        stdcout << polys[i] << std::endl;
     1788      }
     1789      stdcout << "done testing polygon tiling\n";
    17761790      return true;
    17771791    }
    17781792
    1779     static inline bool testPolygon45TilingP6() {
    1780       std::cout << "testing polygon tiling P6\n";
     1793    template <typename stream_type>
     1794    static inline bool testPolygon45TilingP6(stream_type& stdcout) {
     1795      stdcout << "testing polygon tiling P6\n";
    17811796      Polygon45Tiling pf;
    17821797      std::vector<Polygon45> polys;
     
    18021817      std::sort(data.begin(), data.end());
    18031818      pf.scan(polys, data.begin(), data.end());
    1804       std::cout << "result size: " << polys.size() << std::endl;
    1805       for(unsigned int i = 0; i < polys.size(); ++i) {
    1806         std::cout << polys[i] << std::endl;
    1807       }
    1808       std::cout << "done testing polygon tiling\n";
     1819      stdcout << "result size: " << polys.size() << std::endl;
     1820      for(std::size_t i = 0; i < polys.size(); ++i) {
     1821        stdcout << polys[i] << std::endl;
     1822      }
     1823      stdcout << "done testing polygon tiling\n";
    18091824      return true;
    18101825    }
    18111826
    1812     static inline bool testPolygon45TilingStar1() {
    1813       std::cout << "testing polygon tiling star1\n";
     1827    template <typename stream_type>
     1828    static inline bool testPolygon45TilingStar1(stream_type& stdcout) {
     1829      stdcout << "testing polygon tiling star1\n";
    18141830      Polygon45Tiling pf;
    18151831      std::vector<Polygon45> polys;
     
    18651881      std::sort(data.begin(), data.end());
    18661882      pf.scan(polys, data.begin(), data.end());
    1867       std::cout << "result size: " << polys.size() << std::endl;
    1868       for(unsigned int i = 0; i < polys.size(); ++i) {
    1869         std::cout << polys[i] << std::endl;
    1870       }
    1871       std::cout << "done testing polygon tiling\n";
     1883      stdcout << "result size: " << polys.size() << std::endl;
     1884      for(std::size_t i = 0; i < polys.size(); ++i) {
     1885        stdcout << polys[i] << std::endl;
     1886      }
     1887      stdcout << "done testing polygon tiling\n";
    18721888      return true;
    18731889    }
    18741890
    1875     static inline bool testPolygon45TilingStar2() {
    1876       std::cout << "testing polygon tiling\n";
     1891    template <typename stream_type>
     1892    static inline bool testPolygon45TilingStar2(stream_type& stdcout) {
     1893      stdcout << "testing polygon tiling\n";
    18771894      Polygon45Tiling pf;
    18781895      std::vector<Polygon45> polys;
     
    18931910      vertices.push_back(Scan45Vertex(Point(8,0), Scan45Count(ncount, Count2(0, 0), count, Count2(0, 0))));
    18941911      sortScan45Vector(vertices);
    1895       std::cout << "scanning\n";
     1912      stdcout << "scanning\n";
    18961913      scan45.scan(result, vertices.begin(), vertices.end());
    18971914   
    18981915      std::sort(result.begin(), result.end());
    18991916      pf.scan(polys, result.begin(), result.end());
    1900       std::cout << "result size: " << polys.size() << std::endl;
    1901       for(unsigned int i = 0; i < polys.size(); ++i) {
    1902         std::cout << polys[i] << std::endl;
    1903       }
    1904       std::cout << "done testing polygon tiling\n";
     1917      stdcout << "result size: " << polys.size() << std::endl;
     1918      for(std::size_t i = 0; i < polys.size(); ++i) {
     1919        stdcout << polys[i] << std::endl;
     1920      }
     1921      stdcout << "done testing polygon tiling\n";
    19051922      return true;
    19061923    }
    19071924
    1908     static inline bool testPolygon45TilingStarHole1() {
    1909       std::cout << "testing polygon tiling star hole 1\n";
     1925    template <typename stream_type>
     1926    static inline bool testPolygon45TilingStarHole1(stream_type& stdcout) {
     1927      stdcout << "testing polygon tiling star hole 1\n";
    19101928      Polygon45Tiling pf;
    19111929      std::vector<Polygon45> polys;
     
    19691987      std::sort(data.begin(), data.end());
    19701988      pf.scan(polys, data.begin(), data.end());
    1971       std::cout << "result size: " << polys.size() << std::endl;
    1972       for(unsigned int i = 0; i < polys.size(); ++i) {
    1973         std::cout << polys[i] << std::endl;
    1974       }
    1975       std::cout << "done testing polygon tiling\n";
     1989      stdcout << "result size: " << polys.size() << std::endl;
     1990      for(std::size_t i = 0; i < polys.size(); ++i) {
     1991        stdcout << polys[i] << std::endl;
     1992      }
     1993      stdcout << "done testing polygon tiling\n";
    19761994      return true;
    19771995    }
    19781996
    1979     static inline bool testPolygon45TilingStarHole2() {
    1980       std::cout << "testing polygon tiling star hole 2\n";
     1997    template <typename stream_type>
     1998    static inline bool testPolygon45TilingStarHole2(stream_type& stdcout) {
     1999      stdcout << "testing polygon tiling star hole 2\n";
    19812000      Polygon45Tiling pf;
    19822001      std::vector<Polygon45WithHoles> polys;
     
    20402059      std::sort(data.begin(), data.end());
    20412060      pf.scan(polys, data.begin(), data.end());
    2042       std::cout << "result size: " << polys.size() << std::endl;
    2043       for(unsigned int i = 0; i < polys.size(); ++i) {
    2044         std::cout << polys[i] << std::endl;
    2045       }
    2046       std::cout << "done testing polygon tiling\n";
     2061      stdcout << "result size: " << polys.size() << std::endl;
     2062      for(std::size_t i = 0; i < polys.size(); ++i) {
     2063        stdcout << polys[i] << std::endl;
     2064      }
     2065      stdcout << "done testing polygon tiling\n";
    20472066      return true;
    20482067    }
    20492068
    2050     static inline bool testPolygon45Tiling() {
    2051       std::cout << "testing polygon tiling\n";
     2069    template <typename stream_type>
     2070    static inline bool testPolygon45Tiling(stream_type& stdcout) {
     2071      stdcout << "testing polygon tiling\n";
    20522072      Polygon45Tiling pf;
    20532073      std::vector<Polygon45WithHoles> polys;
     
    20832103      std::sort(data.begin(), data.end());
    20842104      pf.scan(polys, data.begin(), data.end());
    2085       std::cout << "result size: " << polys.size() << std::endl;
    2086       for(unsigned int i = 0; i < polys.size(); ++i) {
    2087         std::cout << polys[i] << std::endl;
    2088       }
    2089       std::cout << "done testing polygon tiling\n";
     2105      stdcout << "result size: " << polys.size() << std::endl;
     2106      for(std::size_t i = 0; i < polys.size(); ++i) {
     2107        stdcout << polys[i] << std::endl;
     2108      }
     2109      stdcout << "done testing polygon tiling\n";
    20902110      return true;
    20912111    }
     
    21112131    inline iterator begin() const { return p_->getTail()->begin(); }
    21122132    inline iterator end() const { return p_->getTail()->end(); }
    2113     inline unsigned int size() const { return 0; }
     2133    inline std::size_t size() const { return 0; }
    21142134    template<class iT>
    21152135    inline PolyLine45HoleData& set(iT inputBegin, iT inputEnd) {
     
    21792199    inline ActiveTail45* yield() { return p_; }
    21802200    //stub out these four required functions that will not be used but are needed for the interface
    2181     inline unsigned int size_holes() const { return 0; }
    2182     inline unsigned int size() const { return 0; }
     2201    inline std::size_t size_holes() const { return 0; }
     2202    inline std::size_t size() const { return 0; }
    21832203    template<class iT>
    21842204    inline PolyLine45PolygonData& set(iT inputBegin, iT inputEnd) {
  • sandbox/gtl/boost/polygon/detail/polygon_45_set_view.hpp

    r54345 r54797  
    167167  struct geometry_concept<polygon_45_set_view<ltype, rtype, op_type> > { typedef polygon_45_set_concept type; };
    168168
    169   template <typename geometry_type_1, typename geometry_type_2>
    170   typename enable_if< typename gtl_and_3<
     169  struct y_ps45_b : gtl_yes {};
     170
     171  template <typename geometry_type_1, typename geometry_type_2>
     172  typename enable_if< typename gtl_and_4< y_ps45_b,
    171173    typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
    172174    typename is_polygon_45_or_90_set_type<geometry_type_2>::type,
     
    178180  }
    179181 
    180   template <typename geometry_type_1, typename geometry_type_2>
    181   typename enable_if< typename gtl_and_3< typename is_polygon_45_or_90_set_type<geometry_type_1>
    182 #ifdef BOOST_POLYGON_ICC
    183       ::type
    184 #endif
    185   ::type, typename is_polygon_45_or_90_set_type<geometry_type_2>
    186 #ifdef BOOST_POLYGON_ICC
    187   ::type
    188 #endif
    189   ::type, typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>
    190 #ifdef BOOST_POLYGON_ICC
    191   ::type
    192 #endif
    193   ::type, polygon_45_set_view<geometry_type_1, geometry_type_2, 0> >::type
     182  struct y_ps45_p : gtl_yes {};
     183
     184  template <typename geometry_type_1, typename geometry_type_2>
     185  typename enable_if< typename gtl_and_4< y_ps45_p,
     186    typename gtl_if<typename is_polygon_45_or_90_set_type<geometry_type_1>::type>::type,
     187    typename gtl_if<typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
     188    typename gtl_if<typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type>::type,
     189  polygon_45_set_view<geometry_type_1, geometry_type_2, 0> >::type
    194190  operator+(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
    195191    return polygon_45_set_view<geometry_type_1, geometry_type_2, 0>
     
    197193  }
    198194 
    199   template <typename geometry_type_1, typename geometry_type_2>
    200   typename enable_if< typename gtl_and_3< typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
     195  struct y_ps45_s : gtl_yes {};
     196
     197  template <typename geometry_type_1, typename geometry_type_2>
     198  typename enable_if< typename gtl_and_4< y_ps45_s, typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
    201199                                           typename is_polygon_45_or_90_set_type<geometry_type_2>::type,
    202200                                           typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type,
     
    206204      (lvalue, rvalue);
    207205  }
    208  
    209   template <typename geometry_type_1, typename geometry_type_2>
    210   typename enable_if< typename gtl_and_3< typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
     206
     207  struct y_ps45_a : gtl_yes {};
     208#if 0
     209  template <typename geometry_type_1, typename geometry_type_2>
     210  typename enable_if< typename gtl_and_4< y_ps45_a, typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
     211                                           typename is_polygon_45_or_90_set_type<geometry_type_2>::type,
     212                                           typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type,
     213                       polygon_45_set_view<geometry_type_1, geometry_type_2, 1> >::type
     214  operator&(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     215    return polygon_45_set_view<geometry_type_1, geometry_type_2, 1>
     216      (lvalue, rvalue);
     217  }
     218#endif
     219  struct y_ps45_x : gtl_yes {};
     220
     221  template <typename geometry_type_1, typename geometry_type_2>
     222  typename enable_if< typename gtl_and_4< y_ps45_x, typename is_polygon_45_or_90_set_type<geometry_type_1>::type,
    211223                                           typename is_polygon_45_or_90_set_type<geometry_type_2>::type,
    212224                                           typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type,
     
    217229  }
    218230 
    219   template <typename geometry_type_1, typename geometry_type_2>
    220   typename enable_if< typename gtl_and_3< typename is_polygon_45_or_90_set_type<geometry_type_1>
    221 #ifdef BOOST_POLYGON_ICC
    222       ::type
    223 #endif
    224   ::type, typename is_polygon_45_or_90_set_type<geometry_type_2>
    225 #ifdef BOOST_POLYGON_ICC
    226   ::type
    227 #endif
    228   ::type, typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>
    229 #ifdef BOOST_POLYGON_ICC
    230   ::type
    231 #endif
    232   ::type, polygon_45_set_view<geometry_type_1, geometry_type_2, 3> >::type
     231  struct y_ps45_m : gtl_yes {};
     232
     233  template <typename geometry_type_1, typename geometry_type_2>
     234  typename enable_if< typename gtl_and_4< y_ps45_m,
     235    typename gtl_if<typename is_polygon_45_or_90_set_type<geometry_type_1>::type>::type,
     236    typename gtl_if<typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
     237    typename gtl_if<typename is_either_polygon_45_set_type<geometry_type_1, geometry_type_2>::type>::type>::type,
     238  polygon_45_set_view<geometry_type_1, geometry_type_2, 3> >::type
    233239  operator-(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
    234240    return polygon_45_set_view<geometry_type_1, geometry_type_2, 3>
     
    236242  }
    237243 
    238   template <typename geometry_type_1, typename geometry_type_2>
    239   typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
     244  struct y_ps45_pe : gtl_yes {};
     245
     246  template <typename geometry_type_1, typename geometry_type_2>
     247  typename enable_if< typename gtl_and_4<y_ps45_pe, typename is_mutable_polygon_45_set_type<geometry_type_1>::type, gtl_yes,
    240248                                         typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
    241249                       geometry_type_1>::type &
     
    244252  }
    245253
    246   template <typename geometry_type_1, typename geometry_type_2>
    247   typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
     254  struct y_ps45_be : gtl_yes {};
     255
     256  template <typename geometry_type_1, typename geometry_type_2>
     257  typename enable_if< typename gtl_and_3<y_ps45_be, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
    248258                                         typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
    249259                       geometry_type_1>::type &
     
    252262  }
    253263
    254   template <typename geometry_type_1, typename geometry_type_2>
    255   typename enable_if< typename gtl_and<
     264  struct y_ps45_se : gtl_yes {};
     265
     266  template <typename geometry_type_1, typename geometry_type_2>
     267  typename enable_if< typename gtl_and_3< y_ps45_se,
    256268    typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
    257269    typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
     
    261273  }
    262274
    263   template <typename geometry_type_1, typename geometry_type_2>
    264   typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
     275  struct y_ps45_ae : gtl_yes {};
     276
     277  template <typename geometry_type_1, typename geometry_type_2>
     278  typename enable_if< typename gtl_and_3<y_ps45_ae, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
    265279                                         typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
    266280                       geometry_type_1>::type &
     
    269283  }
    270284
     285  struct y_ps45_xe : gtl_yes {};
     286
    271287  template <typename geometry_type_1, typename geometry_type_2>
    272288  typename enable_if<
    273     typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
     289    typename gtl_and_3<y_ps45_xe, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
    274290                      typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
    275291    geometry_type_1>::type &
     
    278294  }
    279295
    280   template <typename geometry_type_1, typename geometry_type_2>
    281   typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
     296  struct y_ps45_me : gtl_yes {};
     297
     298  template <typename geometry_type_1, typename geometry_type_2>
     299  typename enable_if< typename gtl_and_3<y_ps45_me, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
    282300                                         typename is_polygon_45_or_90_set_type<geometry_type_2>::type>::type,
    283301                       geometry_type_1>::type &
     
    286304  }
    287305
     306  struct y_ps45_rpe : gtl_yes {};
     307
    288308  template <typename geometry_type_1, typename coordinate_type_1>
    289   typename enable_if< typename gtl_and< typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
     309  typename enable_if< typename gtl_and_3< y_ps45_rpe, typename is_mutable_polygon_45_set_type<geometry_type_1>::type,
    290310                                         typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
    291311                                                                coordinate_concept>::type>::type,
     
    295315  }
    296316
     317  struct y_ps45_rme : gtl_yes {};
     318
    297319  template <typename geometry_type_1, typename coordinate_type_1>
    298   typename enable_if< typename gtl_and< typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>::type,
     320  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,
    299321                                         typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
    300322                                                                coordinate_concept>::type>::type,
     
    304326  }
    305327
     328  struct y_ps45_rp : gtl_yes {};
     329
    306330  template <typename geometry_type_1, typename coordinate_type_1>
    307   typename enable_if< typename gtl_and< typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>
    308 #ifdef BOOST_POLYGON_ICC
    309   ::type
    310 #endif
    311   ::type, typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
    312                                  coordinate_concept>::type>
    313 #ifdef BOOST_POLYGON_ICC
    314   ::type
    315 #endif
     331  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,
     332                                        typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
     333                                                               coordinate_concept>::type>
    316334  ::type, geometry_type_1>::type
    317335  operator+(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
     
    321339  }
    322340
     341  struct y_ps45_rm : gtl_yes {};
     342
    323343  template <typename geometry_type_1, typename coordinate_type_1>
    324   typename enable_if< typename gtl_and< typename gtl_if<typename is_mutable_polygon_45_set_type<geometry_type_1>::type>
    325 #ifdef BOOST_POLYGON_ICC
    326   ::type
    327 #endif
    328   ::type, typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
    329                                  coordinate_concept>::type>
    330 #ifdef BOOST_POLYGON_ICC
    331   ::type
    332 #endif
     344  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,
     345                                        typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type,
     346                                                               coordinate_concept>::type>
    333347  ::type, geometry_type_1>::type
    334348  operator-(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
  • sandbox/gtl/boost/polygon/detail/polygon_45_touch.hpp

    r54345 r54797  
    2020      property_map newmp;
    2121      newmp.reserve(mp.size() + mp2.size());
    22       unsigned int i = 0;
    23       unsigned int j = 0;
     22      std::size_t i = 0;
     23      std::size_t j = 0;
    2424      while(i != mp.size() && j != mp2.size()) {
    2525        if(mp[i].first < mp2[j].first) {
     
    159159    };
    160160   
    161     template <typename TSD>
    162     static void print_tsd(TSD& tsd) {
    163       for(unsigned int i = 0; i < tsd.size(); ++i) {
    164         std::cout << tsd[i].first << ": ";
    165         for(unsigned int r = 0; r < 4; ++r) {
    166           std::cout << r << " { ";
    167           for(std::vector<std::pair<int, int> >::iterator itr = tsd[i].second[r].counts.begin();
    168               itr != tsd[i].second[r].counts.end(); ++itr) {
    169             std::cout << itr->first << "," << itr->second << " ";
    170           } std::cout << "} ";
    171         }
    172       } std::cout << std::endl;
    173     }
    174 
    175     template <typename T>
    176     static void print_scanline(T& t) {
    177       for(typename T::iterator itr = t.begin(); itr != t.end(); ++itr) {
    178         std::cout << itr->x << "," << itr->y << " " << itr->rise << " ";
    179         for(std::vector<std::pair<int, int> >::iterator itr2 = itr->count.counts.begin();
    180             itr2 != itr->count.counts.end(); ++itr2) {
    181           std::cout << itr2->first << ":" << itr2->second << " ";
    182         } std::cout << std::endl;
    183       }
    184     }
     161//     template <typename TSD>
     162//     static void print_tsd(TSD& tsd) {
     163//       for(std::size_t i = 0; i < tsd.size(); ++i) {
     164//         std::cout << tsd[i].first << ": ";
     165//         for(unsigned int r = 0; r < 4; ++r) {
     166//           std::cout << r << " { ";
     167//           for(std::vector<std::pair<int, int> >::iterator itr = tsd[i].second[r].counts.begin();
     168//               itr != tsd[i].second[r].counts.end(); ++itr) {
     169//             std::cout << itr->first << "," << itr->second << " ";
     170//           } std::cout << "} ";
     171//         }
     172//       } std::cout << std::endl;
     173//     }
     174
     175//     template <typename T>
     176//     static void print_scanline(T& t) {
     177//       for(typename T::iterator itr = t.begin(); itr != t.end(); ++itr) {
     178//         std::cout << itr->x << "," << itr->y << " " << itr->rise << " ";
     179//         for(std::vector<std::pair<int, int> >::iterator itr2 = itr->count.counts.begin();
     180//             itr2 != itr->count.counts.end(); ++itr2) {
     181//           std::cout << itr2->first << ":" << itr2->second << " ";
     182//         } std::cout << std::endl;
     183//       }
     184//     }
    185185
    186186    template <typename graph_type>
  • sandbox/gtl/boost/polygon/detail/polygon_90_set_view.hpp

    r54345 r54797  
    224224  }
    225225 
    226   template <typename geometry_type_1, typename geometry_type_2>
    227   typename enable_if< typename gtl_and<
     226  struct y_ps90_b : gtl_yes {};
     227
     228  template <typename geometry_type_1, typename geometry_type_2>
     229  typename enable_if< typename gtl_and_3< y_ps90_b,
    228230    typename is_polygon_90_set_type<geometry_type_1>::type,
    229231    typename is_polygon_90_set_type<geometry_type_2>::type>::type,
     
    236238  }
    237239 
     240  struct y_ps90_p : gtl_yes {};
     241
    238242  template <typename geometry_type_1, typename geometry_type_2>
    239243  typename enable_if<
    240     typename gtl_and<
    241       typename is_polygon_90_set_type<geometry_type_1>
    242 #ifdef BOOST_POLYGON_ICC
    243       ::type
    244 #endif
    245       ::type,
    246       typename is_polygon_90_set_type<geometry_type_2>::type>
    247 #ifdef BOOST_POLYGON_ICC
    248     ::type
    249 #endif
    250     ::type,
     244    typename gtl_and_3< y_ps90_p,
     245      typename gtl_if<typename is_polygon_90_set_type<geometry_type_1>::type>::type,
     246      typename gtl_if<typename is_polygon_90_set_type<geometry_type_2>::type>::type>::type,
    251247    polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryOr> >::type
    252248  operator+(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     
    257253  }
    258254 
    259   template <typename geometry_type_1, typename geometry_type_2>
    260   typename enable_if< typename gtl_and<
     255  struct y_ps90_s : gtl_yes {};
     256
     257  template <typename geometry_type_1, typename geometry_type_2>
     258  typename enable_if< typename gtl_and_3< y_ps90_s,
    261259    typename is_polygon_90_set_type<geometry_type_1>::type,
    262260    typename is_polygon_90_set_type<geometry_type_2>::type>::type,
     
    269267  }
    270268 
    271   template <typename geometry_type_1, typename geometry_type_2>
    272   typename enable_if< typename gtl_if<typename gtl_and<
     269  struct y_ps90_a : gtl_yes {};
     270#if 0
     271  template <typename geometry_type_1, typename geometry_type_2>
     272  typename enable_if< typename gtl_if<typename gtl_and_3< y_ps90_a,
    273273    typename is_polygon_90_set_type<geometry_type_1>::type,
    274274    typename is_polygon_90_set_type<geometry_type_2>::type>::type>::type,
     
    280280       boolean_op::BinaryAnd());
    281281  }
    282 
    283   template <typename geometry_type_1, typename geometry_type_2>
    284   typename enable_if< typename gtl_and<
     282#endif
     283  struct y_ps90_x : gtl_yes {};
     284
     285  template <typename geometry_type_1, typename geometry_type_2>
     286  typename enable_if< typename gtl_and_3< y_ps90_x,
    285287    typename is_polygon_90_set_type<geometry_type_1>::type,
    286288    typename is_polygon_90_set_type<geometry_type_2>::type>::type,
     
    293295  }
    294296 
    295   template <typename geometry_type_1, typename geometry_type_2>
    296   typename enable_if< typename gtl_and<
    297     typename is_polygon_90_set_type<geometry_type_1>
    298 #ifdef BOOST_POLYGON_ICC
    299   ::type
    300 #endif
    301 ::type,
    302     typename is_polygon_90_set_type<geometry_type_2>::type>
    303 #ifdef BOOST_POLYGON_ICC
    304   ::type
    305 #endif
    306 ::type,
     297  struct y_ps90_m : gtl_yes {};
     298
     299  template <typename geometry_type_1, typename geometry_type_2>
     300  typename enable_if< typename gtl_and_3< y_ps90_m,
     301    typename gtl_if<typename is_polygon_90_set_type<geometry_type_1>::type>::type,
     302    typename gtl_if<typename is_polygon_90_set_type<geometry_type_2>::type>::type>::type,
    307303                       polygon_90_set_view<geometry_type_1, geometry_type_2, boolean_op::BinaryNot> >::type
    308304  operator-(const geometry_type_1& lvalue, const geometry_type_2& rvalue) {
     
    313309  }
    314310 
     311  struct y_ps90_pe : gtl_yes {};
     312
    315313  template <typename coordinate_type_1, typename geometry_type_2>
    316   typename enable_if< typename is_polygon_90_set_type<geometry_type_2>::type,
     314  typename enable_if< typename gtl_and< y_ps90_pe, typename is_polygon_90_set_type<geometry_type_2>::type>::type,
    317315                       polygon_90_set_data<coordinate_type_1> >::type &
    318316  operator+=(polygon_90_set_data<coordinate_type_1>& lvalue, const geometry_type_2& rvalue) {
     
    322320  }
    323321 
     322  struct y_ps90_be : gtl_yes {};
    324323  //
    325324  template <typename coordinate_type_1, typename geometry_type_2>
    326   typename enable_if< typename is_polygon_90_set_type<geometry_type_2>::type,
     325  typename enable_if< typename gtl_and< y_ps90_be, typename is_polygon_90_set_type<geometry_type_2>::type>::type,
    327326                       polygon_90_set_data<coordinate_type_1> >::type &
    328327  operator|=(polygon_90_set_data<coordinate_type_1>& lvalue, const geometry_type_2& rvalue) {
     
    330329  }
    331330
     331  struct y_ps90_pe2 : gtl_yes {};
     332
    332333  //normal self assignment boolean operations
    333334  template <typename geometry_type_1, typename geometry_type_2>
    334   typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
     335  typename enable_if< typename gtl_and_3< y_ps90_pe2, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
    335336                                         typename is_polygon_90_set_type<geometry_type_2>::type>::type,
    336337                       geometry_type_1>::type &
     
    339340  }
    340341
    341   template <typename geometry_type_1, typename geometry_type_2>
    342   typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
     342  struct y_ps90_be2 : gtl_yes {};
     343
     344  template <typename geometry_type_1, typename geometry_type_2>
     345  typename enable_if< typename gtl_and_3<y_ps90_be2, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
    343346                                         typename is_polygon_90_set_type<geometry_type_2>::type>::type,
    344347                       geometry_type_1>::type &
     
    347350  }
    348351
    349   template <typename geometry_type_1, typename geometry_type_2>
    350   typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
     352  struct y_ps90_se : gtl_yes {};
     353
     354  template <typename geometry_type_1, typename geometry_type_2>
     355  typename enable_if< typename gtl_and_3<y_ps90_se, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
    351356                                         typename is_polygon_90_set_type<geometry_type_2>::type>::type,
    352357                       geometry_type_1>::type &
     
    354359    return self_assignment_boolean_op<geometry_type_1, geometry_type_2, boolean_op::BinaryAnd>(lvalue, rvalue);
    355360  }
    356   template <typename geometry_type_1, typename geometry_type_2>
    357   typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
     361 
     362  struct y_ps90_ae : gtl_yes {};
     363
     364  template <typename geometry_type_1, typename geometry_type_2>
     365  typename enable_if< typename gtl_and_3<y_ps90_ae, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
    358366                                         typename is_polygon_90_set_type<geometry_type_2>::type>::type,
    359367                       geometry_type_1>::type &
     
    362370  }
    363371
    364   template <typename geometry_type_1, typename geometry_type_2>
    365   typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
     372  struct y_ps90_xe : gtl_yes {};
     373
     374  template <typename geometry_type_1, typename geometry_type_2>
     375  typename enable_if< typename gtl_and_3<y_ps90_xe, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
    366376                                         typename is_polygon_90_set_type<geometry_type_2>::type>::type,
    367377                       geometry_type_1>::type &
     
    370380  }
    371381
    372   template <typename geometry_type_1, typename geometry_type_2>
    373   typename enable_if< typename gtl_and< typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
     382  struct y_ps90_me : gtl_yes {};
     383
     384  template <typename geometry_type_1, typename geometry_type_2>
     385  typename enable_if< typename gtl_and_3< y_ps90_me, typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
    374386                                         typename is_polygon_90_set_type<geometry_type_2>::type>::type,
    375387                       geometry_type_1>::type &
     
    378390  }
    379391
     392  struct y_ps90_rpe : gtl_yes {};
     393
    380394  template <typename geometry_type_1, typename coordinate_type_1>
    381   typename enable_if< typename gtl_and<
     395  typename enable_if< typename gtl_and_3<y_ps90_rpe,
    382396    typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
    383397    typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
     
    387401  }
    388402
     403  struct y_ps90_rme : gtl_yes {};
     404
    389405  template <typename geometry_type_1, typename coordinate_type_1>
    390   typename enable_if< typename gtl_and<
     406  typename enable_if< typename gtl_and_3<y_ps90_rme,
    391407    typename is_mutable_polygon_90_set_type<geometry_type_1>::type,
    392408    typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
     
    396412  }
    397413
     414  struct y_ps90_rp : gtl_yes {};
     415
    398416  template <typename geometry_type_1, typename coordinate_type_1>
    399   typename enable_if< typename gtl_and<
    400     typename is_mutable_polygon_90_set_type<geometry_type_1>
    401 #ifdef BOOST_POLYGON_ICC
    402   ::type
    403 #endif
    404 ::type,
    405     typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>
    406 #ifdef BOOST_POLYGON_ICC
    407   ::type
    408 #endif
    409   ::type,
    410                        geometry_type_1>::type
     417  typename enable_if< typename gtl_and_3<y_ps90_rp,
     418    typename gtl_if<typename is_mutable_polygon_90_set_type<geometry_type_1>::type>::type,
     419    typename gtl_if<typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type>::type,
     420  geometry_type_1>::type
    411421  operator+(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
    412422    geometry_type_1 retval(lvalue);
     
    415425  }
    416426
     427  struct y_ps90_rm : gtl_yes {};
     428
    417429  template <typename geometry_type_1, typename coordinate_type_1>
    418   typename enable_if< typename gtl_and<
    419     typename is_mutable_polygon_90_set_type<geometry_type_1>
    420 #ifdef BOOST_POLYGON_ICC
    421   ::type
    422 #endif
    423 ::type,
    424     typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>
    425 #ifdef BOOST_POLYGON_ICC
    426   ::type
    427 #endif
    428   ::type,
    429                        geometry_type_1>::type
     430  typename enable_if< typename gtl_and_3<y_ps90_rm,
     431    typename gtl_if<typename is_mutable_polygon_90_set_type<geometry_type_1>::type>::type,
     432    typename gtl_if<typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type>::type,
     433  geometry_type_1>::type
    430434  operator-(const geometry_type_1& lvalue, coordinate_type_1 rvalue) {
    431435    geometry_type_1 retval(lvalue);
  • sandbox/gtl/boost/polygon/detail/polygon_90_touch.hpp

    r54345 r54797  
    270270      }
    271271
    272       inline void print() const {
    273         for(typename ScanData::const_iterator itr = scanData_.begin(); itr != scanData_.end(); ++itr) {
    274           std::cout << itr->first << ": ";
    275           for(std::set<int>::const_iterator sitr = itr->second.begin();
    276               sitr != itr->second.end(); ++sitr){
    277             std::cout << *sitr << " ";
    278           }
    279           std::cout << std::endl;
    280         }
    281       }
     272//       inline void print() const {
     273//         for(typename ScanData::const_iterator itr = scanData_.begin(); itr != scanData_.end(); ++itr) {
     274//           std::cout << itr->first << ": ";
     275//           for(std::set<int>::const_iterator sitr = itr->second.begin();
     276//               sitr != itr->second.end(); ++sitr){
     277//             std::cout << *sitr << " ";
     278//           }
     279//           std::cout << std::endl;
     280//         }
     281//       }
    282282   
    283283    private:
  • sandbox/gtl/boost/polygon/detail/polygon_arbitrary_formation.hpp

    r54345 r54797  
    879879
    880880      inline void print() {
    881         std::cout << this << " " << tailp_ << " " << otherTailp_ << " " << holesList_.size() << " " << head_ << std::endl;
     881        //std::cout << this << " " << tailp_ << " " << otherTailp_ << " " << holesList_.size() << " " << head_ << std::endl;
    882882      }
    883883
     
    955955      tmp.push_back(count[0]);
    956956      //merge duplicates
    957       for(unsigned int i = 1; i < count.size(); ++i) {
     957      for(std::size_t i = 1; i < count.size(); ++i) {
    958958        if(!equal_slope(pt.get(HORIZONTAL), pt.get(VERTICAL), tmp[i-1].first, count[i].first)) {
    959959          tmp.push_back(count[i]);
     
    10801080      tails.reserve(counts_from_scanline.size());
    10811081      incoming.reserve(incoming_count.size());
    1082       for(unsigned int i = 0; i < counts_from_scanline.size(); ++i) {
     1082      for(std::size_t i = 0; i < counts_from_scanline.size(); ++i) {
    10831083        counts.push_back(counts_from_scanline[i].first.second);
    10841084        tails.push_back(counts_from_scanline[i].second);
    10851085      }
    1086       for(unsigned int i = 0; i < incoming_count.size(); ++i) {
     1086      for(std::size_t i = 0; i < incoming_count.size(); ++i) {
    10871087        incoming.push_back(incoming_count[i].second);
    10881088        if(incoming_count[i].first < point) {
     
    11051105      //assert size = size_less_1 + 1
    11061106      //std::cout << tails.size() << " " << incoming.size() << " " << counts_from_scanline.size() << " " << incoming_count.size() << std::endl;
    1107       //         for(unsigned int i = 0; i < counts.size(); ++i) {
     1107      //         for(std::size_t i = 0; i < counts.size(); ++i) {
    11081108      //           std::cout << counts_from_scanline[i].first.first.first.get(HORIZONTAL) << ",";
    11091109      //           std::cout << counts_from_scanline[i].first.first.first.get(VERTICAL) << " ";
     
    13391339    static inline void print(const vertex_arbitrary_count& count) {
    13401340      for(unsigned i = 0; i < count.size(); ++i) {
    1341         std::cout << count[i].first.get(HORIZONTAL) << ",";
    1342         std::cout << count[i].first.get(VERTICAL) << ":";
    1343         std::cout << count[i].second << " ";
    1344       } std::cout << std::endl;
     1341        //std::cout << count[i].first.get(HORIZONTAL) << ",";
     1342        //std::cout << count[i].first.get(VERTICAL) << ":";
     1343        //std::cout << count[i].second << " ";
     1344      } //std::cout << std::endl;
    13451345    }
    13461346
    13471347    static inline void print(const scanline_data& data) {
    13481348      for(typename scanline_data::const_iterator itr = data.begin(); itr != data.end(); ++itr){
    1349         std::cout << itr->first.pt << ", " << itr->first.other_pt << "; ";
    1350       } std::cout << std::endl;
     1349        //std::cout << itr->first.pt << ", " << itr->first.other_pt << "; ";
     1350      } //std::cout << std::endl;
    13511351    }
    13521352
     
    14091409        vertex_arbitrary_count tmp;
    14101410        tmp.reserve(incoming.size());
    1411         for(unsigned int i = 0; i < incoming.size(); ++i) {
     1411        for(std::size_t i = 0; i < incoming.size(); ++i) {
    14121412          if(currentPoint < incoming[i].first) {
    14131413            tmp.push_back(incoming[i]);
     
    14991499  public: //test functions
    15001500     
    1501     static inline bool testPolygonArbitraryFormationRect() {
    1502       std::cout << "testing polygon formation\n";
     1501    template <typename stream_type>
     1502    static inline bool testPolygonArbitraryFormationRect(stream_type& stdcout) {
     1503      stdcout << "testing polygon formation\n";
    15031504      polygon_arbitrary_formation pf(true);
    15041505      std::vector<polygon_data<Unit> > polys;
     
    15141515      std::sort(data.begin(), data.end());
    15151516      pf.scan(polys, data.begin(), data.end());
    1516       std::cout << "result size: " << polys.size() << std::endl;
    1517       for(unsigned int i = 0; i < polys.size(); ++i) {
    1518         std::cout << polys[i] << std::endl;
    1519       }
    1520       std::cout << "done testing polygon formation\n";
     1517      stdcout << "result size: " << polys.size() << std::endl;
     1518      for(std::size_t i = 0; i < polys.size(); ++i) {
     1519        stdcout << polys[i] << std::endl;
     1520      }
     1521      stdcout << "done testing polygon formation\n";
    15211522      return true;
    15221523    }
    15231524
    1524     static inline bool testPolygonArbitraryFormationP1() {
    1525       std::cout << "testing polygon formation P1\n";
     1525    template <typename stream_type>
     1526    static inline bool testPolygonArbitraryFormationP1(stream_type& stdcout) {
     1527      stdcout << "testing polygon formation P1\n";
    15261528      polygon_arbitrary_formation pf(true);
    15271529      std::vector<polygon_data<Unit> > polys;
     
    15371539      std::sort(data.begin(), data.end());
    15381540      pf.scan(polys, data.begin(), data.end());
    1539       std::cout << "result size: " << polys.size() << std::endl;
    1540       for(unsigned int i = 0; i < polys.size(); ++i) {
    1541         std::cout << polys[i] << std::endl;
    1542       }
    1543       std::cout << "done testing polygon formation\n";
     1541      stdcout << "result size: " << polys.size() << std::endl;
     1542      for(std::size_t i = 0; i < polys.size(); ++i) {
     1543        stdcout << polys[i] << std::endl;
     1544      }
     1545      stdcout << "done testing polygon formation\n";
    15441546      return true;
    15451547    }
    15461548
    1547     static inline bool testPolygonArbitraryFormationP2() {
    1548       std::cout << "testing polygon formation P2\n";
     1549    template <typename stream_type>
     1550    static inline bool testPolygonArbitraryFormationP2(stream_type& stdcout) {
     1551      stdcout << "testing polygon formation P2\n";
    15491552      polygon_arbitrary_formation pf(true);
    15501553      std::vector<polygon_data<Unit> > polys;
     
    15601563      std::sort(data.begin(), data.end());
    15611564      pf.scan(polys, data.begin(), data.end());
    1562       std::cout << "result size: " << polys.size() << std::endl;
    1563       for(unsigned int i = 0; i < polys.size(); ++i) {
    1564         std::cout << polys[i] << std::endl;
    1565       }
    1566       std::cout << "done testing polygon formation\n";
     1565      stdcout << "result size: " << polys.size() << std::endl;
     1566      for(std::size_t i = 0; i < polys.size(); ++i) {
     1567        stdcout << polys[i] << std::endl;
     1568      }
     1569      stdcout << "done testing polygon formation\n";
    15671570      return true;
    15681571    }
    15691572
    15701573
    1571     static inline bool testPolygonArbitraryFormationPolys() {
    1572       std::cout << "testing polygon formation polys\n";
     1574    template <typename stream_type>
     1575    static inline bool testPolygonArbitraryFormationPolys(stream_type& stdcout) {
     1576      stdcout << "testing polygon formation polys\n";
    15731577      polygon_arbitrary_formation pf(false);
    15741578      std::vector<polygon_with_holes_data<Unit> > polys;
     
    16051609      std::sort(data.begin(), data.end());
    16061610      pf.scan(polys, data.begin(), data.end());
    1607       std::cout << "result size: " << polys.size() << std::endl;
    1608       for(unsigned int i = 0; i < polys.size(); ++i) {
    1609         std::cout << polys[i] << std::endl;
     1611      stdcout << "result size: " << polys.size() << std::endl;
     1612      for(std::size_t i = 0; i < polys.size(); ++i) {
     1613        stdcout << polys[i] << std::endl;
    16101614      }
    16111615      pf2.scan(polys2, data.begin(), data.end());
    1612       std::cout << "result size: " << polys2.size() << std::endl;
    1613       for(unsigned int i = 0; i < polys2.size(); ++i) {
    1614         std::cout << polys2[i] << std::endl;
    1615       }
    1616       std::cout << "done testing polygon formation\n";
     1616      stdcout << "result size: " << polys2.size() << std::endl;
     1617      for(std::size_t i = 0; i < polys2.size(); ++i) {
     1618        stdcout << polys2[i] << std::endl;
     1619      }
     1620      stdcout << "done testing polygon formation\n";
    16171621      return true;
    16181622    }
    16191623
    1620     static inline bool testPolygonArbitraryFormationSelfTouch1() {
    1621       std::cout << "testing polygon formation self touch 1\n";
     1624    template <typename stream_type>
     1625    static inline bool testPolygonArbitraryFormationSelfTouch1(stream_type& stdcout) {
     1626      stdcout << "testing polygon formation self touch 1\n";
    16221627      polygon_arbitrary_formation pf(true);
    16231628      std::vector<polygon_data<Unit> > polys;
     
    16511656      std::sort(data.begin(), data.end());
    16521657      pf.scan(polys, data.begin(), data.end());
    1653       std::cout << "result size: " << polys.size() << std::endl;
    1654       for(unsigned int i = 0; i < polys.size(); ++i) {
    1655         std::cout << polys[i] << std::endl;
    1656       }
    1657       std::cout << "done testing polygon formation\n";
     1658      stdcout << "result size: " << polys.size() << std::endl;
     1659      for(std::size_t i = 0; i < polys.size(); ++i) {
     1660        stdcout << polys[i] << std::endl;
     1661      }
     1662      stdcout << "done testing polygon formation\n";
    16581663      return true;
    16591664    }
    16601665
    1661     static inline bool testPolygonArbitraryFormationSelfTouch2() {
    1662       std::cout << "testing polygon formation self touch 2\n";
     1666    template <typename stream_type>
     1667    static inline bool testPolygonArbitraryFormationSelfTouch2(stream_type& stdcout) {
     1668      stdcout << "testing polygon formation self touch 2\n";
    16631669      polygon_arbitrary_formation pf(true);
    16641670      std::vector<polygon_data<Unit> > polys;
     
    16901696      std::sort(data.begin(), data.end());
    16911697      pf.scan(polys, data.begin(), data.end());
    1692       std::cout << "result size: " << polys.size() << std::endl;
    1693       for(unsigned int i = 0; i < polys.size(); ++i) {
    1694         std::cout << polys[i] << std::endl;
    1695       }
    1696       std::cout << "done testing polygon formation\n";
     1698      stdcout << "result size: " << polys.size() << std::endl;
     1699      for(std::size_t i = 0; i < polys.size(); ++i) {
     1700        stdcout << polys[i] << std::endl;
     1701      }
     1702      stdcout << "done testing polygon formation\n";
    16971703      return true;
    16981704    }
    16991705
    1700     static inline bool testPolygonArbitraryFormationSelfTouch3() {
    1701       std::cout << "testing polygon formation self touch 3\n";
     1706    template <typename stream_type>
     1707    static inline bool testPolygonArbitraryFormationSelfTouch3(stream_type& stdcout) {
     1708      stdcout << "testing polygon formation self touch 3\n";
    17021709      polygon_arbitrary_formation pf(true);
    17031710      std::vector<polygon_data<Unit> > polys;
     
    17291736      std::sort(data.begin(), data.end());
    17301737      pf.scan(polys, data.begin(), data.end());
    1731       std::cout << "result size: " << polys.size() << std::endl;
    1732       for(unsigned int i = 0; i < polys.size(); ++i) {
    1733         std::cout << polys[i] << std::endl;
    1734       }
    1735       std::cout << "done testing polygon formation\n";
     1738      stdcout << "result size: " << polys.size() << std::endl;
     1739      for(std::size_t i = 0; i < polys.size(); ++i) {
     1740        stdcout << polys[i] << std::endl;
     1741      }
     1742      stdcout << "done testing polygon formation\n";
    17361743      return true;
    17371744    }
    17381745
    1739     static inline bool testPolygonArbitraryFormationColinear() {
    1740       std::cout << "testing polygon formation colinear 3\n";
    1741       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";
     1746    template <typename stream_type>
     1747    static inline bool testPolygonArbitraryFormationColinear(stream_type& stdcout) {
     1748      stdcout << "testing polygon formation colinear 3\n";
     1749      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";
    17421750      polygon_arbitrary_formation pf(true);
    17431751      std::vector<polygon_data<Unit> > polys;
     
    17561764      std::sort(data.begin(), data.end());
    17571765      pf.scan(polys, data.begin(), data.end());
    1758       std::cout << "result size: " << polys.size() << std::endl;
    1759       for(unsigned int i = 0; i < polys.size(); ++i) {
    1760         std::cout << polys[i] << std::endl;
    1761       }
    1762       std::cout << "done testing polygon formation\n";
     1766      stdcout << "result size: " << polys.size() << std::endl;
     1767      for(std::size_t i = 0; i < polys.size(); ++i) {
     1768        stdcout << polys[i] << std::endl;
     1769      }
     1770      stdcout << "done testing polygon formation\n";
    17631771      return true;
    17641772    }
    17651773
    1766     static inline bool testSegmentIntersection() {
    1767       std::cout << "testing segment intersection\n";
     1774    template <typename stream_type>
     1775    static inline bool testSegmentIntersection(stream_type& stdcout) {
     1776      stdcout << "testing segment intersection\n";
    17681777      half_edge he1, he2;
    17691778      he1.first = Point(0, 0);
     
    18331842    //inline compact_iterator_type begin_compact() const { return compact_iterator_type(begin()); }
    18341843    //inline compact_iterator_type end_compact() const { return compact_iterator_type(end()); }
    1835     inline unsigned int size() const { return 0; }
     1844    inline std::size_t size() const { return 0; }
    18361845    template<class iT>
    18371846    inline poly_line_arbitrary_hole_data& set(iT inputBegin, iT inputEnd) {
     
    19081917    inline active_tail_arbitrary* yield() { return p_; }
    19091918    //stub out these four required functions that will not be used but are needed for the interface
    1910     inline unsigned int size_holes() const { return 0; }
    1911     inline unsigned int size() const { return 0; }
     1919    inline std::size_t size_holes() const { return 0; }
     1920    inline std::size_t size() const { return 0; }
    19121921    template<class iT>
    19131922    inline poly_line_arbitrary_polygon_data& set(iT inputBegin, iT inputEnd) {
  • sandbox/gtl/boost/polygon/detail/polygon_formation.hpp

    r54345 r54797  
    577577    inline iterator_type begin() const { return iterator_type(begin_compact(), end_compact()); }
    578578    inline iterator_type end() const { return iterator_type(end_compact(), end_compact()); }
    579     inline unsigned int size() const { return 0; }
     579    inline std::size_t size() const { return 0; }
    580580    inline ActiveTail<Unit>* yield() { return p_; }
    581581    template<class iT>
     
    637637    inline ActiveTail<Unit>* yield() { return p_; }
    638638    //stub out these four required functions that will not be used but are needed for the interface
    639     inline unsigned int size_holes() const { return 0; }
    640     inline unsigned int size() const { return 0; }
     639    inline std::size_t size_holes() const { return 0; }
     640    inline std::size_t size() const { return 0; }
    641641    template<class iT>
    642642    inline PolyLinePolygonWithHolesData& set(iT inputBegin, iT inputEnd) {
     
    12301230  inline void ActiveTail<Unit>::writeOutFigure(std::vector<Unit>& outVec, bool isHole) const {
    12311231    //we start writing out the polyLine that this active tail points to at its tail
    1232     unsigned int size = outVec.size();
     1232    std::size_t size = outVec.size();
    12331233    outVec.push_back(0); //place holder for size
    12341234    PolyLine<Unit>* nextPolyLinep = 0;
     
    16871687  template<bool orientT, typename Unit, typename polygon_concept_type>
    16881688  inline void ScanLineToPolygonItrs<orientT, Unit, polygon_concept_type>::clearOutput_() {
    1689     for(unsigned int i = 0; i < outputPolygons_.size(); ++i) {
     1689    for(std::size_t i = 0; i < outputPolygons_.size(); ++i) {
    16901690      ActiveTail<Unit>* at1 = outputPolygons_[i].yield();
    16911691      const std::list<ActiveTail<Unit>*>& holes = at1->getHoles();
  • sandbox/gtl/boost/polygon/detail/property_merge.hpp

    r54345 r54797  
    117117    bool firstIteration = true;
    118118    scanlinePosition = scanline.end();
    119     for(unsigned int i = 0; i < data.size(); ++i) {
     119    for(std::size_t i = 0; i < data.size(); ++i) {
    120120      if(firstIteration) {
    121121        mergeProperty(currentVertex.second, data[i].second);
     
    192192  }
    193193
    194   static inline bool assertSorted(property_map& pset) {
    195     bool result = false;
    196     for(unsigned int i = 1; i < pset.size(); ++i) {
    197       if(pset[i] < pset[i-1]) {
    198         std::cout << "Out of Order Error ";
    199         result = true;
    200       }
    201       if(pset[i].first == pset[i-1].first) {
    202         std::cout << "Duplicate Property Error ";
    203         result = true;
    204       }
    205       if(pset[0].second == 0 || pset[1].second == 0) {
    206         std::cout << "Empty Property Error ";
    207         result = true;
    208       }
    209     }
    210     return result;
    211   }
     194//   static inline bool assertSorted(property_map& pset) {
     195//     bool result = false;
     196//     for(std::size_t i = 1; i < pset.size(); ++i) {
     197//       if(pset[i] < pset[i-1]) {
     198//         std::cout << "Out of Order Error ";
     199//         result = true;
     200//       }
     201//       if(pset[i].first == pset[i-1].first) {
     202//         std::cout << "Duplicate Property Error ";
     203//         result = true;
     204//       }
     205//       if(pset[0].second == 0 || pset[1].second == 0) {
     206//         std::cout << "Empty Property Error ";
     207//         result = true;
     208//       }
     209//     }
     210//     return result;
     211//   }
    212212
    213213  static inline void setProperty(property_set& pset, property_map& pmap) {
     
    273273    }
    274274    lvalue.clear();
    275     for(unsigned int i = 0; i < tmpVector.size(); ++i) {
     275    for(std::size_t i = 0; i < tmpVector.size(); ++i) {
    276276      if(tmpVector[i].second != 0) {
    277277        lvalue.push_back(tmpVector[i]);
     
    448448    bool firstIteration = true;
    449449    scanlinePosition = scanline.end();
    450     for(unsigned int i = 0; i < data.size(); ++i) {
     450    for(std::size_t i = 0; i < data.size(); ++i) {
    451451      if(firstIteration) {
    452452        mergeProperty(currentVertex.second, data[i].second);
     
    515515    bool firstIteration = true;
    516516    property_set ps;
    517     for(unsigned int i = 0; i < output.size(); ++i) {
     517    for(std::size_t i = 0; i < output.size(); ++i) {
    518518      edge_property& previousEdge = *previousEdgeP;
    519519      edge_property& edge = output[i];
     
    557557  template <typename Result>
    558558  inline void writeOutput(coordinate_type x, Result& result, edge_property_vector& output) {
    559     for(unsigned int i = 0; i < output.size(); ++i) {
     559    for(std::size_t i = 0; i < output.size(); ++i) {
    560560      edge_property& edge = output[i];
    561561      //edge.second.first is the property set on the left of the edge
  • sandbox/gtl/boost/polygon/detail/scan_arbitrary.hpp

    r54345 r54797  
    7272      std::set<Point> pts;
    7373      std::vector<std::pair<half_edge, segment_id> > data(begin, end);
    74       for(unsigned int i = 0; i < data.size(); ++i) {
     74      for(std::size_t i = 0; i < data.size(); ++i) {
    7575        if(data[i].first.second < data[i].first.first) {
    7676          std::swap(data[i].first.first, data[i].first.second);
     
    133133      }
    134134      validate_scan(intermediate_segments, input_segments.begin(), input_segments.end());
    135       for(unsigned int i = 0; i < intermediate_segments.size(); ++i) {
     135      for(std::size_t i = 0; i < intermediate_segments.size(); ++i) {
    136136        output_segments.push_back(std::make_pair(intermediate_segments[i].first,
    137137                                                 input_properties[intermediate_segments[i].second]));
     
    167167
    168168      std::vector<std::pair<half_edge, segment_id> > data(begin, end);
    169       for(unsigned int i = 0; i < data.size(); ++i) {
     169      for(std::size_t i = 0; i < data.size(); ++i) {
    170170        if(data[i].first.second < data[i].first.first) {
    171171          std::swap(data[i].first.first, data[i].first.second);
     
    300300      iterator remove_iter = lookup(he);
    301301      if(remove_iter == edge_scanline_.end()) {
    302         std::cout << "failed to find removal segment in scanline\n";
     302        //std::cout << "failed to find removal segment in scanline\n";
    303303        return;
    304304      }
     
    306306      std::set<segment_id>::iterator id_iter = ids.find(id);
    307307      if(id_iter == ids.end()) {
    308         std::cout << "failed to find removal segment id in scanline set\n";
     308        //std::cout << "failed to find removal segment id in scanline set\n";
    309309        return;
    310310      }
     
    462462      std::set<segment_id> vertical_ids;
    463463      vertical_data_.clear();
    464       for(unsigned int i = 0; i < event_edges_.size(); ++i) {
     464      for(std::size_t i = 0; i < event_edges_.size(); ++i) {
    465465        segment_id id = event_edges_[i].second;
    466466        const half_edge& he = event_edges_[i].first;
     
    486486            std::set<segment_id>::iterator itr = vertical_ids.find(id);
    487487            if(itr == vertical_ids.end()) {
    488               std::cout << "Failed to find end event id in vertical ids\n";
     488              //std::cout << "Failed to find end event id in vertical ids\n";
    489489            } else {
    490490              vertical_ids.erase(itr);
     
    509509
    510510  public:
    511     static inline bool test_validate_scan() {
     511    template <typename stream_type>
     512    static inline bool test_validate_scan(stream_type& stdcout) {
    512513      std::vector<std::pair<half_edge, segment_id> > input, edges;
    513514      input.push_back(std::make_pair(half_edge(Point(0, 0), Point(0, 10)), 0));
     
    516517      validate_scan(edges, input.begin(), input.end());
    517518      if(!verify_scan(result, edges.begin(), edges.end())) {
    518         std::cout << "s fail1 " << result.first << " " << result.second << "\n";
     519        stdcout << "s fail1 " << result.first << " " << result.second << "\n";
    519520        return false;
    520521      }
     
    523524      validate_scan(edges, input.begin(), input.end());
    524525      if(!verify_scan(result, edges.begin(), edges.end())) {
    525         std::cout << "s fail2 " << result.first << " " << result.second << "\n";
     526        stdcout << "s fail2 " << result.first << " " << result.second << "\n";
    526527        return false;
    527528      }
     
    531532      validate_scan(edges, input.begin(), input.end());
    532533      if(!verify_scan(result, edges.begin(), edges.end())) {
    533         std::cout << "s fail3 " << result.first << " " << result.second << "\n";
     534        stdcout << "s fail3 " << result.first << " " << result.second << "\n";
    534535        return false;
    535536      }
     
    538539      validate_scan(edges, input.begin(), input.end());
    539540      if(!verify_scan(result, edges.begin(), edges.end())) {
    540         std::cout << "s fail4 " << result.first << " " << result.second << "\n";
     541        stdcout << "s fail4 " << result.first << " " << result.second << "\n";
    541542        return false;
    542543      }
     
    546547      validate_scan(edges, input.begin(), input.end());
    547548      if(!verify_scan(result, edges.begin(), edges.end())) {
    548         std::cout << "s fail5 " << result.first << " " << result.second << "\n";
     549        stdcout << "s fail5 " << result.first << " " << result.second << "\n";
    549550        return false;
    550551      }
     
    553554      validate_scan(edges, input.begin(), input.end());
    554555      if(!verify_scan(result, edges.begin(), edges.end())) {
    555         std::cout << "s fail6 " << result.first << " " << result.second << "\n";
     556        stdcout << "s fail6 " << result.first << " " << result.second << "\n";
    556557        return false;
    557558      }
    558559      input.pop_back();
    559       for(unsigned int i = 0; i < input.size(); ++i) {
     560      for(std::size_t i = 0; i < input.size(); ++i) {
    560561        std::swap(input[i].first.first, input[i].first.second);
    561562      }
     
    563564      validate_scan(edges, input.begin(), input.end());
    564565      if(!verify_scan(result, edges.begin(), edges.end())) {
    565         std::cout << "s fail5 2 " << result.first << " " << result.second << "\n";
    566         return false;
    567       }
    568       for(unsigned int i = 0; i < input.size(); ++i) {
     566        stdcout << "s fail5 2 " << result.first << " " << result.second << "\n";
     567        return false;
     568      }
     569      for(std::size_t i = 0; i < input.size(); ++i) {
    569570        input[i].first.first = Point(input[i].first.first.get(HORIZONTAL) * -1,
    570571                                     input[i].first.first.get(VERTICAL) * -1);
     
    574575      edges.clear();
    575576      validate_scan(edges, input.begin(), input.end());
    576       std::cout << edges.size() << std::endl;
     577      stdcout << edges.size() << std::endl;
    577578      if(!verify_scan(result, edges.begin(), edges.end())) {
    578         std::cout << "s fail5 3 " << result.first << " " << result.second << "\n";
     579        stdcout << "s fail5 3 " << result.first << " " << result.second << "\n";
    579580        return false;
    580581      }
     
    585586            validate_scan(edges, input.begin(), input.end());
    586587      if(!verify_scan(result, edges.begin(), edges.end())) {
    587         std::cout << "s fail2 1 " << result.first << " " << result.second << "\n";
     588        stdcout << "s fail2 1 " << result.first << " " << result.second << "\n";
    588589        print(input);
    589590        print(edges);
     
    596597            validate_scan(edges, input.begin(), input.end());
    597598      if(!verify_scan(result, edges.begin(), edges.end())) {
    598         std::cout << "s fail2 2 " << result.first << " " << result.second << "\n";
     599        stdcout << "s fail2 2 " << result.first << " " << result.second << "\n";
    599600        print(input);
    600601        print(edges);
     
    607608            validate_scan(edges, input.begin(), input.end());
    608609      if(!verify_scan(result, edges.begin(), edges.end())) {
    609         std::cout << "s fail2 3 " << result.first << " " << result.second << "\n";
     610        stdcout << "s fail2 3 " << result.first << " " << result.second << "\n";
    610611        print(input);
    611612        print(edges);
     
    618619            validate_scan(edges, input.begin(), input.end());
    619620      if(!verify_scan(result, edges.begin(), edges.end())) {
    620         std::cout << "s fail2 4 " << result.first << " " << result.second << "\n";
     621        stdcout << "s fail2 4 " << result.first << " " << result.second << "\n";
    621622        print(input);
    622623        print(edges);
     
    629630      validate_scan(edges, input.begin(), input.end());
    630631      if(!verify_scan(result, edges.begin(), edges.end())) {
    631         std::cout << "s fail2 5 " << result.first << " " << result.second << "\n";
     632        stdcout << "s fail2 5 " << result.first << " " << result.second << "\n";
    632633        print(input);
    633634        print(edges);
     
    640641      validate_scan(edges, input.begin(), input.end());
    641642      if(!verify_scan(result, edges.begin(), edges.end())) {
    642         std::cout << "s fail2 6 " << result.first << " " << result.second << "\n";
     643        stdcout << "s fail2 6 " << result.first << " " << result.second << "\n";
    643644        print(input);
    644645        print(edges);
     
    652653      print(edges);
    653654      if(!verify_scan(result, edges.begin(), edges.end())) {
    654         std::cout << "s fail2 7 " << result.first << " " << result.second << "\n";
     655        stdcout << "s fail2 7 " << result.first << " " << result.second << "\n";
    655656        print(input);
    656657        print(edges);
     
    663664      validate_scan(edges, input.begin(), input.end());
    664665      if(!verify_scan(result, edges.begin(), edges.end())) {
    665         std::cout << "s fail2 8 " << result.first << " " << result.second << "\n";
     666        stdcout << "s fail2 8 " << result.first << " " << result.second << "\n";
    666667        print(input);
    667668        print(edges);
     
    677678            validate_scan(edges, input.begin(), input.end());
    678679      if(!verify_scan(result, edges.begin(), edges.end())) {
    679         std::cout << "s fail4 1 " << result.first << " " << result.second << "\n";
     680        stdcout << "s fail4 1 " << result.first << " " << result.second << "\n";
    680681        print(input);
    681682        print(edges);
     
    691692            validate_scan(edges, input.begin(), input.end());
    692693      if(!verify_scan(result, edges.begin(), edges.end())) {
    693         std::cout << "s fail4 2 " << result.first << " " << result.second << "\n";
     694        stdcout << "s fail4 2 " << result.first << " " << result.second << "\n";
    694695        print(input);
    695696        print(edges);
     
    703704            validate_scan(edges, input.begin(), input.end());
    704705      if(!verify_scan(result, edges.begin(), edges.end())) {
    705         std::cout << "s fail2 5 " << result.first << " " << result.second << "\n";
     706        stdcout << "s fail2 5 " << result.first << " " << result.second << "\n";
    706707        print(input);
    707708        print(edges);
     
    741742        validate_scan(edges, input.begin(), input.end());
    742743        if(!verify_scan(result, edges.begin(), edges.end())) {
    743           std::cout << "s fail9 " << outer << ": " << result.first << " " << result.second << "\n";
     744          stdcout << "s fail9 " << outer << ": " << result.first << " " << result.second << "\n";
    744745          print(input);
    745746          print(edges);
     
    751752
    752753    static void print(const std::pair<half_edge, segment_id>& segment) {
    753       std::cout << segment.first.first << " " << segment.first.second << ": " << segment.second << "; ";
     754      //std::cout << segment.first.first << " " << segment.first.second << ": " << segment.second << "; ";
    754755    }
    755756    static void print(const std::vector<std::pair<half_edge, segment_id> >& vec) {
    756       for(unsigned int i = 0; i < vec.size(); ++ i) {
    757         print(vec[i]);
    758       } std::cout << std::endl;
    759     }
    760 
    761     static inline bool test_verify_scan() {
     757      //for(std::size_t i = 0; i < vec.size(); ++ i) {
     758      //  print(vec[i]);
     759      //} std::cout << std::endl;
     760    }
     761
     762    template <typename stream_type>
     763    static inline bool test_verify_scan(stream_type& stdcout) {
    762764      std::vector<std::pair<half_edge, segment_id> > edges;
    763765      edges.push_back(std::make_pair(half_edge(Point(0, 0), Point(0, 10)), 0));
     
    765767      std::pair<segment_id, segment_id> result;
    766768      if(!verify_scan(result, edges.begin(), edges.end())) {
    767         std::cout << "fail1\n";
     769        stdcout << "fail1\n";
    768770        return false;
    769771      }
    770772      edges.push_back(std::make_pair(half_edge(Point(0, 5), Point(5, 5)), 2));
    771773      if(verify_scan(result, edges.begin(), edges.end())) {
    772         std::cout << "fail2\n";
     774        stdcout << "fail2\n";
    773775        return false;
    774776      }
     
    776778      edges.push_back(std::make_pair(half_edge(Point(1, 0), Point(11, 11)), 3));
    777779      if(!verify_scan(result, edges.begin(), edges.end())) {
    778         std::cout << "fail3\n";
     780        stdcout << "fail3\n";
    779781        return false;
    780782      }
    781783      edges.push_back(std::make_pair(half_edge(Point(1, 0), Point(10, 11)), 4));
    782784      if(verify_scan(result, edges.begin(), edges.end())) {
    783         std::cout << "fail4\n";
     785        stdcout << "fail4\n";
    784786        return false;
    785787      }
     
    787789      edges.push_back(std::make_pair(half_edge(Point(1, 2), Point(11, 11)), 5));
    788790      if(!verify_scan(result, edges.begin(), edges.end())) {
    789         std::cout << "fail5 " << result.first << " " << result.second << "\n";
     791        stdcout << "fail5 " << result.first << " " << result.second << "\n";
    790792        return false;
    791793      }
    792794      edges.push_back(std::make_pair(half_edge(Point(0, 5), Point(0, 11)), 6));
    793795      if(verify_scan(result, edges.begin(), edges.end())) {
    794         std::cout << "fail6 " << result.first << " " << result.second << "\n";
     796        stdcout << "fail6 " << result.first << " " << result.second << "\n";
    795797        return false;
    796798      }
    797799      edges.pop_back();
    798       for(unsigned int i = 0; i < edges.size(); ++i) {
     800      for(std::size_t i = 0; i < edges.size(); ++i) {
    799801        std::swap(edges[i].first.first, edges[i].first.second);
    800802      }
    801803      if(!verify_scan(result, edges.begin(), edges.end())) {
    802         std::cout << "fail5 2 " << result.first << " " << result.second << "\n";
    803         return false;
    804       }
    805       for(unsigned int i = 0; i < edges.size(); ++i) {
     804        stdcout << "fail5 2 " << result.first << " " << result.second << "\n";
     805        return false;
     806      }
     807      for(std::size_t i = 0; i < edges.size(); ++i) {
    806808        edges[i].first.first = Point(edges[i].first.first.get(HORIZONTAL) * -1,
    807809                                     edges[i].first.first.get(VERTICAL) * -1);
     
    810812      }
    811813      if(!verify_scan(result, edges.begin(), edges.end())) {
    812         std::cout << "fail5 3 " << result.first << " " << result.second << "\n";
     814        stdcout << "fail5 3 " << result.first << " " << result.second << "\n";
    813815        return false;
    814816      }
     
    965967          //iteratively add intertion element counts to count from below
    966968          //and write them to insertion set
    967           for(unsigned int i = 0; i < insertion_elements.size(); ++i) {
     969          for(std::size_t i = 0; i < insertion_elements.size(); ++i) {
    968970            if(i == 0) {
    969971              merge_property_maps(insertion_elements[i].second, vertical_properties_below);
     
    10861088    }
    10871089
    1088     inline void print_scanline() {
    1089       std::cout << "scanline at " << x_ << ": ";
    1090       for(iterator itr = scan_data_.begin(); itr != scan_data_.end(); ++itr) {
    1091         const scanline_element& se = *itr;
    1092         const half_edge& he = se.first;
    1093         const property_map& mp = se.second;
    1094         std::cout << he.first << ", " << he.second << " ( ";
    1095         for(unsigned int i = 0; i < mp.size(); ++i) {
    1096           std::cout << mp[i].first << ":" << mp[i].second << " ";
    1097         } std::cout << ") ";
    1098       } std::cout << std::endl;
    1099     }
     1090    //inline void print_scanline() {
     1091    //  std::cout << "scanline at " << x_ << ": ";
     1092    //  for(iterator itr = scan_data_.begin(); itr != scan_data_.end(); ++itr) {
     1093    //    const scanline_element& se = *itr;
     1094    //    const half_edge& he = se.first;
     1095    //    const property_map& mp = se.second;
     1096    //    std::cout << he.first << ", " << he.second << " ( ";
     1097    //    for(std::size_t i = 0; i < mp.size(); ++i) {
     1098    //      std::cout << mp[i].first << ":" << mp[i].second << " ";
     1099    //    } std::cout << ") ";
     1100    //  } std::cout << std::endl;
     1101    //}
    11001102
    11011103    static inline void merge_property_maps(property_map& mp, const property_map& mp2) {
     
    11371139      newmp.reserve(mp.size() +1);
    11381140      bool consumed = false;
    1139       for(unsigned int i = 0; i < mp.size(); ++i) {
     1141      for(std::size_t i = 0; i < mp.size(); ++i) {
    11401142        if(!consumed && prop_data.first == mp[i].first) {
    11411143          consumed = true;
     
    11901192      }
    11911193    };
    1192     static inline bool test_scanline() {
     1194    template <typename stream_type>
     1195    static inline bool test_scanline(stream_type& stdcout) {
    11931196      std::vector<std::pair<half_edge, std::pair<property_set, property_set> > > result;
    11941197      std::vector<std::pair<half_edge, std::pair<property_type, int> > > input;
     
    12001203      test_functor tf;
    12011204      sl.scan(result, tf, input.begin(), input.end());
    1202       std::cout << "scanned\n";
    1203       for(unsigned int i = 0; i < result.size(); ++i) {
    1204         std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
    1205       } std::cout << std::endl;
     1205      stdcout << "scanned\n";
     1206      for(std::size_t i = 0; i < result.size(); ++i) {
     1207        stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
     1208      } stdcout << std::endl;
    12061209      input.clear();
    12071210      result.clear();
     
    12121215      scanline sl2;
    12131216      sl2.scan(result, tf, input.begin(), input.end());
    1214       std::cout << "scanned\n";
    1215       for(unsigned int i = 0; i < result.size(); ++i) {
    1216         std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
    1217       } std::cout << std::endl;
     1217      stdcout << "scanned\n";
     1218      for(std::size_t i = 0; i < result.size(); ++i) {
     1219        stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
     1220      } stdcout << std::endl;
    12181221      input.clear();
    12191222      result.clear();
     
    12281231      scanline sl3;
    12291232      sl3.scan(result, tf, input.begin(), input.end());
    1230       std::cout << "scanned\n";
    1231       for(unsigned int i = 0; i < result.size(); ++i) {
    1232         std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
    1233       } std::cout << std::endl;
     1233      stdcout << "scanned\n";
     1234      for(std::size_t i = 0; i < result.size(); ++i) {
     1235        stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
     1236      } stdcout << std::endl;
    12341237      input.clear();
    12351238      result.clear();
     
    12441247      scanline sl4;
    12451248      sl4.scan(result, tf, input.begin(), input.end());
    1246       std::cout << "scanned\n";
    1247       for(unsigned int i = 0; i < result.size(); ++i) {
    1248         std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
    1249       } std::cout << std::endl;
     1249      stdcout << "scanned\n";
     1250      for(std::size_t i = 0; i < result.size(); ++i) {
     1251        stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
     1252      } stdcout << std::endl;
    12501253      input.clear();
    12511254      result.clear();
     
    12601263      scanline sl5;
    12611264      sl5.scan(result, tf, input.begin(), input.end());
    1262       std::cout << "scanned\n";
    1263       for(unsigned int i = 0; i < result.size(); ++i) {
    1264         std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
    1265       } std::cout << std::endl;
     1265      stdcout << "scanned\n";
     1266      for(std::size_t i = 0; i < result.size(); ++i) {
     1267        stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
     1268      } stdcout << std::endl;
    12661269      input.clear();
    12671270      result.clear();
     
    12761279      scanline sl6;
    12771280      sl6.scan(result, tf, input.begin(), input.end());
    1278       std::cout << "scanned\n";
    1279       for(unsigned int i = 0; i < result.size(); ++i) {
    1280         std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
    1281       } std::cout << std::endl;
     1281      stdcout << "scanned\n";
     1282      for(std::size_t i = 0; i < result.size(); ++i) {
     1283        stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
     1284      } stdcout << std::endl;
    12821285      input.clear();
    12831286      result.clear();
     
    13001303      scanline sl7;
    13011304      sl7.scan(result, tf, input.begin(), input.end());
    1302       std::cout << "scanned\n";
    1303       for(unsigned int i = 0; i < result.size(); ++i) {
    1304         std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
    1305       } std::cout << std::endl;
     1305      stdcout << "scanned\n";
     1306      for(std::size_t i = 0; i < result.size(); ++i) {
     1307        stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
     1308      } stdcout << std::endl;
    13061309      input.clear();
    13071310      result.clear();
     
    13201323      scanline sl8;
    13211324      sl8.scan(result, tf, input.begin(), input.end());
    1322       std::cout << "scanned\n";
    1323       for(unsigned int i = 0; i < result.size(); ++i) {
    1324         std::cout << result[i].first.first << ", " << result[i].first.second << "; ";
    1325       } std::cout << std::endl;
     1325      stdcout << "scanned\n";
     1326      for(std::size_t i = 0; i < result.size(); ++i) {
     1327        stdcout << result[i].first.first << ", " << result[i].first.second << "; ";
     1328      } stdcout << std::endl;
    13261329      return true;
    13271330    }
     
    14241427      std::vector<std::pair<half_edge, int> > lines;
    14251428      int count = 0;
    1426       for(unsigned int i = 0; i < pmd.size(); ++i) {
     1429      for(std::size_t i = 0; i < pmd.size(); ++i) {
    14271430        lines.push_back(std::make_pair(pmd[i].first, count++));
    14281431      }
    14291432      if(!line_intersection<Unit>::verify_scan(offenders, lines.begin(), lines.end())) {
    1430         std::cout << "Intersection failed!\n";
    1431         std::cout << offenders.first << " " << offenders.second << std::endl;
     1433        //stdcout << "Intersection failed!\n";
     1434        //stdcout << offenders.first << " " << offenders.second << std::endl;
    14321435        return false;
    14331436      }
    14341437      std::vector<Point> pts;
    1435       for(unsigned int i = 0; i < lines.size(); ++i) {
     1438      for(std::size_t i = 0; i < lines.size(); ++i) {
    14361439        pts.push_back(lines[i].first.first);
    14371440        pts.push_back(lines[i].first.second);
    14381441      }
    14391442      std::sort(pts.begin(), pts.end());
    1440       for(unsigned int i = 0; i < pts.size(); i+=2) {
     1443      for(std::size_t i = 0; i < pts.size(); i+=2) {
    14411444        if(pts[i] != pts[i+1]) {
    1442           std::cout << "Non-closed figures after line intersection!\n";
     1445          //stdcout << "Non-closed figures after line intersection!\n";
    14431446          return false;
    14441447        }
     
    15761579  public:
    15771580    //test functions
    1578     static std::ostream& print (std::ostream& o, const property_map& c)
     1581    template <typename stream_type>
     1582    static stream_type& print (stream_type& o, const property_map& c)
    15791583    {
    15801584      o << "count: {";
     
    15861590
    15871591
    1588     static std::ostream& print (std::ostream& o, const half_edge& he)
     1592    template <typename stream_type>
     1593    static stream_type& print (stream_type& o, const half_edge& he)
    15891594    {
    15901595      o << "half edge: (";
     
    15931598    }
    15941599
    1595     static std::ostream& print (std::ostream& o, const vertex_property& c)
     1600    template <typename stream_type>
     1601    static stream_type& print (stream_type& o, const vertex_property& c)
    15961602    {
    15971603      o << "vertex property: {";
     
    16011607    }
    16021608
    1603     static std::ostream& print (std::ostream& o, const std::vector<vertex_property>& hev)
     1609    template <typename stream_type>
     1610    static stream_type& print (stream_type& o, const std::vector<vertex_property>& hev)
    16041611    {
    16051612      o << "vertex properties: {";
    1606       for(unsigned int i = 0; i < hev.size(); ++i) {
     1613      for(std::size_t i = 0; i < hev.size(); ++i) {
    16071614        print(o, (hev[i])) << " ";
    16081615      }
     
    16101617    }
    16111618
    1612     static std::ostream& print (std::ostream& o, const std::vector<half_edge>& hev)
     1619    template <typename stream_type>
     1620    static stream_type& print (stream_type& o, const std::vector<half_edge>& hev)
    16131621    {
    16141622      o << "half edges: {";
    1615       for(unsigned int i = 0; i < hev.size(); ++i) {
     1623      for(std::size_t i = 0; i < hev.size(); ++i) {
    16161624        print(o, (hev[i])) << " ";
    16171625      }
     
    16191627    }
    16201628
    1621     static std::ostream& print (std::ostream& o, const vertex_data& v)
     1629    template <typename stream_type>
     1630    static stream_type& print (stream_type& o, const vertex_data& v)
    16221631    {
    16231632      return print(o << "vertex: <" << (v.first) << ", ", (v.second)) << "> ";
    16241633    }
    16251634
    1626     static std::ostream& print (std::ostream& o, const std::vector<vertex_data>& vv)
     1635    template <typename stream_type>
     1636    static stream_type& print (stream_type& o, const std::vector<vertex_data>& vv)
    16271637    {
    16281638      o << "vertices: {";
    1629       for(unsigned int i = 0; i < vv.size(); ++i) {
     1639      for(std::size_t i = 0; i < vv.size(); ++i) {
    16301640        print(o, (vv[i])) << " ";
    16311641      }
     
    16351645
    16361646
    1637     static inline bool test_insertion() {
     1647    template <typename stream_type>
     1648    static inline bool test_insertion(stream_type& stdcout) {
    16381649      property_merge si;
    16391650      rectangle_data<Unit> rect;
     
    16441655
    16451656      si.insert(rect, 333);
    1646       print(std::cout, si.pmd) << std::endl;
     1657      print(stdcout, si.pmd) << std::endl;
    16471658     
    16481659      Point pts[4] = {Point(0, 0), Point(10,-3), Point(13, 8), Point(0, 0) };
     
    16521663      si2.insert(poly, 444);
    16531664      si2.sort_property_merge_data();
    1654       print(std::cout, si2.pmd) << std::endl;
     1665      print(stdcout, si2.pmd) << std::endl;
    16551666      property_merge si3;
    16561667      poly.set(pts, pts+4);
    16571668      si3.insert(poly, 444);
    16581669      si3.sort_property_merge_data();
    1659       std::cout << (si2.pmd == si3.pmd) << std::endl;
     1670      stdcout << (si2.pmd == si3.pmd) << std::endl;
    16601671      std::reverse(pts, pts+4);
    16611672      property_merge si4;
     
    16631674      si4.insert(poly, 444);
    16641675      si4.sort_property_merge_data();
    1665       print(std::cout, si4.pmd) << std::endl;
    1666       std::cout << (si2.pmd == si4.pmd) << std::endl;
     1676      print(stdcout, si4.pmd) << std::endl;
     1677      stdcout << (si2.pmd == si4.pmd) << std::endl;
    16671678      std::reverse(pts, pts+3);
    16681679      property_merge si5;
     
    16701681      si5.insert(poly, 444);
    16711682      si5.sort_property_merge_data();
    1672       std::cout << (si2.pmd == si5.pmd) << std::endl;
     1683      stdcout << (si2.pmd == si5.pmd) << std::endl;
    16731684     
    16741685      return true;
    16751686    }
    16761687
    1677     static inline bool test_merge() {
     1688    template <typename stream_type>
     1689    static inline bool test_merge(stream_type& stdcout) {
    16781690      property_merge si;
    16791691      rectangle_data<Unit> rect;
     
    16861698      std::map<std::set<property_type>, polygon_set_data<Unit> > result;
    16871699      si.merge(result);
    1688       print(std::cout, si.pmd) << std::endl;
     1700      print(stdcout, si.pmd) << std::endl;
    16891701      polygon_set_data<Unit> psd = (*(result.begin())).second;
    16901702      std::vector<polygon_data<Unit> > polys;
    16911703      psd.get(polys);
    16921704      if(polys.size() != 1) {
    1693         std::cout << "fail merge 1\n";
    1694         return false;
    1695       }
    1696       std::cout << (polys[0]) << std::endl;
     1705        stdcout << "fail merge 1\n";
     1706        return false;
     1707      }
     1708      stdcout << (polys[0]) << std::endl;
    16971709      si.clear();
    16981710      std::vector<Point> pts;
     
    17111723      result.clear();
    17121724      si.merge(result);
    1713       print(std::cout, si.pmd) << std::endl;
     1725      print(stdcout, si.pmd) << std::endl;
    17141726      psd = (*(result.begin())).second;
    1715       std::cout << psd << std::endl;
     1727      stdcout << psd << std::endl;
    17161728      polys.clear();
    17171729      psd.get(polys);
    17181730      if(polys.size() != 1) {
    1719         std::cout << "fail merge 2\n";
     1731        stdcout << "fail merge 2\n";
    17201732        return false;
    17211733      }
     
    17371749      result.clear();
    17381750      si.merge(result);
    1739       print(std::cout, si.pmd) << std::endl;
     1751      print(stdcout, si.pmd) << std::endl;
    17401752      psd = (*(result.begin())).second;
    1741       std::cout << psd << std::endl;
     1753      stdcout << psd << std::endl;
    17421754      polys.clear();
    17431755      psd.get(polys);
    17441756      if(polys.size() != 1) {
    1745         std::cout << "fail merge 3\n";
    1746         return false;
    1747       }
    1748       std::cout << "Polygon { -2 2, -2 2, 1 4 } \n";
    1749       std::cout << "Polygon { 2 4, 2 -4, -3 1 } \n";
     1757        stdcout << "fail merge 3\n";
     1758        return false;
     1759      }
     1760      stdcout << "Polygon { -2 2, -2 2, 1 4 } \n";
     1761      stdcout << "Polygon { 2 4, 2 -4, -3 1 } \n";
    17501762      si.clear();
    17511763      pts.clear();
     
    17631775      result.clear();
    17641776      si.merge(result);
    1765       print(std::cout, si.pmd) << std::endl;
     1777      print(stdcout, si.pmd) << std::endl;
    17661778      psd = (*(result.begin())).second;
    1767       std::cout << psd << std::endl;
     1779      stdcout << psd << std::endl;
    17681780      polys.clear();
    17691781      psd.get(polys);
    17701782      if(polys.size() != 1) {
    1771         std::cout << "fail merge 4\n";
    1772         return false;
    1773       }
    1774       std::cout << (polys[0]) << std::endl;
    1775       std::cout << "Polygon { -4 0, -2 -3, 3 -4 } \n";
    1776       std::cout << "Polygon { -1 1, 1 -2, -4 -3 } \n";
     1783        stdcout << "fail merge 4\n";
     1784        return false;
     1785      }
     1786      stdcout << (polys[0]) << std::endl;
     1787      stdcout << "Polygon { -4 0, -2 -3, 3 -4 } \n";
     1788      stdcout << "Polygon { -1 1, 1 -2, -4 -3 } \n";
    17771789      si.clear();
    17781790      pts.clear();
     
    17901802      result.clear();
    17911803      si.merge(result);
    1792       print(std::cout, si.pmd) << std::endl;
     1804      print(stdcout, si.pmd) << std::endl;
    17931805      psd = (*(result.begin())).second;
    1794       std::cout << psd << std::endl;
     1806      stdcout << psd << std::endl;
    17951807      polys.clear();
    17961808      psd.get(polys);
    17971809      if(polys.size() != 1) {
    1798         std::cout << "fail merge 5\n";
    1799         return false;
    1800       }
    1801       std::cout << "Polygon { 2 2, -2 0, 0 1 }  \n";
    1802       std::cout << "Polygon { 4 -2, 3 -1, 2 3 }  \n";
     1810        stdcout << "fail merge 5\n";
     1811        return false;
     1812      }
     1813      stdcout << "Polygon { 2 2, -2 0, 0 1 }  \n";
     1814      stdcout << "Polygon { 4 -2, 3 -1, 2 3 }  \n";
    18031815      si.clear();
    18041816      pts.clear();
     
    18161828      result.clear();
    18171829      si.merge(result);
    1818       print(std::cout, si.pmd) << std::endl;
     1830      print(stdcout, si.pmd) << std::endl;
    18191831      if(!result.empty()) {
    18201832        psd = (*(result.begin())).second;
    1821         std::cout << psd << std::endl;
     1833        stdcout << psd << std::endl;
    18221834        polys.clear();
    18231835        psd.get(polys);
    18241836        if(polys.size() != 1) {
    1825           std::cout << "fail merge 6\n";
     1837          stdcout << "fail merge 6\n";
    18261838          return false;
    18271839        }
    1828         std::cout << (polys[0]) << std::endl;
    1829       }
    1830       std::cout << "Polygon { 0 2, 3 -1, 4 1 }  \n";
    1831       std::cout << "Polygon { -4 3, 3 3, 4 2 }  \n";
     1840        stdcout << (polys[0]) << std::endl;
     1841      }
     1842      stdcout << "Polygon { 0 2, 3 -1, 4 1 }  \n";
     1843      stdcout << "Polygon { -4 3, 3 3, 4 2 }  \n";
    18321844      si.clear();
    18331845      pts.clear();
     
    18451857      result.clear();
    18461858      si.merge(result);
    1847       print(std::cout, si.pmd) << std::endl;
     1859      print(stdcout, si.pmd) << std::endl;
    18481860      if(!result.empty()) {
    18491861        psd = (*(result.begin())).second;
    1850         std::cout << psd << std::endl;
     1862        stdcout << psd << std::endl;
    18511863        polys.clear();
    18521864        psd.get(polys);
    18531865        if(polys.size() == 0) {
    1854           std::cout << "fail merge 7\n";
     1866          stdcout << "fail merge 7\n";
    18551867          return false;
    18561868        }
    1857         std::cout << (polys[0]) << std::endl;
    1858       }
    1859 std::cout << "Polygon { 1 -2, -1 4, 3 -2 }   \n";
    1860 std::cout << "Polygon { 0 -3, 3 1, -3 -4 }   \n";
     1869        stdcout << (polys[0]) << std::endl;
     1870      }
     1871stdcout << "Polygon { 1 -2, -1 4, 3 -2 }   \n";
     1872stdcout << "Polygon { 0 -3, 3 1, -3 -4 }   \n";
    18611873      si.clear();
    18621874      pts.clear();
     
    18741886      result.clear();
    18751887      si.merge(result);
    1876       print(std::cout, si.pmd) << std::endl;
     1888      print(stdcout, si.pmd) << std::endl;
    18771889      if(!result.empty()) {
    18781890        psd = (*(result.begin())).second;
    1879         std::cout << psd << std::endl;
     1891        stdcout << psd << std::endl;
    18801892        polys.clear();
    18811893        psd.get(polys);
    18821894        if(polys.size() == 0) {
    1883           std::cout << "fail merge 8\n";
     1895          stdcout << "fail merge 8\n";
    18841896          return false;
    18851897        }
    1886         std::cout << (polys[0]) << std::endl;
    1887       }
    1888 std::cout << "Polygon { 2 2, 3 0, -3 4 }  \n";
    1889 std::cout << "Polygon { -2 -2, 0 0, -1 -1 }  \n";
     1898        stdcout << (polys[0]) << std::endl;
     1899      }
     1900stdcout << "Polygon { 2 2, 3 0, -3 4 }  \n";
     1901stdcout << "Polygon { -2 -2, 0 0, -1 -1 }  \n";
    18901902      si.clear();
    18911903      pts.clear();
     
    19031915      result.clear();
    19041916      si.merge(result);
    1905       print(std::cout, si.pmd) << std::endl;
     1917      print(stdcout, si.pmd) << std::endl;
    19061918      if(!result.empty()) {
    19071919        psd = (*(result.begin())).second;
    1908         std::cout << psd << std::endl;
     1920        stdcout << psd << std::endl;
    19091921        polys.clear();
    19101922        psd.get(polys);
    19111923        if(polys.size() == 0) {
    1912           std::cout << "fail merge 9\n";
     1924          stdcout << "fail merge 9\n";
    19131925          return false;
    19141926        }
    1915         std::cout << (polys[0]) << std::endl;
     1927        stdcout << (polys[0]) << std::endl;
    19161928      }
    19171929      si.clear();
     
    20112023      si.merge(result);
    20122024      si.verify();
    2013       print(std::cout, si.pmd) << std::endl;
     2025      print(stdcout, si.pmd) << std::endl;
    20142026      if(!result.empty()) {
    20152027        psd = (*(result.begin())).second;
    2016         std::cout << psd << std::endl;
     2028        stdcout << psd << std::endl;
    20172029        std::vector<Point> outpts;
    20182030        for(typename polygon_set_data<Unit>::iterator_type itr = psd.begin();
     
    20222034        }
    20232035        std::sort(outpts.begin(), outpts.end());
    2024         for(unsigned int i = 0; i < outpts.size(); i+=2) {
     2036        for(std::size_t i = 0; i < outpts.size(); i+=2) {
    20252037          if(outpts[i] != outpts[i+1]) {
    2026             std::cout << "Polygon set not a closed figure\n";
    2027             std::cout << i << std::endl;
    2028             std::cout << outpts[i] << " " << outpts[i+1] << std::endl;
     2038            stdcout << "Polygon set not a closed figure\n";
     2039            stdcout << i << std::endl;
     2040            stdcout << outpts[i] << " " << outpts[i+1] << std::endl;
    20292041            return 0;
    20302042          }
     
    20332045        psd.get(polys);
    20342046        if(polys.size() == 0) {
    2035           std::cout << "fail merge 10\n";
     2047          stdcout << "fail merge 10\n";
    20362048          return false;
    20372049        }
    2038         std::cout << (polys[0]) << std::endl;
     2050        stdcout << (polys[0]) << std::endl;
    20392051      }
    20402052      for(unsigned int i = 0; i < 10; ++i) {
    2041         std::cout << "random case # " << i << std::endl;
     2053        stdcout << "random case # " << i << std::endl;
    20422054        si.clear();
    20432055        pts.clear();
     
    20472059        polygon_data<Unit> poly1;
    20482060        poly1.set(pts.begin(), pts.end());
    2049         std::cout << poly1 << std::endl;
     2061        stdcout << poly1 << std::endl;
    20502062        si.insert(poly1, 444);
    20512063        pts.clear();
     
    20552067        polygon_data<Unit> poly2;
    20562068        poly2.set(pts.begin(), pts.end());
    2057         std::cout << poly2 << std::endl;
     2069        stdcout << poly2 << std::endl;
    20582070        si.insert(poly2, 444);
    20592071        result.clear();
    20602072        si.merge(result);
    2061         print(std::cout, si.pmd) << std::endl;
     2073        print(stdcout, si.pmd) << std::endl;
    20622074        if(!result.empty()) {
    20632075          psd = (*(result.begin())).second;
    2064           std::cout << psd << std::endl;
     2076          stdcout << psd << std::endl;
    20652077          polys.clear();
    20662078          psd.get(polys);
     
    20812093            psd.get(polys2);
    20822094            if(!polys1.empty() || !polys2.empty()) {
    2083               std::cout << "fail random merge " << i << std::endl;
     2095              stdcout << "fail random merge " << i << std::endl;
    20842096              return false;
    20852097            }
     
    20872099        }
    20882100        if(!polys.empty())
    2089           std::cout << polys.size() << ": " << (polys[0]) << std::endl;
     2101          stdcout << polys.size() << ": " << (polys[0]) << std::endl;
    20902102      }
    20912103      return true;
    20922104    }
    20932105
    2094     static inline bool check_rectangle_trio(rectangle_data<Unit> rect1, rectangle_data<Unit> rect2, rectangle_data<Unit> rect3) {
     2106    template <typename stream_type>
     2107    static inline bool check_rectangle_trio(rectangle_data<Unit> rect1, rectangle_data<Unit> rect2, rectangle_data<Unit> rect3, stream_type& stdcout) {
    20952108        property_merge si;
    20962109        std::map<std::set<property_type>, polygon_set_data<Unit> > result;
     
    21012114        si.insert(rect1, 111);
    21022115        si90.insert(rect1, 111);
    2103         std::cout << rect1 << std::endl;
     2116        stdcout << rect1 << std::endl;
    21042117        si.insert(rect2, 222);
    21052118        si90.insert(rect2, 222);
    2106         std::cout << rect2 << std::endl;
     2119        stdcout << rect2 << std::endl;
    21072120        si.insert(rect3, 333);
    21082121        si90.insert(rect3, 333);
    2109         std::cout << rect3 << std::endl;
     2122        stdcout << rect3 << std::endl;
    21102123        si.merge(result);
    21112124        si90.merge(result90);
    21122125        if(result.size() != result90.size()) {
    2113           std::cout << "merge failed with size mismatch\n";
     2126          stdcout << "merge failed with size mismatch\n";
    21142127          return 0;
    21152128        }
     
    21192132          for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
    21202133              set_itr != (*itr).first.end(); ++set_itr) {
    2121             std::cout << (*set_itr) << " ";
    2122           } std::cout << ") \n";
     2134            stdcout << (*set_itr) << " ";
     2135          } stdcout << ") \n";
    21232136          polygon_set_data<Unit> psd = (*itr).second;
    21242137          polygon_90_set_data<Unit> psd90 = (*itr90).second;
     
    21282141          psd90.get(polys90);
    21292142          if(polys.size() != polys90.size()) {
    2130             std::cout << "merge failed with polygon count mismatch\n";
    2131             std::cout << psd << std::endl;
    2132             for(unsigned int j = 0; j < polys.size(); ++j) {
    2133               std::cout << polys[j] << std::endl;
     2143            stdcout << "merge failed with polygon count mismatch\n";
     2144            stdcout << psd << std::endl;
     2145            for(std::size_t j = 0; j < polys.size(); ++j) {
     2146              stdcout << polys[j] << std::endl;
    21342147            }
    2135             std::cout << "reference\n";
    2136             for(unsigned int j = 0; j < polys90.size(); ++j) {
    2137               std::cout << polys90[j] << std::endl;
     2148            stdcout << "reference\n";
     2149            for(std::size_t j = 0; j < polys90.size(); ++j) {
     2150              stdcout << polys90[j] << std::endl;
    21382151            }
    21392152            return 0;
    21402153          }
    21412154          bool failed = false;
    2142           for(unsigned int j = 0; j < polys.size(); ++j) {
    2143             std::cout << polys[j] << std::endl;
    2144             std::cout << polys90[j] << std::endl;
     2155          for(std::size_t j = 0; j < polys.size(); ++j) {
     2156            stdcout << polys[j] << std::endl;
     2157            stdcout << polys90[j] << std::endl;
    21452158#ifdef BOOST_POLYGON_ICC
    21462159#pragma warning (disable:1572)
     
    21502163#pragma warning (default:1572)
    21512164#endif
    2152               std::cout << "merge failed with area mismatch\n";
     2165              stdcout << "merge failed with area mismatch\n";
    21532166              failed = true;
    21542167            }
     
    21602173    }
    21612174
    2162     static inline bool test_manhattan_intersection() {
     2175    template <typename stream_type>
     2176    static inline bool test_manhattan_intersection(stream_type& stdcout) {
    21632177      rectangle_data<Unit> rect1, rect2, rect3;
    21642178      set_points(rect1, (Point(-1, 2)), (Point(1, 4)));
    21652179      set_points(rect2, (Point(-1, 2)), (Point(2, 3)));
    21662180      set_points(rect3, (Point(-3, 0)), (Point(4, 2)));
    2167       if(!check_rectangle_trio(rect1, rect2, rect3)) {
     2181      if(!check_rectangle_trio(rect1, rect2, rect3, stdcout)) {
    21682182        return false;
    21692183      }
     
    21752189        std::map<std::set<property_type>, polygon_90_set_data<Unit> > result90;
    21762190        std::vector<polygon_data<Unit> > polys90;
    2177         std::cout << "random case # " << i << std::endl;
     2191        stdcout << "random case # " << i << std::endl;
    21782192        set_points(rect1, (Point(rand()%9-4, rand()%9-4)), (Point(rand()%9-4, rand()%9-4)));
    21792193        set_points(rect2, (Point(rand()%9-4, rand()%9-4)), (Point(rand()%9-4, rand()%9-4)));
    21802194        set_points(rect3, (Point(rand()%9-4, rand()%9-4)), (Point(rand()%9-4, rand()%9-4)));
    2181         if(!check_rectangle_trio(rect1, rect2, rect3)) {
     2195        if(!check_rectangle_trio(rect1, rect2, rect3, stdcout)) {
    21822196          return false;
    21832197        }
     
    21862200    }
    21872201
    2188     static inline bool test_intersection() {
     2202    template <typename stream_type>
     2203    static inline bool test_intersection(stream_type& stdcout) {
    21892204      property_merge si;
    21902205      rectangle_data<Unit> rect;
     
    22062221      std::map<std::set<property_type>, polygon_set_data<Unit> > result;
    22072222      si.merge(result);
    2208       print(std::cout, si.pmd) << std::endl;
     2223      print(stdcout, si.pmd) << std::endl;
    22092224      for(typename std::map<std::set<property_type>, polygon_set_data<Unit> >::iterator itr = result.begin();
    22102225          itr != result.end(); ++itr) {
    2211         std::cout << "( ";
     2226        stdcout << "( ";
    22122227        for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
    22132228            set_itr != (*itr).first.end(); ++set_itr) {
    2214           std::cout << (*set_itr) << " ";
    2215         } std::cout << ") \n";
     2229          stdcout << (*set_itr) << " ";
     2230        } stdcout << ") \n";
    22162231        polygon_set_data<Unit> psd = (*itr).second;
    2217         std::cout << psd << std::endl;
     2232        stdcout << psd << std::endl;
    22182233        std::vector<polygon_data<Unit> > polys;
    22192234        psd.get(polys);
    2220         for(unsigned int i = 0; i < polys.size(); ++i) {
    2221           std::cout << polys[i] << std::endl;
     2235        for(std::size_t i = 0; i < polys.size(); ++i) {
     2236          stdcout << polys[i] << std::endl;
    22222237        }
    22232238      }
     
    22262241      for(unsigned int i = 0; i < 10; ++i) {
    22272242        property_merge si2;
    2228         std::cout << "random case # " << i << std::endl;
     2243        stdcout << "random case # " << i << std::endl;
    22292244        si.clear();
    22302245        pts.clear();
     
    22342249        polygon_data<Unit> poly1;
    22352250        poly1.set(pts.begin(), pts.end());
    2236         std::cout << poly1 << std::endl;
     2251        stdcout << poly1 << std::endl;
    22372252        si.insert(poly1, 444);
    22382253        si2.insert(poly1, 333);
     
    22432258        polygon_data<Unit> poly2;
    22442259        poly2.set(pts.begin(), pts.end());
    2245         std::cout << poly2 << std::endl;
     2260        stdcout << poly2 << std::endl;
    22462261        si.insert(poly2, 444);
    22472262        si2.insert(poly2, 444);
     
    22522267        polygon_data<Unit> poly3;
    22532268        poly3.set(pts.begin(), pts.end());
    2254         std::cout << poly3 << std::endl;
     2269        stdcout << poly3 << std::endl;
    22552270        si.insert(poly3, 444);
    22562271        si2.insert(poly3, 555);
     
    22592274        si.merge(result);
    22602275        si2.merge(result2);
    2261         std::cout << "merged result\n";
     2276        stdcout << "merged result\n";
    22622277      for(typename std::map<std::set<property_type>, polygon_set_data<Unit> >::iterator itr = result.begin();
    22632278          itr != result.end(); ++itr) {
    2264         std::cout << "( ";
     2279        stdcout << "( ";
    22652280        for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
    22662281            set_itr != (*itr).first.end(); ++set_itr) {
    2267           std::cout << (*set_itr) << " ";
    2268         } std::cout << ") \n";
     2282          stdcout << (*set_itr) << " ";
     2283        } stdcout << ") \n";
    22692284        polygon_set_data<Unit> psd = (*itr).second;
    2270         std::cout << psd << std::endl;
     2285        stdcout << psd << std::endl;
    22712286        std::vector<polygon_data<Unit> > polys2;
    22722287        psd.get(polys2);
    2273         for(unsigned int ii = 0; ii < polys2.size(); ++ii) {
    2274           std::cout << polys2[ii] << std::endl;
    2275         }
    2276       }
    2277       std::cout << "intersected pmd\n";
    2278       print(std::cout, si2.pmd) << std::endl;
    2279       std::cout << "intersected result\n";
     2288        for(std::size_t ii = 0; ii < polys2.size(); ++ii) {
     2289          stdcout << polys2[ii] << std::endl;
     2290        }
     2291      }
     2292      stdcout << "intersected pmd\n";
     2293      print(stdcout, si2.pmd) << std::endl;
     2294      stdcout << "intersected result\n";
    22802295      for(typename std::map<std::set<property_type>, polygon_set_data<Unit> >::iterator itr = result2.begin();
    22812296          itr != result2.end(); ++itr) {
    2282         std::cout << "( ";
     2297        stdcout << "( ";
    22832298        for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
    22842299            set_itr != (*itr).first.end(); ++set_itr) {
    2285           std::cout << (*set_itr) << " ";
    2286         } std::cout << ") \n";
     2300          stdcout << (*set_itr) << " ";
     2301        } stdcout << ") \n";
    22872302        polygon_set_data<Unit> psd = (*itr).second;
    2288         std::cout << psd << std::endl;
     2303        stdcout << psd << std::endl;
    22892304        std::vector<polygon_data<Unit> > polys2;
    22902305        psd.get(polys2);
    2291         for(unsigned int ii = 0; ii < polys2.size(); ++ii) {
    2292           std::cout << polys2[ii] << std::endl;
     2306        for(std::size_t ii = 0; ii < polys2.size(); ++ii) {
     2307          stdcout << polys2[ii] << std::endl;
    22932308        }
    22942309      }
     
    22982313          polys.clear();
    22992314          (*itr).second.get(polys);
    2300           for(unsigned int j = 0; j < polys.size(); ++j) {
     2315          for(std::size_t j = 0; j < polys.size(); ++j) {
    23012316            si.insert(polys[j], 444);
    23022317          }
     
    23042319        result2.clear();
    23052320        si.merge(result2);
    2306       std::cout << "remerged result\n";
     2321      stdcout << "remerged result\n";
    23072322      for(typename std::map<std::set<property_type>, polygon_set_data<Unit> >::iterator itr = result2.begin();
    23082323          itr != result2.end(); ++itr) {
    2309         std::cout << "( ";
     2324        stdcout << "( ";
    23102325        for(typename std::set<property_type>::const_iterator set_itr = (*itr).first.begin();
    23112326            set_itr != (*itr).first.end(); ++set_itr) {
    2312           std::cout << (*set_itr) << " ";
    2313         } std::cout << ") \n";
     2327          stdcout << (*set_itr) << " ";
     2328        } stdcout << ") \n";
    23142329        polygon_set_data<Unit> psd = (*itr).second;
    2315         std::cout << psd << std::endl;
     2330        stdcout << psd << std::endl;
    23162331        std::vector<polygon_data<Unit> > polys2;
    23172332        psd.get(polys2);
    2318         for(unsigned int ii = 0; ii < polys2.size(); ++ii) {
    2319           std::cout << polys2[ii] << std::endl;
     2333        for(std::size_t ii = 0; ii < polys2.size(); ++ii) {
     2334          stdcout << polys2[ii] << std::endl;
    23202335        }
    23212336      }
     
    23252340      (*(result2.begin())).second.get(polys2);
    23262341      if(!(polys == polys2)) {
    2327           std::cout << "failed intersection check # " << i << std::endl;
     2342          stdcout << "failed intersection check # " << i << std::endl;
    23282343          return false;
    23292344        }
     
    24832498  };
    24842499
    2485   template <typename Unit>
    2486   bool test_arbitrary_boolean_op() {
     2500  template <typename Unit, typename stream_type>
     2501  bool test_arbitrary_boolean_op(stream_type& stdcout) {
    24872502    polygon_set_data<Unit> psd;
    24882503    rectangle_data<Unit> rect;
     
    24982513    abo.execute(psd3, psd.begin(), psd.end(), psd2.begin(), psd2.end(), arbitrary_boolean_op<Unit>::BOOLEAN_OR);
    24992514    psd3.get(pv);
    2500     for(unsigned int i = 0; i < pv.size(); ++i) {
    2501       std::cout << pv[i] << std::endl;
     2515    for(std::size_t i = 0; i < pv.size(); ++i) {
     2516      stdcout << pv[i] << std::endl;
    25022517    }
    25032518    pv.clear();
     
    25062521    abo.execute(psd3, psd.begin(), psd.end(), psd2.begin(), psd2.end(), arbitrary_boolean_op<Unit>::BOOLEAN_AND);
    25072522    psd3.get(pv);
    2508     for(unsigned int i = 0; i < pv.size(); ++i) {
    2509       std::cout << pv[i] << std::endl;
     2523    for(std::size_t i = 0; i < pv.size(); ++i) {
     2524      stdcout << pv[i] << std::endl;
    25102525    }
    25112526    pv.clear();
     
    25142529    abo.execute(psd3, psd.begin(), psd.end(), psd2.begin(), psd2.end(), arbitrary_boolean_op<Unit>::BOOLEAN_XOR);
    25152530    psd3.get(pv);
    2516     for(unsigned int i = 0; i < pv.size(); ++i) {
    2517       std::cout << pv[i] << std::endl;
     2531    for(std::size_t i = 0; i < pv.size(); ++i) {
     2532      stdcout << pv[i] << std::endl;
    25182533    }
    25192534    pv.clear();
     
    25222537    abo.execute(psd3, psd.begin(), psd.end(), psd2.begin(), psd2.end(), arbitrary_boolean_op<Unit>::BOOLEAN_NOT);
    25232538    psd3.get(pv);
    2524     for(unsigned int i = 0; i < pv.size(); ++i) {
    2525       std::cout << pv[i] << std::endl;
     2539    for(std::size_t i = 0; i < pv.size(); ++i) {
     2540      stdcout << pv[i] << std::endl;
    25262541    }
    25272542    return true;
  • sandbox/gtl/boost/polygon/gtl_boost_unit_test.cpp

    r54345 r54797  
    77*/
    88#define BOOST_POLYGON_NO_DEPS
     9#include <iostream>
    910#include "polygon.hpp"
    1011namespace gtl = boost::polygon;
     
    1415
    1516namespace boost { namespace polygon{
     17
     18template <class T>
     19std::ostream& operator << (std::ostream& o, const interval_data<T>& i)
     20{
     21  return o << i.get(LOW) << ' ' << i.get(HIGH);
     22}
     23  template <class T>
     24  std::ostream& operator << (std::ostream& o, const point_data<T>& r)
     25  {
     26    return o << r.get(HORIZONTAL) << ' ' << r.get(VERTICAL);
     27  }
     28  template <typename T>
     29  std::ostream& operator<<(std::ostream& o, const polygon_45_data<T>& poly) {
     30    o << "Polygon { ";
     31    for(typename polygon_45_data<T>::iterator_type itr = poly.begin();
     32        itr != poly.end(); ++itr) {
     33      if(itr != poly.begin()) o << ", ";
     34      o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
     35    }
     36    o << " } ";
     37    return o;
     38  }
     39  template <typename Unit>
     40  inline std::ostream& operator<< (std::ostream& o, const polygon_45_set_data<Unit>& p) {
     41    o << "Polygon45Set ";
     42    o << " " << !p.sorted() << " " << p.dirty() << " { ";
     43    for(typename polygon_45_set_data<Unit>::iterator_type itr = p.begin();
     44        itr != p.end(); ++itr) {
     45      o << (*itr).pt << ":";
     46      for(unsigned int i = 0; i < 4; ++i) {
     47        o << (*itr).count[i] << ",";
     48      } o << " ";
     49      //o << (*itr).first << ":" <<  (*itr).second << "; ";
     50    }
     51    o << "} ";
     52    return o;
     53  }
     54
     55  template <typename Unit>
     56  inline std::istream& operator>> (std::istream& i, polygon_45_set_data<Unit>& p) {
     57    //TODO
     58    return i;
     59  }
     60template <typename T>
     61std::ostream& operator << (std::ostream& o, const polygon_90_data<T>& r)
     62{
     63  o << "Polygon { ";
     64  for(typename polygon_90_data<T>::iterator_type itr = r.begin(); itr != r.end(); ++itr) {
     65    o << *itr << ", ";
     66  }
     67  return o << "} ";
     68}
     69
     70template <typename T>
     71std::istream& operator >> (std::istream& i, polygon_90_data<T>& r)
     72{
     73  std::size_t size;
     74  i >> size;
     75  std::vector<T> vec;
     76  vec.reserve(size);
     77  for(std::size_t ii = 0; ii < size; ++ii) {
     78    T coord;
     79    i >> coord;
     80    vec.push_back(coord);
     81  }
     82  r.set_compact(vec.begin(), vec.end());
     83  return i;
     84}
     85 
     86template <typename T>
     87std::ostream& operator << (std::ostream& o, const std::vector<polygon_90_data<T> >& r) {
     88  o << r.size() << ' ';
     89  for(std::size_t ii = 0; ii < r.size(); ++ii) {
     90    o << (r[ii]);
     91  }
     92  return o;
     93}
     94template <typename T>
     95std::istream& operator >> (std::istream& i, std::vector<polygon_90_data<T> >& r) {
     96  std::size_t size;
     97  i >> size;
     98  r.clear();
     99  r.reserve(size);
     100  for(std::size_t ii = 0; ii < size; ++ii) {
     101    polygon_90_data<T> tmp;
     102    i >> tmp;
     103    r.push_back(tmp);
     104  }
     105  return i;
     106}
     107  template <typename T>
     108  std::ostream& operator<<(std::ostream& o, const polygon_data<T>& poly) {
     109    o << "Polygon { ";
     110    for(typename polygon_data<T>::iterator_type itr = poly.begin();
     111        itr != poly.end(); ++itr) {
     112      if(itr != poly.begin()) o << ", ";
     113      o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
     114    }
     115    o << " } ";
     116    return o;
     117  }
     118  template <typename T>
     119  std::ostream& operator << (std::ostream& o, const polygon_set_data<T>& r)
     120  {
     121    o << "Polygon Set Data { ";
     122    for(typename polygon_set_data<T>::iterator_type itr = r.begin(); itr != r.end(); ++itr) {
     123      o << "<" << (*itr).first.first << ", " << (*itr).first.second << ">:" << (*itr).second << " ";
     124    }
     125    o << "} ";
     126    return o;
     127  }
     128  template <typename T>
     129  std::ostream& operator<<(std::ostream& o, const polygon_90_with_holes_data<T>& poly) {
     130    o << "Polygon With Holes { ";
     131    for(typename polygon_90_with_holes_data<T>::iterator_type itr = poly.begin();
     132        itr != poly.end(); ++itr) {
     133      if(itr != poly.begin()) o << ", ";
     134      o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
     135    } o << " { ";
     136    for(typename polygon_90_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
     137        itr != poly.end_holes(); ++itr) {
     138      o << (*itr);
     139    }
     140    o << " } } ";
     141    return o;
     142  }
     143  template <typename T>
     144  std::ostream& operator<<(std::ostream& o, const polygon_45_with_holes_data<T>& poly) {
     145    o << "Polygon With Holes { ";
     146    for(typename polygon_45_with_holes_data<T>::iterator_type itr = poly.begin();
     147        itr != poly.end(); ++itr) {
     148      if(itr != poly.begin()) o << ", ";
     149      o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
     150    } o << " { ";
     151    for(typename polygon_45_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
     152        itr != poly.end_holes(); ++itr) {
     153      o << (*itr);
     154    }
     155    o << " } } ";
     156    return o;
     157  }
     158  template <typename T>
     159  std::ostream& operator<<(std::ostream& o, const polygon_with_holes_data<T>& poly) {
     160    o << "Polygon With Holes { ";
     161    for(typename polygon_with_holes_data<T>::iterator_type itr = poly.begin();
     162        itr != poly.end(); ++itr) {
     163      if(itr != poly.begin()) o << ", ";
     164      o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
     165    } o << " { ";
     166    for(typename polygon_with_holes_data<T>::iterator_holes_type itr = poly.begin_holes();
     167        itr != poly.end_holes(); ++itr) {
     168      o << (*itr);
     169    }
     170    o << " } } ";
     171    return o;
     172  }
     173template <class T>
     174std::ostream& operator << (std::ostream& o, const rectangle_data<T>& r)
     175{
     176  return o << r.get(HORIZONTAL) << ' ' << r.get(VERTICAL);
     177}
     178
     179
     180  template <typename T>
     181  typename enable_if<typename is_polygon_90_set_type<T>::type, void>::type
     182  print_is_polygon_90_set_concept(const T& t) { std::cout << "is polygon 90 set concept\n"; }
     183  template <typename T>
     184  typename enable_if<typename is_mutable_polygon_90_set_type<T>::type, void>::type
     185  print_is_mutable_polygon_90_set_concept(const T& t) { std::cout << "is mutable polygon 90 set concept\n"; }
     186namespace boolean_op {
     187  //self contained unit test for BooleanOr algorithm
     188  template <typename Unit>
     189  inline bool testBooleanOr() {
     190    BooleanOp<int, Unit> booleanOr;
     191    //test one rectangle
     192    std::vector<std::pair<interval_data<Unit>, int> > container;
     193    booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
     194    booleanOr.advanceScan();
     195    booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
     196    if(container.size() != 2) {
     197      std::cout << "Test one rectangle, wrong output size\n";
     198      return false;
     199    }
     200    if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
     201      std::cout << "Test one rectangle, first output wrong: Interval(" <<
     202        container[0].first << "), " << container[0].second << std::endl;
     203    }
     204    if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
     205      std::cout << "Test one rectangle, second output wrong: Interval(" <<
     206        container[1].first << "), " << container[1].second << std::endl;
     207    }
     208
     209    //test two rectangles
     210    container.clear();
     211    booleanOr = BooleanOp<int, Unit>();
     212    booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
     213    booleanOr.advanceScan();
     214    booleanOr.processInterval(container, interval_data<Unit>(5, 15), 1);
     215    booleanOr.advanceScan();
     216    booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
     217    booleanOr.advanceScan();
     218    booleanOr.processInterval(container, interval_data<Unit>(5, 15), -1);
     219    if(container.size() != 4) {
     220      std::cout << "Test two rectangles, wrong output size\n";
     221      for(std::size_t i = 0; i < container.size(); ++i){
     222              std::cout << container[i].first << "), " << container[i].second << std::endl;
     223      }
     224      return false;
     225    }
     226    if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
     227            std::cout << "Test two rectangles, first output wrong: Interval(" <<
     228        container[0].first << "), " << container[0].second << std::endl;
     229    }
     230    if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(10, 15), 1)) {
     231            std::cout << "Test two rectangles, second output wrong: Interval(" <<
     232        container[1].first << "), " << container[1].second << std::endl;
     233    }
     234    if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 5), -1)) {
     235            std::cout << "Test two rectangles, third output wrong: Interval(" <<
     236        container[2].first << "), " << container[2].second << std::endl;
     237    }
     238    if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(5, 15), -1)) {
     239            std::cout << "Test two rectangles, fourth output wrong: Interval(" <<
     240        container[3].first << "), " << container[3].second << std::endl;
     241    }
     242
     243    //test two rectangles
     244    container.clear();
     245    booleanOr = BooleanOp<int, Unit>();
     246    booleanOr.processInterval(container, interval_data<Unit>(5, 15), 1);
     247    booleanOr.advanceScan();
     248    booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
     249    booleanOr.advanceScan();
     250    booleanOr.processInterval(container, interval_data<Unit>(5, 15), -1);
     251    booleanOr.advanceScan();
     252    booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
     253    if(container.size() != 4) {
     254            std::cout << "Test other two rectangles, wrong output size\n";
     255      for(std::size_t i = 0; i < container.size(); ++i){
     256              std::cout << container[i].first << "), " << container[i].second << std::endl;
     257      }
     258      return false;
     259    }
     260    if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(5, 15), 1)) {
     261            std::cout << "Test other two rectangles, first output wrong: Interval(" <<
     262        container[0].first << "), " << container[0].second << std::endl;
     263    }
     264    if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 5), 1)) {
     265            std::cout << "Test other two rectangles, second output wrong: Interval(" <<
     266        container[1].first << "), " << container[1].second << std::endl;
     267    }
     268    if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(10, 15), -1)) {
     269            std::cout << "Test other two rectangles, third output wrong: Interval(" <<
     270        container[2].first << "), " << container[2].second << std::endl;
     271    }
     272    if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
     273            std::cout << "Test other two rectangles, fourth output wrong: Interval(" <<
     274        container[3].first << "), " << container[3].second << std::endl;
     275    }
     276
     277    //test two nonoverlapping rectangles
     278    container.clear();
     279    booleanOr = BooleanOp<int, Unit>();
     280    booleanOr.processInterval(container, interval_data<Unit>(0, 10), 1);
     281    booleanOr.advanceScan();
     282    booleanOr.processInterval(container, interval_data<Unit>(15, 25), 1);
     283    booleanOr.advanceScan();
     284    booleanOr.processInterval(container, interval_data<Unit>(0, 10), -1);
     285    booleanOr.advanceScan();
     286    booleanOr.processInterval(container, interval_data<Unit>(15, 25), -1);
     287    if(container.size() != 4) {
     288            std::cout << "Test two nonoverlapping rectangles, wrong output size\n";
     289      return false;
     290    }
     291    if(container[0] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), 1)) {
     292            std::cout << "Test two nonoverlapping rectangles, first output wrong: Interval(" <<
     293        container[0].first << "), " << container[0].second << std::endl;
     294    }
     295    if(container[1] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(15, 25), 1)) {
     296            std::cout << "Test two nonoverlapping rectangles, second output wrong: Interval(" <<
     297        container[1].first << "), " << container[1].second << std::endl;
     298    }
     299    if(container[2] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(0, 10), -1)) {
     300            std::cout << "Test two nonoverlapping rectangles, third output wrong: Interval(" <<
     301        container[2].first << "), " << container[2].second << std::endl;
     302    }
     303    if(container[3] != std::pair<interval_data<Unit>, int>(interval_data<Unit>(15, 25), -1)) {
     304            std::cout << "Test two nonoverlapping rectangles, fourth output wrong: Interval(" <<
     305        container[3].first << "), " << container[3].second << std::endl;
     306    }
     307    return true;
     308  }
     309}
    16310
    17311  void test_assign() {
     
    20102304   }
    20112305
    2012   boolean_op_45<int>::testScan45();
    2013   polygon_45_formation<int>::testPolygon45Formation();
    2014   polygon_45_formation<int>::testPolygon45Tiling();
     2306   boolean_op_45<int>::testScan45(std::cout);
     2307   polygon_45_formation<int>::testPolygon45Formation(std::cout);
     2308  polygon_45_formation<int>::testPolygon45Tiling(std::cout);
    20152309
    20162310  axis_transformation atr;
     
    20602354  std::cout << testPolygonAssign() << std::endl;
    20612355  std::cout << testPolygonWithHoles() << std::endl;
    2062   std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationRect()) << std::endl;
    2063   std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationP1()) << std::endl;
    2064   std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationP2()) << std::endl;
    2065   std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationPolys()) << std::endl;
    2066   std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch1()) << std::endl;
    2067   std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch2()) << std::endl;
    2068   std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch3()) << std::endl;
    2069   std::cout << (polygon_arbitrary_formation<int>::testSegmentIntersection()) << std::endl;
    2070   std::cout << (property_merge<int, int>::test_insertion()) << std::endl;
    2071   std::cout << (line_intersection<int>::test_verify_scan()) << std::endl;
    2072   std::cout << (line_intersection<int>::test_validate_scan()) << std::endl;
    2073   std::cout << (scanline<int, int>::test_scanline()) << std::endl;
    2074   std::cout << (property_merge<int, int>::test_merge()) << std::endl;
    2075   std::cout << (property_merge<int, int>::test_intersection()) << std::endl;
    2076   std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationColinear()) << std::endl;
    2077   std::cout << (property_merge<int, int>::test_manhattan_intersection()) << std::endl;
    2078   std::cout << (test_arbitrary_boolean_op<int>()) << std::endl;
     2356  std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationRect(std::cout)) << std::endl;
     2357  std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationP1(std::cout)) << std::endl;
     2358  std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationP2(std::cout)) << std::endl;
     2359  std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationPolys(std::cout)) << std::endl;
     2360  std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch1(std::cout)) << std::endl;
     2361  std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch2(std::cout)) << std::endl;
     2362  std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationSelfTouch3(std::cout)) << std::endl;
     2363  std::cout << (polygon_arbitrary_formation<int>::testSegmentIntersection(std::cout)) << std::endl;
     2364  std::cout << (property_merge<int, int>::test_insertion(std::cout)) << std::endl;
     2365  std::cout << (line_intersection<int>::test_verify_scan(std::cout)) << std::endl;
     2366  std::cout << (line_intersection<int>::test_validate_scan(std::cout)) << std::endl;
     2367  std::cout << (scanline<int, int>::test_scanline(std::cout)) << std::endl;
     2368  std::cout << (property_merge<int, int>::test_merge(std::cout)) << std::endl;
     2369  std::cout << (property_merge<int, int>::test_intersection(std::cout)) << std::endl;
     2370  std::cout << (polygon_arbitrary_formation<int>::testPolygonArbitraryFormationColinear(std::cout)) << std::endl;
     2371  std::cout << (property_merge<int, int>::test_manhattan_intersection(std::cout)) << std::endl;
     2372  std::cout << (test_arbitrary_boolean_op<int>(std::cout)) << std::endl;
    20792373  }
    20802374  {
     
    24372731    if(is_45(polyWHoles) != true) return 1;
    24382732
    2439     std::cout << (boolean_op_45<Unit>::testScan45()) << std::endl;
    2440     std::cout << (polygon_45_formation<Unit>::testPolygon45Formation()) << std::endl;
    2441     std::cout << (polygon_45_formation<Unit>::testPolygon45Tiling()) << std::endl;
     2733    std::cout << (boolean_op_45<Unit>::testScan45(std::cout)) << std::endl;
     2734    std::cout << (polygon_45_formation<Unit>::testPolygon45Formation(std::cout)) << std::endl;
     2735    std::cout << (polygon_45_formation<Unit>::testPolygon45Tiling(std::cout)) << std::endl;
    24422736
    24432737
  • sandbox/gtl/boost/polygon/interval_concept.hpp

    r54345 r54797  
    5050
    5151  template <typename T>
    52   typename enable_if<typename gtl_if<typename is_interval_concept<typename geometry_concept<T>::type>::type>::type,
    53       typename interval_coordinate_type<T>::type>::type
    54   get(const T& interval, direction_1d dir) {
     52  typename interval_coordinate_type<T>::type
     53  get(const T& interval, direction_1d dir,
     54  typename enable_if<typename gtl_if<typename is_interval_concept<typename geometry_concept<T>::type>::type>::type>::type *ptr = 0
     55  ) {
    5556    return interval_traits<T>::get(interval, dir);
    5657  }
    5758
    5859  template <typename T, typename coordinate_type>
    59   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type, void>::type
    60   set(T& interval, direction_1d dir, coordinate_type value) {
     60  void
     61  set(T& interval, direction_1d dir, coordinate_type value,
     62  typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type>::type *ptr = 0
     63  ) {
    6164    //this may need to be refined
    6265    interval_mutable_traits<T>::set(interval, dir, value);
     
    6669 
    6770  template <typename T>
    68   typename enable_if<
    69     typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type,
    70     T>::type
    71   construct(typename interval_traits<T>::coordinate_type low_value, typename interval_traits<T>::coordinate_type high_value) {
     71  T
     72  construct(typename interval_traits<T>::coordinate_type low_value, typename interval_traits<T>::coordinate_type high_value,
     73  typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type>::type *ptr = 0
     74  ) {
    7275    if(low_value > high_value) std::swap(low_value, high_value);
    7376    return interval_mutable_traits<T>::construct(low_value, high_value);
     
    7578 
    7679  template <typename T, typename T2>
     80  T
     81  copy_construct(const T2& interval,
    7782  typename enable_if< typename gtl_and<typename is_mutable_interval_concept<typename geometry_concept<T>::type>::type,
    78                                         typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
    79                        T>::type
    80   copy_construct(const T2& interval) {
     83  typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0
     84  ) {
    8185    return construct<T>
    8286      (get(interval, LOW ),
     
    8589
    8690  template <typename T1, typename T2>
     91  T1 &
     92  assign(T1& lvalue, const T2& rvalue,
    8793  typename enable_if< typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<T1>::type>::type,
    88                        typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
    89                        T1>::type &
    90   assign(T1& lvalue, const T2& rvalue) {
     94  typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0) {
    9195    lvalue = copy_construct<T1>(rvalue);
    9296    return lvalue;
     
    9498
    9599  template <typename T, typename T2>
     100  bool
     101  equivalence(const T& interval1, const T2& interval2,
    96102  typename enable_if< typename gtl_and< typename is_interval_concept<typename geometry_concept<T>::type>::type,
    97                        typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type,
    98                        bool>::type
    99   equivalence(const T& interval1, const T2& interval2) {
     103  typename is_interval_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0
     104  ) {
    100105    return get(interval1, LOW) ==
    101106      get(interval2, LOW) &&
     
    105110 
    106111  template <typename interval_type>
    107   typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    108                        bool>::type
     112  bool
    109113  contains(const interval_type& interval,
    110114           typename interval_traits<interval_type>::coordinate_type value,
    111            bool consider_touch = true) {
     115           bool consider_touch = true,
     116                   typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
     117                   ) {
    112118    if(consider_touch) {
    113119      return value <= high(interval) && value >= low(interval);
     
    118124 
    119125  template <typename interval_type, typename interval_type_2>
    120   typename enable_if< typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    121                        typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    122                        bool>::type
     126  bool
    123127  contains(const interval_type& interval,
    124            const interval_type_2& value, bool consider_touch = true) {
     128           const interval_type_2& value, bool consider_touch = true,
     129                   typename enable_if< typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
     130                   typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type>::type *ptr = 0
     131                   ) {
    125132    return contains(interval, get(value, LOW), consider_touch) &&
    126133      contains(interval, get(value, HIGH), consider_touch);
     
    129136  // get the low coordinate
    130137  template <typename interval_type>
    131   typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    132                        typename interval_traits<interval_type>::coordinate_type >::type
    133   low(const interval_type& interval) { return get(interval, LOW); }
     138  typename interval_traits<interval_type>::coordinate_type
     139  low(const interval_type& interval,
     140  typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
     141  ) { return get(interval, LOW); }
    134142
    135143  // get the high coordinate
    136144  template <typename interval_type>
    137   typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    138                        typename interval_traits<interval_type>::coordinate_type >::type
    139   high(const interval_type& interval) { return get(interval, HIGH); }
     145  typename interval_traits<interval_type>::coordinate_type
     146  high(const interval_type& interval,
     147  typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
     148  ) { return get(interval, HIGH); }
    140149
    141150  // get the center coordinate
    142151  template <typename interval_type>
    143   typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    144                        typename interval_traits<interval_type>::coordinate_type >::type
    145   center(const interval_type& interval) { return (high(interval) + low(interval))/2; }
     152  typename interval_traits<interval_type>::coordinate_type
     153  center(const interval_type& interval,
     154  typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
     155  ) { return (high(interval) + low(interval))/2; }
    146156
    147157  // set the low coordinate to v
    148158  template <typename interval_type>
    149   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, void>::type
     159  void
    150160  low(interval_type& interval,
    151       typename interval_traits<interval_type>::coordinate_type v) {
    152     set(interval, LOW, v); }
     161      typename interval_traits<interval_type>::coordinate_type v,
     162          typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
     163          ) { set(interval, LOW, v); }
    153164 
    154165  // set the high coordinate to v
    155166  template <typename interval_type>
    156   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, void>::type
     167  void
    157168  high(interval_type& interval,
    158        typename interval_traits<interval_type>::coordinate_type v) {
    159     set(interval, HIGH, v); }
     169      typename interval_traits<interval_type>::coordinate_type v,
     170          typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
     171          ) { set(interval, HIGH, v); }
    160172 
    161173  // get the magnitude of the interval
    162174  template <typename interval_type>
    163   typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    164                        typename interval_difference_type<interval_type>::type >::type
    165   delta(const interval_type& interval) {
     175  typename interval_difference_type<interval_type>::type
     176  delta(const interval_type& interval,
     177  typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
     178  ) {
    166179    typedef typename coordinate_traits<typename interval_traits<interval_type>::coordinate_type>::coordinate_difference diffT;
    167180    return (diffT)high(interval) - (diffT)low(interval); }
    168181
     182  struct y_i_flip : gtl_yes {};
     183
    169184  // flip this about coordinate
    170185  template <typename interval_type>
    171   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
     186  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 &
    172187  flip(interval_type& interval,
    173188       typename interval_traits<interval_type>::coordinate_type axis = 0) {
     
    180195  }
    181196
     197  struct y_i_scale_up : gtl_yes {};
     198
    182199  // scale interval by factor
    183200  template <typename interval_type>
    184   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
     201  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 &
    185202  scale_up(interval_type& interval,
    186203           typename coordinate_traits<typename interval_traits<interval_type>::coordinate_type>::unsigned_area_type factor) {
     
    192209  }
    193210
    194   template <typename interval_type>
    195   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
     211  struct y_i_scale_down : gtl_yes {};
     212
     213  template <typename interval_type>
     214  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 &
    196215  scale_down(interval_type& interval,
    197216             typename coordinate_traits<typename interval_traits<interval_type>::coordinate_type>::unsigned_area_type factor) {
     
    204223  }
    205224
    206   template <typename interval_type>
    207   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
     225  struct y_i_scale : gtl_yes {};
     226
     227  template <typename interval_type>
     228  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 &
    208229  scale(interval_type& interval, double factor) {
    209230    typedef typename interval_traits<interval_type>::coordinate_type Unit;
     
    216237  // move interval by delta
    217238  template <typename interval_type>
    218   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
     239  interval_type&
    219240  move(interval_type& interval,
    220        typename interval_difference_type<interval_type>::type displacement) {
     241       typename interval_difference_type<interval_type>::type displacement,
     242           typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type *ptr = 0
     243           ) {
    221244    typedef typename coordinate_traits<typename interval_traits<interval_type>::coordinate_type>::coordinate_difference Unit;
    222245    Unit len = delta(interval);
     
    226249  }
    227250 
     251  struct y_i_convolve : gtl_yes {};
     252
    228253  // convolve this with b
    229254  template <typename interval_type>
    230   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
     255  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 &
    231256  convolve(interval_type& interval,
    232257           typename interval_traits<interval_type>::coordinate_type b) {
     
    239264  }
    240265
     266  struct y_i_deconvolve : gtl_yes {};
     267
    241268  // deconvolve this with b
    242269  template <typename interval_type>
    243   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type &
     270  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 &
    244271  deconvolve(interval_type& interval,
    245272             typename interval_traits<interval_type>::coordinate_type b) {
     
    252279  }
    253280
     281  struct y_i_convolve2 : gtl_yes {};
     282
    254283  // convolve this with b
    255284  template <typename interval_type, typename interval_type_2>
    256285  typename enable_if<
    257     typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
    258                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     286    typename gtl_and_3<y_i_convolve2,
     287                           typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     288                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    259289    interval_type>::type &
    260290  convolve(interval_type& interval,
     
    268298  }
    269299 
     300  struct y_i_deconvolve2 : gtl_yes {};
     301
    270302  // deconvolve this with b
    271303  template <typename interval_type, typename interval_type_2>
    272304  typename enable_if<
    273     typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
    274                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     305    typename gtl_and_3< y_i_deconvolve2,
     306                            typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     307                        typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    275308    interval_type>::type &
    276309  deconvolve(interval_type& interval,
     
    284317  }
    285318 
     319  struct y_i_reconvolve : gtl_yes {};
     320
    286321  // reflected convolve this with b
    287322  template <typename interval_type, typename interval_type_2>
    288323  typename enable_if<
    289     typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
    290                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     324    typename gtl_and_3<y_i_reconvolve,
     325                           typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     326                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    291327    interval_type>::type &
    292328  reflected_convolve(interval_type& interval,
     
    300336  }
    301337 
     338  struct y_i_redeconvolve : gtl_yes {};
     339
    302340  // reflected deconvolve this with b
    303341  template <typename interval_type, typename interval_type_2>
    304342  typename enable_if<
    305     typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
    306                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     343    typename gtl_and_3< y_i_redeconvolve,
     344                            typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     345                        typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    307346    interval_type>::type &
    308347  reflected_deconvolve(interval_type& interval,
     
    316355  }
    317356 
     357  struct y_i_e_dist1 : gtl_yes {};
     358
    318359  // distance from a coordinate to an interval
    319360  template <typename interval_type>
    320   typename enable_if< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
     361  typename enable_if< typename gtl_and<y_i_e_dist1, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
    321362                       typename interval_difference_type<interval_type>::type>::type
    322363  euclidean_distance(const interval_type& interval,
     
    326367    return dist[ (dist[1] > 0) + ((dist[2] > 0) << 1) ];
    327368  }
    328  
     369
     370  struct y_i_e_dist2 : gtl_yes {};
    329371 
    330372  // distance between two intervals
    331373  template <typename interval_type, typename interval_type_2>
    332374  typename enable_if<
    333     typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    334                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     375    typename gtl_and_3<y_i_e_dist2, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
     376                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    335377    typename interval_difference_type<interval_type>::type>::type
    336378  euclidean_distance(const interval_type& interval,
     
    341383  }
    342384 
     385  struct y_i_e_intersects : gtl_yes {};
     386
    343387  // check if Interval b intersects `this` Interval
    344388  template <typename interval_type, typename interval_type_2>
    345389  typename enable_if<
    346     typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    347                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     390    typename gtl_and_3<y_i_e_intersects, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
     391                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    348392    bool>::type
    349393    intersects(const interval_type& interval, const interval_type_2& b,
     
    354398  }
    355399
     400  struct y_i_e_bintersect : gtl_yes {};
     401
    356402  // check if Interval b partially overlaps `this` Interval
    357403  template <typename interval_type, typename interval_type_2>
    358404  typename enable_if<
    359     typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    360                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     405    typename gtl_and_3<y_i_e_bintersect, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
     406                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    361407    bool>::type
    362408  boundaries_intersect(const interval_type& interval, const interval_type_2& b,
     
    368414  }
    369415
     416  struct y_i_abuts1 : gtl_yes {};
     417
    370418  // check if they are end to end
    371419  template <typename interval_type, typename interval_type_2>
    372   typename enable_if< typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
     420  typename enable_if< typename gtl_and_3<y_i_abuts1, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    373421                                         typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    374422                       bool>::type
     
    377425  }
    378426
     427  struct y_i_abuts2 : gtl_yes {};
     428
    379429  // check if they are end to end
    380430  template <typename interval_type, typename interval_type_2>
    381431  typename enable_if<
    382     typename gtl_and< typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
    383                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
     432    typename gtl_and_3<y_i_abuts2, typename is_interval_concept<typename geometry_concept<interval_type>::type>::type,
     433                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    384434    bool>::type
    385435  abuts(const interval_type& interval, const interval_type_2& b) {
     
    387437  }
    388438
     439  struct y_i_intersect : gtl_yes {};
    389440
    390441  // set 'this' interval to the intersection of 'this' and b
    391442  template <typename interval_type, typename interval_type_2>
    392   typename enable_if< typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     443  typename enable_if< typename gtl_and_3<y_i_intersect, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
    393444                                         typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    394445                       bool>::type
     
    407458  }
    408459
     460  struct y_i_g_intersect : gtl_yes {};
     461
    409462  // set 'this' interval to the generalized intersection of 'this' and b
    410463  template <typename interval_type, typename interval_type_2>
    411464  typename enable_if<
    412     typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     465    typename gtl_and_3<y_i_g_intersect, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
    413466                      typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    414467    interval_type>::type &
     
    423476  }
    424477
     478  struct y_i_bloat : gtl_yes {};
     479
    425480  // bloat the Interval
    426481  template <typename interval_type>
    427   typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     482  typename enable_if< typename gtl_and<y_i_bloat, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
    428483                       interval_type>::type &
    429484  bloat(interval_type& interval, typename interval_traits<interval_type>::coordinate_type bloating) {
     
    433488  }
    434489 
     490  struct y_i_bloat2 : gtl_yes {};
     491
    435492  // bloat the specified side of `this` Interval
    436493  template <typename interval_type>
    437   typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     494  typename enable_if< typename gtl_and<y_i_bloat2, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
    438495                       interval_type>::type &
    439496  bloat(interval_type& interval, direction_1d dir, typename interval_traits<interval_type>::coordinate_type bloating) {
     
    442499  }
    443500
     501  struct y_i_shrink : gtl_yes {};
    444502
    445503  // shrink the Interval
    446504  template <typename interval_type>
    447   typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     505  typename enable_if< typename gtl_and<y_i_shrink, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
    448506                       interval_type>::type &
    449507  shrink(interval_type& interval, typename interval_traits<interval_type>::coordinate_type shrinking) {
     
    451509  }
    452510
     511  struct y_i_shrink2 : gtl_yes {};
     512
    453513  // shrink the specified side of `this` Interval
    454514  template <typename interval_type>
    455   typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     515  typename enable_if< typename gtl_and<y_i_shrink2, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
    456516                       interval_type>::type &
    457517  shrink(interval_type& interval, direction_1d dir, typename interval_traits<interval_type>::coordinate_type shrinking) {
     
    461521  // Enlarge `this` Interval to encompass the specified Interval
    462522  template <typename interval_type, typename interval_type_2>
     523  bool
     524  encompass(interval_type& interval, const interval_type_2& b,
    463525  typename enable_if<
    464526    typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
    465                       typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    466     bool>::type
    467   encompass(interval_type& interval, const interval_type_2& b) {
     527        typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type>::type *ptr = 0
     528  ) {
    468529    bool retval = !contains(interval, b, true);
    469530    low(interval, (std::min)(low(interval), low(b)));
     
    472533  }   
    473534
     535  struct y_i_encompass : gtl_yes {};
     536
    474537  // Enlarge `this` Interval to encompass the specified Interval
    475538  template <typename interval_type>
    476   typename enable_if< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     539  typename enable_if< typename gtl_and<y_i_encompass, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type>::type,
    477540                       bool>::type
    478541  encompass(interval_type& interval, typename interval_traits<interval_type>::coordinate_type b) {
     
    483546  }   
    484547
     548  struct y_i_get_half : gtl_yes {};
     549
    485550  // gets the half of the interval as an interval
    486551  template <typename interval_type>
    487   typename enable_if<typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type, interval_type>::type
     552  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
    488553  get_half(const interval_type& interval, direction_1d d1d) {
    489554    typedef typename interval_traits<interval_type>::coordinate_type Unit;
     
    493558  }
    494559
     560  struct y_i_join_with : gtl_yes {};
     561
    495562  // returns true if the 2 intervals exactly touch at one value, like in  l1 <= h1 == l2 <= h2
    496563  // sets the argument to the joined interval
    497564  template <typename interval_type, typename interval_type_2>
    498565  typename enable_if<
    499     typename gtl_and< typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
     566    typename gtl_and_3<y_i_join_with, typename is_mutable_interval_concept<typename geometry_concept<interval_type>::type>::type,
    500567                      typename is_interval_concept<typename geometry_concept<interval_type_2>::type>::type>::type,
    501568    bool>::type
  • sandbox/gtl/boost/polygon/interval_data.hpp

    r54345 r54797  
    5151};
    5252
    53 
    54 template <class T>
    55 std::ostream& operator << (std::ostream& o, const interval_data<T>& i)
    56 {
    57   return o << i.get(LOW) << ' ' << i.get(HIGH);
    58 }
    5953}
    6054}
  • sandbox/gtl/boost/polygon/isotropy.hpp

    r54345 r54797  
    2121#ifdef BOOST_HAS_LONG_LONG
    2222#define BOOST_POLYGON_USE_LONG_LONG
     23//typedef boost::long_long_type polygon_long_long_type;
     24//typedef boost::ulong_long_type polygon_ulong_long_type;
     25typedef long long polygon_long_long_type;
     26typedef unsigned long long polygon_ulong_long_type;
    2327#endif
    2428#include <boost/utility/enable_if.hpp>
    25 
     29#include <boost/mpl/bool.hpp>
     30#include <boost/mpl/and.hpp>
     31#include <boost/mpl/or.hpp>
    2632#else
    2733
     
    3339#endif
    3440#define BOOST_POLYGON_USE_LONG_LONG
     41typedef long long polygon_long_long_type;
     42typedef unsigned long long polygon_ulong_long_type;
     43
    3544  namespace boost {
    3645    template <bool B, class T   = void>
     
    125134    typedef long double area_type;
    126135#ifdef BOOST_POLYGON_USE_LONG_LONG
    127     typedef long long manhattan_area_type;
    128     typedef unsigned long long unsigned_area_type;
    129     typedef long long coordinate_difference;
     136    typedef polygon_long_long_type manhattan_area_type;
     137    typedef polygon_ulong_long_type unsigned_area_type;
     138    typedef polygon_long_long_type coordinate_difference;
    130139#else
    131140    typedef long manhattan_area_type;
     
    138147#ifdef BOOST_POLYGON_USE_LONG_LONG
    139148  template <>
    140   struct coordinate_traits<long long> {
    141     typedef long long coordinate_type;
     149  struct coordinate_traits<polygon_long_long_type> {
     150    typedef polygon_long_long_type coordinate_type;
    142151    typedef long double area_type;
    143     typedef long long manhattan_area_type;
    144     typedef unsigned long long unsigned_area_type;
    145     typedef long long coordinate_difference;
     152    typedef polygon_long_long_type manhattan_area_type;
     153    typedef polygon_ulong_long_type unsigned_area_type;
     154    typedef polygon_long_long_type coordinate_difference;
    146155    typedef long double coordinate_distance;
    147156  };
     
    184193  template <>
    185194  struct geometry_concept<int> { typedef coordinate_concept type; };
    186   template <>
    187   struct geometry_concept<long long> { typedef coordinate_concept type; };
     195#ifdef BOOST_POLYGON_USE_LONG_LONG
     196  template <>
     197  struct geometry_concept<polygon_long_long_type> { typedef coordinate_concept type; };
     198#endif
    188199  template <>
    189200  struct geometry_concept<float> { typedef coordinate_concept type; };
     
    198209    typedef T3 type;
    199210  };
    200 
     211#ifndef BOOST_POLYGON_NO_DEPS
     212  struct gtl_no : mpl::bool_<false> {};
     213  struct gtl_yes : mpl::bool_<true> {};
     214  template <typename T, typename T2>
     215  struct gtl_and : mpl::and_<T, T2> {};
     216  template <typename T, typename T2, typename T3>
     217  struct gtl_and_3 : mpl::and_<T, T2, T3> {};
     218  template <typename T, typename T2, typename T3, typename T4>
     219  struct gtl_and_4 : mpl::and_<T, T2, T3, T4> {};
     220//  template <typename T, typename T2>
     221//  struct gtl_or : mpl::or_<T, T2> {};
     222//  template <typename T, typename T2, typename T3>
     223//  struct gtl_or_3 : mpl::or_<T, T2, T3> {};
     224//  template <typename T, typename T2, typename T3, typename T4>
     225//  struct gtl_or_4 : mpl::or_<T, T2, T3, T4> {};
     226#else
    201227  struct gtl_no { static const bool value = false; };
    202228  struct gtl_yes { typedef gtl_yes type;
    203229    static const bool value = true; };
    204230
    205   template <typename T, typename T2>
    206   struct gtl_and { typedef gtl_no type; };
    207   template <typename T>
    208   struct gtl_and<T, T> { typedef T type; };
    209  
    210   template <typename T, typename T2>
    211   struct gtl_or { typedef gtl_yes type; };
    212   template <typename T>
    213   struct gtl_or<T, T> { typedef T type; };
    214    
     231  template <bool T, bool T2>
     232  struct gtl_and_c { typedef gtl_no type; };
     233  template <>
     234  struct gtl_and_c<true, true> { typedef gtl_yes type; };
     235
     236  template <typename T, typename T2>
     237  struct gtl_and : gtl_and_c<T::value, T2::value> {};
    215238  template <typename T, typename T2, typename T3>
    216239  struct gtl_and_3 { typedef typename gtl_and<
    217240                       T, typename gtl_and<T2, T3>::type>::type type; };
     241
     242  template <typename T, typename T2, typename T3, typename T4>
     243  struct gtl_and_4 { typedef typename gtl_and_3<
     244                       T, T2, typename gtl_and<T3, T4>::type>::type type; };
     245#endif
     246  template <typename T, typename T2>
     247  struct gtl_or { typedef gtl_yes type; };
     248  template <typename T>
     249  struct gtl_or<T, T> { typedef T type; };
     250
    218251  template <typename T, typename T2, typename T3>
    219252  struct gtl_or_3 { typedef typename gtl_or<
     
    223256  struct gtl_or_4 { typedef typename gtl_or<
    224257                      T, typename gtl_or_3<T2, T3, T4>::type>::type type; };
    225    
     258
    226259  template <typename T>
    227260  struct gtl_not { typedef gtl_no type; };
     
    273306    typedef typename coordinate_traits<coordinate_type>::manhattan_area_type type; };
    274307
     308        struct y_c_edist : gtl_yes {};
     309
    275310  template <typename coordinate_type_1, typename coordinate_type_2>
    276   typename enable_if<
    277     typename gtl_and<typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type,
    278                      typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
    279     typename coordinate_traits<coordinate_type_1>::coordinate_difference>::type
     311    typename enable_if<
     312    typename gtl_and_3<y_c_edist, typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type,
     313        typename gtl_same_type<typename geometry_concept<coordinate_type_1>::type, coordinate_concept>::type>::type,
     314        typename coordinate_traits<coordinate_type_1>::coordinate_difference>::type
    280315  euclidean_distance(const coordinate_type_1& lvalue, const coordinate_type_2& rvalue) {
    281316    typedef typename coordinate_traits<coordinate_type_1>::coordinate_difference Unit;
  • sandbox/gtl/boost/polygon/point_3d_concept.hpp

    r54345 r54797  
    6060  };
    6161
    62   template <typename T>
    63   typename enable_if< typename gtl_if<typename is_point_3d_concept<typename geometry_concept<T>::type>::type>::type,
     62  struct y_p3d_get : gtl_yes {};
     63
     64  template <typename T>
     65  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,
    6466                       typename point_3d_coordinate_type<T>::type >::type
    6567  get(const T& point, orientation_3d orient) { return point_3d_traits<T>::get(point, orient); }
    6668 
     69  struct y_p3d_set : gtl_yes {};
     70
    6771  template <typename T, typename coordinate_type>
    68   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type, void>::type
     72  typename enable_if< typename gtl_and<y_p3d_set, typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type>::type, void>::type
    6973  set(T& point, orientation_3d orient, coordinate_type value) { point_3d_mutable_traits<T>::set(point, orient, value); }
     74
     75  struct y_p3d_set2 : gtl_yes {};
     76
    7077  template <typename T, typename coordinate_type>
    71   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type, void>::type
     78  typename enable_if< typename gtl_and<y_p3d_set2, typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type>::type, void>::type
    7279  set(T& point, orientation_2d orient, coordinate_type value) { point_3d_mutable_traits<T>::set(point, orient, value); }
    7380
     81  struct y_p3d_construct : gtl_yes {};
     82
    7483  template <typename T, typename coordinate_type1, typename coordinate_type2, typename coordinate_type3>
    75   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type, T>::type
     84  typename enable_if< typename gtl_and<y_p3d_construct, typename is_mutable_point_3d_concept<typename geometry_concept<T>::type>::type>::type, T>::type
    7685  construct(coordinate_type1 x_value, coordinate_type2 y_value, coordinate_type3 z_value) {
    7786    return point_3d_mutable_traits<T>::construct(x_value, y_value, z_value); }
    7887
     88  struct y_p3d_assign : gtl_yes {};
     89 
    7990  template <typename point_3d_type_1, typename point_3d_type_2>
    8091  typename enable_if<
    81     typename gtl_and< typename is_mutable_point_3d_concept<typename geometry_concept<point_3d_type_1>::type>::type,
     92    typename gtl_and_3<y_p3d_assign, typename is_mutable_point_3d_concept<typename geometry_concept<point_3d_type_1>::type>::type,
    8293                      typename is_point_3d_concept<typename geometry_concept<point_3d_type_2>::type>::type>::type,
    8394    point_3d_type_1>::type &
     
    89100  }
    90101
     102  struct y_p3d_z : gtl_yes {};
     103
    91104  template <typename point_type>
    92   typename enable_if< typename is_point_3d_concept<typename geometry_concept<point_type>::type>::type,
     105  typename enable_if< typename gtl_and<y_p3d_z, typename is_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
    93106                       typename point_3d_traits<point_type>::coordinate_type >::type
    94107  z(const point_type& point) { return get(point, PROXIMAL); }
    95108
     109  struct y_p3d_x : gtl_yes {};
     110
    96111  template <typename point_type, typename coordinate_type>
    97   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type, void>::type
     112  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
    98113  x(point_type& point, coordinate_type value) { set(point, HORIZONTAL, value); }
     114
     115  struct y_p3d_y : gtl_yes {};
     116
    99117  template <typename point_type, typename coordinate_type>
    100   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type, void>::type
     118  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
    101119  y(point_type& point, coordinate_type value) { set(point, VERTICAL, value); }
     120
     121  struct y_p3d_z2 : gtl_yes {};
     122
    102123  template <typename point_type, typename coordinate_type>
    103   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type, void>::type
     124  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
    104125  z(point_type& point, coordinate_type value) { set(point, PROXIMAL, value); }
     126
     127  struct y_p3d_equiv : gtl_yes {};
    105128
    106129  template <typename T, typename T2>
    107130  typename enable_if<
    108     typename gtl_and< typename gtl_same_type<point_3d_concept, typename geometry_concept<T>::type>::type,
     131    typename gtl_and_3<y_p3d_equiv, typename gtl_same_type<point_3d_concept, typename geometry_concept<T>::type>::type,
    109132                       typename gtl_same_type<point_3d_concept, typename geometry_concept<T2>::type>::type>::type,
    110133    bool>::type
     
    113136  }
    114137
    115   template <typename point_type_1, typename point_type_2>
    116   typename enable_if< typename gtl_and<  typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_1>::type>::type,
     138  struct y_p3d_man_dist : gtl_yes {};
     139
     140  template <typename point_type_1, typename point_type_2>
     141  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,
    117142                                          typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
    118143                       typename point_3d_difference_type<point_type_1>::type>::type
     
    122147  }
    123148
    124   template <typename point_type_1, typename point_type_2>
    125   typename enable_if< typename gtl_and<  typename is_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
     149  struct y_p3d_dist : gtl_yes {};
     150
     151  template <typename point_type_1, typename point_type_2>
     152  typename enable_if< typename gtl_and_3<y_p3d_dist, typename is_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
    126153                                          typename is_point_3d_concept<typename geometry_concept<point_type_2>::type>::type>::type,
    127154                       typename point_3d_difference_type<point_type_1>::type>::type
     
    133160  }
    134161
    135   template <typename point_type_1, typename point_type_2>
    136   typename enable_if< typename gtl_and< 
     162  struct y_p3d_dist2 : gtl_yes {};
     163
     164  template <typename point_type_1, typename point_type_2>
     165  typename enable_if< typename gtl_and_3< y_p3d_dist2,
    137166    typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_1>::type>::type,
    138167    typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
     
    142171    return_value pdist = (return_value)euclidean_distance(point1, point2, PROXIMAL);
    143172    pdist *= pdist;
    144     return sqrt((return_value)distance_squared(point1, point2) + pdist);
     173    return sqrt((double)(distance_squared(point1, point2) + pdist));
    145174  }
    146175 
    147   template <typename point_type_1, typename point_type_2>
    148   typename enable_if< typename gtl_and< 
     176  struct y_p3d_convolve : gtl_yes {};
     177
     178  template <typename point_type_1, typename point_type_2>
     179  typename enable_if< typename gtl_and_3<  y_p3d_convolve,
    149180    typename is_mutable_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
    150181    typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
     
    157188  }
    158189 
     190  struct y_p3d_deconvolve : gtl_yes {};
     191
    159192  template <typename point_type_1, typename point_type_2>
    160193  typename enable_if<
    161     typename gtl_and<  typename is_mutable_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
     194    typename gtl_and_3<y_p3d_deconvolve,  typename is_mutable_point_3d_concept<typename geometry_concept<point_type_1>::type>::type,
    162195                       typename gtl_same_type<point_3d_concept, typename geometry_concept<point_type_2>::type>::type>::type,
    163196    point_type_1>::type &
     
    169202  }
    170203
     204  struct y_p3d_scale_up : gtl_yes {};
     205
    171206  template <typename point_type>
    172   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type,
     207  typename enable_if< typename gtl_and<y_p3d_scale_up, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
    173208                       point_type>::type &
    174209  scale_up(point_type& point,
     
    180215  }
    181216
     217  struct y_p3d_scale_down : gtl_yes {};
     218
    182219  template <typename point_type>
    183   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type,
     220  typename enable_if< typename gtl_and<y_p3d_scale_down, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
    184221                       point_type>::type &
    185222  scale_down(point_type& point,
     
    193230  }
    194231
     232  struct y_p3d_scale : gtl_yes {};
     233
    195234  template <typename point_type, typename scaling_type>
    196   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type,
     235  typename enable_if< typename gtl_and<y_p3d_scale, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
    197236                       point_type>::type &
    198237  scale(point_type& point,
     
    207246  }
    208247
     248  struct y_p3d_transform : gtl_yes {};
     249
    209250  template <typename point_type, typename transformation_type>
    210   typename enable_if< typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type,
     251  typename enable_if< typename gtl_and<y_p3d_transform, typename is_mutable_point_3d_concept<typename geometry_concept<point_type>::type>::type>::type,
    211252                       point_type>::type &
    212253  transform(point_type& point, const transformation_type& transformation) {
  • sandbox/gtl/boost/polygon/point_concept.hpp

    r54345 r54797  
    6464
    6565  template <typename T>
    66   typename enable_if< typename gtl_if<typename is_point_concept<typename geometry_concept<T>::type>::type>::type,
    67       typename point_coordinate_type<T>::type >::type
    68   get(const T& point, orientation_2d orient) {
     66  typename point_coordinate_type<T>::type
     67  get(const T& point, orientation_2d orient,
     68  typename enable_if< typename gtl_if<typename is_point_concept<typename geometry_concept<T>::type>::type>::type>::type *ptr = 0
     69  ) {
    6970    return point_traits<T>::get(point, orient);
    7071  }
    7172 
    7273  template <typename T, typename coordinate_type>
    73   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<T>::type>::type, void>::type
    74   set(T& point, orientation_2d orient, coordinate_type value) {
     74  void
     75  set(T& point, orientation_2d orient, coordinate_type value,
     76  typename enable_if<typename is_mutable_point_concept<typename geometry_concept<T>::type>::type>::type *ptr = 0
     77  ) {
    7578    point_mutable_traits<T>::set(point, orient, value);
    7679  }
    7780 
    7881  template <typename T, typename coordinate_type1, typename coordinate_type2>
    79   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<T>::type>::type,
    80                       T>::type
    81   construct(coordinate_type1 x_value, coordinate_type2 y_value) {
     82  T
     83  construct(coordinate_type1 x_value, coordinate_type2 y_value,
     84  typename enable_if<typename is_mutable_point_concept<typename geometry_concept<T>::type>::type>::type *ptr = 0
     85  ) {
    8286    return point_mutable_traits<T>::construct(x_value, y_value);
    8387  }
    8488
    8589  template <typename T1, typename T2>
     90  T1&
     91  assign(T1& lvalue, const T2& rvalue,
    8692  typename enable_if< typename gtl_and< typename is_mutable_point_concept<typename geometry_concept<T1>::type>::type,
    87                                          typename is_point_concept<typename geometry_concept<T2>::type>::type>::type,
    88                        T1>::type &
    89   assign(T1& lvalue, const T2& rvalue) {
     93                                         typename is_point_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0
     94  ) {
    9095    set(lvalue, HORIZONTAL, get(rvalue, HORIZONTAL));
    9196    set(lvalue, VERTICAL, get(rvalue, VERTICAL));
     
    9398  }
    9499
     100  struct y_p_x : gtl_yes {};
     101
    95102  template <typename point_type>
    96   typename enable_if< typename is_point_concept<typename geometry_concept<point_type>::type>::type,
     103  typename enable_if< typename gtl_and<y_p_x, typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
    97104                       typename point_traits<point_type>::coordinate_type >::type
    98105  x(const point_type& point) {
     
    100107  }
    101108
     109  struct y_p_y : gtl_yes {};
     110
    102111  template <typename point_type>
    103   typename enable_if< typename is_point_concept<typename geometry_concept<point_type>::type>::type,
     112  typename enable_if< typename gtl_and<y_p_y, typename is_point_concept<typename geometry_concept<point_type>::type>::type>::type,
    104113                       typename point_traits<point_type>::coordinate_type >::type
    105114  y(const point_type& point) {
     
    107116  }
    108117
     118  struct y_p_sx : gtl_yes {};
     119
    109120  template <typename point_type, typename coordinate_type>
    110   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
     121  typename enable_if<typename gtl_and<y_p_sx, typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type,
    111122                      void>::type
    112123  x(point_type& point, coordinate_type value) {
     
    114125  }
    115126
     127  struct y_p_sy : gtl_yes {};
     128
    116129  template <typename point_type, typename coordinate_type>
    117   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
     130  typename enable_if<typename gtl_and<y_p_sy, typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type,
    118131                      void>::type
    119132  y(point_type& point, coordinate_type value) {
     
    122135
    123136  template <typename T, typename T2>
    124   typename enable_if< typename gtl_and<typename gtl_same_type<point_concept, typename geometry_concept<T>::type>::type,
    125                                         typename is_point_concept<typename geometry_concept<T2>::type>::type>::type,
    126                        bool>::type
    127   equivalence(const T& point1, const T2& point2) {
     137  bool
     138  equivalence(const T& point1, const T2& point2,
     139    typename enable_if< typename gtl_and<typename gtl_same_type<point_concept, typename geometry_concept<T>::type>::type,
     140        typename is_point_concept<typename geometry_concept<T2>::type>::type>::type>::type *ptr = 0
     141  ) {
    128142    typename point_traits<T>::coordinate_type x1 = x(point1);
    129143    typename point_traits<T2>::coordinate_type x2 = get(point2, HORIZONTAL);
     
    134148
    135149  template <typename point_type_1, typename point_type_2>
     150  typename point_difference_type<point_type_1>::type
     151  manhattan_distance(const point_type_1& point1, const point_type_2& point2,
    136152  typename enable_if< typename gtl_and<typename gtl_same_type<point_concept, typename geometry_concept<point_type_1>::type>::type,
    137                                         typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
    138                        typename point_difference_type<point_type_1>::type>::type
    139   manhattan_distance(const point_type_1& point1, const point_type_2& point2) {
     153  typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type>::type *ptr = 0) {
    140154    return euclidean_distance(point1, point2, HORIZONTAL) + euclidean_distance(point1, point2, VERTICAL);
    141155  }
    142156 
    143   template <typename point_type_1, typename point_type_2>
    144   typename enable_if< typename gtl_and<typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
    145                                         typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
    146                        typename point_difference_type<point_type_1>::type>::type
     157  struct y_i_ed1 : gtl_yes {};
     158
     159  template <typename point_type_1, typename point_type_2>
     160  typename enable_if< typename gtl_and_3<y_i_ed1, typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
     161  typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
     162  typename point_difference_type<point_type_1>::type>::type
    147163  euclidean_distance(const point_type_1& point1, const point_type_2& point2, orientation_2d orient) {
    148164    typename coordinate_traits<typename point_traits<point_type_1>::coordinate_type>::coordinate_difference return_value =
     
    151167  }
    152168 
    153   template <typename point_type_1, typename point_type_2>
    154   typename enable_if< typename gtl_and<typename gtl_same_type<point_concept, typename geometry_concept<point_type_1>::type>::type,
    155                                         typename gtl_same_type<point_concept, typename geometry_concept<point_type_2>::type>::type>::type,
    156                        typename point_distance_type<point_type_1>::type>::type
     169  struct y_i_ed2 : gtl_yes {};
     170
     171  template <typename point_type_1, typename point_type_2>
     172  typename enable_if< typename gtl_and_3<y_i_ed2, typename gtl_same_type<point_concept, typename geometry_concept<point_type_1>::type>::type,
     173  typename gtl_same_type<point_concept, typename geometry_concept<point_type_2>::type>::type>::type,
     174  typename point_distance_type<point_type_1>::type>::type
    157175  euclidean_distance(const point_type_1& point1, const point_type_2& point2) {
    158176    typedef typename point_traits<point_type_1>::coordinate_type Unit;
    159     return sqrt((typename coordinate_traits<Unit>::coordinate_distance)(distance_squared(point1, point2)));
    160   }
    161  
    162   template <typename point_type_1, typename point_type_2>
    163   typename enable_if< typename gtl_and<typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
    164                                         typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type,
    165                        typename point_difference_type<point_type_1>::type>::type
    166   distance_squared(const point_type_1& point1, const point_type_2& point2) {
     177    return sqrt((double)(distance_squared(point1, point2)));
     178  }
     179 
     180  template <typename point_type_1, typename point_type_2>
     181  typename point_difference_type<point_type_1>::type
     182  distance_squared(const point_type_1& point1, const point_type_2& point2,
     183    typename enable_if< typename gtl_and<typename is_point_concept<typename geometry_concept<point_type_1>::type>::type,
     184        typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type>::type *ptr = 0
     185  ) {
    167186    typedef typename point_traits<point_type_1>::coordinate_type Unit;
    168187    typename coordinate_traits<Unit>::coordinate_difference dx = euclidean_distance(point1, point2, HORIZONTAL);
     
    174193
    175194  template <typename point_type_1, typename point_type_2>
     195  point_type_1 &
     196  convolve(point_type_1& lvalue, const point_type_2& rvalue,
    176197  typename enable_if< typename gtl_and<typename is_mutable_point_concept<typename geometry_concept<point_type_1>::type>::type,
    177                                         typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type, point_type_1>::type &
    178   convolve(point_type_1& lvalue, const point_type_2& rvalue) {
     198  typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type>::type *ptr = 0
     199  ) {
    179200    x(lvalue, x(lvalue) + x(rvalue));
    180201    y(lvalue, y(lvalue) + y(rvalue));
     
    183204 
    184205  template <typename point_type_1, typename point_type_2>
     206  point_type_1 &
     207  deconvolve(point_type_1& lvalue, const point_type_2& rvalue,
    185208  typename enable_if< typename gtl_and<typename is_mutable_point_concept<typename geometry_concept<point_type_1>::type>::type,
    186                                         typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type, point_type_1>::type &
    187   deconvolve(point_type_1& lvalue, const point_type_2& rvalue) {
     209  typename is_point_concept<typename geometry_concept<point_type_2>::type>::type>::type>::type *ptr = 0
     210  ) {
    188211    x(lvalue, x(lvalue) - x(rvalue));
    189212    y(lvalue, y(lvalue) - y(rvalue));
     
    192215 
    193216  template <typename point_type, typename coord_type>
    194   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
    195                       point_type>::type &
    196   scale_up(point_type& point, coord_type factor) {
     217  point_type &
     218  scale_up(point_type& point, coord_type factor,
     219  typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
     220  ) {
    197221    typedef typename point_traits<point_type>::coordinate_type Unit;
    198222    x(point, x(point) * (Unit)factor);
     
    202226
    203227  template <typename point_type, typename coord_type>
    204   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
    205                       point_type>::type &
    206   scale_down(point_type& point, coord_type factor) {
     228  point_type &
     229  scale_down(point_type& point, coord_type factor,
     230  typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
     231  ) {
    207232    typedef typename point_traits<point_type>::coordinate_type Unit;
    208233    typedef typename coordinate_traits<Unit>::coordinate_distance dt;
     
    213238
    214239  template <typename point_type, typename scaling_type>
    215   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
    216                       point_type>::type &
     240  point_type &
    217241  scale(point_type& point,
    218         const scaling_type& scaling) {
     242        const scaling_type& scaling,
     243                typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
     244                ) {
    219245    typedef typename point_traits<point_type>::coordinate_type Unit;
    220246    Unit x_(x(point)), y_(y(point));
     
    226252
    227253  template <typename point_type, typename transformation_type>
    228   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
    229                       point_type>::type &
    230   transform(point_type& point, const transformation_type& transformation) {
     254  point_type &
     255  transform(point_type& point, const transformation_type& transformation,
     256  typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
     257  ) {
    231258    typedef typename point_traits<point_type>::coordinate_type Unit;
    232259    Unit x_(x(point)), y_(y(point));
     
    238265
    239266  template <typename point_type>
    240   typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type,
    241                       point_type>::type &
     267  point_type &
    242268  move(point_type& point, orientation_2d orient,
    243        typename point_traits<point_type>::coordinate_type displacement) {
     269       typename point_traits<point_type>::coordinate_type displacement,
     270           typename enable_if<typename is_mutable_point_concept<typename geometry_concept<point_type>::type>::type>::type *ptr = 0
     271           ) {
    244272    typedef typename point_traits<point_type>::coordinate_type Unit;
    245273    Unit v(get(point, orient));
  • sandbox/gtl/boost/polygon/point_data.hpp

    r54117 r54797  
    6464  };
    6565
    66   template <class T>
    67   std::ostream& operator << (std::ostream& o, const point_data<T>& r)
    68   {
    69     return o << r.get(HORIZONTAL) << ' ' << r.get(VERTICAL);
    70   }
    7166}
    7267}
  • sandbox/gtl/boost/polygon/polygon.hpp

    r54345 r54797  
    1616#include <set>
    1717#include <list>
    18 #include <iostream>
     18//#include <iostream>
    1919#include <algorithm>
    2020#include <limits>
  • sandbox/gtl/boost/polygon/polygon_45_data.hpp

    r54345 r54797  
    4747  inline bool operator==(const polygon_45_data& that) const {
    4848    if(coords_.size() != that.coords_.size()) return false;
    49     for(unsigned int i = 0; i < coords_.size(); ++i) {
     49    for(std::size_t i = 0; i < coords_.size(); ++i) {
    5050      if(coords_[i] != that.coords_[i]) return false;
    5151    }
     
    6767};
    6868
    69   template <typename T>
    70   std::ostream& operator<<(std::ostream& o, const polygon_45_data<T>& poly) {
    71     o << "Polygon { ";
    72     for(typename polygon_45_data<T>::iterator_type itr = poly.begin();
    73         itr != poly.end(); ++itr) {
    74       if(itr != poly.begin()) o << ", ";
    75       o << (*itr).get(HORIZONTAL) << " " << (*itr).get(VERTICAL);
    76     }
    77     o << " } ";
    78     return o;
    79   }
     69
    8070}
    8171}
  • sandbox/gtl/boost/polygon/polygon_45_set_concept.hpp

    r54345