mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Remove any Perl related code from libslic3r
This commit is contained in:
parent
3fac8cd77e
commit
4913e90e10
105 changed files with 907 additions and 1066 deletions
|
@ -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
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue