@@ -83,7+83,9 @@ The two TikZ concepts of I<clips> and I<layers> have been unified with the modif
=head2 Containers
=head2 Containers
-=head3 C<< Tikz->union(@seq) >>
+=head3 C<union>
+
+ Tikz->union(@seq)
Creates a L<LaTeX::TikZ::Set::Union> object out of the paths C<@kids>.
Creates a L<LaTeX::TikZ::Set::Union> object out of the paths C<@kids>.
@@ -97,14+99,18 @@ Creates a L<LaTeX::TikZ::Set::Union> object out of the paths C<@kids>.
'even odd rule',
);
'even odd rule',
);
-=head3 C<< Tikz->join($connector, @kids) >>
+=head3 C<join>
+
+ Tikz->join($connector, @kids)
Creates a L<LaTeX::TikZ::Set::Chain> object that joins the paths C<@kinds> with the given C<$connector> which can be, according to L<LaTeX::TikZ::Set::Chain/connector>, a string, an array reference or a code reference.
# A stair
Tikz->join('-|', map [ $_, $_ ], 0 .. 5);
Creates a L<LaTeX::TikZ::Set::Chain> object that joins the paths C<@kinds> with the given C<$connector> which can be, according to L<LaTeX::TikZ::Set::Chain/connector>, a string, an array reference or a code reference.
Creates a L<LaTeX::TikZ::Set::Chain> object that chains C<$kid0> to C<$kid1> with the string C<$link0>, C<$kid1> to C<$kid2> with C<$link1>, and so on.
Creates a L<LaTeX::TikZ::Set::Chain> object that chains C<$kid0> to C<$kid1> with the string C<$link0>, C<$kid1> to C<$kid2> with C<$link1>, and so on.
@@ -114,7+120,9 @@ Creates a L<LaTeX::TikZ::Set::Chain> object that chains C<$kid0> to C<$kid1> wit
Creates a L<LaTeX::TikZ::Set::Sequence> object out of the sequences or paths C<@kids>.
Creates a L<LaTeX::TikZ::Set::Sequence> object out of the sequences or paths C<@kids>.
@@ -124,7+132,9 @@ Creates a L<LaTeX::TikZ::Set::Sequence> object out of the sequences or paths C<@
Those are the building blocks of your geometrical figure.
Those are the building blocks of your geometrical figure.
-=head3 C<< Tikz->point($point) >>
+=head3 C<point>
+
+ Tikz->point($point)
Creates a L<LaTeX::TikZ::Set::Point> object by coercing C<$point> into a L<LaTeX::TikZ::Point>.
The following rules are available :
Creates a L<LaTeX::TikZ::Set::Point> object by coercing C<$point> into a L<LaTeX::TikZ::Point>.
The following rules are available :
@@ -166,14+176,18 @@ If C<$point> is a L<Math::Complex> object, the L<LaTeX::TikZ::Point::Math::Compl
You can define automatic coercions from your user point types to L<LaTeX::TikZ::Point> by writing your own C<LaTeX::TikZ::Point::My::User::Point> class.
See L<LaTeX::TikZ::Meta::TypeConstraint::Autocoerce> for the rationale and L<LaTeX::TikZ::Point::Math::Complex> for an example.
You can define automatic coercions from your user point types to L<LaTeX::TikZ::Point> by writing your own C<LaTeX::TikZ::Point::My::User::Point> class.
See L<LaTeX::TikZ::Meta::TypeConstraint::Autocoerce> for the rationale and L<LaTeX::TikZ::Point::Math::Complex> for an example.
-=head3 C<< Tikz->line($from => $to) >>
+=head3 C<line>
+
+ Tikz->line($from => $to)
Creates a L<LaTeX::TikZ::Set::Line> object between the points C<$from> and C<$to>.
my $x_axis = Tikz->line(-5 => 5);
my $y_axis = Tikz->line([ 0, -5 ] => [ 0, 5 ]);
Creates a L<LaTeX::TikZ::Set::Line> object between the points C<$from> and C<$to>.
my $x_axis = Tikz->line(-5 => 5);
my $y_axis = Tikz->line([ 0, -5 ] => [ 0, 5 ]);
-=head3 C<< Tikz->polyline(@points) >>
+=head3 C<polyline>
+
+ Tikz->polyline(@points)
Creates a L<LaTeX::TikZ::Set::Polyline> object that links the successive elements of C<@points> by segments.
Creates a L<LaTeX::TikZ::Set::Polyline> object that links the successive elements of C<@points> by segments.
@@ -184,7+198,9 @@ Creates a L<LaTeX::TikZ::Set::Polyline> object that links the successive element
Tikz->point(1, 1),
);
Tikz->point(1, 1),
);
-=head3 C<< Tikz->closed_polyline(@points) >>
+=head3 C<closed_polyline>
+
+ Tikz->closed_polyline(@points)
Creates a L<LaTeX::TikZ::Set::Polyline> object that cycles through successive elements of C<@points>.
Creates a L<LaTeX::TikZ::Set::Polyline> object that cycles through successive elements of C<@points>.
@@ -195,7+211,10 @@ Creates a L<LaTeX::TikZ::Set::Polyline> object that cycles through successive el
Creates a L<LaTeX::TikZ::Set::Rectangle> object with opposite corners C<$from> and C<$to>, or with anchor point C<$from> and dimensions C<$width> and C<$height>.
Creates a L<LaTeX::TikZ::Set::Rectangle> object with opposite corners C<$from> and C<$to>, or with anchor point C<$from> and dimensions C<$width> and C<$height>.
@@ -204,13+223,17 @@ Creates a L<LaTeX::TikZ::Set::Rectangle> object with opposite corners C<$from> a
Tikz->point(2, 1),
);
Tikz->point(2, 1),
);
-=head3 C<< Tikz->circle($center, $radius) >>
+=head3 C<circle>
+
+ Tikz->circle($center, $radius)
Creates a L<LaTeX::TikZ::Set::Circle> object of center C<$center> and radius C<$radius>.
my $unit_circle = Tikz->circle(0, 1);
Creates a L<LaTeX::TikZ::Set::Circle> object of center C<$center> and radius C<$radius>.
my $unit_circle = Tikz->circle(0, 1);
-=head3 C<< Tikz->arc($from => $to, $center) >>
+=head3 C<arc>
+
+ Tikz->arc($from => $to, $center)
Creates a L<LaTeX::TikZ::Set> structure that represents an arc going from C<$from> to C<$to> with center C<$center>.
Creates a L<LaTeX::TikZ::Set> structure that represents an arc going from C<$from> to C<$to> with center C<$center>.
@@ -220,14+243,19 @@ Creates a L<LaTeX::TikZ::Set> structure that represents an arc going from C<$fro
Creates a L<LaTeX::TikZ::Mod::Pattern> object of class C<$class> and arguments C<%args> that fills the interior of a path with the specified pattern.
C<$class> is prepended with C<LaTeX::TikZ::Mod::Pattern> when it doesn't contain C<::>.
Creates a L<LaTeX::TikZ::Mod::Pattern> object of class C<$class> and arguments C<%args> that fills the interior of a path with the specified pattern.
C<$class> is prepended with C<LaTeX::TikZ::Mod::Pattern> when it doesn't contain C<::>.
@@ -305,7+347,9 @@ See L<LaTeX::TikZ::Mod::Pattern::Dots> and L<LaTeX::TikZ::Mod::Pattern::Lines> f
my $hatched_circle = Tikz->circle(0 => 1)
->mod(Tikz->pattern(class => 'Lines'));
my $hatched_circle = Tikz->circle(0 => 1)
->mod(Tikz->pattern(class => 'Lines'));
-=head3 C<< Tikz->raw_mod($content) >>
+=head3 C<raw_mod>
+
+ Tikz->raw_mod($content)
Creates a L<LaTeX::TikZ::Mod::Raw> object that will instantiate to the raw TikZ mod code C<$content>.
Creates a L<LaTeX::TikZ::Mod::Raw> object that will instantiate to the raw TikZ mod code C<$content>.
@@ -314,14+358,18 @@ Creates a L<LaTeX::TikZ::Mod::Raw> object that will instantiate to the raw TikZ
=head2 Helpers
=head2 Helpers
-=head3 C<< Tikz->formatter(%args) >>
+=head3 C<formatter>
+
+ Tikz->formatter(%args)
Creates a L<LaTeX::TikZ::Formatter> object that can render a L<LaTeX::TikZ::Set> tree.
my $tikz = Tikz->formatter;
my ($header, $declarations, $seq1_body, $seq2_body) = $tikz->render($set1, $set2);
Creates a L<LaTeX::TikZ::Formatter> object that can render a L<LaTeX::TikZ::Set> tree.
my $tikz = Tikz->formatter;
my ($header, $declarations, $seq1_body, $seq2_body) = $tikz->render($set1, $set2);
-=head3 C<< Tikz->functor(@rules) >>
+=head3 C<functor>
+
+ Tikz->functor(@rules)
Creates a L<LaTeX::TikZ::Functor> anonymous subroutine that can be called against L<LaTeX::TikZ::Set> trees to clone them according to the given rules.
C<@rules> should be a list of array references whose first element is the class/role to match against and the second the handler to execute.
Creates a L<LaTeX::TikZ::Functor> anonymous subroutine that can be called against L<LaTeX::TikZ::Set> trees to clone them according to the given rules.
C<@rules> should be a list of array references whose first element is the class/role to match against and the second the handler to execute.
} map($tikz->$_, qw<unit format scale width height>), $origin;
}
} map($tikz->$_, qw<unit format scale width height>), $origin;
}
-=head2 C<render @sets>
+=head2 C<render>
+
+ my ($header_lines, $mod_lines, $content_lines) = $formatter->render(@sets);
Processes all the L<LaTeX::TikZ::Set> objects given in C<@sets> to produce the actual TikZ code to insert in the LaTeX file.
First, all the mods applied to the sets and their subsets are collected, and a declaration is emitted if needed for each of them by calling L<LaTeX::TikZ::Mod/declare>.
Processes all the L<LaTeX::TikZ::Set> objects given in C<@sets> to produce the actual TikZ code to insert in the LaTeX file.
First, all the mods applied to the sets and their subsets are collected, and a declaration is emitted if needed for each of them by calling L<LaTeX::TikZ::Mod/declare>.
Inserts the current rule into the list of rules C<@list>.
The list is expected to be ordered, in that each rule must come after all the rules that have a target that inherits or consumes the original rule's own target.
Inserts the current rule into the list of rules C<@list>.
The list is expected to be ordered, in that each rule must come after all the rules that have a target that inherits or consumes the original rule's own target.
@@ -142,7+142,13 @@ my $target_tc = __PACKAGE__->meta->find_attribute_by_name('target')
=head1 METHODS
=head1 METHODS
-=head2 C<< new name => $name, mapper => $mapper, target => $target >>
+=head2 C<new>
+
+ my $tc = LaTeX::TikZ::Meta::TypeConstraint::Autocoerce->new(
+ name => $name,
+ mapper => $mapper,
+ target => $target,
+ );
Constructs a type constraint object that will attempt to autocoerce objects that are not valid according to C<$target> by loading the class returned by C<$mapper>.
Constructs a type constraint object that will attempt to autocoerce objects that are not valid according to C<$target> by loading the class returned by C<$mapper>.