| 1 | package Geometry::Primitive::Bezier; | ||
| 2 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | ▶ | use MooseX::Storage; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 2 | with qw(Geometry::Primitive::Shape MooseX::Clone MooseX::Storage::Deferred); | |
| 6 | |||
| 7 | 2 | ▶ | use overload ('""' => 'to_string'); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | ▶ | use Geometry::Primitive::Point; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 2 | has 'control1' => ( | |
| 12 | is => 'rw', | ||
| 13 | isa => 'Geometry::Primitive::Point', | ||
| 14 | required => 1, | ||
| 15 | coerce => 1 | ||
| 16 | ); | ||
| 17 | 2 | has 'control2' => ( | |
| 18 | is => 'rw', | ||
| 19 | isa => 'Geometry::Primitive::Point', | ||
| 20 | required => 1, | ||
| 21 | coerce => 1 | ||
| 22 | ); | ||
| 23 | 2 | has 'end' => ( | |
| 24 | is => 'rw', | ||
| 25 | isa => 'Geometry::Primitive::Point', | ||
| 26 | required => 1, | ||
| 27 | coerce => 1 | ||
| 28 | ); | ||
| 29 | 2 | has 'start' => ( | |
| 30 | is => 'rw', | ||
| 31 | isa => 'Geometry::Primitive::Point', | ||
| 32 | required => 1, | ||
| 33 | coerce => 1 | ||
| 34 | ); | ||
| 35 | |||
| 36 | 0 | ▶ | sub scale { |
|
Subroutine
scale: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 37 | 0 | my ($self, $amount) = @_; | |
| 38 | |||
| 39 | 0 | $self->start->x($self->start->x * $amount); | |
| 40 | 0 | $self->start->y($self->start->y * $amount); | |
| 41 | |||
| 42 | 0 | $self->end->x($self->end->x * $amount); | |
| 43 | 0 | $self->end->y($self->end->y * $amount); | |
| 44 | |||
| 45 | 0 | $self->control1->x($self->control1->x * $amount); | |
| 46 | 0 | $self->control1->y($self->control1->y * $amount); | |
| 47 | |||
| 48 | 0 | $self->control2->x($self->control2->x * $amount); | |
| 49 | 0 | $self->control2->y($self->control2->y * $amount); | |
| 50 | } | ||
| 51 | |||
| 52 | 1 | ▶ | sub point_end { |
|
Subroutine
point_end: called CC=1 SCAR=0.0
Pod
documented
| |||
| 53 | 1 | my ($self) = @_; return $self->end; | |
| 54 | } | ||
| 55 | |||
| 56 | 1 | ▶ | sub point_start { |
|
Subroutine
point_start: called CC=1 SCAR=0.0
Pod
documented
| |||
| 57 | 1 | my ($self) = @_; return $self->start; | |
| 58 | } | ||
| 59 | |||
| 60 | |||
| 61 | 2 | ▶ | sub to_string { |
|
Subroutine
to_string: called CC=1 SCAR=0.0
Pod
documented
| |||
| 62 | 2 | my ($self) = @_; | |
| 63 | |||
| 64 | 2 | return $self->start->to_string.' - '.$self->control1->to_string | |
| 65 | .' = '.$self->control2->to_string.' = '.$self->end->to_string; | ||
| 66 | } | ||
| 67 | |||
| 68 | 2 | __PACKAGE__->meta->make_immutable; | |
| 69 | |||
| 70 | 2 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 71 | 2 | 1; | |
| 72 | |||
| 73 | __END__ | ||