diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer')
20 files changed, 262 insertions, 7451 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasematrix.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasematrix.code.tex deleted file mode 100644 index d72f2206aa7..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasematrix.code.tex +++ /dev/null @@ -1,634 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbasematrix.code.tex,v 1.11 2007/03/09 17:49:32 tantau Exp $ - - -\newif\ifpgfmatrix -\newif\ifpgf@matrix@correct@call - -\newif\ifpgf@matrix@fixed - -\newcount\pgfmatrixcurrentrow - -\newcount\pgfmatrixcurrentcolumn -\newcount\pgf@matrix@numberofcolumns - -\let\pgf@matrix@cell=\pgfnodeparttextbox % alias -\let\pgf@matrix@box=\pgf@matrix@cell % alias - - -% Sets the default row or column sep -% -% #1 = default row or column sep list -% -% Description: -% -% Sets the macro \pgfmatrixrowsep or \pgfmatrixcolumnsep to #1. -% -% Example: -% -% \pgfsetmatrixrowsep{5pt} - -\def\pgfsetmatrixrowsep#1{\def\pgfmatrixrowsep{#1}} -\def\pgfsetmatrixcolumnsep#1{\def\pgfmatrixcolumnsep{#1}} - -\def\pgfmatrixrowsep{0pt} -\def\pgfmatrixcolumnsep{0pt} - - - -% The pgfmatrix command creates a node that contains a matrix. Like -% the \pgfnode command, it is to be used inside a pgfpicture -% environment. -% -% #1 = shape type -% #2 = anchor -% #3 = name for later reference -% #4 = path usage command -% #5 = inner shift -% #6 = startup code -% #7 = the matrix code (may contain verbatim stuff) -% -% Description: -% -% This command creates a node that contains a matrix. For -% each cell of the matrix, drawing commands may be given. These -% commands will create a cell picture and a bounding box is computed -% for each cell picture. The cell picture is then placed inside the -% cell. The position inside the cell is computed according to the -% following rules: -% -% 1. In each column, the origins of the cell pictures are all on a -% vertical line. -% 2. In each row, the origins of the cell pictures are all on a -% horizontal line. -% 3. All cells in the same row have the same height and depth. -% 4. All cells in the same column have the same width. -% 5. The size of cells are chosen minimal such that the boxes fit into -% the cells and still meet the above requirement. -% -% Next, the whole resulting matrix, which is given as #7, is placed -% inside a node whose name is given as #3, whose shape is #1, and -% whose anchor is #1. This means that the resulting node is shifted -% such that the given anchor lies at the origin. Then, as for a normal -% node, the #4 path usage command is used for the node. -% -% The parameter #5 is an additional negative shift for the node. Normally, such -% a shift could be given beforehand (that is, the shift could be -% preapplied to the current transformation matrix). However, when #5 -% is evaluated, you can refer to temporary positions of nodes inside -% the matrix. In detail, the following happens: When the matrix has -% been typeset, all nodes in the matrix temporarily get assigned their -% positions in the matrix box. The origin of this coordinate system is -% at the left baseline end of the matrix box, which corresponds to the -% text anchor. The position #5 is then interpreted inside this -% coordinate system and then used for shifting. -% -% The idea behind using the parameter #5 is the following: If you -% specify "text" as anchor #2 and specify \pgfpointanchor{inner -% node}{some anchor} for parameter #5, where inner node is a node that -% is created in the matrix, then the whole matrix will be shifted such -% that inner node.some anchor lies at the origin of the whole picture. -% -% At the beginning and at the end of each cell, the macros -% \pgfmatrixbegincode and \pgfmatrixendcode are called. Inside these -% macros you can use \pgfmatrixcurrentcolumn and \pgfmatrixcurrentrow -% to access the current row and column. -% -% Before each column except for the first, an extra space given by the -% macro \pgfmatrixcolumnsep is added. Additionally, an extra space -% given by the optional argument of the \pgfmatrixnextcell commands in -% the first line are added, which may vary between columns. Between -% rows, an extra space given by the macro \pgfmatrixrowsep is -% added. You can also change this value for each row by using a \gdef. -% -% Inside the matrix, \\ must be used to end every line ***including -% the last***. You can pass an optional parameter to \\ as in \\[2pt] -% to give an additional space after this particular line. -% -% The usage of \\ at the end of the matrix is imporant since this -% command is used to find the end of the matrix. What happens is that -% \\ followed by a closing brace ends the matrix. -% -% Inside the matrix, you must use \pgfmatrixnextcell to separate -% columns. The reason is that two columns are used internally for -% every single column shown. The macro \pgfmatrixnextcell is yields -% (more or less) two && (and some further trickery). -% -% The parameter #6 is executed at the beginning of the matrix -% group. It is inside the protecting group of the matrix, but outside -% the matrix itself. It can be used for different purposes: 1) It can be -% used to simplify the next cell macro. 2) It can be used to issue an -% \aftergroup command. 3) It can be used to setup local settings. For -% example, by setting #6 to \let\&=\pgfmatrixnextcell you can use \& -% instead of \pgfmatrixnextcell. You can also set the catcode of & to -% active. -% -% -% Example: -% -% \begin{tikzpicture} -% -% \draw (0,0) circle (1mm); % b.north will lie on the center of this circle -% -% \pgfmatrix{rectangle}{text}{mymatrix}{\pgfusepath{}}{\pgfpointanchor{b}{north}}{\let\&=\pgfmatrixnextcell} -% { -% \draw (0,0) circle (1cm); \& \node (a) [draw] {Hallo}; \\ -% \node (b) [draw] {Welt}; \& \draw (0,0) circle (5mm); \\ -% } -% -% \draw [->] (a) -- (b); -% -% \end{tikzpicture} - -\def\pgfmatrix#1#2#3#4#5#6{% - \ifpgfmatrix% - \PackageError{pgf}{You cannot nest pgfmatrix environments, yet}{} - \fi% - \bgroup% - #6% - \def\pgf@matrix@par@shape{#1}% - \def\pgf@matrix@par@anchor{#2}% - \def\pgf@matrix@par@name{#3}% - \def\pgf@matrix@par@usage{#4}% - \def\pgf@matrix@par@shift{#5}% - % the matrix must have a name: - \ifx\pgf@matrix@par@name\pgfutil@empty% - \def\pgf@matrix@par@name{pgf@matrix@internal}% - \fi% - \pgfmatrixcurrentrow=0\relax% - \pgfmatrixcurrentcolumn=0\relax% - \pgf@matrix@numberofcolumns=0\relax% - \let\\=\pgf@matrix@eol% - \tabskip=0pt% - \offinterlineskip% - \pgfmatrixtrue% - \let\pgf@matrix@node@list=\pgfutil@empty% - \expandafter\let\csname pgf@matrix@column@finish@1\endcsname=\pgfutil@empty% - \let\pgf@matrix@row@finish=\pgfutil@empty% - % - % Get rid of bgroup - % - \afterassignment\pgf@matrix@cont\let\pgf@next=% -} -\def\pgf@matrix@cont{% - \setbox\pgf@matrix@box=\hbox\bgroup\vbox\bgroup% - \halign\bgroup% - \pgf@matrix@init@row% - \pgf@matrix@step@column% - {% - \pgf@matrix@startcell% - ##% - \pgf@matrix@endcell% - }% - &% - ##\pgf@matrix@padding&&% - \pgf@matrix@step@column% - {% - \pgf@matrix@startcell% - ##% - \pgf@matrix@endcell% - }&% - ##\pgf@matrix@padding% - \cr% -} - -\def\pgf@end@matrix{% - \egroup\egroup% - \egroup% - % - % If there are named nodes, we must adjust their coordinates. - % - \ifx\pgf@matrix@node@list\pgfutil@empty% - \else% - % Ok, this means we got a lot of work to do... - \pgf@matrix@compute@origin% - \pgf@matrix@shift@nodes@initial% - \fi% - % - % Compute additional shift - % - \pgftransformresetnontranslations% - \pgftransformshift{\pgf@process{\pgftransformreset\pgf@matrix@par@shift\pgf@x=-\pgf@x\pgf@y=-\pgf@y}}% - % - % Create node - % - \pgfmultipartnode{\pgf@matrix@par@shape}{\pgf@matrix@par@anchor}{\pgf@matrix@par@name}{\pgf@matrix@par@usage}% - % - % If there are named nodes, we must adjust their coordinates, again. - % - \ifx\pgf@matrix@node@list\pgfutil@empty% - \else% - {% - \pgftransformreset% - \pgf@process{\pgfpointanchor{\pgf@matrix@par@name}{text}}% - \xdef\pgf@matrix@offset{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}% - \pgf@matrix@shift@nodes@secondary{\pgf@matrix@offset}% - }% - \fi% -} - - - - -% Ending a cell -% -% #1 = (optional) spacing between previous and next column. This -% parameter only has an effect in the first row. -% -% Description: -% -% This command ends a cell of a matrix. -% -% Example: -% -% \pgfmatrix{rectangle}{text}{mymatrix}{\pgfusepath{}}{\pgfpointanchor{b}{north}}{} -% { -% \draw (0,0) circle (1cm); \pgfmatrixnextcell[1cm] \node (a) [draw] {Hallo}; \\ -% \node (b) [draw] {Welt}; \pgfmatrixnextcell \draw (0,0) circle (5mm); \\ -% } - -\def\pgfmatrixnextcell{% - % if the cell contains nothing, the following \let will be at the - % beginning (macro expansion has stopped here since neither \omit - % nor \span was found) - \let\pgf@matrix@signal@cell@end=\pgf@matrix@signal@cell@end% - \pgfutil@ifnextchar[{\pgf@matrix@cell@cont}{\pgf@matrix@cell@cont[0pt]}}%} - -\def\pgf@matrix@cell@cont[#1]{% - \ifnum\pgfmatrixcurrentcolumn<\pgf@matrix@numberofcolumns% - \else% - {% - \global\pgf@matrix@fixedfalse% - \pgf@x=0pt% - \pgf@matrix@addtolength{\pgf@x}{\pgfmatrixcolumnsep}% - \pgf@matrix@addtolength{\pgf@x}{#1}% - \ifpgf@matrix@fixed% - \expandafter\pgfutil@g@addto@macro\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname% - {\global\pgf@picmaxx=0pt}% - \fi% - \advance\pgfmatrixcurrentcolumn by1\relax % only temporary for the following: - \expandafter\xdef\csname pgf@matrix@column@sep@\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@x}% - \ifpgf@matrix@fixed% - \expandafter\gdef\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname{\global\pgf@picminx=0pt}% - \else% - \expandafter\global\expandafter\let\csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname=\pgfutil@empty% - \fi% - }% - \fi% - &\pgf@matrix@correct@calltrue&% -}% - - -\def\pgf@matrix@fixed@text{between origins} -\def\pgf@matrix@natural@text{between borders} - -\def\pgf@matrix@addtolength#1#2{\edef\pgf@temp{#2}\expandafter\pgf@matrix@addtolength@\expandafter#1#2,\pgf@stop} -\def\pgf@matrix@addtolength@#1#2,#3\pgf@stop{% - \def\pgf@temp{#2}% - \ifx\pgf@temp\pgfutil@empty% - \else% - \ifx\pgf@temp\pgf@matrix@fixed@text% - \global\pgf@matrix@fixedtrue% - \else% - \ifx\pgf@temp\pgf@matrix@natural@text% - \global\pgf@matrix@fixedfalse% - \else% - \pgfmathaddtolength{#1}{#2}% - \fi% - \fi% - \fi% - \def\pgf@temp{#3}% - \ifx\pgf@temp\pgfutil@empty% - \else% - \pgf@matrix@addtolength@#1#3\pgf@stop% - \fi% -} - - - -% Init a line - -\def\pgf@matrix@init@row{% - \relax% - \global\advance\pgfmatrixcurrentrow by 1\relax% - \global\pgfmatrixcurrentcolumn=0\relax% - \expandafter\gdef\csname pgf@matrix@maxy\the\pgfmatrixcurrentrow\endcsname{0pt}% - \expandafter\gdef\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname{0pt}% -} - - - -% Step the row column number - -\def\pgf@matrix@step@column{% - \relax% - \global\advance\pgfmatrixcurrentcolumn by1\relax% -} - - - -% Start a cell - -\def\pgf@matrix@startcell{% - % - % Step 1: Init the list of nodes for this cell - % - \let\pgf@nodecallback=\pgf@matrix@nodecallback% - % - % Step 2: Setup the bounding box - % - \pgfinterruptboundingbox% - % - % Step 3: Reset the transformation matrix - % - \pgftransformreset% - % - % Step 4: Collect everything in a cell box - % - \setbox\pgf@matrix@cell=\hbox\bgroup\bgroup% - \pgfsys@beginpicture% - \normalbaselines% - % Find out whether the cell is empty: - \pgfutil@ifnextchar\let% - {% ok, candidate, check following symbol - \afterassignment\pgf@matrix@empty@check\let\pgf@next=% get rid of \let - }% - {% no, not empty - \pgf@matrix@empty@cell@false% - \pgfmatrixbegincode% - }% -} - -\def\pgf@matrix@empty@check{% - \pgfutil@ifnextchar\pgf@matrix@signal@cell@end% - {% Bingo! - \pgf@matrix@empty@cell@true% - \pgfmatrixemptycode% - \let% reinserted - }% - {% Nope! - \pgf@matrix@empty@cell@false% - \pgfmatrixbegincode% - \let% reinserted - } -}% - -\newif\ifpgf@matrix@empty@cell@ - - -% End a cell - -\def\pgf@matrix@endcell{% - \ifpgf@matrix@empty@cell@% - \else% - \expandafter\pgfmatrixendcode% - \fi - \pgfsys@endpicture% - \csname pgf@matrix@column@finish@\the\pgfmatrixcurrentcolumn\endcsname% - \pgf@matrix@row@finish% - \egroup\egroup% - % Special case of the empty picture - \ifdim\pgf@picmaxx=-16000pt\relax% - \pgf@picmaxx=0pt\relax% - \pgf@picminx=0pt\relax% - \pgf@picmaxy=0pt\relax% - \pgf@picminy=0pt\relax% - \fi% - % - % Step 5: Horizontal gap - % - \ifnum\pgfmatrixcurrentcolumn>1\relax% - \pgf@y=\csname pgf@matrix@column@sep@\the\pgfmatrixcurrentcolumn\endcsname\relax% - \advance\pgf@picminx by-\pgf@y% - \fi% - % - % Step 6: Protocol and adjust height and depth - % - % Step 6.1: Protocol... - % - \ifdim\pgf@picmaxy>\csname pgf@matrix@maxy\the\pgfmatrixcurrentrow\endcsname% - \expandafter\xdef\csname pgf@matrix@maxy\the\pgfmatrixcurrentrow\endcsname{\the\pgf@picmaxy}% - \fi% - \ifdim\pgf@picminy<\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname% - \expandafter\xdef\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname{\the\pgf@picminy}% - \fi% - % - % Step 6.2: and setup. - % - \ht\pgf@matrix@cell=\pgf@picmaxy% - \dp\pgf@matrix@cell=-\pgf@picminy% - % - % Step 7: Protocol and adjust left and right width - % - % Step 7.1: Protocol... - % - \ifnum\pgfmatrixcurrentcolumn>\pgf@matrix@numberofcolumns\relax% - \expandafter\xdef\csname pgf@matrix@maxx\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@picmaxx}% - \expandafter\xdef\csname pgf@matrix@minx\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@picminx}% - \global\pgf@matrix@numberofcolumns=\pgfmatrixcurrentcolumn\relax% - \else% - \ifdim\pgf@picmaxx>\csname pgf@matrix@maxx\the\pgfmatrixcurrentcolumn\endcsname% - \expandafter\xdef\csname pgf@matrix@maxx\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@picmaxx}% - \fi% - \ifdim\pgf@picminx<\csname pgf@matrix@minx\the\pgfmatrixcurrentcolumn\endcsname% - \expandafter\xdef\csname pgf@matrix@minx\the\pgfmatrixcurrentcolumn\endcsname{\the\pgf@picminx}% - \fi% - \fi% - % - % Step 7.2: and setup. - % - \xdef\pgf@matrix@paddingskip{\the\pgf@picmaxx}% - % - % Step 8: Put in the box now - % - \hfil\hskip-\pgf@picminx% - \wd\pgf@matrix@cell=0pt% - \box\pgf@matrix@cell% - % - % Step 9: End bounding box - \endpgfinterruptboundingbox% -} - -% Default code for the start and end code -\let\pgfmatrixbegincode=\relax -\let\pgfmatrixendcode=\relax -\let\pgfmatrixemptycode=\relax - - -% The following callback is called for every node that is produced -% inside a cell - -\def\pgf@matrix@nodecallback#1{% - \def\pgf@temp{#1}% - \ifx\pgf@temp\pgfutil@empty% - \else% - \xdef\pgf@matrix@node@list{\pgf@matrix@node@list,{#1}}% - \expandafter\xdef\csname pgf@matrix@node@location@#1\endcsname{{\the\pgfmatrixcurrentrow}{\the\pgfmatrixcurrentcolumn}}% - \fi% -} - - - -% Padding code - -\def\pgf@matrix@padding{% - \ifpgf@matrix@correct@call% - \else% - \PackageError{pgfbasematrix}{Single ampersand used with wrong - catcode}{}% - \fi% - \hskip\pgf@matrix@paddingskip\hfil% -} - - -% Compute the real positions of the origins - -% We must now compute the real positions of the origins of all the -% small pictures. To this end, we need to compute prefix sums. After -% the procedure is done, the minx and the maxy will contain the origin -% positions. - -\def\pgf@matrix@compute@origin{% - % - % Inverse prefix sum on the vertical positions - % - {% - \ifnum\pgfmatrixcurrentrow>0\relax% - \expandafter\gdef\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname{0pt}% - \fi - \c@pgf@counta=\pgfmatrixcurrentrow\relax% - \loop% - \ifnum\c@pgf@counta>1\relax% - \pgf@y=\csname pgf@matrix@miny\the\c@pgf@counta\endcsname\relax% - \advance\pgf@y by\csname pgf@matrix@maxy\the\c@pgf@counta\endcsname\relax - \advance\c@pgf@counta by-1\relax% - \pgf@ya=\csname pgf@matrix@miny\the\c@pgf@counta\endcsname\relax% - \advance\pgf@y by-\pgf@ya\relax% - \expandafter\xdef\csname pgf@matrix@miny\the\c@pgf@counta\endcsname{\the\pgf@y}% - \repeat% - }% - % - % Prefix sum on the horizontal positions - % - {% - \ifnum\pgf@matrix@numberofcolumns>0\relax% - \pgf@x=\csname pgf@matrix@minx1\endcsname\relax% - \pgf@x=-\pgf@x% - \expandafter\xdef\csname pgf@matrix@minx1\endcsname{\the\pgf@x}% - \fi - \c@pgf@counta=1\relax% - \loop% - \ifnum\c@pgf@counta<\pgf@matrix@numberofcolumns\relax% - \pgf@x=\csname pgf@matrix@minx\the\c@pgf@counta\endcsname\relax% - \advance\pgf@x by\csname pgf@matrix@maxx\the\c@pgf@counta\endcsname\relax% - \advance\c@pgf@counta by1\relax% - \pgf@xa=\csname pgf@matrix@minx\the\c@pgf@counta\endcsname\relax% - \advance\pgf@x by-\pgf@xa\relax% - \expandafter\xdef\csname pgf@matrix@minx\the\c@pgf@counta\endcsname{\the\pgf@x}% - \repeat% - }% -} - - -% Shift the nodes to their origins - -% The following procedure shifts all nodes in -% \pgf@matrix@node@list to their location inside a temporary -% picture. This picture will later be shifted again to its final -% position in the real picture. - -\def\pgf@matrix@shift@nodes@initial{% - {% - \pgfutil@for\pgf@matrix@node@name:=\pgf@matrix@node@list\do{% - \ifx\pgf@matrix@node@name\pgfutil@empty% - \else% - \expandafter\ifx\csname pgf@matrix@node@visited@\pgf@matrix@node@name\endcsname\relax% - \pgf@shift@node{\pgf@matrix@node@name}{% - \pgf@x=\csname pgf@matrix@minx% - \expandafter\expandafter\expandafter\pgfutil@secondoftwo\csname pgf@matrix@node@location@\pgf@matrix@node@name\endcsname\endcsname% - \pgf@y=\csname pgf@matrix@miny% - \expandafter\expandafter\expandafter\pgfutil@firstoftwo\csname pgf@matrix@node@location@\pgf@matrix@node@name\endcsname\endcsname% - }% - \expandafter\let\csname pgf@matrix@node@visited@\pgf@matrix@node@name\endcsname=\pgfutil@empty% - \fi% - \fi% - }% - }% -} - - -% The second shifting, done in the following procedure, shifts all -% nodes to their real positions inside the real picture. - -\def\pgf@matrix@shift@nodes@secondary#1{% - \pgfutil@for\pgf@matrix@node@name:=\pgf@matrix@node@list\do{% - \ifx\pgf@matrix@node@name\pgfutil@empty% - \else% - \expandafter\ifx\csname pgf@matrix@node@visited@\pgf@matrix@node@name\endcsname\relax% - \pgf@shift@node{\pgf@matrix@node@name}{#1}% - \expandafter\let\csname pgf@matrix@node@visited@\pgf@matrix@node@name\endcsname=\pgfutil@empty% - \fi% - \fi% - }% -} - - -% End of line -\def\pgf@matrix@eol{% - % if the cell contains nothing, the following \let will be at the - % beginning (macro expansion has stopped here since neither \omit - % nor \span was found) - \let\pgf@matrix@signal@cell@end=\pgf@matrix@signal@cell@end% - &\pgf@matrix@correct@calltrue% - \global\pgf@matrix@fixedfalse% - \pgf@y=0pt% - \pgf@matrix@addtolength\pgf@y{\pgfmatrixrowsep}% - \pgfutil@ifnextchar[{\pgf@matrix@eol@skip}{\pgf@matrix@finish@line}% -} - -\def\pgf@matrix@signal@cell@end{\pgf@matrix@signal@cell@end} -% exact definition does not matter, only needs to be unique. - -\def\pgf@matrix@eol@skip[#1]{% - \pgf@matrix@addtolength\pgf@y{#1}% - \pgf@matrix@finish@line% -} - -\def\pgf@matrix@finish@line{% - \global\pgf@y=\pgf@y% - \pgf@ya=-\pgf@y% - \global\advance\pgf@ya by\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname% - \expandafter\xdef\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname{\the\pgf@ya}% - \@ifnextchar\egroup{\cr\pgf@end@matrix}{\pgf@matrix@no@eom@found}% -} - -\def\pgf@matrix@eom@found{% - \cr% - \pgf@end@matrix% -} - -\def\pgf@matrix@no@eom@found{% - \cr% - \noalign{\vskip\pgf@y% - \ifpgf@matrix@fixed% - \vskip\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname% unskip - \vskip\pgf@y% - \pgf@y=-\pgf@y% - \expandafter\xdef\csname pgf@matrix@miny\the\pgfmatrixcurrentrow\endcsname{\the\pgf@y}% - \gdef\pgf@matrix@row@finish{\global\pgf@picmaxy=0pt}% - \else% - \global\let\pgf@matrix@row@finish=\pgfutil@empty% - \fi% - }% -} - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex deleted file mode 100644 index 3e019c5feec..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex +++ /dev/null @@ -1,357 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseplot.code.tex,v 1.7 2007/05/02 14:08:27 tantau Exp $ - - -% PGF's plotting interface works as follows: -% -% In order to plot something, two things need to be done. First, you -% need to provide the coordinates (obviously) of the points that -% should be plotted. The coordinates are given via a long stream of -% commands. These commands are \pgfplotstreamstart, which is -% given exactly once at the beginning, \pgfplotstreampoint, of which there -% are numerous in the middle, \pgfplotstreamspecial, of which there may be -% numerous in the middle, and \pgfplotstreamend, which must be given -% at the end. Between these commands arbitrary other commands may be -% given. Here is an example: -% -% ... -% \pgfplotstreamstart -% \pgfplotstreampoint{\pgfpointxy{0}{0}} -% \pgfplotstreampoint{\pgfpointxy{1}{1}} -% \pgfplotstreampoint{\pgfpointxy{2}{4}} -% \relax -% \pgfplotstreampoint{\pgfpointxy{3}{9}} -% \pgfplotstreamspecial{some handler-dependent special stuff} -% \pgfplotstreamend -% -% By themselves, the \pgfplotstreamxxxx commands do not do anything by -% default. Rather, the ``use'' such a stream, you must first install a -% stream handler. For example, the ``lineto'' handler will simply -% translate every \pgfplotstreampoint into a \pgfpathlineto. -% -% Example: -% -% \pgfpathmoveto{\pgfpointorigin} -% -% \pgfplothandlerlineto -% \pgfplotstreamstart -% \pgfplotstreampoint{\pgfpointxy{0}{0}} -% \pgfplotstreampoint{\pgfpointxy{1}{1}} -% \pgfplotstreampoint{\pgfpointxy{2}{4}} -% \relax -% \pgfplotstreampoint{\pgfpointxy{3}{9}} -% \pgfplotstreamend - - -% The stream commands actually call their ``internal'' versions, which -% are set by the handlers: -\def\pgfplotstreamstart{\pgf@plotstreamstart} -\def\pgfplotstreampoint#1{\gdef\pgfplotlastpoint{#1}\pgf@plotstreampoint{#1}} -\def\pgfplotstreamspecial{\pgf@plotstreamspecial} -\def\pgfplotstreamend{\pgf@plotstreamend} - - - - -% Sets the action taken for the first point of a plot to a lineto. -% -% Description: -% -% For certain handlers it makes sense either the start a plot by -% moving to the first point of the plot or to do a lineto to that -% first point. Using this command this action can be set to a lineto. -% -% Example: -% -% \pgfsetlinetofirstplotpoint - -\def\pgfsetlinetofirstplotpoint{\let\pgf@plot@first@action=\pgfpathlineto} - - -% Sets the action taken for the first point of a plot to a moveto. -% -% Example: -% -% \pgfsetmovetofirstplotpoint - -\def\pgfsetmovetofirstplotpoint{\let\pgf@plot@first@action=\pgfpathmoveto} - -\let\pgf@plot@first@action=\pgfpathmoveto - - - -% -% Handlers -% - - -% This handler converts each plot stream command into a lineto -% command, except for the first, which is converted to the action that -% has previously been specified using \pgfsetlinetofirstplotpoint or -% \pgfsetmovetofirstplotpoint. -% -% Example: -% -% \pgfplothandlerlineto -% \pgfplotxyfile{mytable} - -\def\pgfplothandlerlineto{% - \def\pgf@plotstreamstart{% - \global\let\pgf@plotstreampoint=\pgf@plot@line@handler% - \global\let\pgf@plotstreamspecial=\pgfutil@gobble% - \global\let\pgf@plotstreamend=\relax% - }% -} - -\def\pgf@plot@line@handler#1{% - \pgf@plot@first@action{#1}% - \global\let\pgf@plotstreampoint=\pgfpathlineto% -} - - - -% More handlers are defined in pgflibraryplothandlers - - - - - -% This handler discards the plot. -% -% Example: -% -% \pgfplothandlerdiscard -% \pgfplotxyfile{mytable} - -\def\pgfplothandlerdiscard{% - \def\pgf@plotstreamstart{% - \global\let\pgf@plotstreampoint=\pgfutil@gobble% - \global\let\pgf@plotstreamspecial=\pgfutil@gobble% - \global\let\pgf@plotstreamend=\relax% - }% -} - - - - -% This handler records each plot stream command to a macro. This is -% useful if plot commands are difficult to generate and need to be -% ``recylced'' later on. -% -% Example: -% -% \pgfplothandlerrecord{\myplot} -% \pgfplotxyfile{mytable} % stored in \myplot now -% \pgfplothandlerline -% \myplot -% \pgftransformxshift{1cm} -% \myplot - -\def\pgfplothandlerrecord#1{% - \def\pgf@plot@recordto{#1}% - \gdef#1{\pgfplotstreamstart}% - \def\pgf@plotstreamstart{% - \gdef\pgf@plotstreampoint####1{\expandafter\gdef\expandafter#1\expandafter{#1\pgfplotstreampoint{####1}}}% - \gdef\pgf@plotstreamspecial####1{\expandafter\gdef\expandafter#1\expandafter{#1\pgfplotstreamspecial{####1}}}% - \gdef\pgf@plotstreamend{\expandafter\gdef\expandafter#1\expandafter{#1\pgfplotstreamend}}% - }% -} - - - -% Read a plot stream from a file and plot it. -% -% #1 = file from which to read things -% -% File format: -% -% Each line of the file should begin with two numbers separated by a -% space. Such a line with number #1 and #2 is converted to a -% \pgfplotstreampoint{\pgfpointxy{#1}{#2}}. Extra characters following -% on the line are ignored. -% -% Lines starting with ``%'' and ``#'' are ignored. -% -% Example: -% -% \pgfplotxyfile{tableformgnuplot.dat} - -\def\pgfplotxyfile#1{% - \begingroup% - \pgfplotstreamstart% - \openin1=#1 - \ifeof1 - \PackageWarning{pgf}{Plot data file `#1' not found.} - \else - \catcode`\#=14 - \pgf@readxyfile% - \fi - \pgfplotstreamend% - \endgroup% -} - -\let\pgf@savedpar=\par% -\def\pgf@partext{\par} -\def\pgf@readxyfile{% - \read1 to \pgf@temp% - \let\par=\pgf@savedpar% - \edef\pgf@temp{\pgf@temp}% - \ifx\pgf@temp\pgfutil@empty% - \else\ifx\pgf@temp\pgf@partext% - \else% - \expandafter\pgf@parsexyline\pgf@temp\pgf@stop% - \fi\fi% - \ifeof1\else\expandafter\pgf@readxyfile\fi% -} - -\def\pgf@parsexyline#1 #2 #3\pgf@stop{% - \pgfplotstreampoint{\pgfpointxy{#1}{#2}}% -} - - - - - -% Read a plot stream from a file and plot it. -% -% #1 = file from which to read things -% -% File format: -% -% Like xy, except that each line contains three numbers, which are -% converted to xyz coordiantes. -% -% Example: -% -% \pgfplotxyfile{tableformgnuplot.dat} - -\def\pgfplotxyzfile#1{% - \begingroup% - \pgfplotstreamstart% - \openin1=#1 - \ifeof1 - \PackageWarning{pgf}{Plot data file `#1' not found.} - \else - \catcode`\#=14 - \pgf@readxyzfile% - \fi - \pgfplotstreamend% - \endgroup% -} - -\def\pgf@readxyzfile{% - \read1 to \pgf@temp% - \ifx\pgf@temp\pgfutil@empty% - \else\ifx\pgf@temp\pgf@partext% - \else% - \expandafter\pgf@parsexyzline\pgf@temp\pgf@stop% - \fi\fi% - \ifeof1\else\expandafter\pgf@readxyzfile\fi% -} - -\def\pgf@parsexyzline#1 #2 #3 #4\pgf@stop{% - \pgfplotstreampoint{\pgfpointxyz{#1}{#2}{#3}}% -} - - - - -% Render a function using gnuplot. -% -% #1 = filename prefix for .gnuplot and .table files (optional, -% default is \jobname) -% #2 = gnuplot function text -% -% Description: -% -% This command will write a file called #1.gnuplot that sets up -% some gnuplot commands to write output to a file called -% #1.table. Then it calls gnuplot (using the \write18 mechanism) -% to execute the file. Then it reads #2.table using \pgfplotxyfile. -% -% Example: -% -% \pgfplothandlerlineto -% \pgfplotgnuplot[\jobname]{plot [x=0:5] x*sin(x)} - -{ - \catcode`\%=12 - \catcode`\"=12 - \xdef\pgf@gnuplot@head#1{set terminal table; set output "#1.table"; set format "%.5f"} -} - -\newwrite\pgf@plotwrite -\newif\ifpgf@resample@plot - -\def\pgfplotgnuplot{\pgfutil@ifnextchar[{\pgf@plotgnuplot}{\pgf@plotgnuplot[\jobname]}}%} -\def\pgf@plotgnuplot[#1]#2{% - \pgf@resample@plottrue% - % Check, whether it is up-to-date - \openin\pgfutil@inputcheck=#1.gnuplot - \ifeof\pgfutil@inputcheck% - \else% - \read\pgfutil@inputcheck to\pgf@temp% ignored - \read\pgfutil@inputcheck to\pgf@plot@line% - \edef\pgf@plot@code{#2\space}% - \ifx\pgf@plot@code\pgf@plot@line% - \openin\pgfutil@inputcheck=#1.table - \ifeof\pgfutil@inputcheck% - \else% - \pgf@resample@plotfalse% - \fi% - \fi% - \fi - \ifpgf@resample@plot% - \immediate\openout\pgf@plotwrite=#1.gnuplot - \immediate\write\pgf@plotwrite{\pgf@gnuplot@head{#1}}% - \immediate\write\pgf@plotwrite{#2}% - \immediate\closeout\pgf@plotwrite% - \immediate\write18{gnuplot #1.gnuplot} - \fi% - \pgfplotxyfile{#1.table} -} - - - -% This producer handler plots a function using pgf's mathematical engine. -% -% #1 = variable -% #2 = domain for the variable -% #3 = point, typically defined in terms of the value of the variable -% -% Description: -% -% This producer will iterate the variable #1 over all variables in #2 -% (using the \foreach statement). For each value, a plot coordinate -% #3 is created. -% -% Note that this command is pretty slow. -% -% Example: -% -% \pgfplothandlerlineto -% \pgfplotfunction{\x}{0,0.1,...,3.141}{\pgfpointxy{\x}{sin(\x)}} - -\def\pgfplotfunction#1#2#3{% - \pgfplotstreamstart% - \foreach#1in{#2}% - {% - \pgf@process{#3}% - \edef\pgf@marshal{\noexpand\pgfplotstreampoint{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}% - \pgf@marshal% - } - \pgfplotstreamend% -} - - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex deleted file mode 100644 index dc9f660d0c2..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex +++ /dev/null @@ -1,892 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseshapes.code.tex,v 1.19 2007/06/07 07:41:10 tantau Exp $ - - -\newbox\pgfnodeparttextbox - - -% Creates a node -% -% #1 = shape type -% #2 = anchor -% #3 = name for later reference -% #4 = path usage command -% -% Description: -% -% This command draws a shape that has previously been defined using -% \pgfdeclareshape. The shape is shifted such that the anchor is at -% the origin. In order to transform the whole shape, you should setup -% pgf's transformation matrix prior to calling this command. -% -% When this command is called, the shape-specific TeX boxes of the -% node must have been setup correctly. -% -% Example: -% -% \pgftransformshift{\pgfpoint{1cm}{1cm}} -% \pgfmultipartnode{rectangle}{center}{hellonode}{\pgfusepath{stroke}} - -\def\pgfmultipartnode#1#2#3#4{% - \pgfutil@ifundefined{pgf@sh@s@#1}% - {\PackageError{pgf}{Unknown shape ``#1''}{}}% - {% - {% - \let\pgf@sh@savedpoints=\pgfutil@empty% - \csname pgf@sh@s@#1\endcsname% - \pgf@sh@savedpoints% - \pgftransformshift{% - \pgf@sh@reanchor{#1}{#2}% - \pgf@x=-\pgf@x% - \pgf@y=-\pgf@y% - }% - % Save the saved points and the transformation matrix - \edef\pgf@test{#3}% - \ifx\pgf@test\pgfutil@empty% - \else% - \expandafter\xdef\csname pgf@sh@ns@#3\endcsname{#1}% - \edef\pgf@sh@@temp{\noexpand\gdef\expandafter\noexpand\csname pgf@sh@np@#3\endcsname}% - \expandafter\pgf@sh@@temp\expandafter{\pgf@sh@savedpoints}% - \pgfgettransform\pgf@temp - \expandafter\xdef\csname pgf@sh@nt@#3\endcsname{\pgf@temp}% - \expandafter\xdef\csname pgf@sh@pi@#3\endcsname{\pgfpictureid}% - \fi% - \pgfutil@ifundefined{pgf@sh@bbg@#1}{} - {{\pgfscope\csname pgf@sh@bbg@#1\endcsname\endpgfscope}}% - \pgfutil@ifundefined{pgf@sh@bg@#1}{}% - {\csname pgf@sh@bg@#1\endcsname#4}% - \pgfutil@ifundefined{pgf@sh@fbg@#1}{} - {{\pgfscope\csname pgf@sh@fbg@#1\endcsname\endpgfscope}}% - {% - \expandafter\pgfutil@for\expandafter\pgf@shape@com\expandafter:\expandafter=\csname pgf@sh@boxes@#1\endcsname\do{% - {% - \pgftransformshift{\pgf@sh@reanchor{#1}{\pgf@shape@com}}% - \expandafter\pgfqboxsynced\expandafter{\csname pgfnodepart\pgf@shape@com box\endcsname}% - }% - }% - }% - \pgfutil@ifundefined{pgf@sh@bfg@#1}{}% - {{\pgfscope\csname pgf@sh@bfg@#1\endcsname\endpgfscope}}% - \pgfutil@ifundefined{pgf@sh@fg@#1}{}% - {\csname pgf@sh@fg@#1\endcsname#4}% - \pgfutil@ifundefined{pgf@sh@ffg@#1}{}% - {{\pgfscope\csname pgf@sh@ffg@#1\endcsname\endpgfscope}}% - \pgf@nodecallback{#3}% - }% - }% -} - - -\def\pgf@shift@node#1#2{% - % This internal command shifts the recorded coordinates for node #1 - % by the vector #2. It is used to - % correct the position of the node if the recorded coordinate - % happens to be wrong - {% - \pgfsettransform{\csname pgf@sh@nt@#1\endcsname}% - \pgf@process{#2}% - \advance\pgf@pt@x by\pgf@x% - \advance\pgf@pt@y by\pgf@y% - \pgfgettransform{\pgf@temp}% - \expandafter\xdef\csname pgf@sh@nt@#1\endcsname{\pgf@temp}% - }% -} - -\let\pgf@nodecallback=\pgfutil@gobble - - - -% Creates a node -% -% #1 = shape type -% #2 = anchor -% #3 = normal TeX text -% #4 = name for later reference -% #5 = path usage command -% -% Description: -% -% This command draws a shape that has previously been defined using -% \pgfdeclareshape. The shape is shifted such that the anchor is at -% the origin. In order to transform the whole shape, you should setup -% pgf's transformation matrix prior to calling this command. -% -% Example: -% -% \pgftransformshift{\pgfpoint{1cm}{1cm}} -% \pgfnode{rectangle}{center}{Hello}{hellonode}{\pgfusepath{stroke}} - -\def\pgfnode#1#2#3#4#5{% - {% - \setbox\pgfnodeparttextbox=\hbox% - {% - \pgfinterruptpicture% - {#3}% - \endpgfinterruptpicture% - }% - \pgfmultipartnode{#1}{#2}{#4}{#5}% - } -} - -\def\pgf@sh@resavedanchor#1#2{% - \pgf@process{#2}% - \edef\pgf@sh@marshal{% - \noexpand\pgfutil@g@addto@macro\noexpand\pgf@sh@savedpoints{% - \noexpand\def\noexpand#1{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}% - }}% - \pgf@sh@marshal% -} - - -\def\pgf@sh@resaveddimen#1#2{% - {#2\global\pgf@x=\pgf@x}% - \edef\pgf@sh@marshal{% - \noexpand\pgfutil@g@addto@macro\noexpand\pgf@sh@savedpoints{% - \noexpand\def\noexpand#1{\the\pgf@x}% - }}% - \pgf@sh@marshal% -} - -% Invoke an anchor -\def\pgf@sh@reanchor#1#2{% - \pgfutil@ifundefined{pgf@anchor@#1@#2}% - {% - \pgfmathsetcounter{pgf@counta}{#2}% - \csname pgf@anchor@#1@border\endcsname{\pgfqpointpolar{\c@pgf@counta}{1pt}}% - }% - {\csname pgf@anchor@#1@#2\endcsname}% -} - - - -% Retrieves an anchor of a shape -% -% #1 = name -% #2 = anchor or a number (corresponding to a degree) -% -% Description: -% -% This command yields a point at the anchor of the given named shape. -% -% Example: -% -% \pgfshape{rectangle}{center}{Hello}{hellonode}{\pgfusepath[stroke]} -% \pgfpathmoveto{\pgfpointanchor{hellonode}{center}} - -\def\pgfpointanchor#1#2{% - % Ok, check whether #1 is known! - \pgfutil@ifundefined{pgf@sh@ns@#1} - {\PackageError{pgf}{No shape named #1 is known}{}% - \pgfpointorigin}% - {% - \pgf@process{% - % install special coordinates - \csname pgf@sh@np@#1\endcsname - \pgf@sh@reanchor{\csname pgf@sh@ns@#1\endcsname}{#2}% - {% - \pgfsettransform{\csname pgf@sh@nt@#1\endcsname}% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - \global\pgf@x=\pgf@x% - \global\pgf@y=\pgf@y% - }% - % Add inter picture transformation - \pgf@shape@interpictureshift{#1}% - % Undo current transformation - \pgftransforminvert% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - }% - }% -} - -\def\pgf@shape@interpictureshift#1{% - \expandafter\ifx\csname pgf@sh@pi@#1\endcsname\pgfpictureid% - \else% - \pgfsys@getposition{\csname pgf@sh@pi@#1\endcsname}\pgf@shape@original@pos% - \pgfsys@getposition{\pgfpictureid}\pgf@shape@current@pos% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{\pgfpointorigin\pgf@shape@current@pos}% - \advance\pgf@xa by-\pgf@x% - \advance\pgf@ya by-\pgf@y% - \pgf@process{\pgfpointorigin\pgf@shape@original@pos}% - \advance\pgf@xa by\pgf@x% - \advance\pgf@ya by\pgf@y% - \pgf@x=\pgf@xa% - \pgf@y=\pgf@ya% - \fi% -} - - - -% Retrieves a border point of a shape -% -% #1 = name -% #2 = another point -% -% Description: -% -% This command yields a point on the border of the shape that is on a -% straight line from the center to the point #2. -% -% Example: -% -% \pgfshape{rectangle}{center}{Hello}{hellonode}{\pgfusepath[stroke]} -% \pgfpathmoveto{\pgfpointshapeborder{hellonode}{\pgfpoint{2cm}{1cm}} -% \pgfpathlineto{\pgfpoint{2cm}{1cm}} -% \pgfusepath{stroke} - -\def\pgfpointshapeborder#1#2{% - % Ok, check whether #1 is known! - \pgfutil@ifundefined{pgf@sh@ns@#1} - {\PackageError{pgf}{No shape named #1 is known}{}% - \pgfpointorigin}% - {% - \pgf@process{% - % install special coordinates - \csname pgf@sh@np@#1\endcsname% - {% - \pgf@process{\pgfpointtransformed{#2}}% - \pgfsettransform{\csname pgf@sh@nt@#1\endcsname}% - \pgftransforminvert% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{\csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @center\endcsname}% - \pgf@process{\pgf@shape@interpictureshift{#1}}%% - \advance\pgf@xa by-\pgf@x% - \advance\pgf@ya by-\pgf@y% - \csname pgf@anchor@\csname pgf@sh@ns@#1\endcsname @border\endcsname{\pgfqpoint{\pgf@xa}{\pgf@ya}}% - \pgfsettransform{\csname pgf@sh@nt@#1\endcsname}% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - \global\pgf@x=\pgf@x% - \global\pgf@y=\pgf@y% - }% - % Add inter picture transformation - \pgf@shape@interpictureshift{#1}% - % Undo current transformation - \pgftransforminvert% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - }% - }% -} - - - -% Declares a shape type -% -% #1 = shape type -% #2 = shape specification -% -% Description: -% -% This command declares a new shape type. The shape specification -% should contain the following commands: -% -% - \savedanchor -% This command takes two arguments: a name and some code. The point -% specified by the code (the \pgf@x and \pgf@y values resulting from -% executing the code, to be precise), will be stored under the given -% name. Whenever, later on, an anchor is invoked these stored points -% will be available. The \saveddimen works like \savedanchor, only a -% single dimension is stored (taken from \pgf@x). -% When a savedanchor is calculated, the height/width/depth of the -% boxes mentioned in \nodeparts can be used. -% -% - \anchor -% Specifies an anchor. This command takes two arguments: an anchor -% name and some code for computing the anchor. When the anchor -% computation starts, all shape points and shape dimension will be -% setup. -% -% - \anchorborder -% This command should compute a point on the border of the -% shape. When the code is called, \pgf@x and \pgf@y will have been -% preinitialised with a direction. -% -% - \behindbackgroundpath -% Some things to be draw behind everything. -% -% - \backgroundpath -% A path that is drawn behind the main box. How this path is used -% depends on how \pgfshape is called. -% -% - \beforebackgroundpath -% Some things to be draw before the background path, but behind the -% main box. -% -% - \behindforegroundpath -% Some things to be draw on top of the main box. -% -% - \foregroundpath -% A path that is drawn on top of all of the above. How this path is -% used depends on how \pgfshape is called. -% -% - \beforeforegroundpath -% Some things to be draw before everything. -% -% - \nodeparts -% List of node parts that make up the shape. For each entry XYZ in -% the list there must be a box named \pgfnodepartXYZbox (possibly -% ``redirected'' to some different box using \let). Each such box -% will be placed at the anchor XYZ. -% By default, \nodeparts is just {text}. Thus, there will be one -% node part box named \pgfnodeparttextbox and this node will be -% placed at the anchor text. -% -% -% Example: -% -% See the definition of rectangle, below. - -\long\def\pgfdeclareshape#1#2{% - { - \def\shape@name{#1} - \let\savedanchor=\pgf@sh@savedanchor - \let\saveddimen=\pgf@sh@saveddimen - \let\anchor=\pgf@sh@anchor - \let\anchorborder=\pgf@sh@anchorborder - \let\behindbackgroundpath=\pgf@sh@behindbgpath - \let\backgroundpath=\pgf@sh@bgpath - \let\beforebackgroundpath=\pgf@sh@beforebgpath - \let\behindforegroundpath=\pgf@sh@behindfgpath - \let\foregroundpath=\pgf@sh@fgpath - \let\beforeforegroundpath=\pgf@sh@beforefgpath - \let\nodeparts=\pgf@sh@boxes - \let\inheritsavedanchors=\pgf@sh@inheritsavedanchors - \let\inheritanchor=\pgf@sh@inheritanchor - \let\inheritanchorborder=\pgf@sh@inheritanchorborder - \let\inheritbehindbackgroundpath=\pgf@sh@inheritbehindbgpath - \let\inheritbackgroundpath=\pgf@sh@inheritbgpath - \let\inheritbeforebackgroundpath=\pgf@sh@inheritbeforebgpath - \let\inheritbehindforegroundpath=\pgf@sh@inheritbehindfgpath - \let\inheritforegroundpath=\pgf@sh@inheritfgpath - \let\inheritbeforeforegroundpath=\pgf@sh@inheritbeforefgpath - \let\inheritnodeparts=\pgf@sh@inheritboxes - \anchorborder{\csname pgf@anchor@#1@center\endcsname}% - \anchor{text}{\pgfpointorigin}% - \nodeparts{text}% - \expandafter\global\expandafter\let\csname pgf@sh@s@\shape@name\endcsname=\pgfutil@empty% - #2 - } -} - -\def\pgf@sh@savedanchor#1#2{% - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resavedanchor{#1}{#2}}} -\def\pgf@sh@saveddimen#1#2{% - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resaveddimen{#1}{#2}}} -\def\pgf@sh@anchor#1#2{\expandafter\gdef\csname pgf@anchor@\shape@name @#1\endcsname{#2}} -\def\pgf@sh@anchorborder#1{\expandafter\gdef\csname pgf@anchor@\shape@name @border\endcsname##1{\pgf@process{##1}#1}} -\long\def\pgf@sh@behindbgpath#1{\expandafter\gdef\csname pgf@sh@bbg@\shape@name\endcsname{#1}} -\long\def\pgf@sh@bgpath#1{\expandafter\gdef\csname pgf@sh@bg@\shape@name\endcsname{#1}} -\long\def\pgf@sh@beforebgpath#1{\expandafter\gdef\csname pgf@sh@fbg@\shape@name\endcsname{#1}} -\long\def\pgf@sh@behindfgpath#1{\expandafter\gdef\csname pgf@sh@bfg@\shape@name\endcsname{#1}} -\long\def\pgf@sh@fgpath#1{\expandafter\gdef\csname pgf@sh@fg@\shape@name\endcsname{#1}} -\long\def\pgf@sh@beforefgpath#1{\expandafter\gdef\csname pgf@sg@ffg@\shape@name\endcsname{#1}} -\def\pgf@sh@boxes#1{\expandafter\gdef\csname pgf@sh@boxes@\shape@name\endcsname{#1}} - -\def\pgf@sh@inheritsavedanchors[from=#1]{% - \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\csname pgf@sh@s@#1\endcsname}} -\def\pgf@sh@inheritanchor[from=#1]#2{% - \edef\pgf@marshal{\global\let\expandafter\noexpand\csname - pgf@anchor@\shape@name @#2\endcsname=\expandafter\noexpand\csname - pgf@anchor@#1@#2\endcsname}% - \pgf@marshal% -} -\def\pgf@sh@inheritanchorborder[from=#1]{% - \edef\pgf@marshal{\global\let\expandafter\noexpand\csname - pgf@anchor@\shape@name @border\endcsname=\expandafter\noexpand\csname - pgf@anchor@#1@border\endcsname}% - \pgf@marshal% -} -\def\pgf@sh@inheritor#1#2{% - \edef\pgf@marshal{\global\let\expandafter\noexpand\csname - pgf@sh@#1@\shape@name\endcsname=\expandafter\noexpand\csname - pgf@sh@#1@#2\endcsname}% - \pgf@marshal% -} -\def\pgf@sh@inheritbehindbgpath[from=#1]{\pgf@sh@inheritor{bbg}{#1}} -\def\pgf@sh@inheritbgpath[from=#1]{\pgf@sh@inheritor{bg}{#1}} -\def\pgf@sh@inheritbeforebgpath[from=#1]{\pgf@sh@inheritor{fbg}{#1}} -\def\pgf@sh@inheritbehindfgpath[from=#1]{\pgf@sh@inheritor{bfg}{#1}} -\def\pgf@sh@inheritfgpath[from=#1]{\pgf@sh@inheritor{fg}{#1}} -\def\pgf@sh@inheritbeforefgpath[from=#1]{\pgf@sh@inheritor{ffg}{#1}} -\def\pgf@sh@inheritboxes[from=#1]{\pgf@sh@inheritor{boxes}{#1}} - - - -% -% Coordinate. This shape is special: It is only used to reference a -% point for later usage. Nothing is drawn, all anchors are identical -% to the center. -% - -\pgfdeclareshape{coordinate} -{ - \savedanchor\centerpoint{% - % x - \pgf@x=.5\wd\pgfnodeparttextbox% - % y - \pgf@y=.5\ht\pgfnodeparttextbox% - \advance\pgf@y by -.5\dp\pgfnodeparttextbox% - } - - \anchor{center}{\centerpoint} - \anchor{north}{\centerpoint} - \anchor{north west}{\centerpoint} - \anchor{north east}{\centerpoint} - \anchor{center}{\centerpoint} - \anchor{west}{\centerpoint} - \anchor{east}{\centerpoint} - \anchor{mid}{\centerpoint} - \anchor{mid west}{\centerpoint} - \anchor{mid east}{\centerpoint} - \anchor{base}{\centerpoint} - \anchor{base west}{\centerpoint} - \anchor{base east}{\centerpoint} - \anchor{south}{\centerpoint} - \anchor{south west}{\centerpoint} - \anchor{south east}{\centerpoint} - \anchorborder{\centerpoint} - - \nodeparts{}% no text -} - - -% Set the recommended inner x separation -% -% #1 = size -% -% Example: -% -% \pgfsetshapeinnerxsep{2pt} - -\def\pgfsetshapeinnerxsep#1{\def\pgfshapeinnerxsep{#1}} -\pgfsetshapeinnerxsep{.3333em} - - -% Set the recommended inner y separation -% -% #1 = size -% -% Example: -% -% \pgfsetshapeinnerxsep{2pt} - -\def\pgfsetshapeinnerysep#1{\def\pgfshapeinnerysep{#1}} -\pgfsetshapeinnerysep{.3333em} - - -% Set the recommended outer x separation -% -% #1 = size -% -% Example: -% -% \pgfsetshapeouterxsep{2pt} - -\def\pgfsetshapeouterxsep#1{\def\pgfshapeouterxsep{#1}} -\pgfsetshapeouterxsep{.5\pgflinewidth} - - -% Set the recommended outer y separation -% -% #1 = size -% -% Example: -% -% \pgfsetshapeouterxsep{2pt} - -\def\pgfsetshapeouterysep#1{\def\pgfshapeouterysep{#1}} -\pgfsetshapeouterysep{.5\pgflinewidth} - - -% Set the recommended minimum width -% -% #1 = size -% -% Example: -% -% \pgfsetshapeminwidth{1cm} - -\def\pgfsetshapeminwidth#1{\def\pgfshapeminwidth{#1}} -\pgfsetshapeminwidth{1pt} - - -% Set the recommended minimum height -% -% #1 = size -% -% Example: -% -% \pgfsetshapeminheight{1cm} - -\def\pgfsetshapeminheight#1{\def\pgfshapeminheight{#1}} -\pgfsetshapeminheight{1pt} - - -% -% Rectangle -% - -\pgfdeclareshape{rectangle} -{ - \savedanchor\northeast{% - % Calculate x - % - % First, is width < minimum width? - \pgf@x=\the\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@xc{\pgfshapeinnerxsep}% - \advance\pgf@x by 2\pgf@xc% - \pgfmathsetlength\pgf@xb{\pgfshapeminwidth}% - \ifdim\pgf@x<\pgf@xb% - % yes, too small. Enlarge... - \pgf@x=\pgf@xb% - \fi% - % Now, calculate right border: .5\wd\pgfnodeparttextbox + .5 \pgf@x + outer sep - \pgf@x=.5\pgf@x% - \advance\pgf@x by.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@xa{\pgfshapeouterxsep}% - \advance\pgf@x by\pgf@xa% - % Calculate y - % - % First, is height+depth < minimum height? - \pgf@y=\ht\pgfnodeparttextbox% - \advance\pgf@y by\dp\pgfnodeparttextbox% - \pgfmathsetlength\pgf@yc{\pgfshapeinnerysep}% - \advance\pgf@y by 2\pgf@yc% - \pgfmathsetlength\pgf@yb{\pgfshapeminheight}% - \ifdim\pgf@y<\pgf@yb% - % yes, too small. Enlarge... - \pgf@y=\pgf@yb% - \fi% - % Now, calculate upper border: .5\ht-.5\dp + .5 \pgf@y + outer sep - \pgf@y=.5\pgf@y% - \advance\pgf@y by-.5\dp\pgfnodeparttextbox% - \advance\pgf@y by.5\ht\pgfnodeparttextbox% - \pgfmathsetlength\pgf@ya{\pgfshapeouterysep}% - \advance\pgf@y by\pgf@ya% - } - - \savedanchor\southwest{% - % Calculate x - % - % First, is width < minimum width? - \pgf@x=\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@xc{\pgfshapeinnerxsep}% - \advance\pgf@x by 2\pgf@xc% - \pgfmathsetlength\pgf@xb{\pgfshapeminwidth}% - \ifdim\pgf@x<\pgf@xb% - % yes, too small. Enlarge... - \pgf@x=\pgf@xb% - \fi% - % Now, calculate left border: .5\wd\pgfnodeparttextbox - .5 \pgf@x - outer sep - \pgf@x=-.5\pgf@x% - \advance\pgf@x by.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@xa{\pgfshapeouterxsep}% - \advance\pgf@x by-\pgf@xa% - % Calculate y - % - % First, is height+depth < minimum height? - \pgf@y=\ht\pgfnodeparttextbox% - \advance\pgf@y by\dp\pgfnodeparttextbox% - \pgfmathsetlength\pgf@yc{\pgfshapeinnerysep}% - \advance\pgf@y by 2\pgf@yc% - \pgfmathsetlength\pgf@yb{\pgfshapeminheight}% - \ifdim\pgf@y<\pgf@yb% - % yes, too small. Enlarge... - \pgf@y=\pgf@yb% - \fi% - % Now, calculate upper border: .5\ht-.5\dp - .5 \pgf@y - outer sep - \pgf@y=-.5\pgf@y% - \advance\pgf@y by-.5\dp\pgfnodeparttextbox% - \advance\pgf@y by.5\ht\pgfnodeparttextbox% - \pgfmathsetlength\pgf@ya{\pgfshapeouterysep}% - \advance\pgf@y by-\pgf@ya% - } - - % - % Anchors - % - \anchor{center}{ - \pgf@process{\northeast}% - \pgf@xa=.5\pgf@x% - \pgf@ya=.5\pgf@y% - \pgf@process{\southwest}% - \pgf@x=.5\pgf@x% - \pgf@y=.5\pgf@y% - \advance\pgf@x by \pgf@xa% - \advance\pgf@y by \pgf@ya% - } - \anchor{mid}{\pgf@anchor@rectangle@center\pgfmathsetlength\pgf@y{.5ex}} - \anchor{base}{\pgf@anchor@rectangle@center\pgf@y=0pt} - \anchor{north}{ - \pgf@process{\southwest}% - \pgf@xa=.5\pgf@x% - \pgf@process{\northeast}% - \pgf@x=.5\pgf@x% - \advance\pgf@x by \pgf@xa% - } - \anchor{south}{ - \pgf@process{\northeast}% - \pgf@xa=.5\pgf@x% - \pgf@process{\southwest}% - \pgf@x=.5\pgf@x% - \advance\pgf@x by \pgf@xa% - } - \anchor{west}{ - \pgf@process{\northeast}% - \pgf@ya=.5\pgf@y% - \pgf@process{\southwest}% - \pgf@y=.5\pgf@y% - \advance\pgf@y by \pgf@ya% - } - \anchor{mid west}{\southwest\pgfmathsetlength\pgf@y{.5ex}} - \anchor{base west}{\southwest\pgf@y=0pt} - \anchor{north west}{ - \southwest - \pgf@xa=\pgf@x - \northeast - \pgf@x=\pgf@xa} - \anchor{south west}{\southwest} - \anchor{east}{% - \pgf@process{\southwest}% - \pgf@ya=.5\pgf@y% - \pgf@process{\northeast}% - \pgf@y=.5\pgf@y% - \advance\pgf@y by \pgf@ya% - } - \anchor{mid east}{\northeast\pgfmathsetlength\pgf@y{.5ex}} - \anchor{base east}{\northeast\pgf@y=0pt} - \anchor{north east}{\northeast} - \anchor{south east}{ - \northeast - \pgf@xa=\pgf@x - \southwest - \pgf@x=\pgf@xa - } - \anchorborder{% - \pgf@xb=\pgf@x% xb/yb is target - \pgf@yb=\pgf@y% - \southwest% - \pgf@xa=\pgf@x% xa/ya is se - \pgf@ya=\pgf@y% - \northeast% - \advance\pgf@x by-\pgf@xa% - \advance\pgf@y by-\pgf@ya% - \pgf@xc=.5\pgf@x% x/y is half width/height - \pgf@yc=.5\pgf@y% - \advance\pgf@xa by\pgf@xc% xa/ya becomes center - \advance\pgf@ya by\pgf@yc% - \edef\pgf@marshal{% - \noexpand\pgfpointborderrectangle - {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}} - {\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}% - }% - \pgf@process{\pgf@marshal}% - \advance\pgf@x by\pgf@xa% - \advance\pgf@y by\pgf@ya% - } - - % - % Background path - % - \backgroundpath{ - \pgfpathrectanglecorners - {\pgfpointadd{\southwest}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}} - {\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfshapeouterxsep}{\pgfshapeouterysep}}}} - } -} - - - -% Special current bounding box rectangle: -\expandafter\def\csname pgf@sh@ns@current bounding box\endcsname{rectangle} -\expandafter\def\csname pgf@sh@np@current bounding box\endcsname{% - \def\southwest{\pgfqpoint{\pgf@picminx}{\pgf@picminy}}% - \def\northeast{\pgfqpoint{\pgf@picmaxx}{\pgf@picmaxy}}% -} -\expandafter\def\csname pgf@sh@nt@current bounding box\endcsname{{1}{0}{0}{1}{0pt}{0pt}} -\expandafter\def\csname pgf@sh@pi@current bounding box\endcsname{\pgfpictureid} - - -% Special current path bounding box rectangle: -\expandafter\def\csname pgf@sh@ns@current path bounding box\endcsname{rectangle} -\expandafter\def\csname pgf@sh@np@current path bounding box\endcsname{% - \def\southwest{\pgfqpoint{\pgf@pathminx}{\pgf@pathminy}}% - \def\northeast{\pgfqpoint{\pgf@pathmaxx}{\pgf@pathmaxy}}% -} -\expandafter\def\csname pgf@sh@nt@current path bounding box\endcsname{{1}{0}{0}{1}{0pt}{0pt}} -\expandafter\def\csname pgf@sh@pi@current path bounding box\endcsname{\pgfpictureid} - - -% Special current page bounding box rectangle: -\expandafter\def\csname pgf@sh@ns@current page\endcsname{rectangle} -\expandafter\def\csname pgf@sh@np@current page\endcsname{% - \def\southwest{\pgfqpoint{0pt}{0pt}}% - \def\northeast{\pgfqpoint{\paperwidth}{\paperheight}}% -} -\expandafter\def\csname pgf@sh@nt@current page\endcsname{{1}{0}{0}{1}{0pt}{0pt}} -\expandafter\def\csname pgf@sh@pi@current page\endcsname{pgfpageorigin} - - - -% -% Circle -% - -\pgfdeclareshape{circle} -% -% Draws a circle around the text -% -{ - \savedanchor\centerpoint{% - \pgf@x=.5\wd\pgfnodeparttextbox% - \pgf@y=.5\ht\pgfnodeparttextbox% - \advance\pgf@y by-.5\dp\pgfnodeparttextbox% - } - - \saveddimen\radius{% - % - % Caculate ``height radius'' - % - \pgf@ya=.5\ht\pgfnodeparttextbox% - \advance\pgf@ya by.5\dp\pgfnodeparttextbox% - \pgfmathsetlength\pgf@yb{\pgfshapeinnerysep}% - \advance\pgf@ya by\pgf@yb% - % - % Caculate ``width radius'' - % - \pgf@xa=.5\wd\pgfnodeparttextbox% - \pgfmathsetlength\pgf@xb{\pgfshapeinnerxsep}% - \advance\pgf@xa by\pgf@xb% - % - % Calculate length of radius vector: - % - \pgf@process{\pgfpointnormalised{\pgfqpoint{\pgf@xa}{\pgf@ya}}}% - \ifdim\pgf@x>\pgf@y% - \c@pgf@counta=\pgf@x% - \ifnum\c@pgf@counta=0\relax% - \else% - \divide\c@pgf@counta by 255\relax% - \pgf@xa=16\pgf@xa\relax% - \divide\pgf@xa by\c@pgf@counta% - \pgf@xa=16\pgf@xa\relax% - \fi% - \else% - \c@pgf@counta=\pgf@y% - \ifnum\c@pgf@counta=0\relax% - \else% - \divide\c@pgf@counta by 255\relax% - \pgf@ya=16\pgf@ya\relax% - \divide\pgf@ya by\c@pgf@counta% - \pgf@xa=16\pgf@ya\relax% - \fi% - \fi% - \pgf@x=\pgf@xa% - % - % If necessary, adjust radius so that the size requirements are - % met: - % - \pgfmathsetlength{\pgf@xb}{\pgfshapeminwidth}% - \pgfmathsetlength{\pgf@yb}{\pgfshapeminheight}% - \ifdim\pgf@x<.5\pgf@xb% - \pgf@x=.5\pgf@xb% - \fi% - \ifdim\pgf@x<.5\pgf@yb% - \pgf@x=.5\pgf@yb% - \fi% - % - % Now, add larger of outer sepearations. - % - \pgfmathsetlength{\pgf@xb}{\pgfshapeouterxsep}% - \pgfmathsetlength{\pgf@yb}{\pgfshapeouterysep}% - \ifdim\pgf@xb<\pgf@yb% - \advance\pgf@x by\pgf@yb% - \else% - \advance\pgf@x by\pgf@xb% - \fi% - } - - % - % Anchors - % - \anchor{center}{\centerpoint} - \anchor{mid}{\centerpoint\pgfmathsetlength\pgf@y{.5ex}} - \anchor{base}{\centerpoint\pgf@y=0pt} - \anchor{north}{\centerpoint\advance\pgf@y by\radius} - \anchor{south}{\centerpoint\advance\pgf@y by-\radius} - \anchor{west}{\centerpoint\advance\pgf@x by-\radius} - \anchor{east}{\centerpoint\advance\pgf@x by\radius} - \anchor{mid west}{\centerpoint\advance\pgf@x by-\radius\pgfmathsetlength\pgf@y{.5ex}} - \anchor{mid east}{\centerpoint\advance\pgf@x by\radius\pgfmathsetlength\pgf@y{.5ex}} - \anchor{base west}{\centerpoint\advance\pgf@x by-\radius\pgf@y=0pt} - \anchor{base east}{\centerpoint\advance\pgf@x by\radius\pgf@y=0pt} - \anchor{north west}{ - \centerpoint - \pgf@xa=\radius - \advance\pgf@x by-0.707107\pgf@xa - \advance\pgf@y by0.707107\pgf@xa - } - \anchor{south west}{ - \centerpoint - \pgf@xa=\radius - \advance\pgf@x by-0.707107\pgf@xa - \advance\pgf@y by-0.707107\pgf@xa - } - \anchor{north east}{ - \centerpoint - \pgf@xa=\radius - \advance\pgf@x by0.707107\pgf@xa - \advance\pgf@y by0.707107\pgf@xa - } - \anchor{south east}{ - \centerpoint - \pgf@xa=\radius - \advance\pgf@x by0.707107\pgf@xa - \advance\pgf@y by-0.707107\pgf@xa - } - \anchorborder{ - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \edef\pgf@marshal{% - \noexpand\pgfpointborderellipse - {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}} - {\noexpand\pgfqpoint{\radius}{\radius}}% - }% - \pgf@marshal% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \centerpoint% - \advance\pgf@x by\pgf@xa% - \advance\pgf@y by\pgf@ya% - } - - % - % Background path - % - \backgroundpath{ - \pgfutil@tempdima=\radius% - \pgfmathsetlength{\pgf@xb}{\pgfshapeouterxsep}% - \pgfmathsetlength{\pgf@yb}{\pgfshapeouterysep}% - \ifdim\pgf@xb<\pgf@yb% - \advance\pgfutil@tempdima by-\pgf@yb% - \else% - \advance\pgfutil@tempdima by-\pgf@xb% - \fi% - \pgfpathcircle{\centerpoint}{\pgfutil@tempdima}% - } -} - - - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex deleted file mode 100644 index 5259624c57a..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex +++ /dev/null @@ -1,349 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbasesnakes.code.tex,v 1.11 2007/03/09 17:49:32 tantau Exp $ - -\newdimen\pgfsnakeremainingdistance -\newdimen\pgfsnakecompleteddistance - - -% Creates a new pgf snake -% -% #1 = snake name -% #1 = initial state -% #3 = states of the snake -% -% -% This command declares a new snake for later use. The second -% parameter specifies the states of the snake, see also the -% description of pgfpathsnake. -% -% Inside the code of #3 the command \state may be used. This command -% will only be defined while #3 is executed. -% -% Example: -% -% \pgfdeclaresnake{zig zag}{one zig zag} -% { -% \state{one zig zag}[width=10pt] -% { -% \pgfpathlineto{\pgfpoint{2.5pt}{2.5pt}} -% \pgfpathlineto{\pgfpoint{7.5pt}{-2.5pt}} -% \pgfpathlineto{\pgfpoint{10pt}{0pt}} -% } -% \state{final} -% { -% \pgfpathlineto{\pgfpoint{\pgfsnakeremainingdistance}{0pt}} -% } -% } - -\long\def\pgfdeclaresnake#1#2#3{% - \def\pgf@snake@name{#1}% - \pgfutil@namedef{pgf@snake@@#1@initial}{#2}% - \let\pgf@orig@state=\state% - \let\state=\pgf@snake@state - #3 - \let\state=\pgf@orig@state% -} - - -% Sets the additional transformation applied to every segment of a snake -% -% #1 = transformation -% -% Example: -% -% \pgfsetsnakesegmenttransformation{\pgftransformyshift{5pt}} - -\def\pgfsetsnakesegmenttransformation#1{\def\pgf@snakeadditionaltransform{#1}} -\pgfsetsnakesegmenttransformation{} - - -% Declares a new state -% -% #1 = state name -% #2 = options -% #3 = path element -% -% Description: -% -% When a snake is drawn and the current state is #1, the following -% happens. First, the options are executed, which will possible change -% the state. If that does not happen, the path element is added to the -% path and the coordinate system is translated by the path element's -% width (which is specified using the width option). -% -% Example: -% -% \state{initial}[width=10pt] -% { -% \pgfpathlineto{\pgfpoint{2.5pt}{2.5pt}} -% \pgfpathlineto{\pgfpoint{7.5pt}{-2.5pt}} -% \pgfpathlineto{\pgfpoint{10pt}{0pt}} -% } - -\def\pgf@snake@state#1{\pgfutil@ifnextchar[{\pgf@@snake@start#1}{\pgf@@snake@start#1[]}}%} -\def\pgf@@snake@start#1[#2]#3{% - \pgfutil@namedef{pgf@snake@@\pgf@snake@name @#1@options}{#2}% - \pgfutil@namedef{pgf@snake@@\pgf@snake@name @#1@code}{#3}% -} - - - -% Use multiple snakes -% -% #1 = list of snake names/length pairs -% #2 = point to which the snake leads -% -% This operation uses the snakes in parameter #1 to get to the point -% #4. The parameter #1 should contain pairs consisting of a snake name -% and a length for which this snake should be used. When the length is -% computed, the dimensions \pgfsnakeremainingdistance and -% \pgfsnakecompleteddistance will have been set to the length of the -% total distance to #2 that has already been covered/that still needs -% to be covered. -% -% Example: -% -% \pgfpathsnakesto{{lineto}{1cm},{zig zag}{\pgfsnakeremainingdistance}}{\pgfpoint{2cm}{3cm}} - -\def\pgfpathsnakesto#1#2{% - \begingroup% - % compute target vector - \pgfpointtransformed{#2}% - \advance\pgf@x by-\pgf@path@lastx% - \advance\pgf@y by-\pgf@path@lasty% - % Ok, now normalize the vector... - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{\pgfpointnormalised{}}% - % ok, now computer length (arghh...) - % In theory that's easy: divide the larger of the values x or y by - % the normalized x or y. Well... - % - % First, make xa and ya positive: - \ifdim\pgf@xa<0pt% - \pgf@xa=-\pgf@xa% - \fi% - \ifdim\pgf@ya<0pt% - \pgf@ya=-\pgf@ya% - \fi% - % Now do division: - \ifdim\pgf@xa>\pgf@ya% - \c@pgf@counta=\pgf@x% - \ifnum\c@pgf@counta=0\relax% - \else% - \divide\c@pgf@counta by 255\relax% - \pgf@xa=16\pgf@xa\relax% - \divide\pgf@xa by\c@pgf@counta% - \pgf@xa=16\pgf@xa\relax% - \fi% - \else% - \c@pgf@counta=\pgf@y% - \ifnum\c@pgf@counta=0\relax% - \else% - \divide\c@pgf@counta by 255\relax% - \pgf@ya=16\pgf@ya\relax% - \divide\pgf@ya by\c@pgf@counta% - \pgf@xa=16\pgf@ya\relax% - \fi% - \fi% - % Make positive: - \ifdim\pgf@xa<0pt% - \pgf@xa=-\pgf@xa% - \fi% - % Ok, now we draw things... - \edef\pgf@list{#1}% - \pgfsnakeremainingdistance=\pgf@xa% - \pgfsnakecompleteddistance=0pt% - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \pgfutil@for\pgf@temp:=\pgf@list\do{% - \ifx\pgf@temp\pgfutil@empty% - \else% - \expandafter\pgf@snake@invoke\pgf@temp% - \fi% - }% - \endgroup% -} - -\def\pgf@snake@invoke#1#2{% - \pgfmathsetlength\pgf@xa{#2}% - {% - \edef\pgf@marshal{\noexpand\pgfpathsnakealongvector{#1}{\the\pgf@xa}{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}}% - \pgf@marshal% - }% - \advance\pgfsnakecompleteddistance by\pgf@xa% - \advance\pgfsnakeremainingdistance by-\pgf@xa% -} - -% Use a snake -% -% #1 = snake name -% #2 = point to which the snake leads -% -% This operation mainly computes \pgfpathsnakealongvector for a vector -% appropriately choosen. See \pgfpathsnakealongvector for details. -% -% Example: -% -% \pgfpathsnaketo{zig zag}{\pgfpoint{2cm}{3cm}} - -\def\pgfpathsnaketo#1#2{\pgfpathsnakesto{{#1}{\pgfsnakeremainingdistance}}{#2}} - - - -% Use a snake -% -% #1 = snake name -% #2 = length of the snake -% #3 = vector along which the snake grows, should have unit length. -% -% This command draws a snake (more precisely, it adds a snake to the -% path). This works as follows: -% -% First, the coordinate system is transformed such that the vector #3 -% points to the right. -% -% Next, the state `initial' of the snake is entered. Unless the -% options of this state cause it to switch to another state, the path -% element is added to the path. Then, the coordinate system is -% translated by the width of the path element as specified in the -% width option of the path element. The dimensions -% \pgfsnakeremainingdistance and \pgfsnakecompleteddistance are -% updated. -% -% The process ends when the state `final' is entered. The code of the -% final state is executed and the process stops. -% -% Example: -% -% \pgfpathsnakealongvector{zig zag}{100pt}{\pgfpolar{30}{1pt}} - -\def\pgfpathsnakealongvector#1#2#3{% - \pgfutil@ifundefined{pgf@snake@@#1@initial}{\PackageError{pgf}{Undefined snake ``#1''}{}} - { - \begingroup% keep things local - \pgftransformreset% - \pgf@pt@x=\pgf@path@lastx% evil trickery to transform to the last point - \pgf@pt@y=\pgf@path@lasty% - \pgf@process{#3}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@xb=-\pgf@y% - \pgf@yb=\pgf@x% - \pgftransformcm - {\pgf@sys@tonumber{\pgf@xa}}{\pgf@sys@tonumber{\pgf@ya}} - {\pgf@sys@tonumber{\pgf@xb}}{\pgf@sys@tonumber{\pgf@yb}} - {\pgfpointorigin}% - % Now, setup the automaton - \expandafter\let\expandafter\pgf@snake@current@state\expandafter=\csname pgf@snake@@#1@initial\endcsname% - \def\pgf@snake@name{#1}% - \pgfsnakecompleteddistance=0pt% - \pgfmathsetlength\pgfsnakeremainingdistance{#2}% - \pgf@snake@run% - % Last step: - {% - \pgftransformxshift{\pgfsnakecompleteddistance}% - \pgf@snakeadditionaltransform% - \csname pgf@snake@@#1@final@code\endcsname% - }% - \endgroup% - }% -} - -\def\pgf@final@text{final} - -\def\pgf@snake@run{% - \let\pgf@snake@next=\pgf@snake@do@state% - \ifx\pgf@snake@current@state\pgf@final@text% - \let\pgf@snake@next=\relax% - \fi% - \pgf@snake@next% -} - -\def\pgf@snake@do@state{% - \let\pgf@snake@next=\relax% - \let\pgf@snake@next@state=\pgf@snake@current@state% - % execute options - \def\pgf@marshal{\setkeys{pgfsnake}}% - \expandafter\expandafter\expandafter\pgf@marshal - \expandafter\expandafter\expandafter{\csname pgf@snake@@\pgf@snake@name @\pgf@snake@current@state @options\endcsname}% - \ifx\pgf@snake@next\relax% - \let\pgf@snake@next=\pgf@snake@do@code% - \fi% - \pgf@snake@next% -} - -\def\pgf@snake@do@code{% - % Ok, execute code: - {% - \pgftransformxshift{\pgfsnakecompleteddistance}% - \pgf@snakeadditionaltransform% - \csname pgf@snake@@\pgf@snake@name @\pgf@snake@current@state @code\endcsname% - }% - % next, do transformation and update - \pgfmathsetlength{\pgf@xa}{\pgf@snake@width}% - \advance\pgfsnakeremainingdistance by-\pgf@xa% - \advance\pgfsnakecompleteddistance by\pgf@xa% - % Next iteration: - \let\pgf@snake@current@state=\pgf@snake@next@state% - \pgf@snake@run% -} - -\define@key{pgfsnake}{width}{% - \def\pgf@snake@width{#1}% - \pgf@snake@switch@if#1 to final\pgf@stop% -} -\define@key{pgfsnake}{switch if less than}{% - \pgf@snake@switch@if#1\pgf@stop% -} -\define@key{pgfsnake}{next state}{% - \def\pgf@snake@next@state{#1}% -} - -\def\pgf@snake@switch@if#1to #2\pgf@stop{% - \ifx\pgf@snake@next\relax% - \pgfmathsetlength\pgf@x{#1}% - \ifdim\pgfsnakeremainingdistance<\pgf@x% - \def\pgf@snake@current@state{#2}% - \let\pgf@snake@next=\pgf@snake@run% - \fi% - \fi% -} - - - -% lineto snake -% -% This snake simply adds a straight line. This snake is mainly useful -% in conjunction with other snakes. - -\pgfdeclaresnake{lineto}{final} -{ - \state{final} - { \pgfpathlineto{\pgfqpoint{\pgfsnakeremainingdistance}{0pt}} } -} - - - -% moveto snake -% -% This snake simply jumps to the end. This snake, too, is mainly -% useful in conjunction with other snakes. - -\pgfdeclaresnake{moveto}{final} -{ - \state{final} - { \pgfpathmoveto{\pgfqpoint{\pgfsnakeremainingdistance}{0pt}} } -} - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex deleted file mode 100644 index 8cbb060e1c1..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex +++ /dev/null @@ -1,28 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcore.code.tex,v 1.5 2007/03/09 17:49:32 tantau Exp $ - -\newif\ifpgf@draftmode - -\input pgfmath.code.tex - -\input pgfcorepoints.code.tex -\input pgfcorepathconstruct.code.tex -\input pgfcorepathusage.code.tex -\input pgfcorescopes.code.tex -\input pgfcoregraphicstate.code.tex -\input pgfcoretransformations.code.tex -\input pgfcorequick.code.tex -\input pgfcoreobjects.code.tex -\input pgfcorepathprocessing.code.tex -\input pgfcorearrows.code.tex -\input pgfcoreshade.code.tex - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex deleted file mode 100644 index bdf4906c1be..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex +++ /dev/null @@ -1,513 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.8 2007/06/07 07:41:10 tantau Exp $ - - -% Sets the end arrow -% -% #1 = An arrow name -% -% Example: -% -% \pgfsetarrowsend{stealth} - -\def\pgfsetarrowsend#1{\pgf@arrowset{end}{#1}} -\def\pgf@arrowset#1#2{% - \pgfutil@ifundefined{pgf@arrow@code@#2} - {\PackageError{pgf}{Arrow #1 type ``#2'' unknown}{}} - {% - \edef\pgf@arrow@temp{#2}% - \ifx\pgf@arrow@temp\pgfutil@empty% ah. clear! - \expandafter\let\csname pgf@#1arrow\endcsname=\pgfutil@empty% - \expandafter\let\csname pgf@shorten@#1\endcsname=\pgfutil@empty% - \else% - %\pgf@arrow@prepare{#2}% - \expandafter\def\csname pgf@#1arrow\endcsname{\pgf@arrow@call{#2}}% - \expandafter\edef\csname pgf@shorten@#1\endcsname{\expandafter\noexpand\csname pgf@arrow@right@#2\endcsname}% - \fi% - }% -} - - -% Sets the start arrow -% -% #1 = An arrow name -% -% Example: -% -% \pgfsetarrowsstart{stealth} - -\def\pgfsetarrowsstart#1{\pgf@arrowset{start}{\csname pgf@arrows@invert#1\endcsname}} - -\def\pgf@arrows@invname#1#2{\expandafter\def\csname pgf@arrows@invert#1\endcsname{#2}} -\pgf@arrows@invname{}{} - - - - -% Sets arrows -% -% #1 = An arrow specification of the form ``left''-``right''. The last -% and right should be arrow types that have been defined using -% the \pgfarrowsdef command -% -% Example: -% -% \pgfsetarrows{-to} - -\def\pgfsetarrows#1{\pgf@arrows#1\pgf@stop} -\def\pgf@arrows#1-#2\pgf@stop{% - \pgfsetarrowsstart{#1} - \pgfsetarrowsend{#2} -} - -\def\pgf@arrows@checked#1#2#3{% - \pgfutil@ifundefined{pgf@arrow@code@#2}% - {% - \PackageError{pgf}{Arrow end type ``#2'' unknown}{}}% - {% - \pgfutil@ifundefined{pgf@arrow@code@\csname pgf@arrows@invert#1\endcsname} - {\PackageError{pgf}{Arrow start type ``#1'' unknown}{}}% - {#3}% - }% -} - -\def\pgf@arrows@check@already#1#2#3{% - \pgfutil@ifundefined{pgf@arrow@code@#2} - {#3}% - {\PackageError{pgf}{Arrow end type ``#2'' already defined}{}}% -} - - -% Called when an arrow needs to be rendered - -\def\pgf@arrow@call#1{% - \expandafter\ifx\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname\relax% - \pgfsysprotocol@getcurrentprotocol\pgf@arrow@temp% - {% - \pgfinterruptpath% - \let\pgfusepath=\pgf@nousepath@here% - \pgf@relevantforpicturesizefalse% - \pgftransformreset% - \pgfsysprotocol@setcurrentprotocol\pgfutil@empty% - \pgfsysprotocol@bufferedtrue% - \pgfsys@beginscope% - \csname pgf@arrow@code@#1\endcsname% - \pgfsys@endscope% - \pgfsysprotocol@getcurrentprotocol\pgf@@arrow@temp% - \global\let\pgf@@arrow@temp=\pgf@@arrow@temp% - \endpgfinterruptpath% - \expandafter\def\expandafter\pgf@temp\expandafter{\expandafter\pgfsys@invoke\expandafter{\pgf@@arrow@temp}}% - \expandafter\global\expandafter\let\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname=\pgf@temp% - }% - \pgfsysprotocol@setcurrentprotocol\pgf@arrow@temp% - \fi% - \csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname% -} - -\def\pgf@arrow@code@{} % dummy - -\def\pgf@nousepath@here#1{% - \PackageError{pgf}{The definition of an arrow may not use \string\pgfusepath}{} -} - - - -% Define an arrow type. -% -% #1 = name or mnemonic for arrow when used at the start (examples: ``to'' or ``<'') -% #2 = name or mnemonic for arrow when used at the end (examples: ``to'' or ``>'') -% #3 = code to setup the left and right extend of the arrow. To set -% the left extend, call \pgfarrowsleftextend, for the right \pgfarrowsrightextend. -% #4 = protocolable code -% -% Description: -% -% When you define an arrow using this command, you must give two -% names. The first is used for the arrow when it is ``at the start'', -% the other when it is at the end. For example, a simple arrow might -% have the names ``<'' and ``>'', though these particular names are -% not used by pgf and left for the user. -% -% The code should be ``protocolable'' code. This means that it uses -% only pretty simple commands. -% -% The arrow code will be protocolled once for each line width at which -% the arrow is used. Thus, the code can (and often should) depend on -% the line width. -% -% The arrow should ``point right'' in the coordinate system. The end -% of the line at which the arrow should be drawn will be at the origin -% of the coordinate system. The coordinate system will be scaled and -% rotated appropriately before the arrow is drawn. -% -% The right extend of the arrow should be set to how much the arrow -% ``protrudes over the right''. Prior to drawing the arrow, the line -% will be shortened by this amount so that the arrow tip will exactly -% touch the original right end of the unshortened line. -% -% The left extend specifies the leftmost point of the arrow. This is -% important only if you use the swapping command, when this end is -% used to compute the shortening. -% -% The definition of an arrow should normally take care of the fact -% that the line cap of the main line may be a butt cap, a round cap or -% a rect cap. In all cases, the arrow should ``cover'' the cap -% completely or not at all. -% -% Example: -% -% \pgfarrowsdeclare{stealth}{stealth} -% { -% \pgfarrowsleftextend{-6\pgflinewidth} -% \pgfarrowsrightextend{2\pgflinewidth} -% { -% \pgfpathmoveto{\pgfpoint{2\pgflinewidth}{0pt}} -% \pgfpathlineto{\pgfpoint{-6\pgflinewidth}{4\pgflinewidth}} -% \pgfpathlineto{\pgfpoint{-3\pgflinewidth}{0pt}} -% \pgfpathlineto{\pgfpoint{-6\pgflinewidth}{-4\pgflinewidth}} -% \pgfusepathqfill -% } - -\def\pgfarrowsdeclare#1#2#3#4{% - \pgf@arrows@check@already{#1}{#2} - {% - \expandafter\def\csname pgf@arrow@code@#2\endcsname{#4}% - \expandafter\def\csname pgf@arrow@left@#2\endcsname{#3\advance\pgf@x by-\pgf@xa}% - \expandafter\def\csname pgf@arrow@right@#2\endcsname{#3\advance\pgf@x by\pgf@xb}% - \pgf@arrows@invname{#1}{#2}% - }% -} - -\def\pgfarrowsleftextend#1{\pgfmathsetlength\pgf@xa{#1}} -\def\pgfarrowsrightextend#1{\pgfmathsetlength\pgf@xb{#1}} - -\def\pgf@arrows@repeat#1#2{% - \edef\pgf@arrows@marshal{\noexpand\let\expandafter\noexpand\csname#2\endcsname=\expandafter\noexpand\csname#1\endcsname}% - \pgf@arrows@marshal} - - - -% Declare a new arrow type to be the same as another one. -% -% #1 = name of new start -% #2 = name or new end -% #3 = name or old start -% #4 = name or old end -% -% Example: -% -% \pgfarrowsdeclarealias{<}{>}{to}{to} - -\def\pgfarrowsdeclarealias#1#2#3#4{% - \pgf@arrows@check@already{#1}{#2} - {% - \pgf@arrows@checked{#3}{#4}% - {% - \pgf@arrows@repeat{pgf@arrow@code@#4}{pgf@arrow@code@#2}% - \pgf@arrows@repeat{pgf@arrow@left@#4}{pgf@arrow@left@#2}% - \pgf@arrows@repeat{pgf@arrow@right@#4}{pgf@arrow@right@#2}% - \pgf@arrows@invname{#1}{#2}% - }% - }% -} - - - - -% Creates a new arrows by ``swapping'' an existing arrow. -% -% #1 = name of new start -% #2 = name of new end -% #3 = name of old start -% #4 = name of old end -% -% Example: -% -% \pgfarrowsdeclarealias{]}{[}{[}{]} - -\def\pgfarrowsdeclarereversed#1#2#3#4{% - \pgf@arrows@check@already{#1}{#2}% - {% - \pgf@arrows@checked{#3}{#4}% - {% - \expandafter\def\csname pgf@arrow@code@#2\endcsname{% - \pgflowlevel{\pgftransformxscale{-1}}% - \csname pgf@arrow@code@#4\endcsname}% - \pgf@arrows@repeat{pgf@arrow@right@#4}{pgf@arrow@left@#2}% - \pgf@arrows@repeat{pgf@arrow@left@#4}{pgf@arrow@right@#2}% - \pgf@arrows@invname{#1}{#2}% - }% - }% -} - - - -% Creates new arrows by combining two existing arrows. -% -% #1 = optional additional space -% #2 = name of new start -% #3 = name of new end -% #4 = name of second (innermost) start -% #5 = name of second end -% #6 = name of first (outermost) start -% #7 = name of first end -% -% In the star form, the line will end at the innermost arrows, -% otherwise the line will end at the outermost arrows. -% -% Example: -% -% \pgfarrowsdeclarecombine*{|<}{>|}{|}{|}{<}{>} -% \pgfarrowsdeclarecombine{<<}{>>}{<}{>}{<}{>} - -\def\pgfarrowsdeclarecombine{\pgfutil@ifnextchar*{\pgfarrowsdeclarecombine@star}{\pgf@@arrowsdeclarecombine}} - -\def\pgf@@arrowsdeclarecombine{\pgfutil@ifnextchar[{\pgf@arrowsdeclarecombine}{\pgf@arrowsdeclarecombine[0pt]}} -\def\pgf@arrowsdeclarecombine[#1]#2#3#4#5#6#7{% - \pgf@arrows@check@already{#2}{#3}% - {% - \pgf@arrows@checked{#4}{#5}% - {% - \pgf@arrows@checked{#6}{#7}% - {% - \expandafter\edef\csname pgf@arrow@code@#3\endcsname{% - \noexpand\pgfscope% - {\expandafter\noexpand\csname pgf@arrow@code@#7\endcsname}% - \noexpand\endpgfscope% - {% - \noexpand\pgfmathsetlength\pgf@x{#1}% - \noexpand\pgf@process{\expandafter\noexpand\csname pgf@arrow@left@#7\endcsname}% - \noexpand\pgf@process{\expandafter\noexpand\csname pgf@arrow@right@#5\endcsname}% - \pgf@x=-\pgf@x% - \noexpand\pgflowlevel{\noexpand\pgftransformxshift{\pgf@x}}% - \expandafter\noexpand\csname pgf@arrow@code@#5\endcsname}% - }% - \pgf@arrows@repeat{pgf@arrow@right@#7}{pgf@arrow@right@#3}% - \expandafter\def\csname pgf@arrow@left@#3\endcsname{% - \pgf@process{% - \pgfmathsetlength\pgf@y{#1}% - \advance\pgf@x by\pgf@y% - \pgf@process{\csname pgf@arrow@left@#7\endcsname}% - \pgf@process{\csname pgf@arrow@right@#5\endcsname}% - \pgf@process{\csname pgf@arrow@left@#5\endcsname}% - }% - }% - \pgf@arrows@invname{#2}{#3}% - }% - }% - }% -} - -\def\pgfarrowsdeclarecombine@star*{\pgfutil@ifnextchar[{\pgf@arrowsdeclarecombine@star}{\pgf@arrowsdeclarecombine@star[0pt]}} -\def\pgf@arrowsdeclarecombine@star[#1]#2#3#4#5#6#7{% - \pgf@arrows@check@already{#2}{#3}% - {% - \pgf@arrows@checked{#4}{#5}% - {% - \pgf@arrows@checked{#6}{#7}% - {% - \expandafter\edef\csname pgf@arrow@code@#3\endcsname{% - \noexpand\pgfscope% - {% - \noexpand\pgfmathsetlength\pgf@x{#1}% - \pgf@process{\expandafter\noexpand\csname pgf@arrow@left@#7\endcsname}% - \pgf@process{\expandafter\noexpand\csname pgf@arrow@right@#5\endcsname}% - \noexpand\pgflowlevel{\noexpand\pgftransformxshift{\pgf@x}}% - }% - {\expandafter\noexpand\csname pgf@arrow@code@#7\endcsname}% - \noexpand\endpgfscope% - \expandafter\noexpand\csname pgf@arrow@code@#5\endcsname% - }% - \pgf@arrows@repeat{pgf@arrow@left@#7}{pgf@arrow@left@#3}% - \expandafter\def\csname pgf@arrow@right@#3\endcsname{% - \pgf@process{% - \pgfmathsetlength\pgf@y{#1}% - \advance\pgf@x by\pgf@y% - \pgf@process{\csname pgf@arrow@left@#7\endcsname}% - \pgf@process{\csname pgf@arrow@right@#5\endcsname}% - \pgf@process{\csname pgf@arrow@right@#7\endcsname}% - }% - }% - \pgf@arrows@invname{#2}{#3}% - }% - }% - }% -} - - - -% Creates new arrows by doubling/tripling existing arrows. -% -% #1 = optional additional space in multiples of line width -% #2 = name of new start -% #3 = name of new end -% #4 = name of old start -% #5 = name of old end -% -% Example: -% -% \pgfarrowsdeclaredouble{<<}{>>}{<}{>} - -\def\pgfarrowsdeclaredouble{\pgfutil@ifnextchar[{\pgf@arrowsdeclaredouble}{\pgf@arrowsdeclaredouble[0pt]}} -\def\pgf@arrowsdeclaredouble[#1]#2#3#4#5{\pgfarrowsdeclarecombine[#1]{#2}{#3}{#4}{#5}{#4}{#5}} -\def\pgfarrowsdeclaretriple{\pgfutil@ifnextchar[{\pgf@arrowsdeclaretriple}{\pgf@arrowsdeclaretriple[0pt]}} -\def\pgf@arrowsdeclaretriple[#1]#2#3#4#5{% - \pgfarrowsdeclarecombine[#1]{pgf@trip@#2}{pgf@trip@#3}{#4}{#5}{#4}{#5}% - \pgfarrowsdeclarecombine[#1]{#2}{#3}{pgf@trip@#2}{pgf@trip@#3}{#4}{#5}% -} - - -% A stealth-fighter-like pointed arrow -% -% Example: -% -% \pgfsetarrows{-stealth} - -\pgfarrowsdeclare{stealth}{stealth} -{ - \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% - \pgfarrowsleftextend{+-3\pgfutil@tempdima} - \pgfarrowsrightextend{+5\pgfutil@tempdima} -} -{ - \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% - \pgfpathmoveto{\pgfqpoint{5\pgfutil@tempdima}{0pt}} - \pgfpathlineto{\pgfqpoint{-3\pgfutil@tempdima}{4\pgfutil@tempdima}} - \pgfpathlineto{\pgfpointorigin} - \pgfpathlineto{\pgfqpoint{-3\pgfutil@tempdima}{-4\pgfutil@tempdima}} - \pgfusepathqfill -} - -\pgfarrowsdeclarereversed{stealth reversed}{stealth reversed}{stealth}{stealth} - - -% An arrow similar to the $\to$ arrow -% -% Example: -% -% \pgfsetarrow{-to} - -\pgfarrowsdeclare{to}{to} -{ - \pgfutil@tempdima=-0.84pt% - \advance\pgfutil@tempdima by-1.3\pgflinewidth% - \pgfutil@tempdimb=0.21pt% - \advance\pgfutil@tempdimb by.625\pgflinewidth% - \pgfarrowsleftextend{+\pgfutil@tempdima} - \pgfarrowsrightextend{+\pgfutil@tempdimb} -} -{ - \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% - \pgfsetlinewidth{0.8\pgflinewidth} - \pgfsetdash{}{+0pt} - \pgfsetroundcap - \pgfsetroundjoin - \pgfpathmoveto{\pgfqpoint{-3\pgfutil@tempdima}{4\pgfutil@tempdima}} - \pgfpathcurveto - {\pgfqpoint{-2.75\pgfutil@tempdima}{2.5\pgfutil@tempdima}} - {\pgfqpoint{0pt}{0.25\pgfutil@tempdima}} - {\pgfqpoint{0.75\pgfutil@tempdima}{0pt}} - \pgfpathcurveto - {\pgfqpoint{0pt}{-0.25\pgfutil@tempdima}} - {\pgfqpoint{-2.75\pgfutil@tempdima}{-2.5\pgfutil@tempdima}} - {\pgfqpoint{-3\pgfutil@tempdima}{-4\pgfutil@tempdima}} - \pgfusepathqstroke -} - -\pgfarrowsdeclare{to reversed}{to reversed} -{ - \pgfutil@tempdima=-0.21pt% - \advance\pgfutil@tempdima by-0.475\pgflinewidth% - \pgfutil@tempdimb=0.98pt% - \advance\pgfutil@tempdimb by1.45\pgflinewidth% - \pgfarrowsleftextend{+\pgfutil@tempdima} - \pgfarrowsrightextend{+\pgfutil@tempdimb} -} -{ - \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% - \pgfsetlinewidth{+0.8\pgflinewidth} - \pgfsetdash{}{+0pt} - \pgfsetroundcap - \pgfsetroundjoin - \pgfpathmoveto{\pgfqpoint{3.5\pgfutil@tempdima}{4\pgfutil@tempdima}} - \pgfpathcurveto - {\pgfqpoint{3.25\pgfutil@tempdima}{2.5\pgfutil@tempdima}} - {\pgfqpoint{0.5\pgfutil@tempdima}{0.25\pgfutil@tempdima}} - {\pgfqpoint{-0.25\pgfutil@tempdima}{0\pgfutil@tempdima}} - \pgfpathcurveto - {\pgfqpoint{0.5\pgfutil@tempdima}{-0.25\pgfutil@tempdima}} - {\pgfqpoint{3.25\pgfutil@tempdima}{-2.5\pgfutil@tempdima}} - {\pgfqpoint{3.5\pgfutil@tempdima}{-4\pgfutil@tempdima}} - \pgfusepathqstroke -} - - - -% LaTeX's orginal arrow type -% -% Example: -% -% \pgfsetarrows{-latex} - -\pgfarrowsdeclare{latex}{latex} -{ - \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% - \pgfarrowsleftextend{+-1\pgfutil@tempdima} - \pgfarrowsrightextend{+9\pgfutil@tempdima} -} -{ - \pgfutil@tempdima=0.28pt% - \advance\pgfutil@tempdima by.3\pgflinewidth% - \pgfpathmoveto{\pgfqpoint{9\pgfutil@tempdima}{0pt}} - \pgfpathcurveto - {\pgfqpoint{6.3333\pgfutil@tempdima}{.5\pgfutil@tempdima}} - {\pgfqpoint{2\pgfutil@tempdima}{2\pgfutil@tempdima}} - {\pgfqpoint{-1\pgfutil@tempdima}{3.75\pgfutil@tempdima}} - \pgfpathlineto{\pgfqpoint{-1\pgfutil@tempdima}{-3.75\pgfutil@tempdima}} - \pgfpathcurveto - {\pgfqpoint{2\pgfutil@tempdima}{-2\pgfutil@tempdima}} - {\pgfqpoint{6.3333\pgfutil@tempdima}{-.5\pgfutil@tempdima}} - {\pgfqpoint{9\pgfutil@tempdima}{0pt}} - \pgfusepathqfill -} -\pgfarrowsdeclarereversed{latex reversed}{latex reversed}{latex}{latex} - - - -% A bar shaped arrow -% -% Example: -% -% \pgfsetarrows{-|} - -\pgfarrowsdeclare{|}{|} -{ - \pgfarrowsleftextend{+-0.25\pgflinewidth} - \pgfarrowsrightextend{+.75\pgflinewidth} -} -{ - \pgfutil@tempdima=2pt% - \advance\pgfutil@tempdima by1.5\pgflinewidth% - \pgfsetdash{}{+0pt} - \pgfsetrectcap - \pgfpathmoveto{\pgfqpoint{0.25\pgflinewidth}{-\pgfutil@tempdima}} - \pgfpathlineto{\pgfqpoint{0.25\pgflinewidth}{\pgfutil@tempdima}} - \pgfusepathqstroke -} - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex deleted file mode 100644 index 38f60266178..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex +++ /dev/null @@ -1,258 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.7 2007/03/09 17:49:32 tantau Exp $ - -% Globals - -\newdimen\pgflinewidth - - -% Set the line width to #1. -% -% #1 = new line width. -% -% Example: -% -% \pgfsetlinewidth{3pt} - -\def\pgfsetlinewidth#1{% - \pgfmathsetlength\pgflinewidth{#1}% - \global\pgflinewidth=\pgflinewidth% - \pgfsys@setlinewidth{\the\pgflinewidth}% - \ignorespaces} - - -% Set the miter limit to #1. -% -% #1 = new miter limit factor. -% -% Example: -% -% \pgfsetmiterlimit{3} - -\def\pgfsetmiterlimit#1{% - \pgfsys@setmiterlimit{#1}% - \ignorespaces} - - -% Set the dash pattern to #1 with phase #2/ -% -% #1 = a row of numbers of length of ``on'' and ``off'' points. -% #2 = a phase -% -% Example: -% -% \pgfsetdash{} {0pt} % solid line -% \pgfsetdash{{.1cm}} {0pt} % long dashes -% \pgfsetdash{{1pt}{1ex}}{0pt} % dotted - -\def\pgfsetdash#1#2{% - \def\pgf@temp{}% - \def\pgf@next{\pgf@strip}% - \pgf@strip#1{pgf@stop}% - \pgfmathsetlength\pgf@x{#2}% - \pgfsys@setdash{\pgf@temp}{\the\pgf@x}% - \ignorespaces} - -\def\pgf@strip#1{% - \def\pgf@@temp{#1}% - \ifx\pgf@@temp\pgf@stop% - \let\pgf@next=\relax% - \else% - \pgfmathsetlength\pgf@x{#1}% - \ifx\pgf@temp\pgfutil@empty% - \edef\pgf@temp{\the\pgf@x}% - \else% - \edef\pgf@temp{\pgf@temp,\the\pgf@x}% - \fi% - \fi\pgf@next} - -\def\pgf@stop{pgf@stop} - - -% Set color of strokes. This will overrule the normal color. -% -% Example: -% -% \pgfsetstrokecolor{red} - -\def\pgfsetstrokecolor#1{% - \pgfutil@colorlet{pgf@tempcolor}{#1}% - \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% - \expandafter\expandafter\expandafter\pgf@setstrokecolor\csname\string\color@pgf@tempcolor\endcsname% -} -\def\pgf@setstrokecolor#1#2#3#4#5{% - \expandafter\ifx\csname pgfsys@color@#4@stroke\endcsname\relax% - \PackageError{pgfbase}{Unsupported color model `#4'. Sorry}{}% - \else% - \edef\pgf@colmarshal{\expandafter\noexpand\csname pgfsys@color@#4@stroke\endcsname}% - \pgf@uncomma#5,,% - \pgf@colmarshal% - \fi} - -\def\pgf@uncomma#1,{% - \def\pgf@coltest{#1}% - \ifx\pgf@coltest\pgfutil@empty% - \let\pgf@colnext=\relax% - \else% - \expandafter\def\expandafter\pgf@colmarshal\expandafter{\pgf@colmarshal{#1}}% - \let\pgf@colnext=\pgf@uncomma% - \fi% - \pgf@colnext% -} - - -% Set color of fills. This will overrule the normal color. -% -% Example: -% -% \pgfsetfillcolor{gray} - -\def\pgfsetfillcolor#1{% - \pgfutil@colorlet{pgf@tempcolor}{#1}% - \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% - \expandafter\expandafter\expandafter\pgf@setfillcolor\csname\string\color@pgf@tempcolor\endcsname% -} -\def\pgf@setfillcolor#1#2#3#4#5{% - \expandafter\ifx\csname pgfsys@color@#4@fill\endcsname\relax% - \PackageError{pgfbase}{Unsupported color model `#4'. Sorry}{}% - \else% - \edef\pgf@colmarshal{\expandafter\noexpand\csname pgfsys@color@#4@fill\endcsname}% - \pgf@uncomma#5,,% - \pgf@colmarshal% - \fi} - - - -% Sets both the stroke and fill color. -% -% Example: -% -% \pgfsetcolor{blue} - -\def\pgfsetcolor#1{% - \pgfutil@colorlet{pgf@tempcolor}{#1}% - \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% - \expandafter\expandafter\expandafter\pgf@setcolor\csname\string\color@pgf@tempcolor\endcsname% -} -\def\pgf@setcolor#1#2#3#4#5{% - \expandafter\ifx\csname pgfsys@color@#4\endcsname\relax% - \PackageError{pgfbase}{Unsupported color model `#4'. Sorry}{}% - \else% - \edef\pgf@colmarshal{\expandafter\noexpand\csname pgfsys@color@#4\endcsname}% - \pgf@uncomma#5,,% - \pgf@colmarshal% - \fi} - -% Code for ensuring the stroke/fill colors are correctly reset. -\def\XC@bcolor{\pgfsys@color@reset} - -% Set a butt line cap. -% -% Example: -% -% \pgfsetbuttcap - -\def\pgfsetbuttcap{\pgfsys@buttcap\ignorespaces} - - -% Set a round line cap. -% -% Example: -% -% \pgfsetroundcap - -\def\pgfsetroundcap{\pgfsys@roundcap\ignorespaces} - - -% Set a rectangular line cap. -% -% Example: -% -% \pgfsetrectcap - -\def\pgfsetrectcap{\pgfsys@rectcap\ignorespaces} - - -% Set a miter line join. -% -% Example: -% -% \pgfsetmiterjoin - -\def\pgfsetmiterjoin{\pgfsys@miterjoin\ignorespaces} - - -% Set a bevel line join. -% -% Example: -% -% \pgfsetbeveljoin - -\def\pgfsetbeveljoin{\pgfsys@beveljoin\ignorespaces} - - -% Set a round line join. -% -% Example: -% -% \pgfsetroundjoin - -\def\pgfsetroundjoin{\pgfsys@roundjoin\ignorespaces} - - -% Sets the even-odd rule for filling and clipping. -% -% Example: -% -% \pgfseteorule - -\def\pgfseteorule{\pgfsys@eoruletrue\ignorespaces} - - -% Sets the non-zero winding number rule for filling and clipping. -% -% Example: -% -% \pgfsetnonzerorule - -\def\pgfsetnonzerorule{\pgfsys@eorulefalse\ignorespaces} - - -% Sets the opacity of stroking operations. -% -% #1 = opacity, where 1 means fully opaque and 0 means fully -% transparent. -% -% Example: -% -% \pgfsetstrokeopacity{0.5} - -\def\pgfsetstrokeopacity#1{% - \edef\pgf@temp{{#1}}% - \expandafter\pgfsys@stroke@opacity\pgf@temp} - - -% Sets the opacity of stroking operations. -% -% #1 = opacity, where 1 means fully opaque and 0 means fully -% transparent. -% -% Example: -% -% \pgfsetfillopacity{0.5} - -\def\pgfsetfillopacity#1{% - \edef\pgf@temp{{#1}}% - \expandafter\pgfsys@fill@opacity\pgf@temp} - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex index b83c41b3f96..d74d3d1f84f 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex @@ -7,7 +7,8 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseimage.code.tex,v 1.7 2007/05/31 10:31:50 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreimage.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $ + % Declare an image @@ -29,8 +30,7 @@ \def\pgfdeclareimage{\pgfutil@ifnextchar[{\pgf@declareimage}{\pgf@declareimage[]}} \def\pgf@declareimage[#1]#2#3{% - \setkeys{pgfimage}{height=,width=,page=,interpolate=false,mask=}% defaults - \setkeys{pgfimage}{#1}% + \pgfqkeys{/pgf/images}{height=,width=,page=,interpolate=false,mask=,#1}% % Try to find the file \gdef\pgf@filename{}% % If page= parameter is not empty, try that file first: @@ -41,7 +41,7 @@ \ifx\pgf@filename\pgfutil@empty% \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3}% \else% - \setkeys{pgfimage}{page=}% make page empty + \pgfkeys{/pgf/images/page=}% make page empty \fi% \ifx\pgf@filename\pgfutil@empty% \PackageWarning{pgf}% @@ -58,27 +58,31 @@ \expandafter\global\expandafter\let\csname pgf@image@#2!\endcsname=\pgf@image% } -\define@key{pgfimage}{width}{\edef\pgf@imagewidth{#1}} -\define@key{pgfimage}{height}{\edef\pgf@imageheight{#1}} -\define@key{pgfimage}{page}{\edef\pgf@imagepage{#1}} -\define@key{pgfimage}{interpolate}[true]{\edef\pgf@imageinterpolate{/Interpolate #1}} -\define@key{pgfimage}{mask}{% - \edef\pgf@imagemask{#1}% - \ifx\pgf@imagemask\pgfutil@empty% - \else% - \pgfutil@ifundefined{pgf@mask@#1}% - {\PackageError{pgf}{Undefined mask "#1".}{}% - \edef\pgf@imagemask{}}% - {\edef\pgf@imagemask{\csname pgf@mask@#1\endcsname}% - \ifx\pgf@imagemask\pgfutil@empty% - \else - \edef\pgf@imagemask{/SMask \pgf@imagemask\space 0 R}% - \fi}% - \fi} +\pgfkeys{/pgf/images/width/.estore in=\pgf@imagewidth} +\pgfkeys{/pgf/images/height/.estore in=\pgf@imageheight} +\pgfkeys{/pgf/images/page/.estore in=\pgf@imagepage} +\pgfkeys{/pgf/images/interpolate/.cd,.code=\edef\pgf@imageinterpolate{/Interpolate #1},.default=true} +\pgfkeys{/pgf/images/mask/.code=% + {% + \edef\pgf@imagemask{#1}% + \ifx\pgf@imagemask\pgfutil@empty% + \else% + \pgfutil@ifundefined{pgf@mask@#1}% + {\PackageError{pgf}{Undefined mask "#1".}{}% + \edef\pgf@imagemask{}}% + {\edef\pgf@imagemask{\csname pgf@mask@#1\endcsname}% + \ifx\pgf@imagemask\pgfutil@empty% + \else + \edef\pgf@imagemask{/SMask \pgf@imagemask\space 0 R}% + \fi% + }% + \fi% + }} + \def\pgf@findfile#1:#2+#3{% - \pgfutil@IfFileExists{#3.#1}% - {\xdef\pgf@filename{#3.#1}}% + \pgfutil@IfFileExists{#3#1}% + {\xdef\pgf@filename{#3#1}}% {\def\pgf@mightbeempty{#2}% \ifx\pgf@mightbeempty\pgfutil@empty\else% \pgf@findfile#2+{#3}% @@ -129,8 +133,7 @@ \def\pgfdeclaremask{\pgfutil@ifnextchar[\pgf@declaremask{\pgf@declaremask[]}} \def\pgf@declaremask[#1]#2#3{% - \setkeys{pgfmask}{matte={1 1 1}}% defaults - \setkeys{pgfmask}{#1}% + \pgfqkeys{/pgf/images/mask}{matte={1 1 1},#1}% defaults \def\pgf@mask{}% % Try to find the file \gdef\pgf@filename{}% @@ -145,8 +148,7 @@ \expandafter\global\expandafter\let\csname pgf@mask@#2\endcsname=\pgf@mask% } -\define@key{pgfmask}{matte}{\edef\pgf@maskmatte{#1}} - +\pgfkeys{/pgf/images/mask/matte/.cd,.estore in=\pgf@maskmatte,.value required} @@ -185,14 +187,14 @@ \def\pgf@tryextensions#1#2{% \edef\pgf@args{[#2!]}\expandafter\pgf@@tryextensions\pgf@args{#1}} \def\pgf@@tryextensions[#1!#2]#3{% - \expandafter\pgfutil@ifundefined\expandafter{#3.#1!#2}% + \expandafter\pgfutil@ifundefined\expandafter{#3#1!#2}% {\def\pgf@temp{#2}% \ifx\pgf@temp\pgfutil@empty% \edef#3{#3!}% \else% \pgf@@tryextensions[#2]{#3}% \fi}% - {\edef#3{#3.#1!#2}}} + {\edef#3{#3#1!#2}}} % Alternate image @@ -296,7 +298,7 @@ \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}% \ifx\pgf@tempa\pgf@tempb% \else% - \pgf@external@grabshipouttrue + \pgf@external@grabshipouttrue% \fi% } @@ -305,9 +307,9 @@ \newbox\pgfexternal@startupbox \AtBeginDocument{% - \ifpgf@external@grabshipout + \ifpgf@external@grabshipout% \global\let\pgfexternal@originalshipout=\shipout% - \global\def\shipout{\setbox\pgfpic=} + \global\def\shipout{\setbox\pgfpic=}% \maxdeadcycles=10000% % Ok, gather everything we have seen up to now in a box. This box % will contain any specials that have been used. @@ -334,7 +336,7 @@ \def\pgf@externalbegin#1{% % First, check whether we wish to grab this graphic: \let\pgf@next=\pgf@external@normal% - \ifpgf@external@grabshipout + \ifpgf@external@grabshipout% \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}% \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}% \ifx\pgf@tempa\pgf@tempb% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex index d05672009e6..d1e464fb7b7 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex @@ -7,7 +7,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaselayers.code.tex,v 1.5 2006/10/16 22:32:58 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorelayers.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $ % Creates a new pgf layer @@ -71,6 +71,9 @@ \egroup% } +\let\startpgfonlayer=\pgfonlayer +\let\stoppgfonlayer=\endpgfonlayer + diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex deleted file mode 100644 index 557558d82ef..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex +++ /dev/null @@ -1,101 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreobjects.code.tex,v 1.2 2006/10/11 15:22:25 tantau Exp $ - - -% Object reuse - - -% Define a pgf object for reuse. Such objects will be stored -% efficiently internally. -% -% #1 = name for later reuse -% #2 = lower left corner point of bounding box -% #3 = upper right left corner point of bounding box -% #4 = pure pgf code (nothing too fancy!) -% -% Description: -% -% Used to define reusable objects. The object must be composed of -% basic pgf graphic primitives. Nothing fancy can be used. The -% created object will be stored as an xform object in pdf or as a -% postscript procedure in postscript. -% -% Example: -% -% \pgfdefobject{myrect}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{11pt}{11pt}} -% {\pgfpathqmoveto{0pt}{0pt} -% \pgfpathqmoveto{10pt}{0pt} -% \pgfpathqmoveto{10pt}{10pt} -% \pgfpathqmoveto{0pt}{10pt} -% \pgfpathclose -% \pgfusepath{stroke}} -% -% \begin{pgfpicture}{0cm}{0cm}{1cm}{1cm} -% \pgfuseobject{myrect} -% \end{pgfpicture} - -\def\pgfdefobject#1#2#3#4{% - \pgfinterruptpath% - \pgf@relevantforpicturesizefalse% - \pgfsys@defobject{#1}{#2}{#3}{#4}% - \endpgfinterruptpath% - \ignorespaces% -} - - -% Use an object that was previously defined using pgfdefobject -% -% #1 = name of previously defined object -% -% Example: -% -% \pgfdefobject{myrect}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{11pt}{11pt}} -% {\pgfqmoveto{0}{0} -% \pgfqmoveto{10}{0} -% \pgfqmoveto{10}{10} -% \pgfqmoveto{0}{10} -% \pgfclosestroke} -% -% \begin{pgfpicture}{0cm}{0cm}{1cm}{1cm} -% \pgfuseobject{myrect} -% \end{pgfpicture} - -\def\pgfuseobject#1{\pgfsys@beginscope\pgfsys@useobject{#1}{}\pgfsys@endscope} - - -% Use an object that was previously defined using pgfdefobject, but -% magnify the object by the current x and y register values -% -% #1 = name of previously defined object -% -% Example: -% -% \pgfdefobject{myrect}{\pgfpoint{-1pt}{-1pt}}{\pgfpoint{11pt}{11pt}} -% {\pgfqmoveto{0}{0} -% \pgfqmoveto{10}{0} -% \pgfqmoveto{10}{10} -% \pgfqmoveto{0}{10} -% \pgfclosestroke} -% -% \begin{pgfpicture}{0cm}{0cm}{1cm}{1cm} -% \pgf@x=2pt% Scale by factor two in x-direction -% \pgf@y=2pt% Scale by factor two in y-direction -% \pgfuseobjectmagnify{myrect} -% \end{pgfpicture} - -\def\pgfuseobjectmagnify#1{% - \pgfsys@beginscope% - \pgfsys@useobject{#1}{\pgfsys@transformxyscale{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}}% - \pgfsys@endscope% -} - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex deleted file mode 100644 index 2886ffa8a53..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex +++ /dev/null @@ -1,857 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.9 2007/06/07 07:41:10 tantau Exp $ - - -\newdimen\pgf@path@lastx -\newdimen\pgf@path@lasty - - - -% Replace corners by arcs. -% -% #1 = in-size of arc -% #2 = out-size of arc -% -% Description: -% -% This command influences path construction command like -% \pgfpathlineto or \pgfpatharc. It will cause the corners at the end -% of these commands to be replaced by little arcs. If the -% corner is a 90 degrees corner and if #1=#2, a quarter-circle of -% radius #1 is put in place of the corner. If #1 and #2 are different, -% the quarter circle will instead by a quarter ellipse. If the angle -% is different from 90 degrees, a deformed quarter circle will -% result, which may or may not be desirable. For a ``perfect'' arc you -% must use the \pgfpatharc command. -% -% -% Example: One rounded corner. -% -% \pgfpathmoveto{\pgfpointxy{0}{0}} -% \pgfsetcornersarced{4pt}{4pt} -% \pgfpathlineto{\pgfpointxy{0}{1}} -% \pgfpathlineto{\pgfpointxy{1}{1}} -% \pgfstroke -% -% Example: A rounded rectangle -% -% \pgfsetcornersarced{4pt}{4pt} -% \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} -% \pgfstroke -% -% Example: A rounded triangles -% -% \pgfsetcornersarced{4pt}{4pt} -% \pgfpathmoveto{\pgfpointorigin} -% \pgfpathlineto{\pgfpoint{1cm}{0cm}} -% \pgfpathlineto{\pgfpoint{1cm}{1cm}} -% \pgfpathclose -% \pgfstroke - -\newif\ifpgf@arccorners - -\def\pgfsetcornersarced#1{% - \pgf@process{#1}% - \edef\pgf@corner@arc{{\the\pgf@x}{\the\pgf@y}}% - \pgf@arccornerstrue% - \ifdim\pgf@x=0pt% - \ifdim\pgf@y=0pt\relax% - \pgf@arccornersfalse% - \fi% - \fi% -} - -\def\pgf@roundcornerifneeded{% - \ifpgf@arccorners\expandafter\pgfsyssoftpath@specialround\pgf@corner@arc\fi% -} - - -% Move current point to #1. -% -% #1 = new current point -% -% Example: -% -% \pgfpathmoveto{\pgfxy(0,0)} -% \pgfpathlineto{\pgfxy(0,1)} -% \pgfstroke - -\def\pgfpathmoveto#1{% - \pgfpointtransformed{#1}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgfsyssoftpath@moveto{\the\pgf@x}{\the\pgf@y}% - \global\pgf@path@lastx=\pgf@x% - \global\pgf@path@lasty=\pgf@y% -} - -\def\pgf@protocolsizes#1#2{% - \ifpgf@relevantforpicturesize% - \ifdim#1<\pgf@picminx\global\pgf@picminx#1\fi% - \ifdim#1>\pgf@picmaxx\global\pgf@picmaxx#1\fi% - \ifdim#2<\pgf@picminy\global\pgf@picminy#2\fi% - \ifdim#2>\pgf@picmaxy\global\pgf@picmaxy#2\fi% - \fi% - \ifdim#1<\pgf@pathminx\global\pgf@pathminx#1\fi% - \ifdim#1>\pgf@pathmaxx\global\pgf@pathmaxx#1\fi% - \ifdim#2<\pgf@pathminy\global\pgf@pathminy#2\fi% - \ifdim#2>\pgf@pathmaxy\global\pgf@pathmaxy#2\fi% -} - - -\def\pgf@resetpathsizes{% - \global\pgf@pathmaxx=-16000pt\relax% - \global\pgf@pathminx=16000pt\relax% - \global\pgf@pathmaxy=-16000pt\relax% - \global\pgf@pathminy=16000pt\relax% -} - -\def\pgf@getpathsizes#1{% - \edef#1{{\the\pgf@pathmaxx}{\the\pgf@pathminx}{\the\pgf@pathmaxy}{\the\pgf@pathminy}}% -} -\def\pgf@setpathsizes#1{% - \expandafter\pgf@@setpathsizes#1% -} -\def\pgf@@setpathsizes#1#2#3#4{% - \global\pgf@pathmaxx=#1\relax% - \global\pgf@pathminx=#2\relax% - \global\pgf@pathmaxy=#3\relax% - \global\pgf@pathminy=#4\relax% -} - - - - - -% Append a line from the current point to #1 to the current path. -% -% #1 = end of line -% -% Example: -% -% \pgfpathmoveto{\pgfxy(0,0)} -% \pgfpathlineto{\pgfxy(0,1)} -% \pgfstroke - -\def\pgfpathlineto#1{% - \pgfpointtransformed{#1}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@roundcornerifneeded% - \pgfsyssoftpath@lineto{\the\pgf@x}{\the\pgf@y}% - \global\pgf@path@lastx=\pgf@x% - \global\pgf@path@lasty=\pgf@y% -} - - - -% Close the current path. -% -% Example: -% -% % Draws two triangles -% \pgfpathmoveto{\pgfxy(0,0)} -% \pgfpathlineto{\pgfxy(0,1)} -% \pgfpathlineto{\pgfxy(1,0)} -% \pgfclosepath -% \pgfpathmoveto{\pgfxy(2,0)} -% \pgfpathlineto{\pgfxy(2,1)} -% \pgfpathlineto{\pgfxy(3,0)} -% \pgfpathclose -% \pgfstroke - -\def\pgfpathclose{% - \pgf@roundcornerifneeded% - \pgfsyssoftpath@closepath% -} - - -% Append a bezier spline from the current point to #3 with control -% points #1 and #2 to the current path. -% -% #1 = first control point -% #2 = second control point -% #3 = end point -% -% Example: -% -% \pgfpathmoveto{\pgfxy(0,0)} -% \pgfpathcurveto{\pgfxy(0,1)}{\pgfxy(1,1)}{\pgfxy(1,2)} -% \pgfstroke - -\def\pgfpathcurveto#1#2#3{% - \pgfpointtransformed{#3}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \pgfpointtransformed{#2}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgfpointtransformed{#1}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@roundcornerifneeded% - \pgfsyssoftpath@curveto{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}% - \global\pgf@path@lastx=\pgf@xb% - \global\pgf@path@lasty=\pgf@yb% -} - - -% Append an arc to the current point, where the current point is at -% angle #1 and the end is at angle #2. If #2 > #1, the arc is drawn -% counter-clockwise, otherwise it is clockwise. -% -% #1 = angle of first point -% #2 = angle of second point -% #3 = radius or x-radius/y-radius -% -% Example: -% -% \pgfpathmoveto{\pgfxy(0,0)} -% \pgfpatharc{0}{90}{2cm} -% \pgfstroke - -\def\pgfpatharc#1#2#3{% - \pgfmathsetcounter{pgf@countc}{#1}% - \pgfmathsetcounter{pgf@countd}{#2}% - \ifnum\c@pgf@countc>360\relax% - \advance\c@pgf@countc by-360\relax% - \fi% - \ifnum\c@pgf@countc<-360\relax% - \advance\c@pgf@countc by360\relax% - \fi% - \ifnum\c@pgf@countd>360\relax% - \advance\c@pgf@countd by-360\relax% - \fi% - \ifnum\c@pgf@countd<-360\relax% - \advance\c@pgf@countd by360\relax% - \fi% - \loop% - \pgfutil@tempcnta=\c@pgf@countc\relax% - \advance\pgfutil@tempcnta by-\c@pgf@countd\relax% - \ifnum\pgfutil@tempcnta<0\relax% - \pgfutil@tempcnta=-\pgfutil@tempcnta\relax% - \fi% - \ifnum\pgfutil@tempcnta>90\relax% - \ifnum\c@pgf@countd>\c@pgf@countc\relax% - \pgfutil@tempcnta=\c@pgf@countc\relax% - \advance\pgfutil@tempcnta by 90\relax% - \expandafter\pgf@arc\expandafter{\expandafter\c@pgf@countc\expandafter}\expandafter{\the\pgfutil@tempcnta}{#3}% - \advance\c@pgf@countc by 90\relax% - \else - \pgfutil@tempcnta=\c@pgf@countc\relax% - \advance\pgfutil@tempcnta by -90\relax% - \expandafter\pgf@arc\expandafter{\expandafter\c@pgf@countc\expandafter}\expandafter{\the\pgfutil@tempcnta}{#3}% - \advance\c@pgf@countc by -90\relax% - \fi% - \repeat% - \pgf@roundcornerifneeded% - \pgf@arc{\c@pgf@countc}{\c@pgf@countd}{#3}% -} - -\def\pgf@arc#1#2#3{% - \pgfutil@in@{and }{#3}% - \ifpgfutil@in@% - \pgf@@arc{#1}{#2}#3\@@% - \else - \pgf@@arc{#1}{#2}#3and #3\@@% - \fi% -} - -\def\pgf@@arc#1#2#3and #4\@@{% - \pgfmathsetlength{\pgfutil@tempdima}{#3}% - \pgfmathsetlength{\pgfutil@tempdimb}{#4}% - \pgfutil@tempcnta=#1\relax% - \pgfutil@tempcntb=#2\relax% - \advance\pgfutil@tempcntb by-\pgfutil@tempcnta\relax% - \ifnum\pgfutil@tempcntb<0\relax% - \pgfutil@tempcntb=-\pgfutil@tempcntb\relax% - \fi% - \ifnum\pgfutil@tempcntb>85\relax% hackery to correct the control points - \pgfutil@tempdima=0.0555\pgfutil@tempdima\relax% - \pgfutil@tempdimb=0.0555\pgfutil@tempdimb\relax% - \else% - \ifnum\pgfutil@tempcntb>75\relax% - \pgfutil@tempdima=0.055\pgfutil@tempdima\relax% - \pgfutil@tempdimb=0.055\pgfutil@tempdimb\relax% - \else% - \ifnum\pgfutil@tempcntb>60\relax% - \pgfutil@tempdima=0.0545\pgfutil@tempdima\relax% - \pgfutil@tempdimb=0.0545\pgfutil@tempdimb\relax% - \else% - \pgfutil@tempdima=0.054\pgfutil@tempdima\relax% - \pgfutil@tempdimb=0.054\pgfutil@tempdimb\relax% - \fi% - \fi% - \fi - \pgfutil@tempdima=\pgfutil@tempcntb\pgfutil@tempdima\relax% - \divide\pgfutil@tempdima by 9\relax% - \pgfutil@tempdimb=\pgfutil@tempcntb\pgfutil@tempdimb\relax% - \divide\pgfutil@tempdimb by 9\relax% - %.. controls +(\pgfutil@tempcnta+90:\pgfutil@tempdima) and +(\pgfutil@tempcntb-90:\pgfutil@tempdima) .. +(-(#1:#3)+(#2:#3))% - % store first support vector in xa/ya: - \pgfutil@tempcnta=#1\relax% - \ifnum#2>#1\relax% - \advance\pgfutil@tempcnta by 90\relax% - \else% - \advance\pgfutil@tempcnta by -90\relax% - \fi% - \pgfpointtransformed{\pgfpointpolar{\pgfutil@tempcnta}{\pgfutil@tempdima and \pgfutil@tempdimb}}% - \advance\pgf@x by-\pgf@pt@x% - \advance\pgf@y by-\pgf@pt@y% - \pgf@xa=\pgf@path@lastx% - \pgf@ya=\pgf@path@lasty% - \advance\pgf@xa by \pgf@x% - \advance\pgf@ya by \pgf@y% - % store target in xb/yb: - \pgfutil@tempcnta=#1\relax% - \pgfpointtransformed{\pgfpointpolar{\pgfutil@tempcnta}{#3and #4}}% - \pgf@xb=\pgf@path@lastx% - \pgf@yb=\pgf@path@lasty% - \advance\pgf@xb by -\pgf@x% - \advance\pgf@yb by -\pgf@y% - \pgfutil@tempcnta=#2\relax% - \pgfpointtransformed{\pgfpointpolar{\pgfutil@tempcnta}{#3and #4}}% - \advance\pgf@xb by \pgf@x% - \advance\pgf@yb by \pgf@y% - % store second support xc/yc: - \pgfutil@tempcnta=#2\relax% - \ifnum#2>#1\relax% - \advance\pgfutil@tempcnta by -90\relax% - \else% - \advance\pgfutil@tempcnta by 90\relax% - \fi% - \pgfpointtransformed{\pgfpointpolar{\pgfutil@tempcnta}{\pgfutil@tempdima and \pgfutil@tempdimb}}% - \advance\pgf@x by-\pgf@pt@x% - \advance\pgf@y by-\pgf@pt@y% - \pgf@xc=\pgf@xb\relax% - \pgf@yc=\pgf@yb\relax% - \advance \pgf@xc by \pgf@x\relax% - \advance \pgf@yc by \pgf@y\relax% - \pgfsyssoftpath@curveto{\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xc}{\the\pgf@yc}{\the\pgf@xb}{\the\pgf@yb}% - \global\pgf@path@lastx=\pgf@xb% - \global\pgf@path@lasty=\pgf@yb% - \pgf@protocolsizes{\pgf@xa}{\pgf@ya}% - \pgf@protocolsizes{\pgf@xb}{\pgf@yb}% - \pgf@protocolsizes{\pgf@xc}{\pgf@yc}% -} - -% Append an arc to the current point, where the arc is on an ellipse -% given by two axis vectors. -% -% #1 = angle of first point -% #2 = angle of second point -% #3 = first axis -% #4 = second axis -% -% Example: -% -% \pgfpathmoveto{\pgfxy(0,0)} -% \pgfpatharcaxes{0}{90}{\pgfpointxy{2}{0}}{\pgfpointxy{0}{2}} -% \pgfstroke - -\def\pgfpatharcaxes#1#2#3#4{% - {% - \pgftransformtriangle{\pgfpointorigin}{#3}{#4}% - \pgfpatharc{#1}{#2}{1pt}% - }% -} - - - - -% Append an ellipse to the current path. -% -% #1 = center -% #2 = first axis -% #3 = second axis -% -% Example: -% -% % Add a circle of radius 3cm around the origin -% \pgfpathellipse{\pgforigin}{\pgfxy(2,0)}{\pgfxy(0,1)} -% -% % Draw a non-filled circle of radius 1cm around the point (1,1) -% \pgfpathellipse{\pgfxy(1,1)}{\pgfxy(1,1)}{\pgfxy(-2,2)} -% \pgfstroke - -\def\pgfpathellipse#1#2#3{% - \pgfpointtransformed{#1}% store center in xc/yc - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@y% - \pgfpointtransformed{#2}% - \pgf@xa=\pgf@x% store first axis in xa/ya - \pgf@ya=\pgf@y% - \advance\pgf@xa by-\pgf@pt@x% - \advance\pgf@ya by-\pgf@pt@y% - \pgfpointtransformed{#3}% - \pgf@xb=\pgf@x% store second axis in xb/yb - \pgf@yb=\pgf@y% - \advance\pgf@xb by-\pgf@pt@x% - \advance\pgf@yb by-\pgf@pt@y% - {% - \advance\pgf@xa by\pgf@xc% - \advance\pgf@ya by\pgf@yc% - \pgfsyssoftpath@moveto{\the\pgf@xa}{\the\pgf@ya}% - \pgf@protocolsizes{\pgf@xa}{\pgf@ya}% - }% - \pgf@x=0.555\pgf@xb% first arc - \pgf@y=0.555\pgf@yb% - \advance\pgf@x by\pgf@xa% - \advance\pgf@y by\pgf@ya% - \advance\pgf@x by\pgf@xc% - \advance\pgf@y by\pgf@yc% - \edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@x=0.555\pgf@xa% - \pgf@y=0.555\pgf@ya% - \advance\pgf@x by\pgf@xb% - \advance\pgf@y by\pgf@yb% - {% - \advance\pgf@x by\pgf@xc% - \advance\pgf@y by\pgf@yc% - \advance\pgf@xb by\pgf@xc% - \advance\pgf@yb by\pgf@yc% - \expandafter\pgfsyssoftpath@curveto\pgf@temp{\the\pgf@x}{\the\pgf@y}{\the\pgf@xb}{\the\pgf@yb}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@protocolsizes{\pgf@xb}{\pgf@yb}% - }% - \pgf@xa=-\pgf@xa% flip first axis - \pgf@ya=-\pgf@ya% - \pgf@x=0.555\pgf@xa% second arc - \pgf@y=0.555\pgf@ya% - \advance\pgf@x by\pgf@xb% - \advance\pgf@y by\pgf@yb% - \advance\pgf@x by\pgf@xc% - \advance\pgf@y by\pgf@yc% - \edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@x=0.555\pgf@xb% - \pgf@y=0.555\pgf@yb% - \advance\pgf@x by\pgf@xa% - \advance\pgf@y by\pgf@ya% - {% - \advance\pgf@x by\pgf@xc% - \advance\pgf@y by\pgf@yc% - \advance\pgf@xa by\pgf@xc% - \advance\pgf@ya by\pgf@yc% - \expandafter\pgfsyssoftpath@curveto\pgf@temp{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@protocolsizes{\pgf@xa}{\pgf@ya}% - }% - \pgf@xb=-\pgf@xb% flip second axis - \pgf@yb=-\pgf@yb% - \pgf@x=0.555\pgf@xb% third arc - \pgf@y=0.555\pgf@yb% - \advance\pgf@x by\pgf@xa% - \advance\pgf@y by\pgf@ya% - \advance\pgf@x by\pgf@xc% - \advance\pgf@y by\pgf@yc% - \edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@x=0.555\pgf@xa% - \pgf@y=0.555\pgf@ya% - \advance\pgf@x by\pgf@xb% - \advance\pgf@y by\pgf@yb% - {% - \advance\pgf@x by\pgf@xc% - \advance\pgf@y by\pgf@yc% - \advance\pgf@xb by\pgf@xc% - \advance\pgf@yb by\pgf@yc% - \expandafter\pgfsyssoftpath@curveto\pgf@temp{\the\pgf@x}{\the\pgf@y}{\the\pgf@xb}{\the\pgf@yb}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@protocolsizes{\pgf@xb}{\pgf@yb}% - }% - \pgf@xa=-\pgf@xa% flip first axis once more - \pgf@ya=-\pgf@ya% - \pgf@x=0.555\pgf@xa% fourth arc - \pgf@y=0.555\pgf@ya% - \advance\pgf@x by\pgf@xb% - \advance\pgf@y by\pgf@yb% - \advance\pgf@x by\pgf@xc% - \advance\pgf@y by\pgf@yc% - \edef\pgf@temp{{\the\pgf@x}{\the\pgf@y}}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@x=0.555\pgf@xb% - \pgf@y=0.555\pgf@yb% - \advance\pgf@x by\pgf@xa% - \advance\pgf@y by\pgf@ya% - {% - \advance\pgf@x by\pgf@xc% - \advance\pgf@y by\pgf@yc% - \advance\pgf@xa by\pgf@xc% - \advance\pgf@ya by\pgf@yc% - \expandafter\pgfsyssoftpath@curveto\pgf@temp{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@protocolsizes{\pgf@xa}{\pgf@ya}% - }% - \pgfsyssoftpath@closepath% - \pgfsyssoftpath@moveto{\the\pgf@xc}{\the\pgf@yc}% -} - - - -% Append a circle to the current path -% -% #1 = center -% #2 = radius -% -% Example: -% -% % Append a circle of radius 3cm around the the point (1,1) -% \pgfpathcircle{\pgxy(1,1)}{3cm} - -\def\pgfpathcircle#1#2{\pgfpathellipse{#1}{\pgfpoint{#2}{0pt}}{\pgfpoint{0pt}{#2}}} - - - - -% Append a rectangle to the current path -% -% #1 = lower left corner point of rectangle -% #2 = width and height vector -% -% Example: -% -% % A rectangle with corners (2,2) and (3,3) -% \pgfpathrectangle{\pgfpointxy{2}{2}}{\pgfpointxy{1}{1}} - -\def\pgfpathrectangle{% - \let\pgfrect@next=\pgf@specialrect% - \ifpgf@pt@identity% - \ifpgf@arccorners% - \else% - \let\pgfrect@next=\pgf@normalrect% - \fi% - \fi% - \pgfrect@next% -} - -\def\pgf@normalrect#1#2{% - \pgf@process{#2}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgfpointtransformed{#1}% - \pgfsyssoftpath@rect{\the\pgf@x}{\the\pgf@y}{\the\pgf@xa}{\the\pgf@ya}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \advance\pgf@x by\pgf@xa\relax% - \advance\pgf@y by\pgf@ya\relax% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% -} - -\def\pgf@specialrect#1#2{% - \pgf@process{#2}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#1}% - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \advance\pgf@xa by\pgf@xb% - \advance\pgf@ya by\pgf@yb% - \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}% - \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}}% - \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}% - \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}% - \pgfpathclose% - \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yb}}% -} - -% Append a rectangle to the current path -% -% #1 = one corner of the rectangle -% #2 = opposite corner of the rectangle -% -% Example: -% -% % A rectangle with corners (2,2) and (3,3) -% \pgfpathrectanglecorners{\pgfpointxy{2}{2}}{\pgfpointxy{3}{3}} - -\def\pgfpathrectanglecorners#1#2{% - \pgf@process{#2}% - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@y% - \pgf@process{#1}% - \advance\pgf@xc by-\pgf@x% - \advance\pgf@yc by-\pgf@y% - \pgfpathrectangle{#1}{\pgfqpoint{\pgf@xc}{\pgf@yc}}% -} - - -% Append a grid to the current path. -% -% #1 = lower left point of grid -% #2 = upper right point of grid -% -% Options: -% -% stepx = x-step dimension (default 1cm) -% stepy = y-step dimension (default 1cm) -% step = dimesion vector -% -% Example: -% -% \pgfsetlinewidth{0.8pt} -% \pgfgrid{\pgfxy(0,0)}{\pgfxy(3,2)} -% \pgfsetlinewidth{0.4pt} -% \pgfgrid[stepx=1cm,stepy=1cm]{\pgfxy(0,0)}{\pgfxy(3,2)} - -\define@key{pgfbase}{stepx}{\pgfmathsetlength{\pgf@x}{#1}\relax} -\define@key{pgfbase}{stepy}{\pgfmathsetlength{\pgf@y}{#1}\relax} -\define@key{pgfbase}{step}{\pgf@process{#1}} - -\def\pgfpathgrid{\pgfutil@ifnextchar[{\pgf@pathgrid}{\pgf@pathgrid[]}} -\def\pgf@pathgrid[#1]#2#3{% - \setkeys{pgfbase}{stepx=1cm,stepy=1cm}% - \setkeys{pgfbase}{#1}% - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@y% - \pgf@process{#3}% - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \pgf@process{#2}% - \pgf@xa=\pgf@x\relax% - \pgf@ya=\pgf@y\relax% - {% - % compute bounding box - % first corner - \pgf@x=\pgf@xb% - \pgf@y=\pgf@yb% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - % second corner - \pgf@x=\pgf@xb% - \pgf@y=\pgf@ya% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - % third corner - \pgf@x=\pgf@xa% - \pgf@y=\pgf@yb% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - % fourth corner - \pgf@x=\pgf@xa% - \pgf@y=\pgf@ya% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - }% - \c@pgf@counta=\pgf@y\relax% - \c@pgf@countb=\pgf@yc\relax% - \divide\c@pgf@counta by\c@pgf@countb\relax% - \pgf@y=\c@pgf@counta\pgf@yc\relax% - \ifdim\pgf@y<\pgf@ya% - \advance\pgf@y by\pgf@yc% - \fi% - \loop% horizontal lines - {% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@pos@transform{\pgf@xa}{\pgf@ya} - \pgfsyssoftpath@moveto{\the\pgf@xa}{\the\pgf@ya}% - \pgf@xa=\pgf@xb% - \pgf@ya=\pgf@y% - \pgf@pos@transform{\pgf@xa}{\pgf@ya} - \pgfsyssoftpath@lineto{\the\pgf@xa}{\the\pgf@ya}% - }% - \advance\pgf@y by\pgf@yc% - \ifdim\pgf@y<\pgf@yb% - \repeat% - \advance\pgf@y by-0.01pt\relax% - \ifdim\pgf@y<\pgf@yb% - {% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@pos@transform{\pgf@xa}{\pgf@ya} - \pgfsyssoftpath@moveto{\the\pgf@xa}{\the\pgf@ya}% - \pgf@xa=\pgf@xb% - \pgf@ya=\pgf@y% - \pgf@pos@transform{\pgf@xa}{\pgf@ya} - \pgfsyssoftpath@lineto{\the\pgf@xa}{\the\pgf@ya}% - }% - \fi% - \c@pgf@counta=\pgf@x\relax% - \c@pgf@countb=\pgf@xc\relax% - \divide\c@pgf@counta by\c@pgf@countb\relax% - \pgf@x=\c@pgf@counta\pgf@xc\relax% - \ifdim\pgf@x<\pgf@xa% - \advance\pgf@x by\pgf@xc% - \fi% - \loop% vertical lines - {% - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@ya% - \pgf@pos@transform{\pgf@xc}{\pgf@yc} - \pgfsyssoftpath@moveto{\the\pgf@xc}{\the\pgf@yc}% - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@yb% - \pgf@pos@transform{\pgf@xc}{\pgf@yc} - \pgfsyssoftpath@lineto{\the\pgf@xc}{\the\pgf@yc}% - }% - \advance\pgf@x by\pgf@xc% - \ifdim\pgf@x<\pgf@xb% - \repeat% - \advance\pgf@x by-0.01pt\relax% - \ifdim\pgf@x<\pgf@xb% - {% - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@ya% - \pgf@pos@transform{\pgf@xc}{\pgf@yc} - \pgfsyssoftpath@moveto{\the\pgf@xc}{\the\pgf@yc}% - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@yb% - \pgf@pos@transform{\pgf@xc}{\pgf@yc} - \pgfsyssoftpath@lineto{\the\pgf@xc}{\the\pgf@yc}% - }% - \fi% -} - - - -% Append two half-parabolas to the path -% -% #1 = bend (relative to current point) -% #2 = end point (relative to bend point) -% -% Description: -% -% This command appends a half-parabola that starts at the current point -% and has its bend at #1+current point. Then, a second parabola is -% appended that starts at #1+current point, where it also has its -% minimum/maximum, and ends at #1+current point+#2, which becomes the -% new current point. -% -% By setting #2 = (0,0) you draw only a half parabola that goes from the -% current point to the bend; by setting #1 = (0,0) -% you draw a half parabola that going to current point + #2 and has its -% bend at the current point. -% -% Examples: -% -% % Half-parabola going ``up and right'' -% \pgfpathmoveto{\pgfpointorigin} -% \pgfpathparabola{\pgfpointorigin}{\pgfpoint{2cm}{4cm}} -% -% % Half-parabola going ``down and right'' -% \pgfpathmoveto{\pgfpointorigin} -% \pgfpathparabola{\pgfpoint{-2cm}{4cm}}}{\pgfpointorigin} -% -% % Full parabola -% \pgfpathmoveto{\pgfpointorigin} -% \pgfpathparabola{\pgfpoint{-2cm}{4cm}}{\pgfpoint{2cm}{4cm}} - -\def\pgfpathparabola#1#2{% - {% - \pgf@process{#2}% untransformed - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \pgf@process{#1}% untransformed - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@y% - \pgfutil@tempswatrue% - \ifdim\pgf@xb=0pt\relax% - \ifdim\pgf@yb=0pt\relax% - \pgfutil@tempswafalse% - \fi% - \fi% - {% - \ifpgfutil@tempswa% - \pgf@arccornersfalse - \else% - \fi% - \pgfutil@tempswatrue% - \ifdim\pgf@xc=0pt\relax% - \ifdim\pgf@yc=0pt\relax% - \pgfutil@tempswafalse% - \fi% - \fi% - \ifpgfutil@tempswa - {% - \pgf@pt@x=\pgf@path@lastx% - \pgf@pt@y=\pgf@path@lasty% - \pgfpathcurveto% - {\pgfqpoint{.1125\pgf@xc}{.225\pgf@yc}}% found by trial and error - {\pgfqpoint{.5\pgf@xc}{\pgf@yc}}% found by trial and error - {\pgfqpoint{\pgf@xc}{\pgf@yc}}% - }% - \fi% - }% - \ifpgfutil@tempswa% - \pgf@xc=\pgf@xb% - \pgf@yc=\pgf@yb% - {% - \pgf@pt@x=\pgf@path@lastx% - \pgf@pt@y=\pgf@path@lasty% - \pgfpathcurveto% - {\pgfqpoint{.5\pgf@xc}{0\pgf@yc}}% found by trial and error - {\pgfqpoint{.8875\pgf@xc}{.775\pgf@yc}}% found by trial and error - {\pgfqpoint{\pgf@xc}{\pgf@yc}}% - }% - \fi% - }% -} - - - - -% Append a sine curve between 0 and \pi/2 to the path. -% -% #1 = vector, describing the width and height of the curve -% -% Description: -% -% This command appends a sine curve in the interval 0 and \pi/2 to the -% current path. The sine curve ends at currentpoint+#1. -% -% Examples: -% -% % One complete sine in the interval [0,\pi] -% \pgfpathmoveto{\pgfpointorigin} -% \pgfpathsine{\pgfpoint{1.57cm}{1cm}} -% \pgfpathcosine{\pgfpoint{3.141cm}{0cm}} - -\def\pgfpathsine#1{% - {% - \pgf@process{#1}% untransformed - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@y% - \pgf@pt@x=\pgf@path@lastx% evil trickery to transform to the last point - \pgf@pt@y=\pgf@path@lasty% - \pgfpathcurveto% - {\pgfqpoint{.31831\pgf@xc}{.5\pgf@yc}}% found by trial and error - {\pgfqpoint{.63503\pgf@xc}{\pgf@yc}}% found by trial and error - {\pgfqpoint{\pgf@xc}{\pgf@yc}}% - }% -} - -% Append a cosine curve between 0 and \pi/2 to the path. -% -% #1 = vector, describing the width and height of the curve -% -% Examples: -% -% % One complete sine in the interval [0,\pi] -% \pgfpathmoveto{\pgfpointorigin} -% \pgfpathsine{\pgfpoint{1.57cm}{1cm}} -% \pgfpathcosine{\pgfpoint{3.141cm}{0cm}} - -\def\pgfpathcosine#1{% - {% - \pgf@process{#1}% untransformed - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@y% - \pgf@pt@x=\pgf@path@lastx% evil trickery to transform to the last point - \pgf@pt@y=\pgf@path@lasty% - \pgfpathcurveto% - {\pgfqpoint{.36497\pgf@xc}{0pt}}% found by trial and error - {\pgfqpoint{.68169\pgf@xc}{.5\pgf@yc}}% found by trial and error - {\pgfqpoint{\pgf@xc}{\pgf@yc}}% - }% -} - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex deleted file mode 100644 index 072585ba3a8..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex +++ /dev/null @@ -1,506 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.6 2007/03/09 17:49:32 tantau Exp $ - - - -% Cleanup path -% -% #1 = a macro name that stores a path -% -% Description: -% -% This command will remove superfluous parts from a path. Movetos with -% a moveto following are removed. -% -% Example: -% -% \pgfsyssoftpath@moveto{0}{0} -% \pgfsyssoftpath@moveto{10}{10} -% \pgfsyssoftpath@lineto{0}{0} -% \pgfsyssoftpath@getcurrentpath\mypath -% \pgfprocesspathcleanup\mypath - -\def\pgfprocesspathcleanup#1{% - {% - \let\pgf@newpath=\pgfutil@empty% - \expandafter\pgf@cleanupprocessor#1\pgf@stop% - }% - \let#1=\pgf@newpath% -} - -\def\pgf@cleanupprocessor#1{% - \ifx#1\pgf@stop% - \let\next=\pgfutil@gobble% ok, done - \else% - \ifx#1\pgfsyssoftpath@movetotoken% - \let\next=\pgf@cleanupmoveto% - \else% - \let\next=\pgf@cleanupredo% - \fi% - \fi% - \next#1% -} - -\def\pgf@cleanupredo#1#2#3{% - \pgfutil@g@addto@macro\pgf@newpath{#1{#2}{#3}}% - \pgf@cleanupprocessor% -} - -\def\pgf@cleanupmoveto#1#2#3#4{% - \ifx#4\pgfsyssoftpath@movetotoken% - % Ok, skip - \else% - \pgfutil@g@addto@macro\pgf@newpath{#1{#2}{#3}}% - \fi% - \pgf@cleanupprocessor#4% -} - - - -% Extract start and end vectors of a path -% -% #1 = a macro that stores a path -% -% Description: -% -% This command will extract the first and second coordinate on the -% path as well as the last and second-last. These coordinates will be -% put in the pgfpoint-macros \pgfpointfirstonpath, -% \pgfpointsecondonpath, \pgfpointsecondlastonpath, and -% \pgfpointlastonpath. If the path is empty, these macros are set to -% \pgfpointorigin. -% -% Example: -% -% \pgfsyssoftpath@moveto{0}{0} -% \pgfsyssoftpath@lineto{10}{10} -% \pgfsyssoftpath@curveto{20}{20}{30}{30}{40}{40} -% \pgfsyssoftpath@getcurrentpath\mypath -% \pgfprocesspathextractpoints\mypath -% -% % \pgfpointfirstonpath is now \pgfpoint{0}{0} -% % \pgfpointsecondonpath is now \pgfpoint{10bp}{10bp} -% % \pgfpointsecondlastonpath is now \pgfpoint{30bp}{30bp} -% % \pgfpointlastonpath is now \pgfpoint{40bp}{40bp} - -\def\pgfprocesspathextractpoints#1{% - \ifx#1\pgfutil@empty% - \let\pgfpointfirstonpath=\pgfpointorigin% - \let\pgfpointsecondonpath=\pgfpointorigin% - \let\pgfpointsecondlastonpath=\pgfpointorigin% - \let\pgfpointlastonpath=\pgfpointorigin% - \else% - \expandafter\pgf@extractprocessorfirst#1\pgf@stop% - \fi% -} - -\def\pgf@extractprocessorfirst#1#2#3#4{% - \def\pgfpointfirstonpath{\pgfqpoint{#2}{#3}}% - \ifx#4\pgf@stop% - % pretty short path... - \let\pgfpointsecondonpath=\pgfpointfirstonpath% - \let\pgfpointsecondlastonpath=\pgfpointfirstonpath% - \let\pgfpointlastonpath=\pgfpointfirstonpath% - \let\next=\pgfutil@gobble% - \else - \let\next=\pgf@extractprocessorsecond% - \fi% - \next#4% -} - -\def\pgf@extractprocessorsecond#1{% - \ifx#1\pgfsyssoftpath@movetotoken% - % Reset things... - \let\pgf@next=\pgf@extractprocessorfirst% - \else% - \let\pgf@next=\pgf@@extractprocessorsecond% - \fi% - \pgf@next#1% -} -\def\pgf@@extractprocessorsecond#1#2#3#4{% - \def\pgfpointsecondonpath{\pgfqpoint{#2}{#3}}% - \let\pgfpointsecondlastonpath=\pgfpointfirstonpath% - \let\pgfpointlastonpath=\pgfpointsecondonpath% - \ifx#4\pgf@stop% - % short path... - \let\next=\pgfutil@gobble% - \else - \let\next=\pgf@extractprocessorother% - \fi% - \next#4% -} - -\def\pgf@extractprocessorother#1{% - \ifx#1\pgfsyssoftpath@movetotoken% - % Reset things... - \let\pgf@next=\pgf@extractprocessorfirst% - \else% - \let\pgf@next=\pgf@@extractprocessorother% - \fi% - \pgf@next#1% -} -\def\pgf@@extractprocessorother#1#2#3#4{% - \let\pgfpointsecondlastonpath=\pgfpointlastonpath% - \def\pgfpointlastonpath{\pgfqpoint{#2}{#3}}% - \ifx#4\pgf@stop% - % end! - \let\next=\pgfutil@gobble% - \fi% - \next#4% -} - - - -% Check for closepath and rectangles -% -% #1 = a macro that stores a path -% #2 = command to be executed when a closepath or a rectangle is encountered -% -% Example: -% -% \pgfsyssoftpath@moveto{0}{0} -% \pgfsyssoftpath@lineto{10}{10} -% \pgfsyssoftpath@curveto{20}{20}{30}{30}{40}{40} -% \pgfsyssoftpath@getcurrentpath\mypath -% \pgfprocesscheckclosed{\mypath}{\pgf@drawarrowsfalse} - -\def\pgfprocesscheckclosed#1#2{% - {% - \global\let\pgf@proc@todo=\relax% - \let\pgfsyssoftpath@movetotoken=\pgfutil@gobbletwo% - \let\pgfsyssoftpath@linetotoken=\pgfutil@gobbletwo% - \let\pgfsyssoftpath@curvetosupportatoken=\pgfutil@gobbletwo% - \let\pgfsyssoftpath@curvetosupportbtoken=\pgfutil@gobbletwo% - \let\pgfsyssoftpath@curvetotoken=\pgfutil@gobbletwo% - \def\pgfsyssoftpath@rectcornertoken{\gdef\pgf@proc@todo{#2}\pgfutil@gobbletwo}% - \def\pgfsyssoftpath@rectsizetoken{\gdef\pgf@proc@todo{#2}\pgfutil@gobbletwo}% - \def\pgfsyssoftpath@closepathtoken{\gdef\pgf@proc@todo{#2}\pgfutil@gobbletwo}% - #1% - }% - \pgf@proc@todo% -} - - -% Resolve specialround -% -% #1 = a macro that stores a path -% #2 = a macro that stores the new path -% -% Description: -% -% Resolves all specialround tokens. When such a token is encountered, -% the objective is to replace the next corner by a rounded corner. -% - -\def\pgfprocessround#1#2{% - % first, check whether #1 contains \pgfsyssoftpath@specialroundtoken. - % if not, do quick assignment! - \expandafter\pgf@processroundcheck\expandafter#1\expandafter#2#1\pgfsyssoftpath@specialroundtoken\pgf@stop% -} - -\def\pgf@processroundcheck#1#2#3\pgfsyssoftpath@specialroundtoken#4\pgf@stop{% - \def\pgf@test{#4}% - \ifx\pgf@test\pgfutil@empty% - % ok, nothing to be done! - \let#2=#1% - \else% - % very well... - \pgf@@processround#1#2% - \fi% -} - - -\def\pgf@@processround#1#2{% - \let\pgfprocess@newpath\pgfutil@empty% - \let\pgfprocess@moveto\pgfutil@empty% - \let\pgfprocess@firstto\pgfutil@empty% - \let\pgfprocess@segment\pgfutil@empty% - \pgf@xa=0pt% - \pgf@ya=0pt% - \expandafter\pgfprocess@round#1\pgf@stop{0pt}{0pt}% - \expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% - \expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% - \let#2=\pgfprocess@newpath% -} - -\def\pgfprocess@round#1#2#3{% - \ifx#1\pgf@stop% - \let\next=\relax% - \else% - \ifx#1\pgfsyssoftpath@specialroundtoken% - \def\pgfprocess@savex{#2}% - \def\pgfprocess@savey{#3}% - \let\next=\pgfprocess@specialround% - \ifdim#2=0pt% - \ifdim#3=0pt% - \let\next=\pgfprocess@round% skip! - \fi% - \fi% - \else% - \ifx\pgfprocess@firstto\pgfutil@empty% - \def\pgfprocess@firstto{{#2}{#3}}% - \fi% - \pgf@xa=#2% - \pgf@ya=#3% - \ifx#1\pgfsyssoftpath@movetotoken% - % ok, move old segment to newpath - \expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% - \expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% - \def\pgfprocess@moveto{#1{#2}{#3}}% - \let\pgfprocess@firstto=\pgfutil@empty% - \let\pgfprocess@segment=\pgfutil@empty% - \else% - \pgfutil@g@addto@macro\pgfprocess@segment{#1{#2}{#3}}% - \fi% - \let\next=\pgfprocess@round% - \fi% - \fi% - \next% -} - -\def\pgfprocess@specialround#1#2#3{% - \ifx\pgfprocess@firstto\pgfutil@empty% - \def\pgfprocess@firstto{{#2}{#3}}% - \fi% - \let\next=\pgfprocess@round% default: do nothing - \ifx#1\pgfsyssoftpath@linetotoken% - % Ok, round a lineto - \let\next=\pgfprocess@specialroundcope% - \else% - \ifx#1\pgfsyssoftpath@curvetosupportatoken% - % Ok, round a curveto. - \let\next=\pgfprocess@specialroundcurveto% - \else% - \ifx#1\pgfsyssoftpath@closepathtoken% - % Ok, round a closepath (this is tricky...) - \let\next=\pgfprocess@specialroundclose% - \fi% - \fi% - \fi% - \next#1{#2}{#3}% -}% - -\def\pgfprocess@specialroundcope#1#2#3#4#5#6{% - \let\next=\pgfprocess@round% do nothing by default - \let\pgfprocess@continueafterrounding=\pgfprocess@round% - \ifx#4\pgfsyssoftpath@linetotoken% - % ok, let's get kicking... - \pgf@xc=#5% - \pgf@yc=#6% - \let\next=\pgfprocess@@specialround% - \else% - \ifx#4\pgfsyssoftpath@curvetosupportatoken% - \pgf@xc=#5% - \pgf@yc=#6% - \let\next=\pgfprocess@@specialround% - \else% - \ifx#4\pgfsyssoftpath@closepathtoken% - \pgf@xc=#5% - \pgf@yc=#6% - \let\next=\pgfprocess@@specialround% - \else - \ifx#4\pgfsyssoftpath@specialroundtoken% - \let\next=\pgfprocess@@findrightcoordinates% - \fi% - \fi% - \fi% - \fi% - \next#1{#2}{#3}#4{#5}{#6}% -} - -\def\pgfprocess@@findrightcoordinates#1#2#3#4#5#6#7#8#9{% - \pgf@xc=#8% - \pgf@yc=#9% - \pgfprocess@@specialround#1{#2}{#3}#4{#5}{#6}#7{#8}{#9}% -} - -\def\pgfprocess@@specialround#1#2#3{% - \pgfutil@g@addto@macro\pgfprocess@segment{#1}% - % calculate start coordinate of the curve - \pgf@xb=#2% - \pgf@yb=#3% - % - \edef\pgf@marshal% - {\noexpand\pgfpointlineatdistance{\pgfprocess@savex}% - {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}% - {\noexpand\pgfqpoint{\the\pgf@xa}{\the\pgf@ya}}}% - \pgf@process{\pgf@marshal}% - \pgf@xa=\pgf@x% save start point of added curve - \pgf@ya=\pgf@y% - \edef\pgfprocess@addition{{\the\pgf@x}{\the\pgf@y}}% - \expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% - % - % now add curve - % - \edef\pgf@marshal% - {\noexpand\pgfpointlineatdistance{\pgfprocess@savey}% - {\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}% - {\noexpand\pgfqpoint{\the\pgf@xc}{\the\pgf@yc}}}% - \pgf@process{\pgf@marshal}% - \pgf@xc=\pgf@x% save end point of added curve - \pgf@yc=\pgf@y% - % calculate first support: - {% - \pgf@x=\pgf@xb% - \pgf@y=\pgf@yb% - \advance\pgf@x by-\pgf@xa% - \advance\pgf@y by-\pgf@ya% - \advance\pgf@xa by 0.555\pgf@x% - \advance\pgf@ya by 0.555\pgf@y% - \edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetosupportatoken{\the\pgf@xa}{\the\pgf@ya}}% - \expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% - }% - % calculate second support: - {% - \pgf@x=\pgf@xb% - \pgf@y=\pgf@yb% - \advance\pgf@x by-\pgf@xc% - \advance\pgf@y by-\pgf@yc% - \advance\pgf@xc by 0.555\pgf@x% - \advance\pgf@yc by 0.555\pgf@y% - \edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetosupportbtoken{\the\pgf@xc}{\the\pgf@yc}}% - \expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% - }% - % add end: - \edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetotoken{\the\pgf@xc}{\the\pgf@yc}}% - \expandafter\pgfutil@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% - % - % continue! - % - \pgf@xa=#2% - \pgf@ya=#3% - \pgfprocess@continueafterrounding% -} - -\def\pgfprocess@specialroundcurveto#1#2#3#4#5#6{% - \pgfutil@g@addto@macro\pgfprocess@segment{#1{#2}{#3}#4{#5}{#6}}% supports - \pgf@xa=#5% - \pgf@ya=#6% - \pgfprocess@specialroundcope} - -\def\pgfprocess@specialroundclose{% - \let\next=\pgfprocess@round% - \ifx\pgfprocess@moveto\pgfutil@empty% - \else% - \ifx\pgfprocess@firstto\pgfutil@empty% - \else% - \expandafter\pgfprocess@@specialclosetarget\pgfprocess@firstto% - \let\pgfprocess@continueafterrounding=\pgfprocess@cleanupafterclose% - \edef\next{% - \noexpand\pgfprocess@@specialround% - \expandafter\expandafter\expandafter\noexpand\expandafter\pgfprocess@@specialclosemoveto\pgfprocess@moveto% - }% - \fi% - \fi% - \next% -} - -\def\pgfprocess@@specialclosetarget#1#2{% - \pgf@xc=#1% - \pgf@yc=#2% -} - -\def\pgfprocess@@specialclosemoveto#1#2#3{% - \pgfsyssoftpath@linetotoken{#2}{#3}% -} - - -\def\pgfprocess@cleanupafterclose#1#2#3{% - \edef\pgfprocess@moveto{\noexpand\pgfsyssoftpath@movetotoken{\the\pgf@xc}{\the\pgf@yc}}% - \edef\pgf@marshal{\noexpand\pgfprocess@round\noexpand\pgfsyssoftpath@closepathtoken{\the\pgf@xc}{\the\pgf@yc}}% - \pgf@marshal% -} - - -% Replace start and end coordinates of a path -% -% #1 = new start coordinate -% #2 = new end coordinate -% -% Description: -% -% This command will replace the first and last coordinates on a path -% by the given coordinates. -% -% Example: -% -% \pgfsyssoftpath@moveto{0}{0} -% \pgfsyssoftpath@lineto{10}{10} -% \pgfsyssoftpath@curveto{20}{20}{30}{10}{40}{0} -% \pgfsyssoftpath@getcurrentpath\mypath -% \pgfsetlinewidth{2pt} -% \pgfusepath{stroke} -% \pgfprocesspathextractpoints{\mypath} -% \pgfprocesspathreplacestartandend{\mypath} -% {\pgfpointlineatdistance{2pt}{\pgfpointfirstonpath}{\pgfpointsecondonpath}}% -% {\pgfpointlineatdistance{2pt}{\pgfpointlastonpath}{\pgfpointsecondlastonpath}}% -% \pgfsyssoftpath@setcurrentpath\mypath -% \pgfsetlinewidth{1pt} -% \color{red} -% \pgfusepath{stroke} - -\def\pgfprocesspathreplacestartandend#1#2#3{% - {% - \let\pgf@newpath=\pgfutil@empty% - \let\pgf@prepath=\pgfutil@empty% - \ifx#1\pgfutil@empty% - \else% - \pgf@process{#3}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#2}% - \expandafter\pgf@replaceprocessfirst#1\pgf@stop% - \fi% - \expandafter\expandafter\expandafter\def - \expandafter\expandafter\expandafter\pgf@newpath - \expandafter\expandafter\expandafter{\expandafter\pgf@prepath\pgf@newpath}% - \global\let#1=\pgf@newpath% - }% -} - -\def\pgf@replaceprocessfirst#1#2#3#4{% - \def\pgf@temppath{#1{#2}{#3}}% - \edef\pgf@newpath{\noexpand#1{\the\pgf@x}{\the\pgf@y}}% - \ifx#4\pgf@stop% - \let\next=\pgfutil@gobble% - \else% - \let\next=\pgf@replaceprocessother% - \fi% - \next#4% -} - -\def\pgf@replaceprocessother#1{% - \ifx#1\pgfsyssoftpath@movetotoken% - % Arggghh! Must reset everything! - \expandafter\expandafter\expandafter\def - \expandafter\expandafter\expandafter\pgf@prepath - \expandafter\expandafter\expandafter{\expandafter\pgf@prepath\pgf@temppath}% - % Redo first. - \let\pgf@next=\pgf@replaceprocessfirst% - \else% - \let\pgf@next=\pgf@@replaceprocessother% - \fi% - \pgf@next#1% -} -\def\pgf@@replaceprocessother#1#2#3#4{% - \ifx#4\pgf@stop% - \edef\pgf@newpathaddition{{\noexpand#1{\the\pgf@xa}{\the\pgf@ya}}}% - \expandafter\pgfutil@g@addto@macro\expandafter\pgf@newpath\pgf@newpathaddition% - \let\next=\pgfutil@gobble% - \else% - \pgfutil@g@addto@macro\pgf@temppath{#1{#2}{#3}}% - \pgfutil@g@addto@macro\pgf@newpath{#1{#2}{#3}}% - \let\next=\pgf@replaceprocessother% - \fi% - \next#4% -} - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex deleted file mode 100644 index e7d918f5210..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex +++ /dev/null @@ -1,224 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.8 2007/03/09 17:49:32 tantau Exp $ - - -% Stroke/fill/clip/etc. the current path. Depending on the options, -% the current path will be stroked/filled/clipped/etc. If no options -% are given, the path is stroked. If multiple options are given, all -% of them are performed (in a sensible order). -% -% #1 = action(s) to be applied to the current path. Valid actions are: -% stroke - strokes the path. If no options are given, this is the -% default. -% draw - same as stroke. -% fill - fills the path. -% clip - clip the path. -% discard - Discards the path. Same effect as having an empty -% options list. -% -% Example: -% -% % Draws an edge. -% \pgfpathmoveto{\pgfxy(0,0)} -% \pgfpathlineto{\pgfxy(0,1)} -% \pgfpathlineto{\pgfxy(1,0)} -% \pgfusepath{stroke} - -\define@key{pgfup}{stroke}[]{\def\pgf@up@stroke{stroke}} -\define@key{pgfup}{draw}[]{\def\pgf@up@stroke{stroke}} -\define@key{pgfup}{fill}[]{\def\pgf@up@fill{fill}} -\define@key{pgfup}{clip}[]{\def\pgf@up@clip{clip}} -\define@key{pgfup}{discard}[]{} -\define@key{pgfup}{use as bounding box}[]{\def\pgf@up@bb{\pgf@relevantforpicturesizefalse}} - -\def\pgfusepath#1{% - \let\pgf@up@stroke\pgfutil@empty% - \let\pgf@up@fill\pgfutil@empty% - \let\pgf@up@clip\pgfutil@empty% - \let\pgf@up@discard\pgfutil@empty% - \let\pgf@up@bb\pgfutil@empty% - \setkeys{pgfup}{#1}% - \expandafter\def\expandafter\pgf@up@action\expandafter{\csname pgfsys@\pgf@up@fill\pgf@up@stroke\endcsname}% - \ifx\pgf@up@stroke\pgfutil@empty% - \ifx\pgf@up@fill\pgfutil@empty% - \ifx\pgf@up@clip\pgfutil@empty% - \let\pgf@up@action=\pgfutil@empty% - \pgfsyssoftpath@setcurrentpath\pgfutil@empty% - \else% - % only clipping - \let\pgf@up@action=\pgfsys@discardpath% - \fi% - \fi% - \fi% - \pgfprocessround{\pgfsyssoftpath@currentpath}{\pgfsyssoftpath@currentpath}% change the current path - % - % Check whether the path is stroked. If so, add half the line width - % to the bounding box. - % - \ifpgf@relevantforpicturesize% - \ifx\pgf@up@stroke\pgfutil@empty% - \else% - \ifdim\pgf@picmaxx=-16000pt\relax% - \else% - \pgf@x=\pgf@pathminx\advance\pgf@x by-.5\pgflinewidth% - \ifdim\pgf@x<\pgf@picminx\global\pgf@picminx\pgf@x\fi% - \pgf@y=\pgf@pathminy\advance\pgf@y by-.5\pgflinewidth% - \ifdim\pgf@y<\pgf@picminy\global\pgf@picminy\pgf@y\fi% - \pgf@x=\pgf@pathmaxx\advance\pgf@x by.5\pgflinewidth% - \ifdim\pgf@x>\pgf@picmaxx\global\pgf@picmaxx\pgf@x\fi% - \pgf@y=\pgf@pathmaxy\advance\pgf@y by.5\pgflinewidth% - \ifdim\pgf@y>\pgf@picmaxy\global\pgf@picmaxy\pgf@y\fi% - \fi% - \fi% - \fi% - % - \ifx\pgf@up@clip\pgfutil@empty% - \ifx\pgf@up@stroke\pgfutil@empty% - \pgfsyssoftpath@invokecurrentpath% - \pgfsyssoftpath@getcurrentpath\pgf@last@used@path% - \pgf@up@action% - \else% - \pgf@check@for@arrows% - \ifpgf@drawarrows% - \pgf@shorten@path@as@needed% - \pgfsyssoftpath@invokecurrentpath% - \pgfsyssoftpath@getcurrentpath\pgf@last@used@path% - \pgf@up@action% - \pgfsyssoftpath@setcurrentpath\pgfutil@empty% - \pgf@add@arrows@as@needed% - \else% - \pgfsyssoftpath@invokecurrentpath% - \pgfsyssoftpath@getcurrentpath\pgf@last@used@path% - \pgf@up@action% - \fi% - \fi% - \else% - \pgfsyssoftpath@invokecurrentpath% - \pgfsyssoftpath@getcurrentpath\pgf@last@used@path% - \pgfsys@clipnext% - \pgf@up@action% - \pgf@relevantforpicturesizefalse% - \fi% - \pgf@up@bb% - \pgfsyssoftpath@setcurrentpath\pgfutil@empty% - \pgf@resetpathsizes% - \ignorespaces% -} - - -% Shorten start/end of paths by a certain amount. -% -% #1 = amount by which paths should be shortened. -% -% Example: -% -% \pgfpathmoveto{\pgfpointorigin} -% \pgfpathlineto{\pgfpoint{10pt}{0pt} -% -% % The following has the same effect: -% \pgfsetshortenstart{1pt} -% \pgfpathmoveto{\pgfpointorigin} -% \pgfpathlineto{\pgfpoint{11pt}{0pt} - -\def\pgfsetshortenstart#1{\pgfmathsetlength\pgf@shorten@start@additional{#1}} -\def\pgfsetshortenend#1{\pgfmathsetlength\pgf@shorten@end@additional{#1}} - -\newif\ifpgf@drawarrows - -\def\pgf@check@for@arrows{% - \pgf@drawarrowsfalse% - \ifx\pgf@startarrow\pgfutil@empty\else\pgf@drawarrowstrue\fi% - \ifx\pgf@endarrow\pgfutil@empty\else\pgf@drawarrowstrue\fi% - \ifdim\pgf@shorten@end@additional=0pt\relax\else\pgf@drawarrowstrue\fi% - \ifdim\pgf@shorten@start@additional=0pt\relax\else\pgf@drawarrowstrue\fi% - \ifpgf@drawarrows% - \pgfsyssoftpath@getcurrentpath\pgf@arrowpath% - \ifx\pgf@arrowpath\pgfutil@empty% - \pgf@drawarrowsfalse% - \else% - \pgfprocesscheckclosed{\pgf@arrowpath}{\pgf@drawarrowsfalse}% - \fi% - \fi% -} - -\newdimen\pgf@shorten@end@additional -\newdimen\pgf@shorten@start@additional - -\let\pgf@shorten@end=\pgfutil@empty -\let\pgf@shorten@start=\pgfutil@empty - -\def\pgf@shorten@path@as@needed{% - \pgfprocesspathextractpoints{\pgf@arrowpath}% - \let\pgf@arrow@next=\pgf@shorten@now% - \ifx\pgf@shorten@start\pgfutil@empty% - \ifx\pgf@shorten@end\pgfutil@empty% - \ifdim\pgf@shorten@end@additional=0pt\relax% - \ifdim\pgf@shorten@start@additional=0pt\relax% - \let\pgf@arrow@next=\relax% - \fi% - \fi% - \fi% - \fi% - \pgf@arrow@next% -} - -\def\pgf@shorten@now{% - {% - \pgf@x=0pt% - \pgf@shorten@start% - \advance\pgf@x by\pgf@shorten@start@additional% - \pgf@xc=\pgf@x% - \pgfpointlineatdistance{\pgf@xc}{\pgfpointfirstonpath}{\pgfpointsecondonpath}% - \global\pgf@xb=\pgf@x% - \global\pgf@yb=\pgf@y% - \pgf@process{\pgfpointsecondonpath}% - \global\advance\pgf@x by\pgf@xa% - \global\advance\pgf@y by\pgf@ya% - }% - \edef\pgfpointfirstonpath{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}% - \edef\pgfpointsecondonpath{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}% - {% - \pgf@x=0pt% - \pgf@shorten@end% - \advance\pgf@x by\pgf@shorten@end@additional% - \pgf@xc=\pgf@x% - \pgfpointlineatdistance{\pgf@xc}{\pgfpointlastonpath}{\pgfpointsecondlastonpath}% - \global\pgf@xb=\pgf@x% - \global\pgf@yb=\pgf@y% - \pgf@process{\pgfpointsecondlastonpath}% - \global\advance\pgf@x by\pgf@xa% - \global\advance\pgf@y by\pgf@ya% - }% - \edef\pgfpointlastonpath{\noexpand\pgfqpoint{\the\pgf@xb}{\the\pgf@yb}}% - \edef\pgfpointsecondlastonpath{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}% - \pgfprocesspathreplacestartandend{\pgf@arrowpath}{\pgfpointfirstonpath}{\pgfpointlastonpath}% - \pgfsyssoftpath@setcurrentpath\pgf@arrowpath% -} - -\def\pgf@add@arrows@as@needed{% - \ifx\pgf@startarrow\pgfutil@empty% - \else% - \pgflowlevelobj% - {\pgftransformarrow{\pgfpointsecondonpath}{\pgfpointfirstonpath}} - {\pgf@startarrow}% - \fi% - \ifx\pgf@endarrow\pgfutil@empty% - \else% - \pgflowlevelobj% - {\pgftransformarrow{\pgfpointsecondlastonpath}{\pgfpointlastonpath}} - {\pgf@endarrow}% - \fi% -} - -\let\pgf@startarrow=\pgfutil@empty -\let\pgf@endarrow=\pgfutil@empty - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasepatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex index 199d38e3b7b..a3f6eb12502 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasepatterns.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex @@ -7,7 +7,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbasepatterns.code.tex,v 1.10 2007/02/05 11:23:22 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepatterns.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $ % Creates a new uncolored pattern diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex deleted file mode 100644 index 0edcd6d7b2c..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex +++ /dev/null @@ -1,999 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.9 2007/04/19 11:57:08 tantau Exp $ - -\newdimen\pgf@picminx -\newdimen\pgf@picmaxx -\newdimen\pgf@picminy -\newdimen\pgf@picmaxy - -\newdimen\pgf@pathminx -\newdimen\pgf@pathmaxx -\newdimen\pgf@pathminy -\newdimen\pgf@pathmaxy - -\newif\ifpgf@relevantforpicturesize - -\def\pgf@process#1{{#1\global\pgf@x=\pgf@x\global\pgf@y=\pgf@y}} - - - - -% Return a point -% -% #1 = x-coordinate of the point -% #2 = y-coordinate of the point -% -% x = #1 -% y = #2 -% -% Example: -% -% \pgfpathmoveto{\pgfpoint{2pt+3cm}{3cm}} - -\def\pgfpoint#1#2{% - \pgfmathsetlength\pgf@x{#1}% - \pgfmathsetlength\pgf@y{#2}\ignorespaces} - - -% Quickly a point -% -% #1 = x-coordinate of the point (no calculations done) -% #2 = y-coordinate of the point (no calculations done) -% -% x = #1 -% y = #2 -% -% Example: -% -% \pgfpathmoveto{\pgfqpoint{2pt}{3cm}} - -\def\pgfqpoint#1#2{\pgf@x=#1\pgf@y=#2} - - - -% Return the origin. -% -% x = 0 -% y = 0 -% -% Example: -% -% \pgfpathmoveto{\pgfpointorigin} - -\def\pgfpointorigin{\pgf@x=0pt\pgf@y=\pgf@x\ignorespaces} - - - -% Return a transformed point -% -% #1 = a point -% -% Description: -% -% This command applies pgf's current transformation matrix to the -% given point. Normally, this is done automatically by commands like -% lineto or moveto, but sometimes you may wish to access a transformed -% point yourself. For example, this command is useful for a low level -% coordinate system shift: -% -% Example: -% -% \begin{pgflowleveltransformshiftscope}{\pgfpointtransformed{\pgfpointorigin}} -% \pgfbox[center,center]{Hi!} -% \end{pgflowleveltransformshiftscope} - -\def\pgfpointtransformed#1{% - \pgf@process{% - #1% - \pgf@pos@transform{\pgf@x}{\pgf@y}% - }% -} - - -% Return the difference vector of two points. -% -% #1 = start of vector -% #2 = end of vector -% -% x = x-component of difference -% y = y-component of difference -% -% Example: -% -% \pgfpathmoveto{\pgfpointdiff{\pgfpointxy{1}{1}}{\pgfpointxy{2}{3}}} - -\def\pgfpointdiff#1#2{% - \pgf@process{#1}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#2}% - \advance\pgf@x by-\pgf@xa\relax% - \advance\pgf@y by-\pgf@ya\relax\ignorespaces} - -% Add two vectors. -% -% #1 = first vector -% #2 = second vector -% -% x = x-component of addition -% y = y-component of addition -% -% Example: -% -% \pgfpathmoveto{\pgfpointadd{\pgfpointxy{0}{1}}{\pgfpointxy{2}{3}}} - -\def\pgfpointadd#1#2{% - \pgf@process{#1}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#2}% - \advance\pgf@x by\pgf@xa% - \advance\pgf@y by\pgf@ya} - - - -% Multiply a vector by a factor. -% -% #1 = factor -% #2 = vector -% -% Example: -% -% \pgfpointscale{2}{\pgfpointxy{0}{1}} - -\def\pgfpointscale#1#2{% - \pgf@process{#2}% - \pgf@x=#1\pgf@x% - \pgf@y=#1\pgf@y% -} - - -% The intersection of two lines -% -% #1 = point on first line -% #2 = another point on first line -% #3 = point on second line -% #4 = another point on second line -% -% Returns the intersection of the two lines. If there is no -% intersection or if the points #1 and #2 or the points #3 and #4 are -% identical, the behaviour is not specified. -% -% Example: -% -% \pgfpointintersectionoflines{\pgfpointxy{0}{1}}{\pgfpointxy{1}{0}}{\pgfpointxy{2}{2}}{\pgfpointxy{3}{4}} - -\def\pgfpointintersectionoflines#1#2#3#4{% - { - % - % Compute orthogonal vector to #1--#2 - % - \pgf@process{#2}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#1}% - \advance\pgf@xa by-\pgf@x% - \advance\pgf@ya by-\pgf@y% - \pgf@ya=-\pgf@ya% - % Normalise a bit - \c@pgf@counta=\pgf@xa% - \ifnum\c@pgf@counta<0\relax% - \c@pgf@counta=-\c@pgf@counta\relax% - \fi% - \c@pgf@countb=\pgf@ya% - \ifnum\c@pgf@countb<0\relax% - \c@pgf@countb=-\c@pgf@countb\relax% - \fi% - \advance\c@pgf@counta by\c@pgf@countb\relax% - \divide\c@pgf@counta by 65536\relax% - \ifnum\c@pgf@counta>0\relax% - \divide\pgf@xa by\c@pgf@counta\relax% - \divide\pgf@ya by\c@pgf@counta\relax% - \fi% - % - % Compute projection - % - \pgf@xc=\pgf@sys@tonumber{\pgf@ya}\pgf@x% - \advance\pgf@xc by\pgf@sys@tonumber{\pgf@xa}\pgf@y% - % - % The orthogonal vector is (\pgf@ya,\pgf@xa) - % - % - % Compute orthogonal vector to #3--#4 - % - \pgf@process{#4}% - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \pgf@process{#3}% - \advance\pgf@xb by-\pgf@x% - \advance\pgf@yb by-\pgf@y% - \pgf@yb=-\pgf@yb% - % Normalise a bit - \c@pgf@counta=\pgf@xb% - \ifnum\c@pgf@counta<0\relax% - \c@pgf@counta=-\c@pgf@counta\relax% - \fi% - \c@pgf@countb=\pgf@yb% - \ifnum\c@pgf@countb<0\relax% - \c@pgf@countb=-\c@pgf@countb\relax% - \fi% - \advance\c@pgf@counta by\c@pgf@countb\relax% - \divide\c@pgf@counta by 65536\relax% - \ifnum\c@pgf@counta>0\relax% - \divide\pgf@xb by\c@pgf@counta\relax% - \divide\pgf@yb by\c@pgf@counta\relax% - \fi% - % - % Compute projection - % - \pgf@yc=\pgf@sys@tonumber{\pgf@yb}\pgf@x% - \advance\pgf@yc by\pgf@sys@tonumber{\pgf@xb}\pgf@y% - % - % The orthogonal vector is (\pgf@yb,\pgf@xb) - % - % Setup transformation matrx (this is just to use the matrix - % inversion) - % - \pgfsettransform{{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@yb}{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{0pt}{0pt}}% - \pgftransforminvert% - \pgf@process{\pgfpointtransformed{\pgfpoint{\pgf@xc}{\pgf@yc}}}% - }% -} - - -% Returns point on a line from #2 to #3 at time #1. -% -% #1 = a time, where 0 is the start and 1 is the end -% #2 = start point -% #3 = end point -% -% x = x-component of #1*start + (1-#1)*end -% y = y-component of #1*start + (1-#1)*end -% -% Example: -% -% % Middle of (1,1) and (2,3) -% \pgfpathmoveto{\pgfpointlineattime{0.5}{\pgfpointxy{0}{1}}{\pgfpointxy{2}{3}}} - -\def\pgfpointlineattime#1#2#3{% - \pgf@process{#3}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#2}% - \advance\pgf@xa by-\pgf@x\relax% - \advance\pgf@ya by-\pgf@y\relax% - \advance\pgf@x by #1\pgf@xa\relax% - \advance\pgf@y by #1\pgf@ya\relax% - \ignorespaces} - - -% Move point #2 #1 many units in the direction of #3. -% -% #1 = a distance -% #2 = start point -% #3 = end point -% -% x = x-component of start + #1*(normalise(end-start)) -% y = y-component of start + #1*(normalise(end-start)) -% xa = #1*(normalise(end-start)) -% ya = #1*(normalise(end-start)) -% -% Example: -% -% -% \pgfpathmoveto{\pgfpointlineatdistance{2pt}{\pgfpointxy{0}{1}}{\pgfpointxy{2}{3}}} -% \pgfpathlineto{\pgfpointlineatdistance{3pt}{\pgfpointxy{2}{3}}{\pgfpointxy{0}{1}}} - -\def\pgfpointlineatdistance#1#2#3{% - \pgf@process{#2}% - \pgf@xb=\pgf@x\relax% xb/yb = start point - \pgf@yb=\pgf@y\relax% - \pgf@process{#3}% - \advance\pgf@x by-\pgf@xb\relax% - \advance\pgf@y by-\pgf@yb\relax% - \pgf@process{\pgfpointnormalised{}}% x/y = normalised vector - \pgfmathsetlength\pgf@xa{#1}% - \pgf@ya=\pgf@xa\relax% - \pgf@xa=\pgf@sys@tonumber{\pgf@x}\pgf@xa% - \pgf@ya=\pgf@sys@tonumber{\pgf@y}\pgf@ya% - \pgf@x=\pgf@xb\relax% - \pgf@y=\pgf@yb\relax% - \advance\pgf@x by\pgf@xa\relax% - \advance\pgf@y by\pgf@ya\relax% - \ignorespaces} - - -% Returns point on a curve from #2 to #5 with controls #3 and #4 at time #1. -% -% #1 = a time -% #2 = start point -% #3 = first control point -% #4 = second control point -% #5 = end point -% -% x = x-component of place on the curve at time t -% y = y-component of place on the curve at time t -% -% Additionally, (\pgf@xa,\pgf@ya) and (\pgf@xb,\pgf@yb) will be on a -% tangent to the point on the curve (this can be useful for computing -% a label rotation). -% -% Example: -% -% % Middle of (1,1) and (2,3) -% \pgfpathmoveto{\pgfpointcurveattime{0.5}{\pgfpointxy{0}{1}}{\pgfpointxy{1}{1}}{\pgfpointxy{1}{1}}{\pgfpointxy{2}{3}}} - -\def\pgfpointcurveattime#1#2#3#4#5{% - \pgfmathparse{#1}% - \let\pgf@time@s=\pgfmathresult% - \pgf@x=\pgfmathresult pt% - \pgf@x=-\pgf@x% - \advance\pgf@x by 1pt% - \edef\pgf@time@t{\pgf@sys@tonumber{\pgf@x}}% - \pgf@process{#5}% - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@y% - \pgf@process{#4}% - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \pgf@process{#3}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#2}% - % First iteration: - \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa% - \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya% - \pgf@xa=\pgf@time@t\pgf@xa\advance\pgf@xa by\pgf@time@s\pgf@xb% - \pgf@ya=\pgf@time@t\pgf@ya\advance\pgf@ya by\pgf@time@s\pgf@yb% - \pgf@xb=\pgf@time@t\pgf@xb\advance\pgf@xb by\pgf@time@s\pgf@xc% - \pgf@yb=\pgf@time@t\pgf@yb\advance\pgf@yb by\pgf@time@s\pgf@yc% - % Second iteration: - \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa% - \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya% - \pgf@xa=\pgf@time@t\pgf@xa\advance\pgf@xa by\pgf@time@s\pgf@xb% - \pgf@ya=\pgf@time@t\pgf@ya\advance\pgf@ya by\pgf@time@s\pgf@yb% - % Save x/y - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - % Third iteration: - \pgf@x=\pgf@time@t\pgf@x\advance\pgf@x by\pgf@time@s\pgf@xa% - \pgf@y=\pgf@time@t\pgf@y\advance\pgf@y by\pgf@time@s\pgf@ya% -} - - - - - - -% Internal registers -\newdimen\pgf@xx -\newdimen\pgf@xy -\newdimen\pgf@yx -\newdimen\pgf@yy -\newdimen\pgf@zx -\newdimen\pgf@zy - - - -% A polar coordinate -% -% #1 = a degree -% #2 = a radius -- either a dimension or two dimensions separated by -% " and ". -% -% x = (first dimension in #2) * cos(#1) -% y = (second dimension in #2) * sin(#2) -% -% Example: -% -% \pgfpathmoveto{\pgfpointpolar{30}{1cm}} -% \pgfpathlineto{\pgfpointpolar{30}{1cm and 2cm}} - -\def\pgfpointpolar#1#2{% - \pgfutil@in@{and }{#2}% - \ifpgfutil@in@% - \pgf@polar@#2\@@% - \else% - \pgf@polar@#2 and #2\@@% - \fi% - \pgfmathparse{#1}% - \let\pgfpoint@angle=\pgfmathresult% - \pgfmathcos@{\pgfpoint@angle}% - \pgf@x=\pgfmathresult\pgf@x% - \pgfmathsin@{\pgfpoint@angle}% - \pgf@y=\pgfmathresult\pgf@y% -} - -\def\pgf@polar@#1and #2\@@{% - \pgfmathsetlength{\pgf@y}{#2}% - \pgfmathsetlength{\pgf@x}{#1}% -} - -% Quick version of the polar coordinate method - -\def\pgfqpointpolar#1#2{% - \pgf@x=#2% - \pgf@y=\pgf@x% - \pgfmathcos@{#1}% - \pgf@x=\pgfmathresult\pgf@x% - \pgfmathsin@{#1}% - \pgf@y=\pgfmathresult\pgf@y\relax% -} - - - - -% A polar coordinate in the xy plane. -% -% #1 = a degree -% #2 = a radius given as a number or two radi -% -% result = (first dim in #2) * x-vector * cos(#1) + -% (second dim in #2) * y-vector * sin(#1) -% -% Example: -% -% \pgfpathmoveto{\pgfpointpolarxy{30}{2}} - -\def\pgfpointpolarxy#1#2{% - \pgfutil@in@{and }{#2}% - \ifpgfutil@in@% - \pgf@polarxy@#2\@@% - \else% - \pgf@polarxy@#2and #2\@@% - \fi% - \pgfmathparse{#1}% - \let\pgfpoint@angle=\pgfmathresult% - \pgfmathcos@{\pgfpoint@angle}% - \pgf@xa=\pgfmathresult\pgf@xa% - \pgfmathsin@{\pgfpoint@angle}% - \pgf@ya=\pgfmathresult\pgf@ya% - \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@xx% - \advance\pgf@x by \pgf@sys@tonumber{\pgf@ya}\pgf@yx% - \pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@xy% - \advance\pgf@y by \pgf@sys@tonumber{\pgf@ya}\pgf@yy} - -\def\pgf@polarxy@#1and #2\@@{% - \pgfmathsetlength{\pgf@xa}{#1}% - \pgfmathsetlength{\pgf@ya}{#2}% -} - - - -% A cylindrical coordinate. -% -% #1 = a degree -% #2 = a radius given as a number -% #3 = a height given as a number -% -% result = #2*(x-vector * cos(#1) + y-vector * sin(#1)) + #3*z-vector -% -% Example: -% -% \pgfpathmoveto{\pgfpointcylindrical{30}{2}{1}} - -\def\pgfpointcylindrical#1#2#3{% - \pgfpointpolarxy{#1}{#2}% - \pgfmathparse{#3}% - \advance\pgf@x by \pgfmathresult\pgf@zx% - \advance\pgf@y by \pgfmathresult\pgf@zy} - - -% A spherical coordinate. -% -% #1 = a longitude -% #2 = a latitude -% #3 = a radius -% -% result = #3*(cos(#2)*(x-vector * cos(#1) + y-vector * sin(#1)) + sin(#2)*z-vector) -% -% Example: -% -% \pgfpathmoveto{\pgfpointspherical{30}{30}{2}} - -\def\pgfpointspherical#1#2#3{% - \pgfmathparse{#1}% - \let\pgfpoint@angle=\pgfmathresult% - \pgfmathsin@{\pgfpoint@angle}% - \pgf@xb=\pgfmathresult\pgf@xx% - \pgf@yb=\pgfmathresult\pgf@xy% - \pgfmathcos@{\pgfpoint@angle}% - \advance\pgf@xb by \pgfmathresult\pgf@yx% - \advance\pgf@yb by \pgfmathresult\pgf@yy% - % - \pgfmathparse{#2}% - \let\pgfpoint@angle=\pgfmathresult% - \pgfmathcos@{\pgfpoint@angle}% - \pgf@xc=\pgfmathresult\pgf@xb% - \pgf@yc=\pgfmathresult\pgf@yb% - \pgfmathsin@{\pgfpoint@angle}% - \advance\pgf@xc by \pgfmathresult\pgf@zx% - \advance\pgf@yc by \pgfmathresult\pgf@zy% - \pgfmathparse{#3}% - \pgf@x=\pgfmathresult\pgf@xc% - \pgf@y=\pgfmathresult\pgf@yc\relax% -} - - -% Store the vector #1 * x-vec + #2 * y-vec -% -% #1 = a factor for the x-vector -% #2 = a factor fot the y-vector -% -% x = x-component of result vector -% y = y-component of result vector -% -% Description: -% -% This command can be used to create a new coordinate system -% without using the rotate/translate/scale commands. This -% may be useful, if you do not want arrows and line width to -% be scaled/transformed together with the coordinate system. -% -% Example: -% -% % Create a slanted rectangle -% -% \pgfsetxvec{\pgfpoint{1cm}{1cm}} -% \pgfsetyvec{\pgfpoint{0cm}{1cm}} -% -% \pgfpathmoveto{\pgfpointxy{0}{0}} -% \pgfpathlineto{\pgfpointxy{1}{0}} -% \pgfpathlineto{\pgfpointxy{1}{1}} -% \pgfpathlineto{\pgfpointxy{0}{1}} -% \pgfclosestroke - -\def\pgfpointxy#1#2{% - \pgfmathparse{#1}% - \let\pgftemp@x=\pgfmathresult% - \pgfmathparse{#2}% - \let\pgftemp@y=\pgfmathresult% - \pgf@x=\pgftemp@x\pgf@xx% - \advance\pgf@x by \pgftemp@y\pgf@yx% - \pgf@y=\pgftemp@x\pgf@xy% - \advance\pgf@y by \pgftemp@y\pgf@yy} - - -% Store the vector #1 * x-vec + #2 * y-vec + #3 * z-vec -% -% #1 = a factor for the x-vector -% #2 = a factor fot the y-vector -% #3 = a factor fot the z-vector -% -% x = x-component of result vector -% y = y-component of result vector -% -% -% Description: -% -% This command allows you to use a 3d coordinate system. -% -% -% Example: -% -% % Draw a cubus -% -% \pgfline{\pgfpointxyz{0}{0}{0}}{\pgfpointxyz{0}{0}{1}} -% \pgfline{\pgfpointxyz{0}{1}{0}}{\pgfpointxyz{0}{1}{1}} -% \pgfline{\pgfpointxyz{1}{0}{0}}{\pgfpointxyz{1}{0}{1}} -% \pgfline{\pgfpointxyz{1}{1}{0}}{\pgfpointxyz{1}{1}{1}} -% \pgfline{\pgfpointxyz{0}{0}{0}}{\pgfpointxyz{0}{1}{0}} -% \pgfline{\pgfpointxyz{0}{0}{1}}{\pgfpointxyz{0}{1}{1}} -% \pgfline{\pgfpointxyz{1}{0}{0}}{\pgfpointxyz{1}{1}{0}} -% \pgfline{\pgfpointxyz{1}{0}{1}}{\pgfpointxyz{1}{1}{1}} -% \pgfline{\pgfpointxyz{0}{0}{0}}{\pgfpointxyz{1}{0}{0}} -% \pgfline{\pgfpointxyz{0}{0}{1}}{\pgfpointxyz{1}{0}{1}} -% \pgfline{\pgfpointxyz{0}{1}{0}}{\pgfpointxyz{1}{1}{0}} -% \pgfline{\pgfpointxyz{0}{1}{1}}{\pgfpointxyz{1}{1}{1}} - -\def\pgfpointxyz#1#2#3{% - \pgfmathparse{#1}% - \let\pgftemp@x=\pgfmathresult% - \pgfmathparse{#2}% - \let\pgftemp@y=\pgfmathresult% - \pgfmathparse{#3}% - \let\pgftemp@z=\pgfmathresult% - \pgf@x=\pgftemp@x\pgf@xx% - \advance\pgf@x by \pgftemp@y\pgf@yx% - \advance\pgf@x by \pgftemp@z\pgf@zx% - \pgf@y=\pgftemp@x\pgf@xy% - \advance\pgf@y by \pgftemp@y\pgf@yy% - \advance\pgf@y by \pgftemp@z\pgf@zy} - - - - -% Set the x-vector -% -% #1 = a point the is the new x-vector -% -% Example: -% -% \pgfsetxvec{\pgfpoint{1cm}{0cm}} - -\def\pgfsetxvec#1{% - \pgf@process{#1}% - \pgf@xx=\pgf@x% - \pgf@xy=\pgf@y% - \ignorespaces} - - -% Set the y-vector -% -% #1 = a point the is the new y-vector -% -% Example: -% -% \pgfsetyvec{\pgfpoint{0cm}{1cm}} - -\def\pgfsetyvec#1{% - \pgf@process{#1}% - \pgf@yx=\pgf@x% - \pgf@yy=\pgf@y% - \ignorespaces} - - -% Set the z-vector -% -% #1 = a point the is the new z-vector -% -% Example: -% -% \pgfsetzvec{\pgfpoint{-0.385cm}{-0.385cm}} - -\def\pgfsetzvec#1{% - \pgf@process{#1}% - \pgf@zx=\pgf@x% - \pgf@zy=\pgf@y% - \ignorespaces} - - - -% Default values -\pgfsetxvec{\pgfpoint{1cm}{0cm}} -\pgfsetyvec{\pgfpoint{0cm}{1cm}} -\pgfsetzvec{\pgfpoint{-0.385cm}{-0.385cm}} - - - - -% Normalise a point. -% -% #1 = point with coordinates (a,b) -% -% x = a/\sqrt(a*a+b*b) -% y = b/\sqrt(a*a+b*b) -% -% Example: -% -% \pgfpointnormalised{\pgfpointxy{2}{1}} - -\def\pgfpointnormalised#1{% - \pgf@process{#1}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \ifdim\pgf@x<0pt\relax% move into first quadrant - \pgf@x=-\pgf@x% - \fi% - \ifdim\pgf@y<0pt\relax% - \pgf@y=-\pgf@y% - \fi% - \ifdim\pgf@x>\pgf@y% x > y - % make point small - \c@pgf@counta=\pgf@x% - \divide\c@pgf@counta by 65536\relax% - \ifnum\c@pgf@counta=0\relax% - \c@pgf@counta=1\relax% - \fi% - \divide\pgf@x by\c@pgf@counta% - \divide\pgf@y by\c@pgf@counta% - \divide\pgf@xa by\c@pgf@counta% - \divide\pgf@ya by\c@pgf@counta% - % ok. - \pgf@x=.125\pgf@x% - \pgf@y=.125\pgf@y% - \c@pgf@counta=\pgf@x% - \c@pgf@countb=\pgf@y% - \multiply\c@pgf@countb by 100% - \ifnum\c@pgf@counta<64\relax% - \pgf@x=1pt\relax% - \pgf@y=0pt\relax% - \else% - \divide\c@pgf@countb by \c@pgf@counta% - \pgf@x=\csname pgf@cosfrac\the\c@pgf@countb\endcsname pt% - \pgf@xc=8192pt% - \divide\pgf@xc by\c@pgf@counta% - \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@ya% - \pgf@y=\pgf@sys@tonumber{\pgf@x}\pgf@y% - \fi% - \ifdim\pgf@xa<0pt% - \pgf@x=-\pgf@x% - \fi% - \else% x <= y - % make point small - \c@pgf@counta=\pgf@y% - \divide\c@pgf@counta by 65536\relax% - \ifnum\c@pgf@counta=0\relax% - \c@pgf@counta=1\relax% - \fi% - \divide\pgf@x by\c@pgf@counta% - \divide\pgf@y by\c@pgf@counta% - \divide\pgf@xa by\c@pgf@counta% - \divide\pgf@ya by\c@pgf@counta% - % ok. - \pgf@x=.125\pgf@x% - \pgf@y=.125\pgf@y% - \c@pgf@counta=\pgf@y% - \c@pgf@countb=\pgf@x% - \multiply\c@pgf@countb by 100% - \ifnum\c@pgf@counta<64\relax% - \pgf@y=1pt\relax% - \pgf@x=0pt\relax% - \else% - \divide\c@pgf@countb by \c@pgf@counta% - \pgf@y=\csname pgf@cosfrac\the\c@pgf@countb\endcsname pt% - \pgf@xc=8192pt% - \divide\pgf@xc by\c@pgf@counta% - \pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@xa% - \pgf@x=\pgf@sys@tonumber{\pgf@y}\pgf@x% - \fi% - \ifdim\pgf@ya<0pt% - \pgf@y=-\pgf@y% - \fi% - \fi\ignorespaces% -} - - - - - -% A point on a rectangle in a certain direction. -% -% #1 = a point pointing in some direction (length should be about 1pt, -% but need not be exact) -% #2 = upper right corner of a rectangle centered at the origin -% -% Returns the intersection of a line starting at the origin going in -% the given direction and the rectangle's border. -% -% Example: -% -% \pgfpointborderrectangle{\pgfpointnormalised{\pgfpointxy{2}{1}} -% {\pgfpoint{1cm}{2cm}} - -\def\pgfpointborderrectangle#1#2{% - \pgf@process{#2}% - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \pgf@process{#1}% - % Ok, let's find out about the direction: - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \ifnum\pgf@xa<0\relax% move into first quadrant - \pgf@x=-\pgf@x% - \fi% - \ifnum\pgf@ya<0\relax% - \pgf@y=-\pgf@y% - \fi% - \pgf@xc=.125\pgf@x% - \pgf@yc=.125\pgf@y% - \c@pgf@counta=\pgf@xc% - \c@pgf@countb=\pgf@yc% - \ifnum\c@pgf@countb<\c@pgf@counta% - \ifnum\c@pgf@counta<255\relax% - \pgf@y=\pgf@yb\relax% - \pgf@x=0pt\relax% - \else% - \pgf@xc=8192pt% - \divide\pgf@xc by\c@pgf@counta% \pgf@xc = 1/\pgf@x - \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y% - \pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y% - \ifnum\pgf@y<\pgf@yb% - \pgf@x=\pgf@xb% - \else% rats, calculate intersection on upper side - \ifnum\c@pgf@countb<255\relax% - \pgf@x=\pgf@xb\relax% - \pgf@y=0pt\relax% - \else% - \pgf@yc=8192pt% - \divide\pgf@yc by\c@pgf@countb% \pgf@xc = 1/\pgf@x - \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x% - \pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x% - \pgf@y=\pgf@yb% - \fi% - \fi% - \fi% - \else% - \ifnum\c@pgf@countb<255\relax% - \pgf@x=\pgf@xb\relax% - \pgf@y=0pt\relax% - \else% - \pgf@yc=8192pt% - \divide\pgf@yc by\c@pgf@countb% \pgf@xc = 1/\pgf@x - \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x% - \pgf@x=\pgf@sys@tonumber{\pgf@yb}\pgf@x% - \ifnum\pgf@x<\pgf@xb% - \pgf@y=\pgf@yb% - \else% - \ifnum\c@pgf@counta<255\relax% - \pgf@y=\pgf@yb\relax% - \pgf@x=0pt\relax% - \else% - \pgf@xc=8192pt% - \divide\pgf@xc by\c@pgf@counta% \pgf@xc = 1/\pgf@x - \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y% - \pgf@y=\pgf@sys@tonumber{\pgf@xb}\pgf@y% - \pgf@x=\pgf@xb% - \fi% - \fi% - \fi% - \fi% - \ifnum\pgf@xa<0\relax\pgf@x=-\pgf@x\fi% - \ifnum\pgf@ya<0\relax\pgf@y=-\pgf@y\fi% -} - - - - -% An approximation to a point on an ellipse in a certain -% direction. Will be exact only if the ellipse is a circle. -% -% #1 = a point pointing in some direction -% #2 = upper right corner of a bounding box for the ellipse -% -% Returns the intersection of a line starting at the origin going in -% the given direction and the ellipses border. -% -% Example: -% -% \pgfpointborderellipse{\pgfpointnormalised{\pgfpointxy{2}{1}} -% {\pgfpoint{1cm}{2cm}} - -\def\pgfpointborderellipse#1#2{% - \pgf@process{#2}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \ifdim\pgf@xa=\pgf@ya% circle. that's easy! - \pgf@process{\pgfpointnormalised{#1}}% - \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x% - \pgf@y=\pgf@sys@tonumber{\pgf@xa}\pgf@y% - \else% - \ifdim\pgf@xa<\pgf@ya% - % Ok, first, let's compute x/y: - \c@pgf@countb=\pgf@ya% - \divide\c@pgf@countb by65536\relax% - \divide\pgf@x by\c@pgf@countb% - \divide\pgf@y by\c@pgf@countb% - \pgf@xc=\pgf@x% - \pgf@yc=8192pt% - \pgf@y=.125\pgf@y% - \c@pgf@countb=\pgf@y% - \divide\pgf@yc by\c@pgf@countb% - \pgf@process{#1}% - \pgf@y=\pgf@sys@tonumber{\pgf@yc}\pgf@y% - \pgf@y=\pgf@sys@tonumber{\pgf@xc}\pgf@y% - \pgf@process{\pgfpointnormalised{}}% - \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x% - \pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y% - \else% - % Ok, now let's compute y/x: - \c@pgf@countb=\pgf@xa% - \divide\c@pgf@countb by65536\relax% - \divide\pgf@x by\c@pgf@countb% - \divide\pgf@y by\c@pgf@countb% - \pgf@yc=\pgf@y% - \pgf@xc=8192pt% - \pgf@x=.125\pgf@x% - \c@pgf@countb=\pgf@x% - \divide\pgf@xc by\c@pgf@countb% - \pgf@process{#1}% - \pgf@x=\pgf@sys@tonumber{\pgf@yc}\pgf@x% - \pgf@x=\pgf@sys@tonumber{\pgf@xc}\pgf@x% - \pgf@process{\pgfpointnormalised{}}% - \pgf@x=\pgf@sys@tonumber{\pgf@xa}\pgf@x% - \pgf@y=\pgf@sys@tonumber{\pgf@ya}\pgf@y% - \fi% - \fi% -} - - - - - -% Extract the x-coordinate of a point to a dimensions -% -% #1 = a TeX dimension -% #2 = a point -% -% Example: -% -% \newdimen\mydim -% \pgfextractx{\mydim}{\pgfpoint{2cm}{4pt}} -% % \mydim is now 2cm - -\def\pgfextractx#1#2{% - \pgf@process{#2}% - #1=\pgf@x\relax} - - -% Extract the y-coordinate of a point to a dimensions -% -% #1 = a TeX dimension -% #2 = a point -% -% Example: -% -% \newdimen\mydim -% \pgfextracty{\mydim}{\pgfpoint{2cm}{4pt}} -% % \mydim is now 4pt - -\def\pgfextracty#1#2{% - \pgf@process{#2}% - #1=\pgf@y\relax} - - - -\def\pgf@def#1#2#3{\expandafter\def\csname pgf@#1#2\endcsname{#3}} -\pgf@def{cosfrac}{0}{1} -\pgf@def{cosfrac}{1}{0.99995} \pgf@def{cosfrac}{2}{0.9998} -\pgf@def{cosfrac}{3}{0.99955} \pgf@def{cosfrac}{4}{0.999201} -\pgf@def{cosfrac}{5}{0.998752} \pgf@def{cosfrac}{6}{0.998205} -\pgf@def{cosfrac}{7}{0.997559} \pgf@def{cosfrac}{8}{0.996815} -\pgf@def{cosfrac}{9}{0.995974} \pgf@def{cosfrac}{10}{0.995037} -\pgf@def{cosfrac}{11}{0.994004} \pgf@def{cosfrac}{12}{0.992877} -\pgf@def{cosfrac}{13}{0.991656} \pgf@def{cosfrac}{14}{0.990342} -\pgf@def{cosfrac}{15}{0.988936} \pgf@def{cosfrac}{16}{0.987441} -\pgf@def{cosfrac}{17}{0.985856} \pgf@def{cosfrac}{18}{0.984183} -\pgf@def{cosfrac}{19}{0.982424} \pgf@def{cosfrac}{20}{0.980581} -\pgf@def{cosfrac}{21}{0.978653} \pgf@def{cosfrac}{22}{0.976644} -\pgf@def{cosfrac}{23}{0.974555} \pgf@def{cosfrac}{24}{0.972387} -\pgf@def{cosfrac}{25}{0.970143} \pgf@def{cosfrac}{26}{0.967823} -\pgf@def{cosfrac}{27}{0.965429} \pgf@def{cosfrac}{28}{0.962964} -\pgf@def{cosfrac}{29}{0.960429} \pgf@def{cosfrac}{30}{0.957826} -\pgf@def{cosfrac}{31}{0.955157} \pgf@def{cosfrac}{32}{0.952424} -\pgf@def{cosfrac}{33}{0.949629} \pgf@def{cosfrac}{34}{0.946773} -\pgf@def{cosfrac}{35}{0.943858} \pgf@def{cosfrac}{36}{0.940887} -\pgf@def{cosfrac}{37}{0.937862} \pgf@def{cosfrac}{38}{0.934784} -\pgf@def{cosfrac}{39}{0.931655} \pgf@def{cosfrac}{40}{0.928477} -\pgf@def{cosfrac}{41}{0.925252} \pgf@def{cosfrac}{42}{0.921982} -\pgf@def{cosfrac}{43}{0.918669} \pgf@def{cosfrac}{44}{0.915315} -\pgf@def{cosfrac}{45}{0.911922} \pgf@def{cosfrac}{46}{0.90849} -\pgf@def{cosfrac}{47}{0.905024} \pgf@def{cosfrac}{48}{0.901523} -\pgf@def{cosfrac}{49}{0.89799} \pgf@def{cosfrac}{50}{0.894427} -\pgf@def{cosfrac}{51}{0.890835} \pgf@def{cosfrac}{52}{0.887217} -\pgf@def{cosfrac}{53}{0.883573} \pgf@def{cosfrac}{54}{0.879905} -\pgf@def{cosfrac}{55}{0.876216} \pgf@def{cosfrac}{56}{0.872506} -\pgf@def{cosfrac}{57}{0.868777} \pgf@def{cosfrac}{58}{0.865031} -\pgf@def{cosfrac}{59}{0.861269} \pgf@def{cosfrac}{60}{0.857493} -\pgf@def{cosfrac}{61}{0.853704} \pgf@def{cosfrac}{62}{0.849903} -\pgf@def{cosfrac}{63}{0.846092} \pgf@def{cosfrac}{64}{0.842271} -\pgf@def{cosfrac}{65}{0.838444} \pgf@def{cosfrac}{66}{0.834609} -\pgf@def{cosfrac}{67}{0.83077} \pgf@def{cosfrac}{68}{0.826927} -\pgf@def{cosfrac}{69}{0.82308} \pgf@def{cosfrac}{70}{0.819232} -\pgf@def{cosfrac}{71}{0.815383} \pgf@def{cosfrac}{72}{0.811534} -\pgf@def{cosfrac}{73}{0.807687} \pgf@def{cosfrac}{74}{0.803842} -\pgf@def{cosfrac}{75}{0.8} \pgf@def{cosfrac}{76}{0.796162} -\pgf@def{cosfrac}{77}{0.792329} \pgf@def{cosfrac}{78}{0.788502} -\pgf@def{cosfrac}{79}{0.784682} \pgf@def{cosfrac}{80}{0.780869} -\pgf@def{cosfrac}{81}{0.777064} \pgf@def{cosfrac}{82}{0.773268} -\pgf@def{cosfrac}{83}{0.769481} \pgf@def{cosfrac}{84}{0.765705} -\pgf@def{cosfrac}{85}{0.761939} \pgf@def{cosfrac}{86}{0.758185} -\pgf@def{cosfrac}{87}{0.754443} \pgf@def{cosfrac}{88}{0.750714} -\pgf@def{cosfrac}{89}{0.746997} \pgf@def{cosfrac}{90}{0.743294} -\pgf@def{cosfrac}{91}{0.739605} \pgf@def{cosfrac}{92}{0.735931} -\pgf@def{cosfrac}{93}{0.732272} \pgf@def{cosfrac}{94}{0.728628} -\pgf@def{cosfrac}{95}{0.724999} \pgf@def{cosfrac}{96}{0.721387} -\pgf@def{cosfrac}{97}{0.717792} \pgf@def{cosfrac}{98}{0.714213} -\pgf@def{cosfrac}{99}{0.710651} \pgf@def{cosfrac}{100}{0.707107} - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex deleted file mode 100644 index 84a432ceadb..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex +++ /dev/null @@ -1,134 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorequick.code.tex,v 1.2 2006/10/11 15:22:25 tantau Exp $ - -% Quick version of basic drawing commands. Most high-level commands -% are not available if these commands are used. - -% Move current point to (#1,#2). -% -% #1 = x dimension of new current point -% #2 = y dimension of new current point -% -% Example: -% -% \pgfpathqmoveto{0pt}{0pt} -% \pgfpathqlineto{1pt}{1pt} -% \pgfpathqcurveto{2pt}{1pt}{2pt}{2pt}{3pt}{2pt} -% \pgfqstroke - -\def\pgfpathqmoveto#1#2{\pgfsyssoftpath@moveto{#1}{#2}} - - -% Append a line to (#1,#2) to the current path. -% -% #1 = x dimension of target -% #2 = y dimension of target -% -% Example: -% -% \pgfpathqmoveto{0pt}{0pt} -% \pgfpathqlineto{1pt}{1pt} -% \pgfpathqcurveto{2pt}{1pt}{2pt}{2pt}{3pt}{2pt} -% \pgfqstroke - -\def\pgfpathqlineto#1#2{\pgfsyssoftpath@lineto{#1}{#2}} - - -% Append a bezier spline to the current path. -% -% #1 = x dimension of first support point -% #2 = y dimension of first support point -% #3 = x dimension of second support point -% #4 = y dimension of second support point -% #5 = x dimension of target point -% #6 = y dimension of target point -% -% Example: -% -% \pgfpathqmoveto{0pt}{0pt} -% \pgfpathqlineto{1pt}{1pt} -% \pgfpathqcurveto{2pt}{1pt}{2pt}{2pt}{3pt}{2pt} -% \pgfqstroke - -\def\pgfpathqcurveto#1#2#3#4#5#6{\pgfsyssoftpath@curveto{#1}{#2}{#3}{#4}{#5}{#6}} - - - - -% Append a circle of the given radius around the origin. -% -% #1 = radius -% -% Example: -% -% \pgfpathqcircle{10pt} -% is quicker than -% \pgfpathcircle{\pgforigin}{10pt} - -\def\pgfpathqcircle#1{% - {% - \pgf@x=#1% - \pgf@y=0.555\pgf@x% - \pgfsyssoftpath@moveto{\the\pgf@x}{0pt}% - \pgfsyssoftpath@curveto{\the\pgf@x}{\the\pgf@y}{\the\pgf@y}{\the\pgf@x}{0pt}{\the\pgf@x}% - \pgfsyssoftpath@curveto{-\the\pgf@y}{\the\pgf@x}{-\the\pgf@x}{\the\pgf@y}{-\the\pgf@x}{0pt}% - \pgfsyssoftpath@curveto{-\the\pgf@x}{-\the\pgf@y}{-\the\pgf@y}{-\the\pgf@x}{0pt}{-\the\pgf@x}% - \pgfsyssoftpath@curveto{\the\pgf@y}{-\the\pgf@x}{\the\pgf@x}{-\the\pgf@y}{\the\pgf@x}{0pt}% - \pgfsyssoftpath@closepath% - }% -} - - - -% Stroke current path. No hooks called. -% -% Example: -% -% \pgfpathqmoveto{0cm}{0cm} -% \pgfpathqlineto{1cm}{1cm} -% \pgfpathqcurveto{2cm}{1cm}{2cm}{2cm}{3cm}{2cm} -% \pgfqstroke - -\def\pgfusepathqstroke{% - \pgfsyssoftpath@flushcurrentpath% - \pgfsys@stroke% - \pgf@resetpathsizes% -} - - -% Quickly fill current path. - -\def\pgfusepathqfill{% - \pgfsyssoftpath@flushcurrentpath% - \pgfsys@fill% - \pgf@resetpathsizes% -} - - -% Quickly fill and stroke current path. - -\def\pgfusepathqfillstroke{% - \pgfsyssoftpath@flushcurrentpath% - \pgfsys@fillstroke% - \pgf@resetpathsizes% -} - -% Quickly clip current path. - -\def\pgfusepathqclip{% - \pgfsyssoftpath@flushcurrentpath% - \pgfsys@clipnext% - \pgfsys@discardpath% - \pgf@resetpathsizes% -} - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex deleted file mode 100644 index 286ac78c216..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex +++ /dev/null @@ -1,535 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.24 2007/06/07 07:41:10 tantau Exp $ - -% Globals - -\newbox\pgfpic -\newbox\pgf@hbox - -\newbox\pgf@layerbox@main - -\newcount\pgf@picture@serial@count - - - -% This if decides whether the position of pictures on the page is -% protocolled or not. Normally, -% this is switched off as it works only with certain drivers and it -% causes external files to be written. When switched on, the position -% of pgfpictures are protocolled and can be referenced using -% \pgfsys@getposition{XXX} where XXX is the value of \pgfpictureid -% inside the picture. -\newif\ifpgfrememberpicturepositiononpage - - - -% Library files inclusion - - -% Include a library file. -% -% #1 = List of names of library file. -% -% Description: -% -% This command includes a list of library files. For each file X in the -% list, the file pgflibraryX.code.tex is included, provided this has -% not been done earlier. -% -% For the convenience of Context users, both round and square brackets -% are possible for the argument. -% -% Example: -% -% \usepgflibrary{arrows} -% \usepgflibrary[patterns,snakes] - -\def\usepgflibrary{\pgfutil@ifnextchar[{\use@pgflibrary}{\use@@pgflibrary}}%} -\def\use@pgflibrary[#1]{\use@@pgflibrary{#1}} -\def\use@@pgflibrary#1{% - \edef\pgf@list{#1}% - \pgfutil@for\pgf@temp:=\pgf@list\do{% - \expandafter\ifx\csname pgf@library@\pgf@temp @loaded\endcsname\relax% - \expandafter\let\csname pgf@library@\pgf@temp @loaded\endcsname=\pgfutil@empty% - \expandafter\edef\csname pgf@library@#1@atcode\endcsname{\the\catcode`\@} - \expandafter\edef\csname pgf@library@#1@barcode\endcsname{\the\catcode`\|} - \catcode`\@=11 - \catcode`\|=12 - \input pgflibrary\pgf@temp.code.tex - \catcode`\@=\csname pgf@library@#1@atcode\endcsname - \catcode`\|=\csname pgf@library@#1@barcode\endcsname - \fi% - }% -} - - - -% Scopes - - -% Pgf scope environment. All changes of the graphic state are local to -% the scope. -% -% Example: -% -% \begin{pgfscope} -% \pgfsetlinewidth{3pt} -% \pgfline{\pgfxy(0,0)}{\pgfxy(3,3)} -% \end{pgfscope} - -\def\pgfscope{% - \pgfsyssoftpath@setcurrentpath\pgfutil@empty% - \pgfsys@beginscope% - \pgf@resetpathsizes% - \edef\pgfscope@linewidth{\the\pgflinewidth}% - \begingroup} -\def\endpgfscope{% - \endgroup% - \global\pgflinewidth=\pgfscope@linewidth% - \pgfsys@endscope} - - - - -% Quickly insert a box can contain normal TeX text at the origin. -% -% #1 = box of width/height and depth 0pt -% -% Example: -% -% \pgfqbox{\mybox} - -\def\pgfqbox#1{% - \pgfsys@hbox#1% -} - - -% Insert a box that can contain normal TeX text at the origin, but -% with the current coordinate transformation matrix synced with the -% low-level transformation matrix. -% -% #1 = box of width/height and depth 0pt -% -% In essence, this command does the same as if you first said -% \pgflowlevelsynccm and then \pgfqbox. However, pgf will use a -% ``TeX-translation'' for the translation part of the transformation -% cm. This will ensure that hyperlinks ``survive'' at least -% translations. -% -% Example: -% -% \pgfqboxsynced{\mybox} - -\def\pgfqboxsynced#1{% - \pgfsys@hboxsynced#1% -} - - -% Puts some text in a box and inserts it with the current -% transformations applied. -% -% #1 = List of optional positioning. Possible values are ``left'', ``right'', -% ``top'', ``bottom'' and ``base''. -% #2 = TeX text. May contain verbatims. -% -% Example: -% -% \pgftransformshift{\pgfpoint{1cm}{0cm}} -% \pgftext{Hello World!} - -\def\pgftext{\pgfutil@ifnextchar[\pgf@text{\pgf@text[]}}% -\def\pgf@text[#1]{% - \def\pgf@text@options{#1}% - \pgf@maketext\pgf@after@text} -\def\pgf@after@text{% - {% - \def\pgf@text@hshift{center}% - \def\pgf@text@vshift{center}% - \def\pgf@marshal{\setkeys{pgfbox}}% - \expandafter\pgf@marshal\expandafter{\pgf@text@options}% - \csname pgf@halign\pgf@text@hshift\endcsname% - \csname pgf@valign\pgf@text@vshift\endcsname% - % Protocol sizes: - \pgf@process{\pgfpointtransformed{\pgfqpoint{0pt}{\dp\pgf@hbox}}}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@process{\pgfpointtransformed{\pgfqpoint{\wd\pgf@hbox}{\dp\pgf@hbox}}}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@process{\pgfpointtransformed{\pgfqpoint{0pt}{\ht\pgf@hbox}}}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgf@process{\pgfpointtransformed{\pgfqpoint{\wd\pgf@hbox}{\ht\pgf@hbox}}}% - \pgf@protocolsizes{\pgf@x}{\pgf@y}% - \pgfqboxsynced{\pgf@hbox}% - }% -} - -\define@key{pgfbox}{left}[]{\def\pgf@text@hshift{left}} -\define@key{pgfbox}{center}[]{} -\define@key{pgfbox}{right}[]{\def\pgf@text@hshift{right}} -\define@key{pgfbox}{top}[]{\def\pgf@text@vshift{top}} -\define@key{pgfbox}{bottom}[]{\def\pgf@text@vshift{bottom}} -\define@key{pgfbox}{base}[]{\def\pgf@text@vshift{base}} -\define@key{pgfbox}{at}{\pgftransformshift{#1}} -\define@key{pgfbox}{x}{\pgftransformxshift{#1}} -\define@key{pgfbox}{y}{\pgftransformyshift{#1}} -\define@key{pgfbox}{rotate}{\pgftransformrotate{#1}} - -\def\pgf@halignleft{}% do nothing -\def\pgf@haligncenter{\pgftransformxshift{+-.5\wd\pgf@hbox}} -\def\pgf@halignright{\pgftransformxshift{+-\wd\pgf@hbox}}% -\def\pgf@valignbase{}% do nothing -\def\pgf@valignbottom{\pgftransformyshift{+\dp\pgf@hbox}}% -\def\pgf@valigncenter{\pgftransformyshift{+.5\dp\pgf@hbox}\pgftransformyshift{+-.5\ht\pgf@hbox}}% -\def\pgf@valigntop{\pgftransformyshift{+-\ht\pgf@hbox}}% - - -% Internal function for creating a hbox. -\def\pgf@maketext#1{% - \def\pgf@@maketextafter{#1}% - \setbox\pgf@hbox=\hbox\bgroup% - \pgfinterruptpicture% - \bgroup% - \aftergroup\pgf@collectresetcolor% - \let\next=% -} -\def\pgf@collectresetcolor{% - \pgfutil@ifnextchar\reset@color% - {\reset@color\afterassignment\pgf@collectresetcolor\let\pgf@temp=}% - {\pgf@textdone}% -} -\def\pgf@textdone{% - \endpgfinterruptpicture% - \egroup% - \pgf@@maketextafter% -} - -\long\def\pgf@makehbox#1{% - \setbox\pgf@hbox=\hbox{{% - \pgfinterruptpicture% - #1% - \endpgfinterruptpicture% - }}} - - - -% Picture environment -% -% Example: -% -% \begin{pgfpicture} -% \pgfsetendarrow{\pgfarrowto} -% \pgfpathmoveto{\pgfpointxy{-0.9}{0.2}} -% \pgfpathlineto{\pgfpointxy{0.9}{0.4}} -% \pgfusepath{stroke} -% \end{pgfpicture} - -\newif\ifpgfpicture - -\def\pgfpicture{% - \begingroup% - \pgfpicturetrue% - \global\advance\pgf@picture@serial@count by1\relax% - \edef\pgfpictureid{pgfid\the\pgf@picture@serial@count}% - \let\pgf@nodecallback=\pgfutil@gobble% - \pgf@picmaxx=-16000pt\relax% - \pgf@picminx=16000pt\relax% - \pgf@picmaxy=-16000pt\relax% - \pgf@picminy=16000pt\relax% - \pgf@relevantforpicturesizetrue% - \pgf@resetpathsizes% - \pgfutil@ifnextchar\bgroup\pgf@oldpicture\pgf@picture} -\def\pgf@oldpicture#1#2#3#4{% - \pgfmathsetlength\pgf@picminx{#1}% - \pgfmathsetlength\pgf@picminy{#2}% - \pgfmathsetlength\pgf@picmaxx{#3}% - \pgfmathsetlength\pgf@picmaxy{#4}% - \pgf@relevantforpicturesizefalse% - \pgf@picture} - -\def\pgf@picture{% - \setbox\pgfpic\hbox to0pt\bgroup% - \begingroup% - \pgfsys@beginpicture% - \pgfsys@beginscope% - \begingroup% - \pgfsetcolor{.}% - \pgfsetlinewidth{0.4pt}% - \pgftransformreset% - \pgfsyssoftpath@setcurrentpath\pgfutil@empty% - \begingroup% - \let\pgf@setlengthorig=\setlength% - \let\pgf@addtolengthorig=\addtolength% - \let\pgf@selectfontorig=\selectfont% - \let\setlength=\pgf@setlength% - \let\addtolength=\pgf@addtolength% - \let\selectfont=\pgf@selectfont% - \nullfont\spaceskip\z@\xspaceskip\z@% - \setbox\pgf@layerbox@main\hbox to0pt\bgroup% - \begingroup% - } -\def\endpgfpicture{% - \ifpgfrememberpicturepositiononpage% - \hbox to0pt{\pgfsys@markposition{\pgfpictureid}}% - \fi% - % ok, now let's position the box - \ifdim\pgf@picmaxx=-16000pt\relax% - % empty picture. make size 0. - \global\pgf@picmaxx=0pt\relax% - \global\pgf@picminx=0pt\relax% - \global\pgf@picmaxy=0pt\relax% - \global\pgf@picminy=0pt\relax% - \fi% - % Shift baseline outside: - \pgf@relevantforpicturesizefalse% - \pgf@process{\pgf@baseline}% - \gdef\pgf@shift@baseline{\the\pgf@y}% - \endgroup% - \hss% - \egroup% - \pgf@insertlayers% - \endgroup% - \pgfsys@discardpath% - \endgroup% - \pgfsys@endscope% - \pgfsys@endpicture% - \endgroup% - \hss - \egroup% - \pgfsys@typesetpicturebox\pgfpic% - \endgroup% -} - -\def\pgf@insertlayers{% - \box\pgf@layerbox@main% -} - -\def\pgf@selectfont{\pgf@selectfontorig\nullfont} - -\def\pgf@setlength#1#2{% these will be used only when \nullfont is active - \begingroup% keep font setting local - \pgfutil@selectfont% restore font - \pgf@setlengthorig#1{#2}% calculate dimension (possibly using calc) - \expandafter% - \endgroup% - \expandafter#1\expandafter=\the#1\relax} -\def\pgf@addtolength#1#2{% - \begingroup% keep font setting local - \pgfutil@selectfont% restore font - \pgf@addtolengthorig#1{#2}% calculate dimension (possibly using calc) - \expandafter% - \endgroup% - \expandafter#1\expandafter=\the#1\relax} - - -% Sets the baseline at the y-coordinate of a given point -% -% #1 = point -% -% Sets the baseline of the picture to the y-coordinate of a given -% point. However, the point will be evaluated *at the end of the -% picture*. -% -% Example: -% -% \pgfsetbaselinepointlater{\pgfpointanchor{mynode}{base}} - -\def\pgfsetbaselinepointlater#1{\def\pgf@baseline{#1}} - - -% Sets the baseline at the y-coordinate of a given point, now -% -% #1 = point -% -% Sets the baseline of the picture to the y-coordinate of a given -% point. -% -% Example: -% -% \pgfsetbaselinepointnow{\pgfpoint{1cm}{2pt}} - -\def\pgfsetbaselinepointnow#1{% - \pgf@process{#1}% - \edef\pgf@setter@baseline{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% - \pgfsetbaselinepointlater{\pgf@setter@baseline}% -} - - -% Sets the baseline -% -% #1 = baseline -% -% Sets the baseline of the picture. Default is the lower border, which -% is the same as \pgf@picminy -% -% Example: -% -% \pgfsetbaseline{1cm+2pt} - -\def\pgfsetbaseline#1{\pgfsetbaselinepointlater{\pgfpoint{0pt}{#1}}} -\pgfsetbaseline{\pgf@picminy} - - - - -% Interrupt path -% -% Description: -% -% The environment can be used to insert some drawing commands while -% constructing a path. The drawing commands inside the environment -% will not interfere with the path being constructed ``outside.'' -% However, you must ward against graphic state changes using a scope. -% -% Example: Draw two parallel lines -% -% \pgfmoveto{\pgfpoint{0cm}{0cm}} -% \begin{pgfinterruptpath} -% \pgfmoveto{\pgfpoint{1cm}{0cm}} -% \pgfmoveto{\pgfpoint{1cm}{1cm}} -% \pgfusepath{stroke} -% \end{pgfinterruptpath} -% \pgflineto{\pgfpoint{0cm}{1cm}} -% \pgfusepath{stroke} - -\def\pgfinterruptpath -{% - \begingroup% - % save all sorts of things... - \edef\pgf@interrupt@savex{\the\pgf@path@lastx}% - \edef\pgf@interrupt@savey{\the\pgf@path@lasty}% - \pgf@getpathsizes\pgf@interrupt@pathsizes% - \pgfsyssoftpath@getcurrentpath\pgf@interrupt@path% - \pgfsyssoftpath@setcurrentpath\pgfutil@empty% - \edef\pgfscope@linewidth{\the\pgflinewidth}% - \let\pgf@interrupt@lastmoveto=\pgfsyssoftpath@lastmoveto% - \begingroup% -} -\def\endpgfinterruptpath -{% - \endgroup% - \global\pgflinewidth=\pgfscope@linewidth% - \pgfsyssoftpath@setcurrentpath\pgf@interrupt@path% - \pgf@setpathsizes\pgf@interrupt@pathsizes% - \global\pgf@path@lastx=\pgf@interrupt@savex% - \global\pgf@path@lasty=\pgf@interrupt@savey% - \global\let\pgfsyssoftpath@lastmoveto=\pgf@interrupt@lastmoveto% - \endgroup% -} - - - -% Interrupt bounding box -% -% Description: -% -% The environment can be used to temporarily setup a new bounding box -% computation. The bounding box will be made empty at the beginning of -% the environment and will be reset to its old value after the -% environment. -% -% Example: -% -% \begin{pgfinterruptboundinbox} -% \pgfmoveto{\pgfpoint{1cm}{0cm}} -% \pgfmoveto{\pgfpoint{1cm}{1cm}} -% \pgfusepath{stroke} -% \end{pgfinterruptboundinbox} - -\def\pgfinterruptboundingbox -{% - \begingroup% - \edef\pgf@interrupt@savemaxx{\the\pgf@picmaxx}% - \edef\pgf@interrupt@saveminx{\the\pgf@picminx}% - \edef\pgf@interrupt@savemaxy{\the\pgf@picmaxy}% - \edef\pgf@interrupt@saveminy{\the\pgf@picminy}% - \pgf@picmaxx=-16000pt\relax% - \pgf@picminx=16000pt\relax% - \pgf@picmaxy=-16000pt\relax% - \pgf@picminy=16000pt\relax% -} -\def\endpgfinterruptboundingbox -{% - \global\pgf@picmaxx=\pgf@interrupt@savemaxx% - \global\pgf@picmaxy=\pgf@interrupt@savemaxy% - \global\pgf@picminx=\pgf@interrupt@saveminx% - \global\pgf@picminy=\pgf@interrupt@saveminy% - \endgroup% -} - - - - - -% Interrupts a picture -% -% Description: -% -% This environment interrupts a picture and temporarily returns to -% normal TeX mode. All sorts of things are saved and restored by this -% environment. -% -% WARNING: Using this environment in conjuction with low level -% transformations can *strongly* upset the typesetting. Typically, the -% contents of this environment should have size/height/depth 0pt in -% the end. -% -% WARNING: This environment should only be used inside typesetting a -% box and this box must in turn be inserted using \pgfqbox. -% -% Example: Draw two parallel lines -% -% \pgfmoveto{\pgfpoint{0cm}{0cm}} -% \setbox\mybox=\hbox{ -% \begin{pgfinterruptpicture} -% This is normal text. -% \begin{pgfpicture} % a subpicture -% \pgfmoveto{\pgfpoint{1cm}{0cm}} -% \pgfmoveto{\pgfpoint{1cm}{1cm}} -% \pgfusepath{stroke} -% \end{pgfpicture} -% More text. -% \end{pgfinterruptpicture} -% } -% \ht\mybox=0pt -% \wd\mybox=0pt -% \dp\mybox=0pt -% \pgfqbox{\mybox}% -% \pgfpathlineto{\pgfpoint{0cm}{1cm}} -% \pgfusepath{stroke} - -\def\pgfinterruptpicture -{% - \begingroup% - \pgfinterruptboundingbox% - \pgftransformreset% - \pgfinterruptpath% - \ifx\pgf@selectfontorig\@undefined% - \else% - \let\setlength\pgf@setlengthorig% - \let\addtolength\pgf@addtolengthorig% - \let\selectfont\pgf@selectfontorig% - \fi% - \pgfutil@selectfont% - \pgfpicturefalse% - \pgf@savelayers% -} -\def\endpgfinterruptpicture -{% - \pgf@restorelayers% - \endpgfinterruptpath% - \endpgfinterruptboundingbox% - \endgroup% -} - -\let\pgf@savelayers=\relax -\let\pgf@restorelayers=\relax - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex deleted file mode 100644 index 05142e8c0db..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex +++ /dev/null @@ -1,440 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreshade.code.tex,v 1.8 2007/03/09 17:49:32 tantau Exp $ - -% -% Parsing functions -% -\newdimen\pgf@max -\newcount\pgf@sys@shading@range@num -\def\pgf@parsefunc#1{% - \edef\temp{{#1}}% - \expandafter\pgf@convertrgbstring\temp% - \edef\temp{{\pgf@rgbconv}}% - \expandafter\pgf@@parsefunc\temp} -\def\pgf@@parsefunc#1{% - \let\pgf@bounds=\pgfutil@empty% - \let\pgf@funcs=\pgfutil@empty% - \let\pgf@psfuncs=\pgfutil@empty% - \let\pgf@encode=\pgfutil@empty% - \let\pgf@sys@shading@ranges=\pgfutil@empty% - \pgf@sys@shading@range@num=0\relax% - \pgf@parsefirst[#1; ]% - \pgf@parselastdom[#1; ]% - \pgf@parsemid[#1; ]% - \ifx\pgf@bounds\pgfutil@empty% - \edef\pgf@pdfparseddomain{0 1}% - \edef\pgf@pdfparsedfunction{\pgf@singlefunc\space}% - \else% - \edef\pgf@pdfparseddomain{\pgf@doma\space\pgf@domb}% - \edef\pgf@pdfparsedfunction{% - << /FunctionType 3 /Domain [\pgf@doma\space\pgf@domb] /Functions - [\pgf@funcs\space] /Bounds [\pgf@bounds] /Encode [0 1 \pgf@encode] - >> }% - \fi% - \xdef\pgf@psfuncs{\pgf@psfuncs}% - } -\def\pgf@parsefirst[rgb(#1)=(#2,#3,#4)#5]{% - \pgfmathsetlength\pgf@x{#1}% - \edef\pgf@sys@shading@start@pos{\the\pgf@x}% - \pgf@sys@bp@correct\pgf@x% - \edef\pgf@doma{\pgf@sys@tonumber{\pgf@x}}% - \edef\pgf@prevx{\pgf@sys@tonumber{\pgf@x}}% - \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% - \edef\pgf@sys@shading@start@rgb{\pgf@sys@rgb}% - \let\pgf@sys@prevcolor=\pgf@sys@shading@start@rgb% - \let\pgf@sys@prevpos=\pgf@sys@shading@start@pos% - \edef\pgf@prevcolor{\pgf@rgb}% - \edef\pgf@firstcolor{\pgf@rgb}} -\def\pgf@parselastdom[rgb(#1)=(#2,#3,#4); {% - \pgfutil@ifnextchar]{% - \pgfmathsetlength\pgf@x{#1}% - \edef\pgf@sys@shading@end@pos{\the\pgf@x}% - \pgf@max=\pgf@x\relax% - \pgf@sys@bp@correct\pgf@x% - \edef\pgf@domb{\pgf@sys@tonumber{\pgf@x}}% - \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% - \edef\pgf@sys@shading@end@rgb{\pgf@sys@rgb}% - \pgfutil@gobble}{\pgf@parselastdom[}} -\def\pgf@parsemid[rgb(#1)=(#2,#3,#4); {\pgf@parserest[} -\def\pgf@parserest[rgb(#1)=(#2,#3,#4); {% - \advance\pgf@sys@shading@range@num by1\relax% - \pgfutil@ifnextchar]{% - \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% - \edef\pgf@singlefunc{\space% - << /FunctionType 2 /Domain [0 1] /C0 - [\pgf@prevcolor] /C1 [\pgf@rgb] /N 1 >> }% - \edef\pgf@funcs{\pgf@funcs\space% - << /FunctionType 2 /Domain [\pgf@doma\space\pgf@domb] /C0 - [\pgf@prevcolor] /C1 [\pgf@rgb] /N 1 >> }% - \edef\pgf@psfuncs{\pgf@prevx\space \pgf@rgb\space \pgf@prevcolor\space pgfshade \pgf@psfuncs}% - \pgfmathsetlength\pgf@x{#1}% - \edef\pgf@sys@shading@ranges{\pgf@sys@shading@ranges{{\pgf@sys@prevpos}{\the\pgf@x}{\pgf@sys@prevcolor}{\pgf@sys@rgb}}}% - \edef\pgf@sys@prevpos{\the\pgf@x}% - \let\pgf@sys@prevcolor=\pgf@sys@rgb% - \pgfutil@gobble}{% - \pgfmathsetlength\pgf@x{#1}% - \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% - \edef\pgf@sys@shading@ranges{\pgf@sys@shading@ranges{{\pgf@sys@prevpos}{\the\pgf@x}{\pgf@sys@prevcolor}{\pgf@sys@rgb}}}% - \edef\pgf@sys@prevpos{\the\pgf@x}% - \let\pgf@sys@prevcolor=\pgf@sys@rgb% - \edef\pgf@psfuncs{\pgf@prevx\space \pgf@rgb\space \pgf@prevcolor\space pgfshade \pgf@psfuncs}% - \pgf@sys@bp@correct\pgf@x% - \edef\pgf@prevx{\pgf@sys@tonumber{\pgf@x}}% - \edef\pgf@bounds{\pgf@bounds\space\pgf@sys@tonumber{\pgf@x}}% - \edef\pgf@encode{\pgf@encode\space0 1}% - \edef\pgf@singlefunc{\space% - << /FunctionType 2 /Domain [0 1] /C0 - [\pgf@prevcolor] /C1 [\pgf@rgb] /N 1 >> }% - \edef\pgf@funcs{\pgf@funcs\space% - << /FunctionType 2 /Domain [\pgf@doma\space\pgf@domb] /C0 - [\pgf@prevcolor] /C1 [\pgf@rgb] /N 1 >> }% - \edef\pgf@prevcolor{\pgf@rgb}% - \pgf@parserest[}} - -\def\pgf@getrgbtuplewithmixin#1#2#3{% - \pgfutil@definecolor{pgfshadetemp}{rgb}{#1,#2,#3}% - \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}% - \pgfutil@extractcolorspec{pgfshadetemp}{\pgf@tempcolor}% - \expandafter\pgfutil@convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% - \expandafter\pgf@getrgb@@\pgf@rgbcolor!} -\def\pgf@getrgb@@#1,#2,#3!{% - \def\pgf@rgb{#1 #2 #3}% - \def\pgf@sys@rgb{{#1}{#2}{#3}}% -} - - -\def\pgf@convertrgbstring#1{% - \def\pgf@rgbconv{}% - \pgf@converttorgb#1]% - } -\def\pgf@converttorgb{% - \pgfutil@ifnextchar]{\pgfutil@gobble}%done! - {% - \pgfutil@ifnextchar;{\pgf@grabsemicolor}% - {% - \pgfutil@ifnextchar r{\pgf@grabrgb}% - {% - \pgfutil@ifnextchar g{\pgf@grabgray}% - {% - \pgfutil@ifnextchar c{\pgf@grabcolor}% - {\PackageError{pgfshade}{Illformed shading - specification}{}\pgf@converttorgb}% - }% - }% - }% - }% -} -\def\pgf@grabsemicolor;{% - \edef\pgf@rgbconv{\pgf@rgbconv; }\pgf@converttorgb} -\def\pgf@grabrgb rgb(#1)=(#2,#3,#4){% - \edef\pgf@rgbconv{\pgf@rgbconv rgb(#1)=(#2,#3,#4)}\pgf@converttorgb} -\def\pgf@grabgray gray(#1)=(#2){% - \edef\pgf@rgbconv{\pgf@rgbconv rgb(#1)=(#2,#2,#2)}\pgf@converttorgb} -\def\pgf@grabcolor color(#1)=(#2){% - \pgfutil@colorlet{pgf@tempcol}{#2}% - \pgfutil@extractcolorspec{pgf@tempcol}{\pgf@tempcolor}% - \expandafter\pgfutil@convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% - \expandafter\pgf@convgetrgb@\expandafter{\pgf@rgbcolor}{#1}% -} -\def\pgf@convgetrgb@#1#2{% - \edef\pgf@rgbconv{\pgf@rgbconv rgb(#2)=(#1)}\pgf@converttorgb} - - - - -% Declares a horizontal shading for later use. The shading is a -% horizontal bar that changes its color. -% -% #1 = name of the shading for later use -% #2 = height of the shading -% #3 = color specification in the following format: A list of colors -% that the bar should have at certain points. If the bar should -% be red at 1cm, this is specified as -% "rgb(1cm)=(1,0,0)". Multiple specifications are separated by a -% semicolon and a space. At least two specifications must be -% given. The specified positions must be given in increasing -% order. -% -% Example: -% -% \pgfdeclarehorizontalshading{redtogreentoblue}{1cm}{% -% rgb(0cm)=(1,0,0); % red -% rgb(1cm)=(0,1,0); % green -% rgb(2cm)=(0,0,1)} -% -% \begin{document} -% The following bar is 2cm long: \pgfuseshading{redtogreentoblue}. -% \end{document} - -\def\pgfdeclarehorizontalshading{\pgfutil@ifnextchar[\pgf@declarehorizontalshading{\pgf@declarehorizontalshading[]}}% -\def\pgf@declarehorizontalshading[#1]#2#3#4{% - \expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}% - \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgfutil@empty% - \pgfsys@horishading{#2}{#3}{#4}% - \else% - \expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@horishading}% - \expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}% - \expandafter\let\csname @pgfshading#2!\endcsname=\pgfutil@empty% - \fi} - - -% Declares a vertical shading for later use. -% -% #1 = name of the shading for later use -% #2 = height of the shading -% #3 = color specification -% -% Example: -% -% \pgfdeclareverticalshading{redtogreentoblue}{1cm}{% -% rgb(0cm)=(1,0,0); % red -% rgb(1cm)=(0,1,0); % green -% rgb(2cm)=(0,0,1)} -% -% \begin{document} -% The following bar is 2cm high: \pgfuseshading{redtogreentoblue}. -% \end{document} - -\def\pgfdeclareverticalshading{\pgfutil@ifnextchar[\pgf@declareverticalshading{\pgf@declareverticalshading[]}}% -\def\pgf@declareverticalshading[#1]#2#3#4{% - \expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}% - \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgfutil@empty% - \pgfsys@vertshading{#2}{#3}{#4}% - \else% - \expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@vertshading}% - \expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}% - \expandafter\let\csname @pgfshading#2!\endcsname=\pgfutil@empty% - \fi} - - -% Declares a radial shading for later use. -% -% #1 = name of the shading for later use -% #2 = center of inner circle -% #3 = color specification -% -% Description: -% -% A radial shading creates a smooth color transition between two -% circles. The center of the inner circle is at the give position. Its -% radius is the start of the color specification. The -% center of the outer circle is at the center of the whole shading, -% whose radius is the end of the color specification. For example, -% suppose the color specification is "rgb(1cm)=(1,1,1); rgb(2cm)=(0,0,0)". -% Then the shading would be 4cm times 4cm large. The inner circle would -% have diameter 1cm and the outer circle would have diameter 2cm. The -% outer circle would be centered in the middle of the shading, whereas -% the outer circle would be centered at the given position. -% -% Example: -% -% \pgfdeclareradialshading{redtogreentoblue}{\pgfpoint{2cm}{2cm}}{% -% rgb(10pt)=(1,0,0); % red -% rgb(2cm)=(0,1,0); % green -% rgb(3cm)=(0,0,1)} -% -% \begin{document} -% The following ball has diameter 3cm: \pgfuseshading{redtogreentoblue}. -% \end{document} - -\def\pgfdeclareradialshading{\pgfutil@ifnextchar[\pgf@declareradialshading{\pgf@declareradialshading[]}}% -\def\pgf@declareradialshading[#1]#2#3#4{% - \expandafter\def\csname pgf@deps@pgfshading#2!\endcsname{#1}% - \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgfutil@empty% - \pgfsys@radialshading{#2}{#3}{#4}% - \else% - \expandafter\def\csname pgf@func@pgfshading#2!\endcsname{\pgfsys@radialshading}% - \expandafter\def\csname pgf@args@pgfshading#2!\endcsname{{#3}{#4}}% - \expandafter\let\csname @pgfshading#2!\endcsname=\pgfutil@empty% - \fi} - - -% Inserts a box into the text that contains a previously defined -% shading. -% -% #1 = Name of a shading -% -% Example: -% -% \pgfuseshading{redtogreentoblue} - -\def\pgfuseshading#1{% - \edef\pgf@shadingname{@pgfshading#1}% - \pgf@tryextensions{\pgf@shadingname}{\pgfalternateextension}% - \expandafter\pgfutil@ifundefined\expandafter{\pgf@shadingname}% - {\PackageError{pgfshade}{Undefined shading "#1"}{}}% - {% - {% - \pgfutil@globalcolorsfalse% - \def\pgf@shade@adds{}% - \pgfutil@ifundefined{pgf@deps\pgf@shadingname}% - {}% - {% - \edef\@list{\csname pgf@deps\pgf@shadingname\endcsname}% - \pgfutil@for\@temp:=\@list\do{% - {% - \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{\@temp}}% - \pgfutil@extractcolorspec{\@temp}{\pgf@tempcolor}% - \expandafter\pgfutil@convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% - \xdef\pgf@shade@adds{\pgf@shade@adds,\pgf@rgbcolor}% - }% - }% - }% - \expandafter\pgf@strip@shadename\pgf@shadingname!!% - \pgfutil@ifundefined{@pgfshading\pgf@basename\pgf@shade@adds!}% - {% - {% - \expandafter\def\expandafter\@temp\expandafter{\csname pgf@func\pgf@shadingname\endcsname}% - \edef\@args{{\pgf@basename\pgf@shade@adds}}% - \expandafter\expandafter\expandafter\def% - \expandafter\expandafter\expandafter\@@args% - \expandafter\expandafter\expandafter{\csname pgf@args\pgf@shadingname\endcsname}% - \expandafter\expandafter\expandafter\@temp\expandafter\@args\@@args% - % - }% - }% - {}% - \pgf@invokeshading{\csname @pgfshading\pgf@basename\pgf@shade@adds!\endcsname}% - }% - }% -} - -\def\pgf@strip@shadename @pgfshading#1!!!{\def\pgf@basename{#1}} - -\def\pgf@invokeshading#1{% - \ifpgfpicture% - \pgfsys@shadinginsidepgfpicture{#1}% - \else% - \pgfsys@shadingoutsidepgfpicture{#1}% - \fi% -} - - -% Create an alias name for a shading -% -% #1 = name of the alias -% #2 = name of the original -% -% Example: -% -% \pgfaliasshading{shading!25}{shadingshaded} - -\def\pgfaliasshading#1#2{% - \expandafter\let\expandafter\pgf@temp\expandafter=\csname @pgfshading#2!\endcsname% - \expandafter\let\csname @pgfshading#1!\endcsname=\pgf@temp% - \expandafter\let\expandafter\pgf@temp\expandafter=\csname pgf@deps@pgfshading#2!\endcsname% - \expandafter\let\csname pgf@deps@pgfshading#1!\endcsname=\pgf@temp% - \expandafter\let\expandafter\pgf@temp\expandafter=\csname pgf@func@pgfshading#2!\endcsname% - \expandafter\let\csname pgf@func@pgfshading#1!\endcsname=\pgf@temp% - \expandafter\let\expandafter\pgf@temp\expandafter=\csname pgf@args@pgfshading#2!\endcsname% - \expandafter\let\csname pgf@args@pgfshading#1!\endcsname=\pgf@temp% -} - - - - -% Shades the current path, but does not discard it. -% -% #1 - a shading (see below) -% #2 - an angle -% -% Description: -% -% \pgfshadepath ``tries'' to fill the -% current path with a shading. The shading's original size should -% completely cover the area between (0,0) and (100bp,100bp). The -% shading will be rotated by #2 and then rescaled so that it -% completely covers the path. Then the path will be used (locally) for -% clipping and the shading is drawn. -% -% In addition to the rotation, any transformation set by the -%\pgfsetadditionalshadetransform will also be applied. -% -% After all this, the path can still be used for the normal -% stroking/clipping operations. -% -% The shading is rotated around its middle. If no rotation occurs, the -% lower left corner of the path will lie on (25bp, 25bp), the upper -% right corner on (75bp, 75bp). -% -% Example: -% -% \pgfdeclareverticalshading{myshading}{100bp}{color(0pt)=(red); color(100bp)=(green)} -% -% \pgfpathmoveto{\pgforigin} -% \pgfpathlineto{\pgfxy(1,0)} -% \pgfpathlineto{\pgfxy(1,1)} -% \pgfshadepath{myshading}{0} -% \pgfusepath{stroke} - -\def\pgfshadepath#1#2{% - \ifdim\pgf@pathminx=16000pt% - \PackageWarning{pgfshade}{No path specified that can be filled}% - \else% - \begingroup% - \pgfsys@beginscope% - % Calculate center: - \pgf@xb=.5\pgf@pathmaxx% - \advance\pgf@xb by.5\pgf@pathminx% - \pgf@yb=.5\pgf@pathmaxy% - \advance\pgf@yb by.5\pgf@pathminy% - % Calculate scaling: - \pgf@xc=\pgf@pathmaxx% - \advance\pgf@xc by-\pgf@pathminx% - \pgf@yc=\pgf@pathmaxy% - \advance\pgf@yc by-\pgf@pathminy% - \pgf@xc=.02\pgf@xc% - \pgf@yc=.02\pgf@yc% - \pgfsyssoftpath@invokecurrentpath% - \pgfsys@clipnext% - \pgfsys@discardpath% - % Compute new transformation matrix: - \pgfsys@transformcm{1}{0}{0}{1}{\pgf@xb}{\pgf@yb}% - \pgfsys@transformcm% - {\pgf@sys@tonumber{\pgf@xc}}{0}% - {0}{\pgf@sys@tonumber{\pgf@yc}}{0pt}{0pt}% - \pgfmathparse{#2}% - \let\pgfshade@angle=\pgfmathresult% - \pgfmathsin@{\pgfshade@angle}% - \let\pgfshade@sin=\pgfmathresult% - \pgfmathcos@{\pgfshade@angle}% - \let\pgfshade@cos=\pgfmathresult% - \pgf@x=\pgfshade@sin pt% - \pgf@xa=-\pgf@x% - \pgfsys@transformcm{\pgfshade@cos}{\pgfshade@sin}{\pgf@sys@tonumber{\pgf@xa}}{\pgfshade@cos}{0pt}{0pt}% - \ifx\pgf@shade@extra@transform\pgfutil@empty% - \else% - \pgflowlevel{\pgf@shade@extra@transform}% - \fi% - \pgfuseshading{#1}% - \pgfsys@endscope% - \endgroup% - \fi% -} - - -% Additionally transform shade paths -% -% #1 = Transformation code that is used in addition to the normal -% shading transformation. -% -% Example: -% -% \pgfsetadditionalshadetransform{\pgftransformrotate{30}} - -\def\pgfsetadditionalshadetransform#1{\def\pgf@shade@extra@transform{#1}} -\let\pgf@shade@extra@transform=\pgfutil@empty - - - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex deleted file mode 100644 index 4a9a23f0d2c..00000000000 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex +++ /dev/null @@ -1,589 +0,0 @@ -% Copyright 2006 by Till Tantau -% -% This file may be distributed and/or modified -% -% 1. under the LaTeX Project Public License and/or -% 2. under the GNU Public License. -% -% See the file doc/generic/pgf/licenses/LICENSE for more details. - -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.6 2007/06/07 07:41:10 tantau Exp $ - - -% Position transformations - -\newdimen\pgf@pt@x -\newdimen\pgf@pt@y - -\newdimen\pgf@pt@temp - -\newif\ifpgf@pt@identity -\pgf@pt@identitytrue - -\def\pgf@pt@aa{1.0} \def\pgf@pt@ab{0.0} -\def\pgf@pt@ba{0.0} \def\pgf@pt@bb{1.0} - - - -% Store the current transformation matrix in a macro. -% -% #1 = macro name -% -% Example: -% -% \pgfgettransform\mytransform - -\def\pgfgettransform#1{% - \edef#1{{\pgf@pt@aa}{\pgf@pt@ab}{\pgf@pt@ba}{\pgf@pt@bb}{\the\pgf@pt@x}{\the\pgf@pt@y}} -} - - -% Restore the current transformation matrix from a macro. -% -% #1 = macro name, previously used with \pgfgettransform -% -% Example: -% -% \pgfsettransform\mytransform - -\def\pgfsettransform#1{% - \edef\pgf@temp{#1}% - \expandafter\pgf@settransform\pgf@temp% -} -\def\pgf@settransform#1#2#3#4#5#6{% - \def\pgf@pt@aa{#1}% - \def\pgf@pt@ab{#2}% - \def\pgf@pt@ba{#3}% - \def\pgf@pt@bb{#4}% - \pgf@pt@x=#5% - \pgf@pt@y=#6% - \edef\pgf@idtest{#1,#2,#3,#4}% - \ifx\pgf@idtest\pgf@idmatrixtext% - \pgf@pt@identitytrue% - \else% - \pgf@pt@identityfalse% - \fi% -} - -\def\pgf@idmatrixtext{1.0,0.0,0.0,1.0} - - -% Transformation command -% -% #1 = x dimension -% #2 = y dimension -% -% Description: -% -% Applies the pgfs transformation matrix to the point (#1,#2). The -% result is once more stored in the point. -% -% -% Example: -% -% \pgf@pos@transform{\pgf@x}{\pgf@y} - -\def\pgf@pos@transform#1#2{% - \ifpgf@pt@identity% - \else% - \pgf@pt@temp=#1% - #1=\pgf@pt@aa#1% - \advance#1 by\pgf@pt@ba#2% - #2=\pgf@pt@bb#2% - \advance#2 by\pgf@pt@ab\pgf@pt@temp% - \fi% - \advance#1 by\pgf@pt@x% - \advance#2 by\pgf@pt@y% -} - - -% Invert the current transformation matrix -% -% Description: -% -% This command replaces the current transformation matrix by its -% inverse. The inversion is not very exact if the matrix is nearly -% singular. -% -% Example: -% -% \pgftransforminvert - -\def\pgftransforminvert{% - % First, invert the shift. That's easy - \pgf@pt@x=-\pgf@pt@x - \pgf@pt@y=-\pgf@pt@y - \ifpgf@pt@identity% - \else% - % Sigh. Have to calculate the inverse of the matrix. - % Start with determinant - % Matrix = (aa ab - % ba bb) - {% - \pgfutil@tempdima=\pgf@pt@aa pt% - \pgfutil@tempdima=\pgf@pt@bb\pgfutil@tempdima% aa * bb - \pgfutil@tempdimb=\pgf@pt@ba pt% - \pgfutil@tempdimb=\pgf@pt@ab\pgfutil@tempdimb% ba * ab - \advance\pgfutil@tempdima by -\pgfutil@tempdimb% aa*bb - ba*ab - % Invert - \pgfutil@tempdima=.125\pgfutil@tempdima% - \c@pgf@counta=\pgfutil@tempdima\relax% 8192*determinant - \pgfutil@tempdima=8192pt% - \divide\pgfutil@tempdima by\c@pgf@counta% - \pgf@x=\pgf@pt@bb\pgfutil@tempdima% bb/(det A) - \xdef\pgf@new@pt@aa{\pgf@sys@tonumber{\pgf@x}}% - \pgf@x=\pgf@pt@aa\pgfutil@tempdima% aa/(det A) - \xdef\pgf@new@pt@bb{\pgf@sys@tonumber{\pgf@x}}% - \pgfutil@tempdima=-\pgfutil@tempdima% - \pgf@x=\pgf@pt@ba\pgfutil@tempdima% -ba/(det A) - \xdef\pgf@new@pt@ba{\pgf@sys@tonumber{\pgf@x}}% - \pgf@x=\pgf@pt@ab\pgfutil@tempdima% -ab/(det A) - \xdef\pgf@new@pt@ab{\pgf@sys@tonumber{\pgf@x}}% - }% - \expandafter\def\expandafter\pgf@pt@aa\expandafter{\pgf@new@pt@aa}% - \expandafter\def\expandafter\pgf@pt@ab\expandafter{\pgf@new@pt@ab}% - \expandafter\def\expandafter\pgf@pt@ba\expandafter{\pgf@new@pt@ba}% - \expandafter\def\expandafter\pgf@pt@bb\expandafter{\pgf@new@pt@bb}% - \pgf@pt@temp=\pgf@pt@x% - \pgf@pt@x=\pgf@pt@aa\pgf@pt@x% - \advance\pgf@pt@x by\pgf@pt@ba\pgf@pt@y% - \pgf@pt@y=\pgf@pt@bb\pgf@pt@y% - \advance\pgf@pt@y by\pgf@pt@ab\pgf@pt@temp% - \fi% -} - - - - -% PGF-Level concatenation of the transformation matrix with a given -% matrix. -% -% #1 - #5 = a concatenation matrix (see pdf spec). Entry #5 is a -% translation point. -% -% Description: -% -% All coordinates given to subsequent path construction commands will -% be transformed additionally by the given transformation matrix. If -% the command is followed by a 6th argument, the transformation is -% only applied to this argument. -% -% -% Example: -% -% \pgftransformcm{1}{0}{0}{1}{\pgfpoint{100pt}{0pt}} % 100pt to the right. -% -% \pgftransformcm{2}{0}{0}{2}{\pgfpointorigin} % double in in size -% \pgfpathmoveto{\pgfpoint{0cm}{0cm}} -% \pgfpathlineto{\pgflineto{1cm}{1cm}} % actually 2cm/2cm - -\def\pgftransformcm#1#2#3#4#5{% - \edef\pgf@marshal{\noexpand\pgf@transformcm{#1}{#2}{#3}{#4}}% - \pgf@marshal{#5}% -} -\def\pgf@transformcm#1#2#3#4#5{% - {% - \pgf@process{#5}% - \pgf@xc=\pgf@x% - \pgf@yc=\pgf@y% - % - \pgf@x=#1pt% - \pgf@y=#2pt% - % - \pgf@xa=\pgf@pt@aa\pgf@x% - \advance\pgf@xa by \pgf@pt@ba\pgf@y% - % - \pgf@ya=\pgf@pt@ab\pgf@x% - \advance\pgf@ya by \pgf@pt@bb\pgf@y% - % - \pgf@x=#3pt% - \pgf@y=#4pt% - % - \pgf@xb=\pgf@pt@aa\pgf@x% - \advance\pgf@xb by \pgf@pt@ba\pgf@y% - % - \pgf@yb=\pgf@pt@ab\pgf@x% - \advance\pgf@yb by \pgf@pt@bb\pgf@y% - % - \pgf@x=\pgf@pt@aa\pgf@xc% - \advance\pgf@x by\pgf@pt@ba\pgf@yc% - \advance\pgf@x by\pgf@pt@x% - % - \pgf@y=\pgf@pt@ab\pgf@xc% - \advance\pgf@y by\pgf@pt@bb\pgf@yc% - \advance\pgf@y by\pgf@pt@y% - % - \global\pgf@x=\pgf@x% - \global\pgf@y=\pgf@y% - \xdef\pgf@tempaa{\pgf@sys@tonumber{\pgf@xa}}% - \xdef\pgf@tempab{\pgf@sys@tonumber{\pgf@ya}}% - \xdef\pgf@tempba{\pgf@sys@tonumber{\pgf@xb}}% - \xdef\pgf@tempbb{\pgf@sys@tonumber{\pgf@yb}}% - }% - \pgf@pt@x=\pgf@x% - \pgf@pt@y=\pgf@y% - \let\pgf@pt@aa=\pgf@tempaa% - \let\pgf@pt@ba=\pgf@tempba% - \let\pgf@pt@ab=\pgf@tempab% - \let\pgf@pt@bb=\pgf@tempbb% - \def\pgf@trans@idtest{#1,#2,#3,#4}% - \ifx\pgf@trans@idtest\pgf@trans@idtext% - \else% - \pgf@pt@identityfalse% - \fi% -} -\def\pgf@trans@idtext{1.0,0,0,1.0} - - - -% Transformation into a given triangle. The three corners of the -% triangle are called "origin", "x" and "y" are given. After this -% transformation has been applied, the canvas origin is at "origin", -% the vector (1pt,0pt) lies at "x" and the vector (0pt,1pt) lies at -% "y". -% -% #1 = origin -% #2 = x -% #3 = y -% -% Example: -% -% \pgftransformtriangle{\pgfpointorigin}{\pgfpoint{1cm}{1cm}}{\pgfpoint{-1cm}{1cm}} - -\def\pgftransformtriangle#1#2#3{% - \pgf@process{#2}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#3}% - \pgf@xb=\pgf@x% - \pgf@yb=\pgf@y% - \pgf@process{#1}% - \advance\pgf@xa by-\pgf@x% - \advance\pgf@ya by-\pgf@y% - \advance\pgf@xb by-\pgf@x% - \advance\pgf@yb by-\pgf@y% - \pgftransformcm% - {\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@ya}% - {\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@yb}% - {\pgfpoint{\pgf@x}{\pgf@y}}% -} - - - -% Undo all transformations -% -% Example: -% -% \pgftansformreset - -\def\pgftransformreset{% - \pgf@pt@x=0pt% - \pgf@pt@y=0pt% - \def\pgf@pt@aa{1.0}% - \def\pgf@pt@ba{0.0}% - \def\pgf@pt@ab{0.0}% - \def\pgf@pt@bb{1.0}% - \pgf@pt@identitytrue% -} - - -% Undo all slanting/rotation, but not translations -% -% Example: -% -% \pgftansformreset - -\def\pgftransformresetnontranslations{% - \def\pgf@pt@aa{1.0}% - \def\pgf@pt@ba{0.0}% - \def\pgf@pt@ab{0.0}% - \def\pgf@pt@bb{1.0}% - \pgf@pt@identitytrue% -} - - - - -% Shifting command and environment -% -% #1 = vector by which all subsequent points should be moved. -% -% Example: -% -% \pgftansformshift{\pgfpoint{1cm}{1cm}} - -\def\pgftransformshift#1{\pgftransformcm{1.0}{0}{0}{1.0}{#1}} -\def\pgftransformxshift#1{\pgftransformcm{1.0}{0}{0}{1.0}{\pgfpoint{#1}{0pt}}} -\def\pgftransformyshift#1{\pgftransformcm{1.0}{0}{0}{1.0}{\pgfpoint{0pt}{#1}}} - - - - -% Scaling commands -% -% #1 = scaling for all subsequent points. -% -% Example: -% -% \pgftransformscale{2} -% \pgftransformxscale{2} -% \pgftransformyscale{2} - -\def\pgftransformscale#1{\pgftransformcm{#1}{0}{0}{#1}{\pgfpointorigin}} -\def\pgftransformxscale#1{\pgftransformcm{#1}{0}{0}{1.0}{\pgfpointorigin}} -\def\pgftransformyscale#1{\pgftransformcm{1.0}{0}{0}{#1}{\pgfpointorigin}} - - - -% Slanting commands -% -% #1 = slanting in x-direction. 1 means 45 degrees. -% -% Example: -% -% \pgftransformxslant{2} -% \pgftransformyslant{2} - -\def\pgftransformxslant#1{\pgftransformcm{1.0}{0}{#1}{1.0}{\pgfpointorigin}} -\def\pgftransformyslant#1{\pgftransformcm{1.0}{#1}{0}{1.0}{\pgfpointorigin}} - - - -% Rotation commands -% -% #1 = degrees for the rotation -% -% Example: -% -% \pgftransformrotate{30} - -\def\pgftransformrotate#1{% - \pgfmathparse{#1}% - \let\pgftransform@angle=\pgfmathresult% - \pgfmathsin@{\pgftransform@angle}% - \let\pgftransform@sin=\pgfmathresult% - \pgfmathcos@{\pgftransform@angle}% - \let\pgftransform@cos=\pgfmathresult% - \pgf@x=\pgftransform@sin pt% - \pgf@xa=-\pgf@x% - \pgftransformcm{\pgftransform@cos}{\pgftransform@sin}{\pgf@sys@tonumber{\pgf@xa}}{\pgftransform@cos}{\pgfpointorigin}% -} - - - -% The following if's have the following effect: -% -% \ifpgfslopedattime decides whether the coordinate system of an -% xxxattime transformation command should be rotated such that text -% drawn on the line should be tangent to the line -% -% \ifpgfallowupsidedowattime decides whether the transformation should -% be done in such a way that the text is always ``upright,'' that is, -% text drawn in this coordiante system is never upside-down. -% -% \ifpgfresetnontranslationattime decides whether the coordinate -% system of an xxxattime transformation command should be reset -% (concerning the non-translations) before a possible rotation is -% applied. This is useful, for example, if the main coordinate system -% is scaled by, say, a factor of 2 and you do not want that to apply -% to the text, but you do want the rotation to applyu. - -\newif\ifpgfslopedattime -\newif\ifpgfallowupsidedownattime -\newif\ifpgfresetnontranslationattime - - -% Transform to the coordinate system of a point on a line -% -% #1 = a time fraction of line where to put the label, where 0 means start, -% 1 means end, and for example 0.5 means the middle. -% #2 = start of line -% #3 = end of line -% -% Example: -% -% { -% \pgftransformlineattime{.5}{\pgfxy(0,0)}{\pgfxy(3,2)} -% \pgftext{Hi!} -% } -% -% { -% \pgftransformlineattime{.75}{\pgfxy(0,0)}{\pgfxy(3,2)} -% \pgftransformresetnontranslations -% \pgftext{Hi!} -% } -% -\def\pgftransformlineattime#1#2#3{% - \pgftransformshift{\pgfpointlineattime{#1}{#2}{#3}}% - \ifpgfresetnontranslationattime% - \pgftransformresetnontranslations% - \fi% - \ifpgfslopedattime% - \pgf@process{#2}% - \pgf@xa=\pgf@x% xb/yb = start point - \pgf@ya=\pgf@y% - \pgf@process{#3}% - \advance\pgf@x by-\pgf@xa% - \advance\pgf@y by-\pgf@ya% - \ifpgfallowupsidedownattime% - \else% - \ifdim\pgf@x<0pt% - \pgf@x=-\pgf@x% - \pgf@y=-\pgf@y% - \fi% - \fi% - \pgfpointnormalised{}% x/y = normalised vector - \pgf@ya=-\pgf@y% - \pgftransformcm% - {\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}% - {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}{\pgfpointorigin}% - \fi% -} - - - - -% Transform to the coordinate system of a point on a curve -% -% #1 = a time fraction of line where to put the label, where 0 means start, -% 1 means end, and for example 0.5 means the middle. -% #2 = start of line -% #3 = first control -% #4 = second control -% #5 = end of line -% -% Example: -% -% { -% \pgftransformlabel{.5}{\pgfxy(0,0)}{\pgfxy(3,2)} -% \pgftext{Hi!} -% } -% -% { -% \pgftransformlabel{.75}{\pgfxy(0,0)}{\pgfxy(3,2)} -% \pgftransformresetnontranslations -% \pgftext{Hi!} -% } -% -\def\pgftransformcurveattime#1#2#3#4#5{% - \pgfpointcurveattime{#1}{#2}{#3}{#4}{#5}% - \pgftransformshift{\pgfqpoint{\pgf@x}{\pgf@y}}% - \ifpgfresetnontranslationattime% - \pgftransformresetnontranslations% - \fi% - \ifpgfslopedattime% - \pgf@x=\pgf@xa% - \pgf@y=\pgf@ya% - \advance\pgf@x by-\pgf@xb% - \advance\pgf@y by-\pgf@yb% - \ifpgfallowupsidedownattime% - \else% - \ifdim\pgf@x<0pt% - \pgf@x=-\pgf@x% - \pgf@y=-\pgf@y% - \fi% - \fi% - \pgfpointnormalised{}% x/y = normalised vector - \pgf@ya=-\pgf@y% - \pgftransformcm% - {\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}% - {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}{\pgfpointorigin}% - \fi% -} - - - - - -% Transform to the coordinate system of an arrow at the end of the -% line going from point #1 to point #2 with the correct rotation. -% -% #1 = a start point an (invisible) line -% #2 = an end point an (invisible) line -% -% Example: -% -% \pgftransformarrow{\pgfpointorigin}{\pgfpoint{1cm}{0cm}} - -\def\pgftransformarrow#1#2{% - \pgftransformshift{#2}% - \pgf@process{#2}% - \pgf@xa=\pgf@x% - \pgf@ya=\pgf@y% - \pgf@process{#1}% - \advance\pgf@xa by-\pgf@x% - \advance\pgf@ya by-\pgf@y% - \pgf@x=\pgf@xa% - \pgf@y=\pgf@ya% - \pgfpointnormalised{}% - \pgf@ya=-\pgf@y% - \pgftransformcm% - {\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}% - {\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}{\pgfqpoint{0pt}{0pt}}% -} - - - -% Low-level transformations - -% Causes the current high-level transformation command to be applied -% to the low-level. -% -% Description: -% -% All subsequent drawing will be transformed additionally by the -% current high-level transformation. Thus, the high-level -% transformation becomes the low-level transformation. The high-level -% transformation is reset at this point. - -\def\pgflowlevelsynccm{% - \pgfsys@transformcm% - {\pgf@pt@aa}{\pgf@pt@ab}% - {\pgf@pt@ba}{\pgf@pt@bb}% - {\pgf@pt@x}{\pgf@pt@y}% - \pgftransformreset% - \pgf@relevantforpicturesizefalse% -} - - - -% Causes a transformation command to be applied to the ``lowlevel'' -% transformation matrix. -% -% #1 - a high-level transformation command -% -% Description: -% -% All subsequent drawing will be transformed additionally by the given -% transformation matrix. Note that PGF will no longer be able to -% ``keep track'' of the coordinates. Also, transformations are applied -% to *everything*, including line thickness and line endings. Most -% often, this is not desirable. -% -% Example: -% -% \pgflowlevel{\pgftransformcm{1}{0}{0}{1}{\pgfpoint{100pt}{0pt}}} % 100bp to the right. -% -% \begin{pgflowlevelscope}{\pgftransformcm{2}{0}{0}{2}{\pgfpointorigin}} % double in in size -% \pgfmoveto{\pgfpoint{0cm}{0cm}} -% \pgflineto{\pgflineto{1cm}{1cm}} % actually 2cm/2cm -% \end{pgflowlevelscope} - -\def\pgflowlevel#1{% - {% - \pgftransformreset% - #1% - \pgflowlevelsynccm% - }% - \pgf@relevantforpicturesizefalse% -} - -\def\pgflowlevelscope#1{\pgfscope\pgflowlevel{#1}} -\def\endpgflowlevelscope{\endpgfscope} - -\long\def\pgflowlevelobj#1#2{\pgfscope{\pgflowlevel{#1}#2}\endpgfscope} - - - - -\endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex new file mode 100644 index 00000000000..3048e6077fe --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex @@ -0,0 +1,222 @@ +% Copyright 2007 by Till Tantau +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransparency.code.tex,v 1.2 2008/01/17 20:09:16 tantau Exp $ + + +% Sets the opacity of stroking operations. +% +% #1 = opacity, where 1 means fully opaque and 0 means fully +% transparent. +% +% Example: +% +% \pgfsetstrokeopacity{0.5} + +\def\pgfsetstrokeopacity#1{% + \pgfmathparse{#1}% + \expandafter\pgfsys@stroke@opacity\expandafter{\pgfmathresult}} + + +% Sets the opacity of stroking operations. +% +% #1 = opacity, where 1 means fully opaque and 0 means fully +% transparent. +% +% Example: +% +% \pgfsetfillopacity{0.5} + +\def\pgfsetfillopacity#1{% + \pgfmathparse{#1}% + \expandafter\pgfsys@fill@opacity\expandafter{\pgfmathresult}} + + + +% Declares a new fading based on the contents of a box. +% +% #1 = name of the fading +% #2 = content of a TeX box that specifies the fading +% +% Description: +% +% This command declares a new fading based on the contents of +% the TeX box. The mask can later be used to mask other graphics. +% +% The box is used to determine where the mask is opaque: At the +% beginning, the mask is completely transparent. Whereever the box +% contains something (like text or a picture or whatever), the +% luminosity of the text/graphic is used to determine how opaque the +% point will be. The greater the luminosity, the more opaque. The net +% effect is that white corresponds to "completely opaque" and black to +% "completely transparent". This is rather counterintuitive. Because +% of this, the special color "pgftransparent" is defined, which is the +% same as black. By setting the color to, say, +% \color{pgftransparent!10} you get something that is 10% transparent +% and \color{pgftransparent!90} gives you 90% transparency. +% +% By default, the drawing color is set to opaque. +% +% Example: +% +% \pgfdeclarefading{mymask}{ +% \fontsize{200}{200}\bfseries +% Ti\emph{k}Z +% } +% \pgfdeclarefading{myothermask}{ +% \tikz \shade [left color=transparent,right color=transparent!0] +% (0,0) rectangle (5,5); +% } + +\def\pgfdeclarefading#1#2{% + \setbox\pgfutil@tempboxa=\hbox{{\pgfsys@beginscope\pgfutil@color{white}\ignorespaces#2\pgfsys@endscope}}% + \pgfsys@fadingfrombox{#1}\pgfutil@tempboxa% +} + +\pgfutil@colorlet{pgftransparent}{black} + + +% Use a previously declared fading. +% +% #1 = name of the fading +% #2 = transformation code +% +% Description: +% +% The command should be used *inside* a pgfpicture to install a +% fading. The fading is a part of the graphic state. (This command +% works much like \pgfsetstrokeopacity). +% +% The mask will be centered on the origin. The transformation code #2 is +% applied to the mask (but not the contents of the actual picture). + +\def\pgfsetfading#1#2{% + {% + \pgftransformreset% + #2% + \pgfgettransform{\pgftrans@temp}% + \edef\pgf@marshal{\noexpand\pgfsys@usefading{#1}\pgftrans@temp}% + \pgf@marshal% + }% +} + + + +% Use a previously declared fading scaled for the current path. +% +% #1 - an fading +% #2 - extra transformations +% +% Description: +% +% This command works a bit like \pgfshadepath. "Works a bit like" +% means the following: The masks's original size should +% completely cover the area between (0,0) and (100bp,100bp). The +% mask is then rescaled so that it completely covers the path. Then +% the additional transformation #2 is applied. Finally, the mask is +% made part of the graphic state (as with \pgfsetfading). The path +% used for computation purposes only -- it is not drawn or otherwise +% used. +% +% If no transformations occur, the lower left corner of the path will +% lie on (25bp, 25bp), the upper right corner on (75bp, 75bp). +% +% If the path was empty, the fading will be used at its natural size, +% centered on the origin. +% +% Example: +% +% \pgfdeclarefading{fade right} +% {\tikz[left color=transparent!0,right color=transparent!100] +% (0,0) rectangle (100bp,100bp);} +% +% \pgfpathmoveto{\pgforigin} +% \pgfpathlineto{\pgfxy(1,0)} +% \pgfpathlineto{\pgfxy(1,1)} +% \pgfsetfadingforcurrentpath{fade right}{} +% \pgfusepath{fill} + +\def\pgfsetfadingforcurrentpath#1#2{% + \ifdim\pgf@pathminx=16000pt% + % Path was empty -> use natural size + \pgfsetfading{#1}{#2}% + \else% + \pgfsetfading{#1}{% + % Calculate center: + \pgf@xb=.5\pgf@pathmaxx% + \advance\pgf@xb by.5\pgf@pathminx% + \pgf@yb=.5\pgf@pathmaxy% + \advance\pgf@yb by.5\pgf@pathminy% + % Calculate scaling: + \pgf@xc=\pgf@pathmaxx% + \advance\pgf@xc by-\pgf@pathminx% + \pgf@yc=\pgf@pathmaxy% + \advance\pgf@yc by-\pgf@pathminy% + \pgf@xc=.02\pgf@xc% + \pgf@yc=.02\pgf@yc% + % Compute new transformation matrix: + \pgftransformcm{1}{0}{0}{1}{\pgfqpoint{\pgf@xb}{\pgf@yb}}% + \pgftransformcm{\pgf@sys@tonumber{\pgf@xc}}{0}{0}{\pgf@sys@tonumber{\pgf@yc}}{\pgfpointorigin}% + #2% + }% + \fi% +} + + + + +% Group things in a a transparency group +% +% Description: +% +% This takes groups pgf commands inside a pgfpicture in a transparency +% group. This means that any transparency settings apply to commands a +% whole. For instance, if a box contains two overlapping black +% circles and you draw them normally with 50% transparency, then the +% overlap will be darker than the rest. By comparison, if the circles +% are part of a transparency group, the overlap will get the same +% color as the rest. +% +% + +\def\pgftransparencygroup{% + \begingroup% + \setbox\pgfutil@tempboxa=\hbox\bgroup% +} +\def\endpgftransparencygroup{% + \egroup% + % Now compute the correct position. This is a bit tricky... + \ifdim\pgf@picminx=16000pt% + % Nothing needs to be done + \else% + % Safety margin to avoid clipping: + \advance\pgf@picminx by-1cm% + \advance\pgf@picmaxx by1cm% + \advance\pgf@picminy by-1cm% + \advance\pgf@picmaxy by1cm% + % Ok, set the box size to current picture size. + \setbox\pgfutil@tempboxa=\hbox{% + \vrule width0pt height\pgf@picmaxy depth-\pgf@picminy% + \hskip-\pgf@picminx% + \box\pgfutil@tempboxa% + \hskip\pgf@picmaxx% + }% + \pgfsys@transparencygroupfrombox\pgfutil@tempboxa% + \wd\pgfutil@tempboxa=0pt% + \ht\pgfutil@tempboxa=0pt% + \dp\pgfutil@tempboxa=0pt% + \hskip\pgf@picminx\box\pgfutil@tempboxa\hskip-\pgf@picminx% + \fi% + \endgroup% +} + +\let\startpgftransparencygroup=\pgftransparencygroup +\let\stoppgftransparencygroup=\endpgftransparencygroup + +\endinput |