1 package LaTeX::TikZ::Set;
8 LaTeX::TikZ::Set - Base role for LaTeX::TikZ set objects.
16 our $VERSION = '0.01';
18 use LaTeX::TikZ::Set::Mod;
20 use LaTeX::TikZ::Tools;
22 use Any::Moose 'Role';
31 return $set unless @_ > 1;
33 # If $set is already a Tikz::Set::Mod object, the overridden method is
34 # called instead. This ensures that you can't have two T::S::M objects in a
37 # Prepend a new set with the mods
38 my $new = LaTeX::TikZ::Set::Mod->new(
40 mods => [ @_[1 .. $#_] ],
43 $_[0] = $new unless defined wantarray;
48 my $ltml_tc = LaTeX::TikZ::Tools::type_constraint('LaTeX::TikZ::Mod::Layer');
49 my $ltmc_tc = LaTeX::TikZ::Tools::type_constraint('LaTeX::TikZ::Mod::Clip');
52 return $_[0] unless @_ > 1;
57 $ltml_tc->check($layer) ? $layer
58 : LaTeX::TikZ::Mod::Layer->new(name => $layer)
63 return $_[0] unless @_ > 1;
67 $ltmc_tc->check($_) ? $_ : LaTeX::TikZ::Mod::Clip->new($_)
74 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
76 You can contact me by mail or on C<irc.perl.org> (vincent).
80 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>.
81 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
85 You can find documentation for this module with the perldoc command.
89 =head1 COPYRIGHT & LICENSE
91 Copyright 2010 Vincent Pit, all rights reserved.
93 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
97 1; # End of LaTeX::TikZ::Set