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