Adopt XS containers everywhere (incomplete work)

This commit is contained in:
Alessandro Ranellucci 2013-07-16 09:49:34 +02:00
parent 339ba9e5c3
commit 9b582a11ff
30 changed files with 130 additions and 311 deletions

View file

@ -2,51 +2,17 @@ package Slic3r::ExtrusionLoop;
use strict;
use warnings;
use Slic3r::Geometry qw(same_point);
sub polygon { $_[0] }
# class or object method
sub pack {
my $self = shift;
if (ref $self) {
return $self;
} else {
return $self->new(@_);
}
}
# no-op
sub unpack { $_[0] }
sub split_at_index {
my $self = shift;
return Slic3r::ExtrusionPath->new(
polyline => $self->as_polygon->split_at_index(@_),
role => $self->role,
flow_spacing => $self->flow_spacing,
height => $self->height,
);
}
sub split_at {
my $self = shift;
return Slic3r::ExtrusionPath->new(
polyline => $self->as_polygon->split_at(@_),
polyline => $self->polygon->split_at(@_),
role => $self->role,
flow_spacing => $self->flow_spacing,
height => $self->height,
);
}
sub split_at_first_point {
my $self = shift;
return $self->split_at_index(0);
}
sub first_point {
my $self = shift;
return $self->polygon->[0];