| 1 | package Math::Geometry::Construction::Role::PointSet; | ||||||||||||||
| 2 | 13 | ▶ | use Moose::Role; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | |||||||||||||||
| 4 | 13 | ▶ | use 5.008008; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 13 | ▶ | use Math::Geometry::Construction::Types qw(HashRefOfPoint Extension); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 13 | ▶ | use Carp; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | |||||||||||||||
| 9 | =head1 NAME | ||||||||||||||
| 10 | |||||||||||||||
| 11 | C<Math::Geometry::Construction::Role::PointSet> - point set objects | ||||||||||||||
| 12 | |||||||||||||||
| 13 | =head1 VERSION | ||||||||||||||
| 14 | |||||||||||||||
| 15 | Version 0.020 | ||||||||||||||
| 16 | |||||||||||||||
| 17 | =cut | ||||||||||||||
| 18 | |||||||||||||||
| 19 | 13 | our $VERSION = '0.020'; | |||||||||||||
| 20 | |||||||||||||||
| 21 | |||||||||||||||
| 22 | ########################################################################### | ||||||||||||||
| 23 | # # | ||||||||||||||
| 24 | # Accessors # | ||||||||||||||
| 25 | # # | ||||||||||||||
| 26 | ########################################################################### | ||||||||||||||
| 27 | |||||||||||||||
| 28 | has 'points' => (isa => HashRefOfPoint, | ||||||||||||||
| 29 | is => 'bare', | ||||||||||||||
| 30 | traits => ['Hash'], | ||||||||||||||
| 31 | 115 | ▶ | default => sub { {} }, | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 32 | 13 | handles => {points => 'values', | |||||||||||||
| 33 | _pointset_point => 'accessor'}); | ||||||||||||||
| 34 | |||||||||||||||
| 35 | has 'extend' => (isa => Extension, | ||||||||||||||
| 36 | coerce => 1, | ||||||||||||||
| 37 | is => 'rw', | ||||||||||||||
| 38 | 113 | ▶ | default => sub { [0, 0] }); | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 39 | |||||||||||||||
| 40 | 259 | ▶ | sub register_point { | ||||||||||||
|
Subroutine
register_point: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 41 | 259 | my ($self, @args) = @_; | |||||||||||||
| 42 | |||||||||||||||
| 43 | 259 | foreach(@args) { $self->_pointset_point($_->id, $_) } | |||||||||||||
| 44 | } | ||||||||||||||
| 45 | |||||||||||||||
| 46 | 95 | ▶ | sub has_point { | ||||||||||||
|
Subroutine
has_point: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||
| 47 | 95 | my ($self, @args) = @_; | |||||||||||||
| 48 | |||||||||||||||
| 49 | 95 | foreach(@args) { | |||||||||||||
| 50 | 139 | ▶ | return 0 if(!$self->_pointset_point(blessed($_) ? $_->id : $_)); | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 51 | } | ||||||||||||||
| 52 | 39 | return 1; | |||||||||||||
| 53 | } | ||||||||||||||
| 54 | |||||||||||||||
| 55 | 13 | 1; | |||||||||||||
| 56 | |||||||||||||||
| 57 | |||||||||||||||
| 58 | __END__ | ||||||||||||||