Removed useless thing added in e79aa2e81c

This commit is contained in:
Alessandro Ranellucci 2014-12-17 00:52:01 +01:00
parent c00061678b
commit 9264db7ecd
8 changed files with 8 additions and 16 deletions

View File

@ -232,7 +232,7 @@ sub make_fill {
my $extrusion_height = $is_bridge ? $flow->width : $h; my $extrusion_height = $is_bridge ? $flow->width : $h;
push @fills, my $collection = Slic3r::ExtrusionPath::Collection->new($role); push @fills, my $collection = Slic3r::ExtrusionPath::Collection->new;
$collection->no_sort($params->{no_sort}); $collection->no_sort($params->{no_sort});
$collection->append( $collection->append(
map Slic3r::ExtrusionPath->new( map Slic3r::ExtrusionPath->new(
@ -250,7 +250,7 @@ sub make_fill {
# add thin fill regions # add thin fill regions
foreach my $thin_fill (@{$layerm->thin_fills}) { foreach my $thin_fill (@{$layerm->thin_fills}) {
push @fills, Slic3r::ExtrusionPath::Collection->new($thin_fill->role, $thin_fill); push @fills, Slic3r::ExtrusionPath::Collection->new($thin_fill);
push @fills_ordering_points, $thin_fill->first_point; push @fills_ordering_points, $thin_fill->first_point;
} }

View File

@ -246,7 +246,7 @@ sub make_perimeters {
my ($polynodes, $depth, $is_contour) = @_; my ($polynodes, $depth, $is_contour) = @_;
# convert all polynodes to ExtrusionLoop objects # convert all polynodes to ExtrusionLoop objects
my $collection = Slic3r::ExtrusionPath::Collection->new(EXTR_ROLE_PERIMETER); # temporary collection my $collection = Slic3r::ExtrusionPath::Collection->new; # temporary collection
my @children = (); my @children = ();
foreach my $polynode (@$polynodes) { foreach my $polynode (@$polynodes) {
my $polygon = ($polynode->{outer} // $polynode->{hole})->clone; my $polygon = ($polynode->{outer} // $polynode->{hole})->clone;
@ -303,7 +303,7 @@ sub make_perimeters {
# (clone because the collection gets DESTROY'ed) # (clone because the collection gets DESTROY'ed)
# We allow polyline reversal because Clipper may have randomly # We allow polyline reversal because Clipper may have randomly
# reversed polylines during clipping. # reversed polylines during clipping.
my $collection = Slic3r::ExtrusionPath::Collection->new(EXTR_ROLE_PERIMETER, @paths); # temporary collection my $collection = Slic3r::ExtrusionPath::Collection->new(@paths); # temporary collection
@paths = map $_->clone, @{$collection->chained_path(0)}; @paths = map $_->clone, @{$collection->chained_path(0)};
} else { } else {
push @paths, Slic3r::ExtrusionPath->new( push @paths, Slic3r::ExtrusionPath->new(

View File

@ -146,7 +146,6 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
{ {
my $collection = Slic3r::ExtrusionPath::Collection->new( my $collection = Slic3r::ExtrusionPath::Collection->new(
EXTR_ROLE_PERIMETER,
map Slic3r::ExtrusionPath->new(polyline => $_, role => 0, mm3_per_mm => 1), map Slic3r::ExtrusionPath->new(polyline => $_, role => 0, mm3_per_mm => 1),
Slic3r::Polyline->new([0,15], [0,18], [0,20]), Slic3r::Polyline->new([0,15], [0,18], [0,20]),
Slic3r::Polyline->new([0,10], [0,8], [0,5]), Slic3r::Polyline->new([0,10], [0,8], [0,5]),
@ -159,7 +158,6 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
{ {
my $collection = Slic3r::ExtrusionPath::Collection->new( my $collection = Slic3r::ExtrusionPath::Collection->new(
EXTR_ROLE_PERIMETER,
map Slic3r::ExtrusionPath->new(polyline => $_, role => 0, mm3_per_mm => 1), map Slic3r::ExtrusionPath->new(polyline => $_, role => 0, mm3_per_mm => 1),
Slic3r::Polyline->new([15,0], [10,0], [4,0]), Slic3r::Polyline->new([15,0], [10,0], [4,0]),
Slic3r::Polyline->new([10,5], [15,5], [20,5]), Slic3r::Polyline->new([10,5], [15,5], [20,5]),

View File

@ -64,9 +64,9 @@ use overload
'fallback' => 1; 'fallback' => 1;
sub new { sub new {
my ($class, $type, @paths) = @_; my ($class, @paths) = @_;
my $self = $class->_new($type); my $self = $class->_new;
$self->append(@paths); $self->append(@paths);
return $self; return $self;
} }

View File

@ -5,7 +5,7 @@
namespace Slic3r { namespace Slic3r {
ExtrusionEntityCollection::ExtrusionEntityCollection(const ExtrusionEntityCollection& collection) ExtrusionEntityCollection::ExtrusionEntityCollection(const ExtrusionEntityCollection& collection)
: no_sort(collection.no_sort), role(collection.role), orig_indices(collection.orig_indices) : no_sort(collection.no_sort), orig_indices(collection.orig_indices)
{ {
this->entities.reserve(collection.entities.size()); this->entities.reserve(collection.entities.size());
for (ExtrusionEntitiesPtr::const_iterator it = collection.entities.begin(); it != collection.entities.end(); ++it) for (ExtrusionEntitiesPtr::const_iterator it = collection.entities.begin(); it != collection.entities.end(); ++it)
@ -23,7 +23,6 @@ void
ExtrusionEntityCollection::swap (ExtrusionEntityCollection &c) ExtrusionEntityCollection::swap (ExtrusionEntityCollection &c)
{ {
std::swap(this->entities, c.entities); std::swap(this->entities, c.entities);
std::swap(this->role, c.role);
std::swap(this->orig_indices, c.orig_indices); std::swap(this->orig_indices, c.orig_indices);
std::swap(this->no_sort, c.no_sort); std::swap(this->no_sort, c.no_sort);
} }

View File

@ -13,9 +13,7 @@ class ExtrusionEntityCollection : public ExtrusionEntity
ExtrusionEntitiesPtr entities; ExtrusionEntitiesPtr entities;
std::vector<size_t> orig_indices; // handy for XS std::vector<size_t> orig_indices; // handy for XS
bool no_sort; bool no_sort;
ExtrusionRole role;
ExtrusionEntityCollection(): no_sort(false) {}; ExtrusionEntityCollection(): no_sort(false) {};
ExtrusionEntityCollection(ExtrusionRole _role): no_sort(false), role(_role) {};
ExtrusionEntityCollection(const ExtrusionEntityCollection &collection); ExtrusionEntityCollection(const ExtrusionEntityCollection &collection);
ExtrusionEntityCollection& operator= (const ExtrusionEntityCollection &other); ExtrusionEntityCollection& operator= (const ExtrusionEntityCollection &other);
void swap (ExtrusionEntityCollection &c); void swap (ExtrusionEntityCollection &c);

View File

@ -27,7 +27,6 @@ my $loop = Slic3r::ExtrusionLoop->new_from_paths(
); );
my $collection = Slic3r::ExtrusionPath::Collection->new( my $collection = Slic3r::ExtrusionPath::Collection->new(
Slic3r::ExtrusionPath::EXTR_ROLE_FILL,
$path, $path,
); );
isa_ok $collection, 'Slic3r::ExtrusionPath::Collection', 'collection object with items in constructor'; isa_ok $collection, 'Slic3r::ExtrusionPath::Collection', 'collection object with items in constructor';
@ -58,7 +57,6 @@ is scalar(@{$collection->[1]}), 1, 'appended collection was duplicated';
{ {
my $collection = Slic3r::ExtrusionPath::Collection->new( my $collection = Slic3r::ExtrusionPath::Collection->new(
Slic3r::ExtrusionPath::EXTR_ROLE_FILL,
map Slic3r::ExtrusionPath->new(polyline => $_, role => 0, mm3_per_mm => 1), map Slic3r::ExtrusionPath->new(polyline => $_, role => 0, mm3_per_mm => 1),
Slic3r::Polyline->new([0,15], [0,18], [0,20]), Slic3r::Polyline->new([0,15], [0,18], [0,20]),
Slic3r::Polyline->new([0,10], [0,8], [0,5]), Slic3r::Polyline->new([0,10], [0,8], [0,5]),
@ -75,7 +73,6 @@ is scalar(@{$collection->[1]}), 1, 'appended collection was duplicated';
{ {
my $collection = Slic3r::ExtrusionPath::Collection->new( my $collection = Slic3r::ExtrusionPath::Collection->new(
Slic3r::ExtrusionPath::EXTR_ROLE_FILL,
map Slic3r::ExtrusionPath->new(polyline => $_, role => 0, mm3_per_mm => 1), map Slic3r::ExtrusionPath->new(polyline => $_, role => 0, mm3_per_mm => 1),
Slic3r::Polyline->new([15,0], [10,0], [4,0]), Slic3r::Polyline->new([15,0], [10,0], [4,0]),
Slic3r::Polyline->new([10,5], [15,5], [20,5]), Slic3r::Polyline->new([10,5], [15,5], [20,5]),

View File

@ -6,7 +6,7 @@
%} %}
%name{Slic3r::ExtrusionPath::Collection} class ExtrusionEntityCollection { %name{Slic3r::ExtrusionPath::Collection} class ExtrusionEntityCollection {
%name{_new} ExtrusionEntityCollection(ExtrusionRole role); %name{_new} ExtrusionEntityCollection();
void reverse(); void reverse();
void clear() void clear()
%code{% THIS->entities.clear(); %}; %code{% THIS->entities.clear(); %};