Move semantics on MultiPoint, Polygon, Polyline.

Append methods on Polyline.
squared length function on point->DistanceTo
This commit is contained in:
bubnikv 2017-01-19 13:43:29 +01:00
parent 50cdf8e6d1
commit 0b90ebd74e
6 changed files with 69 additions and 35 deletions

View file

@ -14,14 +14,19 @@ class Polygon;
typedef std::vector<Polygon> Polygons;
class Polygon : public MultiPoint {
public:
public:
operator Polygons() const;
operator Polyline() const;
Point& operator[](Points::size_type idx);
const Point& operator[](Points::size_type idx) const;
Polygon() {};
explicit Polygon(const Points &points): MultiPoint(points) {};
Polygon() {}
explicit Polygon(const Points &points): MultiPoint(points) {}
Polygon(const Polygon &other) : MultiPoint(other.points) {}
Polygon(Polygon &&other) : MultiPoint(std::move(other.points)) {}
Polygon& operator=(const Polygon &other) { points = other.points; return *this; }
Polygon& operator=(Polygon &&other) { points = std::move(other.points); return *this; }
Point last_point() const;
virtual Lines lines() const;
Polyline split_at_vertex(const Point &point) const;