Construction/Derivate/TranslatedPoint.pm

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 94.1% 32 / 34 CC 2 SCAR 2.5
CC
2
Cov
96%
calculate_positions
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Construction/DerivedPoint.pm ↑ Summary Construction/Types.pm »
1 package Math::Geometry::Construction::Derivate::TranslatedPoint;
2 9 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 extends 'Math::Geometry::Construction::Derivate';
4  
5 9 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 ▶use Math::Geometry::Construction::Types qw(Vector Point);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 9 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 9 ▶use Math::Vector::Real;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 =head1 NAME
12  
13 C<Math::Geometry::Construction::Derivate::TranslatedPoint> - point translated by a given vector
14  
15 =head1 VERSION
16  
17 Version 0.024
18  
19 =cut
20  
21 9 our $VERSION = '0.024';
22  
23  
24 ###########################################################################
25 # #
26 # Accessors #
27 # #
28 ###########################################################################
29  
30 9 with 'Math::Geometry::Construction::Role::Buffering';
31  
32 9 has 'input' => (isa => Point,
33 coerce => 1,
34 is => 'ro',
35 required => 1);
36  
37 9 has 'translator' => (isa => Vector,
38 coerce => 1,
39 is => 'rw',
40 required => 1,
41 trigger => \&clear_global_buffer);
42  
43 ###########################################################################
44 # #
45 # Retrieve Data #
46 # #
47 ###########################################################################
48  
49 44 ▶sub calculate_positions {
Subroutine calculate_positions: called CC=2 SCAR=7.0
Pod undocumented
50 44 my ($self) = @_;
51 44 my $reference = $self->input;
52  
53 44 my $position = $reference->position;
54 44 ▶ return if(!$position);
Branch: 1 branch
BranchTrueFalseTotal
unless $position 0 44 44
55  
56 44 return($position + $self->translator->value);
57 }
58  
59 ###########################################################################
60 # #
61 # Change Data #
62 # #
63 ###########################################################################
64  
65 9 1;
66  
67  
68 __END__
« Construction/DerivedPoint.pm ↑ Summary Construction/Types.pm »