.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 >0, 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 .\" ======================================================================== .\" .IX Title "State 3pm" .TH State 3pm "2023-06-17" "perl v5.36.0" "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" State \- A package to keep track of plotting commands .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use PDL::Graphics::State; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a very simple, at present almost trivial, package to keep track of the current set of plotting commands. .SH "USAGE" .IX Header "USAGE" You create a new object by calling the \f(CW\*(C`new\*(C'\fR operator .PP .Vb 1 \& $state = PDL::Graphics::State\->new(); .Ve .PP Then for each new command you call \f(CW\*(C`add\*(C'\fR on this object so that for a call to \f(CW\*(C`line\*(C'\fR of the form .PP .Vb 1 \& line $x, $y, $opt; .Ve .PP the call to \f(CW\*(C`add\*(C'\fR would be like .PP .Vb 1 \& $state\->add(\e&line, \*(Aqline\*(Aq, [$x, $y], $opt); .Ve .PP which is stored internally as: .PP .Vb 1 \& [\e&line, \*(Aqline\*(Aq, [$x, $y], $opt] .Ve .PP The state can later be extracted using \f(CW\*(C`get\*(C'\fR which returns the state object which is an array of anonymous arrays like the one above where the first object is a reference to the function, the second an anomymous array of arguments to the function and finally an anonymous hash with options to the command. .PP If you know the order in which you inserted commands they can be removed by calling \f(CW\*(C`remove\*(C'\fR with the number in the stack. No further interaction is implemented except \f(CW\*(C`clear\*(C'\fR which clears the stack and \f(CW\*(C`copy\*(C'\fR which returns a \*(L"deep\*(R" copy of the state. .SH "AUTHOR" .IX Header "AUTHOR" Jarle Brinchmann (jarle@astro.ox.ac.uk) after some prodding by Karl Glazebrook. .PP All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file \s-1COPYING\s0 in the \s-1PDL\s0 distribution. If this file is separated from the \s-1PDL\s0 distribution, the copyright notice should be included in the file.