1 package LaTeX::TikZ::Set::Path;
8 LaTeX::TikZ::Set::Path - A set object representing a path.
16 our $VERSION = '0.01';
18 use LaTeX::TikZ::Interface;
19 use LaTeX::TikZ::Functor;
22 use Any::Moose 'Util::TypeConstraints'
23 => [ qw/subtype as where find_type_constraint/ ];
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.
33 LaTeX::TikZ::Set::Mutable
40 The L<LaTeX::TikZ::Set::Op> objects that from the path.
44 subtype 'LaTeX::TikZ::Set::Path::Elements'
46 => where { $_->does('LaTeX::TikZ::Set::Op') };
50 isa => 'Maybe[ArrayRef[LaTeX::TikZ::Set::Path::Elements]]',
52 default => sub { [ ] },
55 sub ops { @{$_[0]->_ops} }
63 my $ltspe_tc = find_type_constraint('LaTeX::TikZ::Set::Path::Elements');
68 $ltspe_tc->assert_valid($_) for @_;
70 push @{$set->_ops}, @_;
82 join ' ', map $_->path(@_), $set->ops;
85 LaTeX::TikZ::Interface->register(
89 __PACKAGE__->new(ops => \@_);
93 LaTeX::TikZ::Functor->default_rule(
94 (__PACKAGE__) => sub {
95 my ($functor, $set, @args) = @_;
96 $set->new(ops => [ map $_->$functor(@args), $set->ops ])
100 __PACKAGE__->meta->make_immutable;
104 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
106 You can contact me by mail or on C<irc.perl.org> (vincent).
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.
115 You can find documentation for this module with the perldoc command.
119 =head1 COPYRIGHT & LICENSE
121 Copyright 2010 Vincent Pit, all rights reserved.
123 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
127 1; # End of LaTeX::TikZ::Set::Path