Ported various clipper unit tests from Perl to C++,

the clipper Perl unit tests were removed.
This commit is contained in:
bubnikv 2019-10-25 17:07:55 +02:00
parent d70b45a51b
commit f8dc74374c
6 changed files with 237 additions and 283 deletions

View file

@ -22,7 +22,8 @@ public:
const Point& operator[](Points::size_type idx) const { return this->points[idx]; }
Polygon() {}
explicit Polygon(const Points &points): MultiPoint(points) {}
explicit Polygon(const Points &points) : MultiPoint(points) {}
Polygon(std::initializer_list<Point> points) : MultiPoint(points) {}
Polygon(const Polygon &other) : MultiPoint(other.points) {}
Polygon(Polygon &&other) : MultiPoint(std::move(other.points)) {}
static Polygon new_scale(const std::vector<Vec2d> &points) {
@ -66,6 +67,10 @@ public:
Point point_projection(const Point &point) const;
};
inline bool operator==(const Polygon &lhs, const Polygon &rhs) { return lhs.points == rhs.points; }
inline bool operator!=(const Polygon &lhs, const Polygon &rhs) { return lhs.points != rhs.points; }
extern BoundingBox get_extents(const Polygon &poly);
extern BoundingBox get_extents(const Polygons &polygons);
extern BoundingBox get_extents_rotated(const Polygon &poly, double angle);