Further rework of ClipperUtils: Replaced many to_polygons() /

to_expolygons() calls with templated ClipperUtils variants to avoid
memory allocation and copying.
This commit is contained in:
Vojtech Bubnik 2021-05-03 11:39:53 +02:00
parent 9fbba855ef
commit 09a80d954c
22 changed files with 437 additions and 398 deletions

View file

@ -90,7 +90,6 @@ public:
return *this;
}
operator Polygons() const { return this->expolygon; }
double area() const { return this->expolygon.area(); }
bool empty() const { return expolygon.empty(); }
void clear() { expolygon.clear(); }
@ -107,6 +106,16 @@ public:
typedef std::vector<Surface> Surfaces;
typedef std::vector<Surface*> SurfacesPtr;
inline Polygons to_polygons(const Surface &surface)
{
return to_polygons(surface.expolygon);
}
inline Polygons to_polygons(Surface &&surface)
{
return to_polygons(std::move(surface.expolygon));
}
inline Polygons to_polygons(const Surfaces &src)
{
size_t num = 0;