123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #ifndef BOOST_POLYGON_ITERATOR_POINTS_TO_COMPACT_HPP
- #define BOOST_POLYGON_ITERATOR_POINTS_TO_COMPACT_HPP
- namespace boost { namespace polygon{
- template <typename iT, typename point_type>
- class iterator_points_to_compact {
- private:
- iT iter_, iterEnd_;
- orientation_2d orient_;
- mutable typename point_traits<point_type>::coordinate_type coord_;
- public:
- typedef typename point_traits<point_type>::coordinate_type coordinate_type;
- typedef std::forward_iterator_tag iterator_category;
- typedef coordinate_type value_type;
- typedef std::ptrdiff_t difference_type;
- typedef const coordinate_type* pointer;
- typedef const coordinate_type& reference;
- inline iterator_points_to_compact() : iter_(), iterEnd_(), orient_(), coord_() {}
- inline iterator_points_to_compact(iT iter, iT iterEnd) :
- iter_(iter), iterEnd_(iterEnd), orient_(HORIZONTAL), coord_() {}
- inline iterator_points_to_compact(const iterator_points_to_compact& that) :
- iter_(that.iter_), iterEnd_(that.iterEnd_), orient_(that.orient_), coord_(that.coord_) {}
-
- inline iterator_points_to_compact& operator++() {
-
- ++iter_;
-
- orient_.turn_90();
-
-
-
-
- return *this;
- }
- inline const iterator_points_to_compact operator++(int) {
- iT tmp(*this);
- ++(*this);
- return tmp;
- }
- inline bool operator==(const iterator_points_to_compact& that) const {
- return (iter_ == that.iter_);
- }
- inline bool operator!=(const iterator_points_to_compact& that) const {
- return (iter_ != that.iter_);
- }
- inline reference operator*() const { coord_ = get(*iter_, orient_);
- return coord_;
- }
- };
- }
- }
- #endif
|