line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LaTeX::TikZ::Set::Union; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
37
|
use strict; |
|
10
|
|
|
|
|
9
|
|
|
10
|
|
|
|
|
259
|
|
4
|
10
|
|
|
10
|
|
32
|
use warnings; |
|
10
|
|
|
|
|
11
|
|
|
10
|
|
|
|
|
321
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
LaTeX::TikZ::Set::Union - A set object representing a path formed by the reunion of several subpaths. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.03 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
17
|
|
|
|
|
|
|
|
18
|
10
|
|
|
10
|
|
37
|
use LaTeX::TikZ::Interface; |
|
10
|
|
|
|
|
8
|
|
|
10
|
|
|
|
|
155
|
|
19
|
10
|
|
|
10
|
|
35
|
use LaTeX::TikZ::Functor; |
|
10
|
|
|
|
|
9
|
|
|
10
|
|
|
|
|
135
|
|
20
|
|
|
|
|
|
|
|
21
|
10
|
|
|
10
|
|
29
|
use LaTeX::TikZ::Tools; |
|
10
|
|
|
|
|
11
|
|
|
10
|
|
|
|
|
140
|
|
22
|
|
|
|
|
|
|
|
23
|
10
|
|
|
10
|
|
29
|
use Mouse; |
|
10
|
|
|
|
|
9
|
|
|
10
|
|
|
|
|
40
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 RELATIONSHIPS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
This class consumes the L and L roles, and as such implements the L, L and L methods. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
with qw< |
32
|
|
|
|
|
|
|
LaTeX::TikZ::Set::Path |
33
|
|
|
|
|
|
|
LaTeX::TikZ::Set::Container |
34
|
|
|
|
|
|
|
>; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 C |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The L objects that form the path. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has '_kids' => ( |
45
|
|
|
|
|
|
|
is => 'ro', |
46
|
|
|
|
|
|
|
isa => 'Maybe[ArrayRef[LaTeX::TikZ::Set::Path]]', |
47
|
|
|
|
|
|
|
init_arg => 'kids', |
48
|
|
|
|
|
|
|
default => sub { [ ] }, |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
25
|
|
|
25
|
1
|
423
|
sub kids { @{$_[0]->_kids} } |
|
25
|
|
|
|
|
102
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 C |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
my $ltsp_tc = LaTeX::TikZ::Tools::type_constraint('LaTeX::TikZ::Set::Path'); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub add { |
62
|
2
|
|
|
2
|
1
|
965
|
my $set = shift; |
63
|
|
|
|
|
|
|
|
64
|
2
|
|
|
|
|
9
|
$ltsp_tc->assert_valid($_) for @_; |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
|
|
43
|
push @{$set->_kids}, @_; |
|
1
|
|
|
|
|
4
|
|
67
|
|
|
|
|
|
|
|
68
|
1
|
|
|
|
|
3
|
$set; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 C |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub path { |
76
|
9
|
|
|
9
|
1
|
11
|
my $set = shift; |
77
|
|
|
|
|
|
|
|
78
|
9
|
|
|
|
|
20
|
join ' ', map $_->path(@_), $set->kids; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 C |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub begin { |
86
|
2
|
|
|
2
|
1
|
986
|
my $set = shift; |
87
|
|
|
|
|
|
|
|
88
|
2
|
|
|
|
|
5
|
my @kids = $set->kids; |
89
|
2
|
50
|
|
|
|
5
|
return undef unless @kids; |
90
|
|
|
|
|
|
|
|
91
|
2
|
|
|
|
|
6
|
$kids[0]->begin; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 C |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub end { |
99
|
2
|
|
|
2
|
1
|
4
|
my $set = shift; |
100
|
|
|
|
|
|
|
|
101
|
2
|
|
|
|
|
3
|
my @kids = $set->kids; |
102
|
2
|
50
|
|
|
|
5
|
return undef unless @kids; |
103
|
|
|
|
|
|
|
|
104
|
2
|
|
|
|
|
7
|
$kids[-1]->end; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
LaTeX::TikZ::Interface->register( |
108
|
|
|
|
|
|
|
union => sub { |
109
|
6
|
|
|
6
|
0
|
2064
|
shift; |
110
|
|
|
|
|
|
|
|
111
|
6
|
|
|
|
|
52
|
__PACKAGE__->new(kids => \@_); |
112
|
|
|
|
|
|
|
}, |
113
|
|
|
|
|
|
|
path => sub { |
114
|
0
|
|
|
0
|
0
|
|
shift; |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
__PACKAGE__->new(kids => \@_); |
117
|
|
|
|
|
|
|
}, |
118
|
|
|
|
|
|
|
); |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
LaTeX::TikZ::Functor->default_rule( |
121
|
|
|
|
|
|
|
(__PACKAGE__) => sub { |
122
|
|
|
|
|
|
|
my ($functor, $set, @args) = @_; |
123
|
|
|
|
|
|
|
$set->new(kids => [ map $_->$functor(@args), $set->kids ]) |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
); |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 SEE ALSO |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
L, L, L. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head1 AUTHOR |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
Vincent Pit, C<< >>, L. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
You can contact me by mail or on C (vincent). |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 BUGS |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through the web interface at L. |
142
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head1 SUPPORT |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
perldoc LaTeX::TikZ |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Copyright 2010,2011,2012,2013,2014,2015 Vincent Pit, all rights reserved. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=cut |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
1; # End of LaTeX::TikZ::Set::Union |