line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LaTeX::TikZ::Set::Path; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
56
|
use strict; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
322
|
|
4
|
10
|
|
|
10
|
|
53
|
use warnings; |
|
10
|
|
|
|
|
95
|
|
|
10
|
|
|
|
|
490
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
LaTeX::TikZ::Set::Path - A set object representing a path. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.02 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
17
|
|
|
|
|
|
|
|
18
|
10
|
|
|
10
|
|
54
|
use LaTeX::TikZ::Interface; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
237
|
|
19
|
10
|
|
|
10
|
|
56
|
use LaTeX::TikZ::Functor; |
|
10
|
|
|
|
|
25
|
|
|
10
|
|
|
|
|
245
|
|
20
|
|
|
|
|
|
|
|
21
|
10
|
|
|
10
|
|
61
|
use LaTeX::TikZ::Tools; |
|
10
|
|
|
|
|
44
|
|
|
10
|
|
|
|
|
312
|
|
22
|
|
|
|
|
|
|
|
23
|
10
|
|
|
10
|
|
48
|
use Any::Moose; |
|
10
|
|
|
|
|
26
|
|
|
10
|
|
|
|
|
73
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 RELATIONSHIPS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
This class consumes the L<LaTeX::TikZ::Set::Op> and L<LaTeX::TikZ::Set::Mutable> roles, and as such implements the L</path> and L</add> methods. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
with qw( |
32
|
|
|
|
|
|
|
LaTeX::TikZ::Set::Op |
33
|
|
|
|
|
|
|
LaTeX::TikZ::Set::Mutable |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 C<ops> |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The L<LaTeX::TikZ::Set::Op> objects that from the path. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has '_ops' => ( |
45
|
|
|
|
|
|
|
is => 'ro', |
46
|
|
|
|
|
|
|
isa => 'Maybe[ArrayRef[LaTeX::TikZ::Set::Op]]', |
47
|
|
|
|
|
|
|
init_arg => 'ops', |
48
|
|
|
|
|
|
|
default => sub { [ ] }, |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
6
|
|
|
6
|
1
|
8
|
sub ops { @{$_[0]->_ops} } |
|
6
|
|
|
|
|
30
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 C<add> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
my $ltso_tc = LaTeX::TikZ::Tools::type_constraint('LaTeX::TikZ::Set::Op'); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub add { |
62
|
2
|
|
|
2
|
1
|
875
|
my $set = shift; |
63
|
|
|
|
|
|
|
|
64
|
2
|
|
|
|
|
13
|
$ltso_tc->assert_valid($_) for @_; |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
|
|
53
|
push @{$set->_ops}, @_; |
|
1
|
|
|
|
|
4
|
|
67
|
|
|
|
|
|
|
|
68
|
1
|
|
|
|
|
4
|
$set; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 C<path> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub path { |
76
|
3
|
|
|
3
|
1
|
5
|
my $set = shift; |
77
|
|
|
|
|
|
|
|
78
|
3
|
|
|
|
|
7
|
join ' ', map $_->path(@_), $set->ops; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
LaTeX::TikZ::Interface->register( |
82
|
|
|
|
|
|
|
path => sub { |
83
|
2
|
|
|
2
|
0
|
1968
|
shift; |
84
|
|
|
|
|
|
|
|
85
|
2
|
|
|
|
|
25
|
__PACKAGE__->new(ops => \@_); |
86
|
|
|
|
|
|
|
}, |
87
|
|
|
|
|
|
|
); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
LaTeX::TikZ::Functor->default_rule( |
90
|
|
|
|
|
|
|
(__PACKAGE__) => sub { |
91
|
|
|
|
|
|
|
my ($functor, $set, @args) = @_; |
92
|
|
|
|
|
|
|
$set->new(ops => [ map $_->$functor(@args), $set->ops ]) |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 SEE ALSO |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Op>, L<LaTeX::TikZ::Set::Mutable>. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 AUTHOR |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
You can contact me by mail or on C<irc.perl.org> (vincent). |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 BUGS |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
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>. |
111
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 SUPPORT |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
perldoc LaTeX::TikZ |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Copyright 2010 Vincent Pit, all rights reserved. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=cut |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; # End of LaTeX::TikZ::Set::Path |