line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LaTeX::TikZ::Set::Line; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
59
|
use strict; |
|
10
|
|
|
|
|
36
|
|
|
10
|
|
|
|
|
345
|
|
4
|
10
|
|
|
10
|
|
58
|
use warnings; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
433
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
LaTeX::TikZ::Set::Line - A set object representing a line. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.02 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
17
|
|
|
|
|
|
|
|
18
|
10
|
|
|
10
|
|
61
|
use LaTeX::TikZ::Set::Point; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
290
|
|
19
|
|
|
|
|
|
|
|
20
|
10
|
|
|
10
|
|
53
|
use LaTeX::TikZ::Interface; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
208
|
|
21
|
10
|
|
|
10
|
|
72
|
use LaTeX::TikZ::Functor; |
|
10
|
|
|
|
|
17
|
|
|
10
|
|
|
|
|
210
|
|
22
|
|
|
|
|
|
|
|
23
|
10
|
|
|
10
|
|
66
|
use Any::Moose; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
65
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 RELATIONSHIPS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
This class consumes the L<LaTeX::TikZ::Set::Op> role, and as such implements the L</path> method. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
with 'LaTeX::TikZ::Set::Op'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 C<from> |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
The first endpoint of the line, as a L<LaTeX::TikZ::Set::Point> object. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
has 'from' => ( |
42
|
|
|
|
|
|
|
is => 'ro', |
43
|
|
|
|
|
|
|
isa => 'LaTeX::TikZ::Set::Point', |
44
|
|
|
|
|
|
|
required => 1, |
45
|
|
|
|
|
|
|
coerce => 1, |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 C<to> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
The second endpoint of the line, also as a L<LaTeX::TikZ::Set::Point> object. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
has 'to' => ( |
55
|
|
|
|
|
|
|
is => 'ro', |
56
|
|
|
|
|
|
|
isa => 'LaTeX::TikZ::Set::Point', |
57
|
|
|
|
|
|
|
required => 1, |
58
|
|
|
|
|
|
|
coerce => 1, |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 C<path> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=cut |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub path { |
68
|
9
|
|
|
9
|
1
|
22
|
my $set = shift; |
69
|
|
|
|
|
|
|
|
70
|
9
|
|
|
|
|
269
|
$set->from->path(@_) . ' -- ' . $set->to->path(@_); |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
LaTeX::TikZ::Interface->register( |
74
|
|
|
|
|
|
|
line => sub { |
75
|
3
|
|
|
3
|
0
|
3995
|
shift; |
76
|
|
|
|
|
|
|
|
77
|
3
|
|
|
|
|
50
|
__PACKAGE__->new(from => $_[0], to => $_[1]); |
78
|
|
|
|
|
|
|
}, |
79
|
|
|
|
|
|
|
); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
LaTeX::TikZ::Functor->default_rule( |
82
|
|
|
|
|
|
|
(__PACKAGE__) => sub { |
83
|
|
|
|
|
|
|
my ($functor, $set, @args) = @_; |
84
|
|
|
|
|
|
|
$set->new(map { $_ => $set->$_->$functor(@args) } qw/from to/) |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 SEE ALSO |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Op>. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
You can contact me by mail or on C<irc.perl.org> (vincent). |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 BUGS |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Please report any bugs or feature requests to C<bug-latex-tikz at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LaTeX-TikZ>. |
103
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 SUPPORT |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
perldoc LaTeX::TikZ |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Copyright 2010 Vincent Pit, all rights reserved. |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
1; # End of LaTeX::TikZ::Set::Line |