File indexing completed on 2025-01-30 09:55:23
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_POLYGON_POLYGON_90_DATA_HPP
0009 #define BOOST_POLYGON_POLYGON_90_DATA_HPP
0010 namespace boost { namespace polygon{
0011 struct polygon_90_concept;
0012 template <typename T>
0013 class polygon_90_data {
0014 public:
0015 typedef polygon_90_concept geometry_type;
0016 typedef T coordinate_type;
0017 typedef typename std::vector<coordinate_type>::const_iterator compact_iterator_type;
0018 typedef iterator_compact_to_points<compact_iterator_type, point_data<coordinate_type> > iterator_type;
0019 typedef typename coordinate_traits<T>::area_type area_type;
0020
0021 inline polygon_90_data() : coords_() {}
0022
0023
0024
0025 template<class iT>
0026 inline polygon_90_data& set(iT begin_point, iT end_point) {
0027 return set_compact(iterator_points_to_compact<iT, typename std::iterator_traits<iT>::value_type>(begin_point, end_point),
0028 iterator_points_to_compact<iT, typename std::iterator_traits<iT>::value_type>(end_point, end_point));
0029 }
0030
0031 template<class iT>
0032 inline polygon_90_data& set_compact(iT input_begin, iT input_end) {
0033 coords_.clear();
0034 while(input_begin != input_end) {
0035 coords_.insert(coords_.end(), *input_begin);
0036 ++input_begin;
0037 }
0038 return *this;
0039 }
0040
0041
0042 inline polygon_90_data(const polygon_90_data& that) : coords_(that.coords_) {}
0043
0044
0045 inline polygon_90_data& operator=(const polygon_90_data& that) {
0046 coords_ = that.coords_;
0047 return *this;
0048 }
0049
0050 template <typename T2>
0051 inline polygon_90_data& operator=(const T2& rvalue);
0052
0053
0054 inline bool operator==(const polygon_90_data& that) const {
0055 return coords_ == that.coords_;
0056 }
0057
0058
0059 inline iterator_type begin() const { return iterator_type(coords_.begin(), coords_.end()); }
0060
0061
0062 inline iterator_type end() const { return iterator_type(coords_.end(), coords_.end()); }
0063
0064
0065 inline compact_iterator_type begin_compact() const { return coords_.begin(); }
0066
0067
0068 inline compact_iterator_type end_compact() const { return coords_.end(); }
0069
0070 inline std::size_t size() const { return coords_.size(); }
0071
0072 private:
0073 std::vector<coordinate_type> coords_;
0074 };
0075
0076
0077 }
0078 }
0079 #endif