Replaced Moose with Moo => big performance boost and easier packaging

This commit is contained in:
Alessandro Ranellucci 2011-09-06 11:50:43 +02:00
parent bf5824781d
commit 26b05ab155
13 changed files with 67 additions and 75 deletions

View file

@ -1,32 +1,28 @@
package Slic3r::Line;
use Moose;
use Moose::Util::TypeConstraints;
use Moo;
use Scalar::Util qw(weaken);
subtype 'Slic3r::Line::Length', as 'Int';
coerce 'Slic3r::Line::Length', from 'Num', via { sprintf '%.0f', $_ };
has 'a' => (
is => 'ro',
isa => 'Slic3r::Point',
#isa => 'Slic3r::Point',
required => 1,
);
has 'b' => (
is => 'ro',
isa => 'Slic3r::Point',
#isa => 'Slic3r::Point',
required => 1,
);
has 'polyline' => (
is => 'rw',
isa => 'Slic3r::Polyline',
#isa => 'Slic3r::Polyline',
weak_ref => 1,
);
has 'solid_side' => (
is => 'rw',
isa => enum([qw(left right)]), # going from a to b
#isa => enum([qw(left right)]), # going from a to b
);
sub BUILD {