line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Math::Geometry::Construction::Derivate; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1737
|
use 5.008008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
38
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
38
|
use Math::Geometry::Construction::Types qw(ArrayRefOfGeometricObject); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moose; |
7
|
|
|
|
|
|
|
use Carp; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
C<Math::Geometry::Construction::Derivate> - derive points from objects |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 VERSION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Version 0.019 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.019'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
########################################################################### |
23
|
|
|
|
|
|
|
# # |
24
|
|
|
|
|
|
|
# Class Variables and Methods # |
25
|
|
|
|
|
|
|
# # |
26
|
|
|
|
|
|
|
########################################################################### |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
our $ID_TEMPLATE = 'D%09d'; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub id_template { return $ID_TEMPLATE } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
########################################################################### |
33
|
|
|
|
|
|
|
# # |
34
|
|
|
|
|
|
|
# Accessors # |
35
|
|
|
|
|
|
|
# # |
36
|
|
|
|
|
|
|
########################################################################### |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
with 'Math::Geometry::Construction::Role::Object'; |
39
|
|
|
|
|
|
|
with 'Math::Geometry::Construction::Role::PositionSelection'; |
40
|
|
|
|
|
|
|
with 'Math::Geometry::Construction::Role::Buffering'; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
########################################################################### |
43
|
|
|
|
|
|
|
# # |
44
|
|
|
|
|
|
|
# Retrieve Data # |
45
|
|
|
|
|
|
|
# # |
46
|
|
|
|
|
|
|
########################################################################### |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub calculate_positions { return } |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub positions { |
51
|
|
|
|
|
|
|
my ($self) = @_; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
return(@{$self->buffer('positions') || []}) |
54
|
|
|
|
|
|
|
if($self->is_buffered('positions')); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $positions = [$self->calculate_positions]; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
$self->buffer('positions', $positions) |
59
|
|
|
|
|
|
|
if($self->construction->buffer_results); |
60
|
|
|
|
|
|
|
return @$positions; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub register_derived_point {} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub create_derived_point { |
66
|
|
|
|
|
|
|
my ($self, %args) = @_; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
my $point = $self->construction->add_object |
69
|
|
|
|
|
|
|
('Math::Geometry::Construction::DerivedPoint', |
70
|
|
|
|
|
|
|
derivate => $self, |
71
|
|
|
|
|
|
|
%args); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
$self->register_derived_point($point); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
return $point; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
########################################################################### |
79
|
|
|
|
|
|
|
# # |
80
|
|
|
|
|
|
|
# Change Data # |
81
|
|
|
|
|
|
|
# # |
82
|
|
|
|
|
|
|
########################################################################### |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__END__ |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=pod |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 SYNOPSIS |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 DESCRIPTION |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 INTERFACE |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 Public Attributes |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 Methods for Users |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head2 Methods for Subclass Developers |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head3 create_derived_point |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head3 id_template |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 AUTHOR |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Lutz Gehlen, C<< <perl at lutzgehlen.de> >> |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Copyright 2011 Lutz Gehlen. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
120
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
121
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=cut |
127
|
|
|
|
|
|
|
|