lib/SVG/Estimate/Path/Command.pm

filter: Statementstmt 68.0% 17 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 65.5% 19 / 29 CC 1 SCAR 2.9
CC
1
Cov
68%
summarize_myself
2.0
BEGIN
1.0
__ANON__
1.0
CRAP 1.3
« lib/SVG/Estimate/Shape.pm ↑ Summary lib/SVG/Estimate/Role/MakePolygon.pm »
1 package SVG::Estimate::Path::Command;
2 16 $SVG::Estimate::Path::Command::VERSION = '1.0111';
3 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 with 'SVG::Estimate::Role::Round';
5  
6  
7 =head1 NAME
8  
9 SVG::Estimate::Path::Command - Base class for all path calculations.
10  
11 =head1 VERSION
12  
13 version 1.0111
14  
15 =head1 DESCRIPTION
16  
17 There are a lot of methods and parameters shared between the various shape classes in L<SVG::Estimate::Path>. This base class encapsulates them all.
18  
19 =head1 INHERITANCE
20  
21 This class consumes L<SVG::Estimate::Role::Round>.
22  
23 =head1 METHODS
24  
25 =head2 new( properties )
26  
27 Constructor.
28  
29 =over
30  
31 =item properties
32  
33 =over
34  
35 =item start_point
36  
37 An array ref that describes the position of the cursor (or CNC head) prior to drawing this path (where it left off from the last object).
38  
39 =item transformer
40  
41 A reference to a L<Image::SVG::Transform> object that contains all the transforms for this path segment.
42  
43 =back
44  
45 =back
46  
47 =cut
48  
49 16 has start_point => (
50 is => 'ro',
51 required => 1,
52 );
53  
54 16 has transformer => (
55 is => 'ro',
56 required => 1,
57 );
58  
59 =head2 end_point ( )
60  
61 Returns an array ref that contains an end point of where this command left off to fill the C<start_point> of the next command.
62  
63 =cut
64  
65 16 has end_point => (
66 is => 'ro',
67 required => 1,
68 );
69  
70 =head2 shape_length ( )
71  
72 Returns the total shape length of the vector in the path command.
73  
74 =cut
75  
76 16 has shape_length => (
77 is => 'ro',
78 required => 1,
79 );
80  
81 =head2 travel_length ( )
82  
83 Returns the total travel length of the vector in the path command.
84  
85 =cut
86  
87 16 has travel_length => (
88 is => 'ro',
89 required => 1,
90 );
91  
92 =head2 min_x ( )
93  
94 Returns the minimum position of C<x> that this path segment will ever reach.
95  
96 =cut
97  
98 16 has min_x => (
99 is => 'ro',
100 required => 1,
101 );
102  
103 =head2 max_x ( )
104  
105 Returns the maximum position of C<x> that this path segment will ever reach.
106  
107 =cut
108  
109 16 has max_x => (
110 is => 'ro',
111 required => 1,
112 );
113  
114 =head2 min_y ( )
115  
116 Returns the minimum position of C<y> that this path segment will ever reach.
117  
118 =cut
119  
120 16 has min_y => (
121 is => 'ro',
122 required => 1,
123 );
124  
125 =head2 max_y ( )
126  
127 Returns the max position of C<y> that this path segment will ever reach.
128  
129 =cut
130  
131 16 has max_y => (
132 is => 'ro',
133 required => 1,
134 );
135  
136 has summarize => (
137 is => 'ro',
138 29 ▶ default => sub { 0 },
Subroutine __ANON__: called CC=1 SCAR=0.0
139 16 );
140  
141 sub summarize_myself {
142 0 ▶ my $self = shift;
Subroutine summarize_myself: not called CC=1 SCAR=6.9
Pod undocumented
143 0 print "\t".ref $self;
144 0 printf "\n\t\tstart point: [%s, %s]", $self->round($self->start_point->[0]), $self->round($self->start_point->[1]);
145 0 printf "\n\t\tend point: [%s, %s]", $self->round($self->end_point->[0]), $self->round($self->end_point->[1]);
146 0 print "\n\t\ttotal length: ". $self->round($self->travel_length + $self->shape_length);
147 0 print "\n\t\ttravel length: ". $self->round($self->travel_length);
148 0 print "\n\t\tshape length: ". $self->round($self->shape_length);
149 0 print "\n";
150 }
151  
152 16 1;
« lib/SVG/Estimate/Shape.pm ↑ Summary lib/SVG/Estimate/Role/MakePolygon.pm »