Ticket #8575: 8575.diff

File 8575.diff, 4.8 KB (added by Andrii Sydorchuk, 9 years ago)
  • transform.hpp

     
    1 // Boost.Polygon library point_data.hpp header file
     1// Boost.Polygon library transform.hpp header file
    22
    33// Copyright (c) Intel Corporation 2008.
    44// Copyright (c) 2008-2012 Simonson Lucanus.
  • detail/polygon_45_touch.hpp

     
    6565      inline CountTouch& operator=(const CountTouch& count) { counts = count.counts; return *this; }
    6666      inline int& operator[](int index) {
    6767        std::vector<std::pair<int, int> >::iterator itr =
    68             std::lower_bound(counts.begin(), counts.end(),
    69                              std::make_pair(index, int(0)));
     68            std::lower_bound(counts.begin(), counts.end(),
     69                             std::make_pair(index, int(0)));
    7070        if(itr != counts.end() && itr->first == index) {
    7171            return itr->second;
    7272        }
  • detail/polygon_arbitrary_formation.hpp

     
    326326          } else if(elm1y == elm2y) {
    327327            if(elm1 == elm2)
    328328              return false;
    329             retval = less_slope(elm1.second.get(HORIZONTAL) - elm1.first.get(HORIZONTAL),
    330                                      elm1.second.get(VERTICAL) - elm1.first.get(VERTICAL),
    331                                      elm2.second.get(HORIZONTAL) - elm2.first.get(HORIZONTAL),
    332                                      elm2.second.get(VERTICAL) - elm2.first.get(VERTICAL));
    333             retval = ((*justBefore_) != 0) ^ retval;
     329            typedef typename coordinate_traits<Unit>::manhattan_area_type at;
     330            at dx1 = at(elm1.second.get(HORIZONTAL)) - at(elm1.first.get(HORIZONTAL));
     331            at dy1 = at(elm1.second.get(VERTICAL)) - at(elm1.first.get(VERTICAL));
     332            at dx2 = at(elm2.second.get(HORIZONTAL)) - at(elm2.first.get(HORIZONTAL));
     333            at dy2 = at(elm2.second.get(VERTICAL)) - at(elm2.first.get(VERTICAL));
     334            retval = ((*justBefore_) != 0) ^ less_slope(dx1, dy1, dx2, dy2);
    334335          }
    335336        }
    336337        return retval;
     
    826827          } else if(elm1y == elm2y) {
    827828            if(elm1.pt == elm2.pt && elm1.other_pt == elm2.other_pt)
    828829              return false;
    829             retval = less_slope(elm1.other_pt.get(HORIZONTAL) - elm1.pt.get(HORIZONTAL),
    830                                      elm1.other_pt.get(VERTICAL) - elm1.pt.get(VERTICAL),
    831                                      elm2.other_pt.get(HORIZONTAL) - elm2.pt.get(HORIZONTAL),
    832                                      elm2.other_pt.get(VERTICAL) - elm2.pt.get(VERTICAL));
    833             retval = ((*justBefore_) != 0) ^ retval;
     830            typedef typename coordinate_traits<Unit>::manhattan_area_type at;
     831            at dx1 = at(elm1.other_pt.get(HORIZONTAL)) - at(elm1.pt.get(HORIZONTAL));
     832            at dy1 = at(elm1.other_pt.get(VERTICAL)) - at(elm1.pt.get(VERTICAL));
     833            at dx2 = at(elm2.other_pt.get(HORIZONTAL)) - at(elm2.pt.get(HORIZONTAL));
     834            at dy2 = at(elm2.other_pt.get(VERTICAL)) - at(elm2.pt.get(VERTICAL));
     835            retval = ((*justBefore_) != 0) ^ less_slope(dx1, dy1, dx2, dy2);
    834836          }
    835837        }
    836838        return retval;
     
    12331235      inline less_incoming_count(Point point) : pt_(point) {}
    12341236      inline bool operator () (const std::pair<std::pair<std::pair<Point, Point>, int>, active_tail_arbitrary*>& elm1,
    12351237                               const std::pair<std::pair<std::pair<Point, Point>, int>, active_tail_arbitrary*>& elm2) const {
    1236         Unit dx1 = elm1.first.first.first.get(HORIZONTAL) - elm1.first.first.second.get(HORIZONTAL);
    1237         Unit dx2 = elm2.first.first.first.get(HORIZONTAL) - elm2.first.first.second.get(HORIZONTAL);
    1238         Unit dy1 = elm1.first.first.first.get(VERTICAL) - elm1.first.first.second.get(VERTICAL);
    1239         Unit dy2 = elm2.first.first.first.get(VERTICAL) - elm2.first.first.second.get(VERTICAL);
     1238        typedef typename coordinate_traits<Unit>::manhattan_area_type at;
     1239        at dx1 = at(elm1.first.first.first.get(HORIZONTAL)) - at(elm1.first.first.second.get(HORIZONTAL));
     1240        at dx2 = at(elm2.first.first.first.get(HORIZONTAL)) - at(elm2.first.first.second.get(HORIZONTAL));
     1241        at dy1 = at(elm1.first.first.first.get(VERTICAL)) - at(elm1.first.first.second.get(VERTICAL));
     1242        at dy2 = at(elm2.first.first.first.get(VERTICAL)) - at(elm2.first.first.second.get(VERTICAL));
    12401243        return scanline_base<Unit>::less_slope(dx1, dy1, dx2, dy2);
    12411244      }
    12421245    };