.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Graphics::Primitive::Path 3pm" .TH Graphics::Primitive::Path 3pm "2014-02-17" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Graphics::Primitive::Path \- Collection of primitives .SH "DESCRIPTION" .IX Header "DESCRIPTION" Graphics::Primitive::Path is a shape defined by a list of primitives. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Graphics::Primitive::Path; \& \& my $path = Graphics::Primitive::Path\->new(); \& $path\->add_primitive($line); \& $path\->move_to($point); .Ve .SH "METHODS" .IX Header "METHODS" .SS "Constructor" .IX Subsection "Constructor" .IP "\fInew\fR" 4 .IX Item "new" Creates a new Graphics::Primitive::Path .SS "Instance Methods" .IX Subsection "Instance Methods" .IP "\fIadd_primitive ($prim)\fR" 4 .IX Item "add_primitive ($prim)" Add a primitive to this Path. .ie n .IP "\fIarc ($radius, \fI$start\fI, \f(CI$end\fI, [ \f(CI$skip_line_to\fI ])\fR" 4 .el .IP "\fIarc ($radius, \f(CI$start\fI, \f(CI$end\fI, [ \f(CI$skip_line_to\fI ])\fR" 4 .IX Item "arc ($radius, $start, $end, [ $skip_line_to ])" .Vb 1 \& $path\->arc($radius, $start_angle_in_radians, $end_angle_in_radians); .Ve .Sp Draw an arc based at the current point with the given radius from the given start angle to the given end angle. \fBA line will be drawn from the current_point to the start point of the described arc. If you do not want this to happen, supply a true value as the last argument.\fR .IP "\fIclear_current_point\fR" 4 .IX Item "clear_current_point" Clears the current point on this Path. .IP "\fIclear_primitives\fR" 4 .IX Item "clear_primitives" Clears all primitives from this Path. \s-1NOTE:\s0 This does not clear the current point. .IP "\fIclose_path\fR" 4 .IX Item "close_path" Close the current path by drawing a line from the \fIcurrent_point\fR back to the first point in the path. .IP "\fIcontiguous\fR" 4 .IX Item "contiguous" Flag this path as being contiguous at this point. Continuity is important so some path-based drivers such as Cairo. You should not mess with this attribute unless you know what you are doing. It's used for driver hinting. .IP "\fIcurrent_point\fR" 4 .IX Item "current_point" Returns the current \*(-- or last \*(-- point on this Path. .ie n .IP "\fIcurve_to ($control1, \fI$control2\fI, \f(CI$end\fI)\fR" 4 .el .IP "\fIcurve_to ($control1, \f(CI$control2\fI, \f(CI$end\fI)\fR" 4 .IX Item "curve_to ($control1, $control2, $end)" Creates a cubic Be\*'zier curve from the current point to the \f(CW$end\fR point using \&\f(CW$control1\fR and \f(CW$control2\fR as control points. .ie n .IP "\fIellipse ($width, \fI$height\fI, [ \f(CI$skip_line_to\fI ])\fR" 4 .el .IP "\fIellipse ($width, \f(CI$height\fI, [ \f(CI$skip_line_to\fI ])\fR" 4 .IX Item "ellipse ($width, $height, [ $skip_line_to ])" Creates an ellipse at the current point with the specified width and height. Optional last argument, if true, skips drawing a line to the ellipse's starting point. .IP "\fIget_points\fR" 4 .IX Item "get_points" Get this path as a series of points. .IP "\fIget_primitive\fR" 4 .IX Item "get_primitive" Returns the primitive at the specified offset. .IP "\fIhints\fR" 4 .IX Item "hints" List of hint hashrefs. This hint arrayref matches the primitives arrayref one-to-one. Hints are tidbits of information that may assist drivers in optimizing (or successfully handling) primitives in this path's list. You should not mess with this structure unless you know what you are doing. .ie n .IP "\fIline_to ($point | \fI$x\fI, \f(CI$y\fI)\fR" 4 .el .IP "\fIline_to ($point | \f(CI$x\fI, \f(CI$y\fI)\fR" 4 .IX Item "line_to ($point | $x, $y)" Draw a line from the current point to the one provided. Accepts either a Geoemetry::Primitive::Point or two arguments for x and y. .ie n .IP "\fImove_to ($point | \fI$x\fI, \f(CI$y\fI)\fR" 4 .el .IP "\fImove_to ($point | \f(CI$x\fI, \f(CI$y\fI)\fR" 4 .IX Item "move_to ($point | $x, $y)" Move the current point to the one specified. This will not add any primitives to the path. Accepts either a Geoemetry::Primitive::Point or two arguments for x and y. .IP "\fIprimitive_count\fR" 4 .IX Item "primitive_count" Returns the number of primitives on this Path. .ie n .IP "\fIrectangle ($width, \fI$height\fI)\fR" 4 .el .IP "\fIrectangle ($width, \f(CI$height\fI)\fR" 4 .IX Item "rectangle ($width, $height)" Draw a rectangle at \fIcurrent_position\fR of the specified width and height. .ie n .IP "\fIrel_curve_to ($x1, \fI$y1\fI, \f(CI$x2\fI, \f(CI$y2\fI, \f(CI$x3\fI, \f(CI$y3\fI)\fR" 4 .el .IP "\fIrel_curve_to ($x1, \f(CI$y1\fI, \f(CI$x2\fI, \f(CI$y2\fI, \f(CI$x3\fI, \f(CI$y3\fI)\fR" 4 .IX Item "rel_curve_to ($x1, $y1, $x2, $y2, $x3, $y3)" Creates a cubic Be\*'zier curve from the current point using the provided values as offsets: .Sp .Vb 4 \& start = current point \& control1 = current point + $x1,$y1 \& control1 = current point + $x2,$y2 \& end = current point + $x3,$y3 .Ve .ie n .IP "\fIrel_line_to ($x_amount, \fI$y_amount\fI)\fR" 4 .el .IP "\fIrel_line_to ($x_amount, \f(CI$y_amount\fI)\fR" 4 .IX Item "rel_line_to ($x_amount, $y_amount)" Draw a line by adding the supplied x and y values to the current one. For example if the current point is 5,5 then calling rel_line_to(2, 2) would draw a line from the current point to 7,7. .ie n .IP "\fIrel_move_to ($x_amount, \fI$y_amount\fI)\fR" 4 .el .IP "\fIrel_move_to ($x_amount, \f(CI$y_amount\fI)\fR" 4 .IX Item "rel_move_to ($x_amount, $y_amount)" Move to a new point by adding the supplied x and y values to the current ones. .SH "AUTHOR" .IX Header "AUTHOR" Cory Watson .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2008\-2010 by Cory G Watson. .PP You can redistribute and/or modify this code under the same terms as Perl itself.