File indexing completed on 2025-01-18 09:47:59
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_POLYGON_POLYGON_45_DATA_HPP
0009 #define BOOST_POLYGON_POLYGON_45_DATA_HPP
0010 #include "isotropy.hpp"
0011 namespace boost { namespace polygon{
0012 struct polygon_45_concept;
0013 template <typename T> class polygon_data;
0014 template <typename T>
0015 class polygon_45_data {
0016 public:
0017 typedef polygon_45_concept geometry_type;
0018 typedef T coordinate_type;
0019 typedef typename std::vector<point_data<coordinate_type> >::const_iterator iterator_type;
0020 typedef typename coordinate_traits<T>::coordinate_distance area_type;
0021 typedef point_data<T> point_type;
0022
0023 inline polygon_45_data() : coords_() {}
0024
0025 template<class iT>
0026 inline polygon_45_data(iT input_begin, iT input_end) : coords_(input_begin, input_end) {}
0027
0028 template<class iT>
0029 inline polygon_45_data& set(iT input_begin, iT input_end) {
0030 coords_.clear();
0031 coords_.insert(coords_.end(), input_begin, input_end);
0032 return *this;
0033 }
0034
0035
0036 inline polygon_45_data(const polygon_45_data& that) : coords_(that.coords_) {}
0037
0038
0039 inline polygon_45_data& operator=(const polygon_45_data& that) {
0040 coords_ = that.coords_;
0041 return *this;
0042 }
0043
0044 template <typename T2>
0045 inline polygon_45_data& operator=(const T2& rvalue);
0046
0047 inline bool operator==(const polygon_45_data& that) const {
0048 if(coords_.size() != that.coords_.size()) return false;
0049 for(std::size_t i = 0; i < coords_.size(); ++i) {
0050 if(coords_[i] != that.coords_[i]) return false;
0051 }
0052 return true;
0053 }
0054
0055 inline bool operator!=(const polygon_45_data& that) const { return !((*this) == that); }
0056
0057
0058 inline iterator_type begin() const { return coords_.begin(); }
0059
0060
0061 inline iterator_type end() const { return coords_.end(); }
0062
0063 inline std::size_t size() const { return coords_.size(); }
0064
0065 public:
0066 std::vector<point_data<coordinate_type> > coords_;
0067 };
0068
0069
0070 }
0071 }
0072 #endif