| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package LaTeX::TikZ::Set::Point; |
|
2
|
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
34
|
use strict; |
|
|
10
|
|
|
|
|
12
|
|
|
|
10
|
|
|
|
|
296
|
|
|
4
|
10
|
|
|
10
|
|
35
|
use warnings; |
|
|
10
|
|
|
|
|
13
|
|
|
|
10
|
|
|
|
|
295
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
LaTeX::TikZ::Set::Point - A set object representing a point. |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 VERSION |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Version 0.03 |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
|
17
|
|
|
|
|
|
|
|
|
18
|
10
|
|
|
10
|
|
46
|
use LaTeX::TikZ::Point; |
|
|
10
|
|
|
|
|
21
|
|
|
|
10
|
|
|
|
|
172
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
10
|
|
|
10
|
|
174
|
use LaTeX::TikZ::Interface; |
|
|
10
|
|
|
|
|
13
|
|
|
|
10
|
|
|
|
|
148
|
|
|
21
|
10
|
|
|
10
|
|
33
|
use LaTeX::TikZ::Functor; |
|
|
10
|
|
|
|
|
12
|
|
|
|
10
|
|
|
|
|
129
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
10
|
|
|
10
|
|
32
|
use Mouse; |
|
|
10
|
|
|
|
|
10
|
|
|
|
10
|
|
|
|
|
39
|
|
|
24
|
10
|
|
|
10
|
|
2128
|
use Mouse::Util::TypeConstraints; |
|
|
10
|
|
|
|
|
16
|
|
|
|
10
|
|
|
|
|
51
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 RELATIONSHIPS |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
This class consumes the L role, and as such implements the L method. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
with 'LaTeX::TikZ::Set::Path'; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 C |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
The L object representing the underlying geometrical point. |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
has 'point' => ( |
|
43
|
|
|
|
|
|
|
is => 'ro', |
|
44
|
|
|
|
|
|
|
isa => 'LaTeX::TikZ::Point::Autocoerce', |
|
45
|
|
|
|
|
|
|
required => 1, |
|
46
|
|
|
|
|
|
|
coerce => 1, |
|
47
|
|
|
|
|
|
|
handles => [ qw ], |
|
48
|
|
|
|
|
|
|
); |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 C |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
An optional label for the point. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
has 'label' => ( |
|
57
|
|
|
|
|
|
|
is => 'rw', |
|
58
|
|
|
|
|
|
|
isa => 'Maybe[Str]', |
|
59
|
|
|
|
|
|
|
default => undef, |
|
60
|
|
|
|
|
|
|
); |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 C |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
The position of the label around the point. |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
enum 'LaTeX::TikZ::Set::Point::Positions' => ( |
|
69
|
|
|
|
|
|
|
'below left', |
|
70
|
|
|
|
|
|
|
'below', |
|
71
|
|
|
|
|
|
|
'below right', |
|
72
|
|
|
|
|
|
|
'right', |
|
73
|
|
|
|
|
|
|
'above right', |
|
74
|
|
|
|
|
|
|
'above', |
|
75
|
|
|
|
|
|
|
'above left', |
|
76
|
|
|
|
|
|
|
'left', |
|
77
|
|
|
|
|
|
|
); |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
has 'pos' => ( |
|
80
|
|
|
|
|
|
|
is => 'rw', |
|
81
|
|
|
|
|
|
|
isa => 'Maybe[LaTeX::TikZ::Set::Point::Positions]', |
|
82
|
|
|
|
|
|
|
); |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
coerce 'LaTeX::TikZ::Set::Point' |
|
85
|
|
|
|
|
|
|
=> from 'Any' |
|
86
|
|
|
|
|
|
|
=> via { __PACKAGE__->new(point => $_) }; |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
coerce 'LaTeX::TikZ::Point::Autocoerce' |
|
89
|
|
|
|
|
|
|
=> from 'LaTeX::TikZ::Set::Point' |
|
90
|
|
|
|
|
|
|
=> via { $_->point }; |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 METHODS |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 C |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub path { |
|
99
|
126
|
|
|
126
|
1
|
111
|
my ($set, $tikz) = @_; |
|
100
|
|
|
|
|
|
|
|
|
101
|
126
|
|
|
|
|
168
|
my $p = $set->point; |
|
102
|
|
|
|
|
|
|
|
|
103
|
126
|
|
|
|
|
297
|
my $path = '(' . $tikz->len($p->x) . ',' . $tikz->len($p->y) . ')'; |
|
104
|
|
|
|
|
|
|
|
|
105
|
126
|
|
|
|
|
205
|
my $label = $set->label; |
|
106
|
126
|
100
|
|
|
|
166
|
if (defined $label) { |
|
107
|
2
|
|
|
|
|
6
|
my $pos = $set->pos; |
|
108
|
2
|
100
|
|
|
|
5
|
$pos = 'above' unless defined $pos; |
|
109
|
|
|
|
|
|
|
|
|
110
|
2
|
|
|
|
|
17
|
my $size = sprintf '%0.1fpt', 2 * $tikz->scale / 5; |
|
111
|
2
|
|
|
|
|
7
|
$path .= " [fill] circle ($size) " . $tikz->label($label, $pos); |
|
112
|
|
|
|
|
|
|
} |
|
113
|
|
|
|
|
|
|
|
|
114
|
126
|
|
|
|
|
344
|
$path; |
|
115
|
|
|
|
|
|
|
} |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head2 C |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |
|
120
|
|
|
|
|
|
|
|
|
121
|
2
|
|
|
2
|
1
|
9
|
sub begin { $_[0]->point } |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 C |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=cut |
|
126
|
|
|
|
|
|
|
|
|
127
|
2
|
|
|
2
|
1
|
7
|
sub end { $_[0]->point } |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
LaTeX::TikZ::Interface->register( |
|
130
|
|
|
|
|
|
|
point => sub { |
|
131
|
23
|
|
|
23
|
0
|
10537
|
shift; |
|
132
|
|
|
|
|
|
|
|
|
133
|
23
|
|
|
|
|
24
|
my $point; |
|
134
|
23
|
100
|
|
|
|
74
|
if (@_ == 0) { |
|
|
|
100
|
|
|
|
|
|
|
135
|
3
|
|
|
|
|
5
|
$point = 0; |
|
136
|
|
|
|
|
|
|
} elsif (@_ % 2) { |
|
137
|
12
|
|
|
|
|
15
|
$point = shift; |
|
138
|
|
|
|
|
|
|
} else { # @_ even, @_ >= 2 |
|
139
|
8
|
|
|
|
|
20
|
$point = [ shift, shift ]; |
|
140
|
|
|
|
|
|
|
} |
|
141
|
|
|
|
|
|
|
|
|
142
|
23
|
|
|
|
|
154
|
__PACKAGE__->new(point => $point, @_); |
|
143
|
|
|
|
|
|
|
}, |
|
144
|
|
|
|
|
|
|
); |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
LaTeX::TikZ::Functor->default_rule( |
|
147
|
|
|
|
|
|
|
(__PACKAGE__) => sub { |
|
148
|
|
|
|
|
|
|
my ($functor, $set, @args) = @_; |
|
149
|
|
|
|
|
|
|
$set->new( |
|
150
|
|
|
|
|
|
|
point => $set->point, |
|
151
|
|
|
|
|
|
|
label => $set->label, |
|
152
|
|
|
|
|
|
|
pos => $set->pos, |
|
153
|
|
|
|
|
|
|
); |
|
154
|
|
|
|
|
|
|
} |
|
155
|
|
|
|
|
|
|
); |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
L, L. |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head1 AUTHOR |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Vincent Pit, C<< >>, L. |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
You can contact me by mail or on C (vincent). |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=head1 BUGS |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through the web interface at L. |
|
172
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=head1 SUPPORT |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
perldoc LaTeX::TikZ |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Copyright 2010,2011,2012,2013,2014,2015 Vincent Pit, all rights reserved. |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=cut |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
1; # End of LaTeX::TikZ::Set::Point |