]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/blob - lib/LaTeX/TikZ/Point.pm
Make Points into a real class
[perl/modules/LaTeX-TikZ.git] / lib / LaTeX / TikZ / Point.pm
1 package LaTeX::TikZ::Point;
2
3 use strict;
4 use warnings;
5
6 =head1 NAME
7
8 LaTeX::TikZ::Point - Internal representation of what LaTeX::TikZ consider as 2D points.
9
10 =head1 VERSION
11
12 Version 0.01
13
14 =cut
15
16 our $VERSION = '0.01';
17
18 use Any::Moose;
19 use Any::Moose 'Util::TypeConstraints' => [ qw/
20  coerce
21  from
22  via
23  find_type_constraint
24  register_type_constraint
25 / ];
26
27 has 'x' => (
28  is       => 'ro',
29  isa      => 'Num',
30  required => 1,
31 );
32
33 has 'y' => (
34  is       => 'ro',
35  isa      => 'Num',
36  required => 1,
37 );
38
39 use LaTeX::TikZ::Meta::TypeConstraint::Autocoerce;
40
41 register_type_constraint(
42  LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
43   name   => 'LaTeX::TikZ::Point::Autocoerce',
44   parent => find_type_constraint(__PACKAGE__),
45  ),
46 );
47
48 coerce 'LaTeX::TikZ::Point::Autocoerce'
49     => from 'LaTeX::TikZ::Point'
50     => via { $_ };
51
52 __PACKAGE__->meta->make_immutable;
53
54 =head1 AUTHOR
55
56 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
57
58 You can contact me by mail or on C<irc.perl.org> (vincent).
59
60 =head1 BUGS
61
62 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>.
63 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
64
65 =head1 SUPPORT
66
67 You can find documentation for this module with the perldoc command.
68
69     perldoc LaTeX::TikZ
70
71 =head1 COPYRIGHT & LICENSE
72
73 Copyright 2010 Vincent Pit, all rights reserved.
74
75 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
76
77 =cut
78
79 1; # End of LaTeX::TikZ::Point