1 package LaTeX::TikZ::Set::Union;
8 LaTeX::TikZ::Set::Union - A set object representing a path formed by the reunion of several subpaths.
16 our $VERSION = '0.02';
18 use LaTeX::TikZ::Interface;
19 use LaTeX::TikZ::Functor;
21 use LaTeX::TikZ::Tools;
27 This class consumes the L<LaTeX::TikZ::Set::Path> and L<LaTeX::TikZ::Set::Container> roles, and as such implements the L</path>, L</kids> and L</add> methods.
32 LaTeX::TikZ::Set::Path
33 LaTeX::TikZ::Set::Container
40 The L<LaTeX::TikZ::Set::Path> objects that form the path.
46 isa => 'Maybe[ArrayRef[LaTeX::TikZ::Set::Path]]',
48 default => sub { [ ] },
51 sub kids { @{$_[0]->_kids} }
59 my $ltsp_tc = LaTeX::TikZ::Tools::type_constraint('LaTeX::TikZ::Set::Path');
64 $ltsp_tc->assert_valid($_) for @_;
66 push @{$set->_kids}, @_;
78 join ' ', map $_->path(@_), $set->kids;
81 LaTeX::TikZ::Interface->register(
85 __PACKAGE__->new(kids => \@_);
89 LaTeX::TikZ::Functor->default_rule(
90 (__PACKAGE__) => sub {
91 my ($functor, $set, @args) = @_;
92 $set->new(kids => [ map $_->$functor(@args), $set->kids ])
96 __PACKAGE__->meta->make_immutable;
100 L<LaTeX::TikZ>, L<LaTeX::TikZ::Set::Path>, L<LaTeX::TikZ::Set::Container>.
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::Union