Rest of the path chaining has been replaced with the new algorithm.

PolylineCollection.cpp/hpp was removed, use Polylines instead.
Various first_point() / last_point() now return references, not copies.
This commit is contained in:
bubnikv 2019-09-27 18:17:21 +02:00
parent 4b35ebe6e5
commit 331c187b39
29 changed files with 266 additions and 364 deletions

View file

@ -62,9 +62,9 @@ public:
operator Polylines() const;
operator Line() const;
Point last_point() const override { return this->points.back(); }
const Point& last_point() const override { return this->points.back(); }
Point leftmost_point() const;
const Point& leftmost_point() const;
virtual Lines lines() const;
void clip_end(double distance);
void clip_start(double distance);
@ -77,6 +77,15 @@ public:
bool is_straight() const;
};
// Don't use this class in production code, it is used exclusively by the Perl binding for unit tests!
#ifdef PERL_UCHAR_MIN
class PolylineCollection
{
public:
Polylines polylines;
};
#endif /* PERL_UCHAR_MIN */
extern BoundingBox get_extents(const Polyline &polyline);
extern BoundingBox get_extents(const Polylines &polylines);
@ -129,6 +138,8 @@ inline void polylines_append(Polylines &dst, Polylines &&src)
}
}
const Point& leftmost_point(const Polylines &polylines);
bool remove_degenerate(Polylines &polylines);
class ThickPolyline : public Polyline {