Ported from the playground branch. Various documentation and optimization.

This commit is contained in:
bubnikv 2016-09-13 13:30:00 +02:00
parent a5b7f14dfa
commit 620c6c7378
38 changed files with 586 additions and 92 deletions

View file

@ -1,3 +1,4 @@
#include "BoundingBox.hpp"
#include "Surface.hpp"
namespace Slic3r {
@ -54,4 +55,31 @@ Surface::is_bridge() const
|| this->surface_type == stInternalBridge;
}
BoundingBox get_extents(const Surface &surface)
{
return get_extents(surface.expolygon.contour);
}
BoundingBox get_extents(const Surfaces &surfaces)
{
BoundingBox bbox;
if (! surfaces.empty()) {
bbox = get_extents(surfaces.front());
for (size_t i = 1; i < surfaces.size(); ++ i)
bbox.merge(get_extents(surfaces[i]));
}
return bbox;
}
BoundingBox get_extents(const SurfacesPtr &surfaces)
{
BoundingBox bbox;
if (! surfaces.empty()) {
bbox = get_extents(*surfaces.front());
for (size_t i = 1; i < surfaces.size(); ++ i)
bbox.merge(get_extents(*surfaces[i]));
}
return bbox;
}
}