Construction/DerivedPoint.pm

filter: Statementstmt 100% 29 / 29 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 50.0% 1 / 2 totaltotal 95.2% 40 / 42 CC 3 SCAR 5.1
CC
3
Cov
97%
position
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Construction/FixedPoint.pm ↑ Summary Construction/Derivate/TranslatedPoint.pm »
1 package Math::Geometry::Construction::DerivedPoint;
2 12 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 12 extends 'Math::Geometry::Construction::Point';
4  
5 12 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 12 ▶use Math::Geometry::Construction::Types qw(Derivate);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 12 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 =head1 NAME
11  
12 C<Math::Geometry::Construction::DerivedPoint> - point derived from other objects, e.g. intersection point
13  
14 =head1 VERSION
15  
16 Version 0.019
17  
18 =cut
19  
20 12 our $VERSION = '0.019';
21  
22  
23 ###########################################################################
24 # #
25 # Class Variables and Methods #
26 # #
27 ###########################################################################
28  
29 12 our $ID_TEMPLATE = 'S%09d';
30  
31 119 ▶sub id_template { return $ID_TEMPLATE }
Subroutine id_template: called CC=1 SCAR=0.0
Pod documented
32  
33 ###########################################################################
34 # #
35 # Accessors #
36 # #
37 ###########################################################################
38  
39 12 with 'Math::Geometry::Construction::Role::Object';
40 12 with 'Math::Geometry::Construction::Role::Output';
41 12 with 'Math::Geometry::Construction::Role::Buffering';
42  
43 12 has 'derivate' => (isa => Derivate,
44 is => 'ro',
45 required => 1);
46  
47 has 'position_selector' => (isa => 'ArrayRef[Defined]',
48 is => 'ro',
49 reader => '_position_selector',
50 70 ▶ default => sub { ['indexed_position', [0]] },
Subroutine __ANON__: called CC=1 SCAR=0.0
51 12 required => 1);
52  
53 ###########################################################################
54 # #
55 # Retrieve Data #
56 # #
57 ###########################################################################
58  
59 180 ▶sub position {
Subroutine position: called CC=3 SCAR=11.0
Pod undocumented
60 180 my ($self) = @_;
61  
62 180 ▶ return $self->buffer('position') if($self->is_buffered('position'));
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_buffered("position") 60 120 180
63  
64 120 my ($selection_method, $args) = @{$self->_position_selector};
65 120 my $position = $self->derivate->$selection_method(@$args);
66  
67 120 ▶ $self->buffer('position', $position)
Branch: 1 branch
BranchTrueFalseTotal
if $self->construction->buffer_results 120 0 120
68 if($self->construction->buffer_results);
69 120 return $position;
70 }
71  
72 ###########################################################################
73 # #
74 # Change Data #
75 # #
76 ###########################################################################
77  
78 12 1;
79  
80  
81 __END__
« Construction/FixedPoint.pm ↑ Summary Construction/Derivate/TranslatedPoint.pm »