Remove any Perl related code from libslic3r

This commit is contained in:
Alessandro Ranellucci 2015-12-08 00:39:54 +01:00
parent 3fac8cd77e
commit 4913e90e10
105 changed files with 907 additions and 1066 deletions

View file

@ -154,51 +154,4 @@ MultiPoint::_douglas_peucker(const Points &points, const double tolerance)
return results;
}
#ifdef SLIC3RXS
void
MultiPoint::from_SV(SV* poly_sv)
{
AV* poly_av = (AV*)SvRV(poly_sv);
const unsigned int num_points = av_len(poly_av)+1;
this->points.resize(num_points);
for (unsigned int i = 0; i < num_points; i++) {
SV** point_sv = av_fetch(poly_av, i, 0);
this->points[i].from_SV_check(*point_sv);
}
}
void
MultiPoint::from_SV_check(SV* poly_sv)
{
if (sv_isobject(poly_sv) && (SvTYPE(SvRV(poly_sv)) == SVt_PVMG)) {
*this = *(MultiPoint*)SvIV((SV*)SvRV( poly_sv ));
} else {
this->from_SV(poly_sv);
}
}
SV*
MultiPoint::to_AV() {
const unsigned int num_points = this->points.size();
AV* av = newAV();
if (num_points > 0) av_extend(av, num_points-1);
for (unsigned int i = 0; i < num_points; i++) {
av_store(av, i, perl_to_SV_ref(this->points[i]));
}
return newRV_noinc((SV*)av);
}
SV*
MultiPoint::to_SV_pureperl() const {
const unsigned int num_points = this->points.size();
AV* av = newAV();
if (num_points > 0) av_extend(av, num_points-1);
for (unsigned int i = 0; i < num_points; i++) {
av_store(av, i, this->points[i].to_SV_pureperl());
}
return newRV_noinc((SV*)av);
}
#endif
}