mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-20 10:50:33 -07:00
sla::Raster interface clarified and covered with tests.
Also renamed sla::SupportTreeAlgorithm to SupportTreeBuildsteps.
This commit is contained in:
@@ -21,37 +21,12 @@ std::string RasterWriter::createIniContent(const std::string& projectname) const
|
||||
return out;
|
||||
}
|
||||
|
||||
void RasterWriter::flpXY(ClipperLib::Polygon &poly)
|
||||
{
|
||||
for(auto& p : poly.Contour) std::swap(p.X, p.Y);
|
||||
std::reverse(poly.Contour.begin(), poly.Contour.end());
|
||||
|
||||
for(auto& h : poly.Holes) {
|
||||
for(auto& p : h) std::swap(p.X, p.Y);
|
||||
std::reverse(h.begin(), h.end());
|
||||
}
|
||||
}
|
||||
|
||||
void RasterWriter::flpXY(ExPolygon &poly)
|
||||
{
|
||||
for(auto& p : poly.contour.points) p = Point(p.y(), p.x());
|
||||
std::reverse(poly.contour.points.begin(), poly.contour.points.end());
|
||||
|
||||
for(auto& h : poly.holes) {
|
||||
for(auto& p : h.points) p = Point(p.y(), p.x());
|
||||
std::reverse(h.points.begin(), h.points.end());
|
||||
}
|
||||
}
|
||||
|
||||
RasterWriter::RasterWriter(const Raster::Resolution &res,
|
||||
const Raster::PixelDim &pixdim,
|
||||
const std::array<bool, 2> &mirror,
|
||||
double gamma)
|
||||
: m_res(res), m_pxdim(pixdim), m_mirror(mirror), m_gamma(gamma)
|
||||
{
|
||||
// PNG raster will implicitly do an Y mirror
|
||||
m_mirror[1] = !m_mirror[1];
|
||||
}
|
||||
RasterWriter::RasterWriter(const Raster::Resolution &res,
|
||||
const Raster::PixelDim & pixdim,
|
||||
const Raster::Trafo & trafo,
|
||||
double gamma)
|
||||
: m_res(res), m_pxdim(pixdim), m_trafo(trafo), m_gamma(gamma)
|
||||
{}
|
||||
|
||||
void RasterWriter::save(const std::string &fpath, const std::string &prjname)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user