diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer')
19 files changed, 909 insertions, 328 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex index 41597300e23..ec8d93af683 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseimage.code.tex @@ -1,11 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseimage.code.tex,v 1.2 2005/07/06 15:58:57 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% 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/pgfbaseimage.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ % Declare an image @@ -25,23 +27,23 @@ % % \pgfdeclareimage[width=2cm,page=2]{myimage}{imagefilename} -\def\pgfdeclareimage{\@ifnextchar[{\pgf@declareimage}{\pgf@declareimage[]}} +\def\pgfdeclareimage{\pgf@ifnextchar[{\pgf@declareimage}{\pgf@declareimage[]}} \def\pgf@declareimage[#1]#2#3{% \setkeys{pgfimage}{height=,width=,page=,interpolate=false,mask=}% defaults \setkeys{pgfimage}{#1}% % Try to find the file \gdef\pgf@filename{}% % If page= parameter is not empty, try that file first: - \ifx\pgf@imagepage\@empty% + \ifx\pgf@imagepage\pgf@empty% \else% \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3.page\pgf@imagepage}% \fi% - \ifx\pgf@filename\@empty% + \ifx\pgf@filename\pgf@empty% \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3}% \else% \setkeys{pgfimage}{page=}% make page empty \fi% - \ifx\pgf@filename\@empty% + \ifx\pgf@filename\pgf@empty% \PackageWarning{pgf}% {File "#3" not found when defining image "#2".\MessageBreak Tried all extensions in "\pgfsys@imagesuffixlist"}% @@ -62,13 +64,13 @@ \define@key{pgfimage}{interpolate}[true]{\edef\pgf@imageinterpolate{/Interpolate #1}} \define@key{pgfimage}{mask}{% \edef\pgf@imagemask{#1}% - \ifx\pgf@imagemask\@empty% + \ifx\pgf@imagemask\pgf@empty% \else% - \@ifundefined{pgf@mask@#1}% + \pgf@ifundefined{pgf@mask@#1}% {\PackageError{pgf}{Undefined mask "#1".}{}% \edef\pgf@imagemask{}}% {\edef\pgf@imagemask{\csname pgf@mask@#1\endcsname}% - \ifx\pgf@imagemask\@empty% + \ifx\pgf@imagemask\pgf@empty% \else \edef\pgf@imagemask{/SMask \pgf@imagemask\space 0 R}% \fi}% @@ -78,20 +80,20 @@ \IfFileExists{#3.#1}% {\xdef\pgf@filename{#3.#1}}% {\def\pgf@mightbeempty{#2}% - \ifx\pgf@mightbeempty\@empty\else% + \ifx\pgf@mightbeempty\pgf@empty\else% \pgf@findfile#2+{#3}% \fi}} \def\pgf@declaredraftimage#1{% - \ifx\pgf@imagewidth\@empty% + \ifx\pgf@imagewidth\pgf@empty% \PackageWarning{pgf}{Missing width for image "#1" in draft mode.\MessageBreak Using 1cm instead}% \edef\pgf@imagewidth{1cm}% \fi% - \ifx\pgf@imageheight\@empty% + \ifx\pgf@imageheight\pgf@empty% \PackageWarning{pgf}{Missing height for image "#1" in draft mode.\MessageBreak Using 1cm instead}% \edef\pgf@imageheight{1cm}% \fi% - \ifx\pgf@imagepage\@empty\else\edef\pgf@imagepagetext{ page \pgf@imagepage}\fi% + \ifx\pgf@imagepage\pgf@empty\else\edef\pgf@imagepagetext{ page \pgf@imagepage}\fi% \edef\pgf@image{% \hbox to \pgf@imagewidth{% \vrule\kern-0.4pt% @@ -125,7 +127,7 @@ % \pgfdeclaremask[matte=white]{maskname}{maskfilename} % \pgfdeclareimage[mask=maskname]{image}{imagefilename} -\def\pgfdeclaremask{\@ifnextchar[\pgf@declaremask{\pgf@declaremask[]}} +\def\pgfdeclaremask{\pgf@ifnextchar[\pgf@declaremask{\pgf@declaremask[]}} \def\pgf@declaremask[#1]#2#3{% \setkeys{pgfmask}{matte={1 1 1}}% defaults \setkeys{pgfmask}{#1}% @@ -133,7 +135,7 @@ % Try to find the file \gdef\pgf@filename{}% \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#3}% - \ifx\pgf@filename\@empty% + \ifx\pgf@filename\pgf@empty% \PackageWarning{pgf}% {File "#3" not found when defining mask "#2".\MessageBreak Tried all extensions in "\pgfsys@imagesuffixlist"}% @@ -176,16 +178,16 @@ \def\pgfuseimage#1{% \def\pgf@imagename{pgf@image@#1}% \pgf@tryextensions{\pgf@imagename}{\pgfalternateextension}% - \expandafter\@ifundefined\expandafter{\pgf@imagename}% + \expandafter\pgf@ifundefined\expandafter{\pgf@imagename}% {\PackageError{pgf}{Undefined image "#1"}{}}% {{\leavevmode\csname\pgf@imagename\endcsname}}} \def\pgf@tryextensions#1#2{% \edef\pgf@args{[#2!]}\expandafter\pgf@@tryextensions\pgf@args{#1}} \def\pgf@@tryextensions[#1!#2]#3{% - \expandafter\@ifundefined\expandafter{#3.#1!#2}% + \expandafter\pgf@ifundefined\expandafter{#3.#1!#2}% {\def\pgf@temp{#2}% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \edef#3{#3!}% \else% \pgf@@tryextensions[#2]{#3}% @@ -226,7 +228,7 @@ % % \pgfimage[height=2cm]{filename} -\def\pgfimage{\@ifnextchar[\pgf@imagecom{\pgf@imagecom[]}} +\def\pgfimage{\pgf@ifnextchar[\pgf@imagecom{\pgf@imagecom[]}} \def\pgf@imagecom[#1]#2{% \pgfdeclareimage[#1]{pgflastimage}{#2}% \pgfuseimage{pgflastimage}} diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex index d97d742934e..7603b016a67 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaselayers.code.tex @@ -1,9 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaselayers.code.tex,v 1.2 2005/10/24 15:14:48 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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/pgfbaselayers.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ % Creates a new pgf layer @@ -86,7 +90,7 @@ \pgfsys@endscope% \fi% \def\pgf@test{#2}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% \else% \pgf@dolayer#2,\relax% \fi% @@ -102,7 +106,7 @@ \setbox\csname pgf@layerboxsaved@#1\endcsname=\box\csname pgf@layerbox@#1\endcsname% \fi% \def\pgf@test{#2}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% \else% \pgf@dosavelayer#2,\relax% \fi% @@ -118,7 +122,7 @@ \global\setbox\csname pgf@layerbox@#1\endcsname=\box\csname pgf@layerboxsaved@#1\endcsname% \fi% \def\pgf@test{#2}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% \else% \pgf@dorestorelayer#2,\relax% \fi% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasepatterns.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasepatterns.code.tex new file mode 100644 index 00000000000..2d6116f3ac2 --- /dev/null +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasepatterns.code.tex @@ -0,0 +1,178 @@ +% 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/pgfbasepatterns.code.tex,v 1.8 2006/10/11 15:22:25 tantau Exp $ + + +% Creates a new uncolored pattern +% +% #1 = pattern name +% #2 = lower left of bounding box +% #3 = upper right of bounding box +% #4 = step vector +% #5 = pattern code +% +% Description: +% +% Declares a new uncolored pattern. An uncolored pattern is a pattern +% that has no inherent color. When the pattern is used, a color for +% the pattern must be supplied. +% +% See the pdf-manual for more details on uncolored patterns. +% +% The bounding box must be a bounding box of the pattern cell. +% +% The step vector must provide the x- and y-step by which the cells +% are spaced. +% +% The pattern code should be pgf code that can be protocolled. +% +% The transformation matrix will be reset prior to invoking the +% pattern code. +% +% Example: +% +% \pgfdeclarepatternformonly{stars}{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +% {\pgfpoint{1cm}{1cm}}{ +% \pgftransformshift{\pgfpoint{.5cm}{.5cm}} +% \pgfpathmoveto{\pgfpointpolar{0}{4mm}} +% \pgfpathlineto{\pgfpointpolar{144}{4mm}} +% \pgfpathlineto{\pgfpointpolar{288}{4mm}} +% \pgfpathlineto{\pgfpointpolar{72}{4mm}} +% \pgfpathlineto{\pgfpointpolar{216}{4mm}} +% \pgfpathclose% +% \pgfusepath{stroke} +% } + +\def\pgfdeclarepatternformonly#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{0}} + +% Creates a new colored pattern +% +% #1 = pattern name +% #2 = lower left of bounding box +% #3 = upper right of bounding box +% #4 = step vector +% #5 = pattern code +% +% Description: +% +% Declares a new colored pattern. Such patterns have a one or more +% fixed inherent colors. See the pdf-manual for more details on +% uncolored patterns. +% +% The parameters have the same effect as for uncolored patterns. +% +% Example: +% +% \pgfdeclarepatterninherentlycolored{red stars}{\pgfpointorigin}{\pgfpoint{1cm}{1cm}} +% {\pgfpoint{1cm}{1cm}}{ +% \pgfsetfillcolor{red} +% \pgfsetstrokecolor{black} +% \pgftransformshift{\pgfpoint{.5cm}{.5cm}} +% \pgfpathmoveto{\pgfpointpolar{0}{4mm}} +% \pgfpathlineto{\pgfpointpolar{144}{4mm}} +% \pgfpathlineto{\pgfpointpolar{288}{4mm}} +% \pgfpathlineto{\pgfpointpolar{72}{4mm}} +% \pgfpathlineto{\pgfpointpolar{216}{4mm}} +% \pgfpathclose% +% \pgfusepath{stroke,fill} +% } + +\def\pgfdeclarepatterninherentlycolored#1#2#3#4#5{\pgf@declarepattern{#1}{#2}{#3}{#4}{#5}{1}} + +\def\pgf@declarepattern#1#2#3#4#5#6{% + \pgf@ifundefined{pgf@pattern@name@#1}{% + \pgfsysprotocol@getcurrentprotocol\pgf@pattern@temp% + {% + \pgfinterruptpath% + \pgfpicturetrue% + \pgf@relevantforpicturesizefalse% + \pgftransformreset% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% + \pgfsysprotocol@bufferedtrue% + \pgfsys@beginscope% + #5% + \pgfsys@endscope% + \pgfsysprotocol@getcurrentprotocol\pgf@pattern@code% + \global\let\pgf@pattern@code=\pgf@pattern@code% + \endpgfinterruptpath% + \pgf@process{#2}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{#3}% + \pgf@xb=\pgf@x% + \pgf@yb=\pgf@y% + \pgf@process{#4}% + \pgf@xc=\pgf@x% + \pgf@yc=\pgf@y% + % Now, build a name for the pattern + \@tempcnta=\pgf@pattern@number% + \advance\@tempcnta by1\relax% + \xdef\pgf@pattern@number{\the\@tempcnta}% + \expandafter\xdef\csname pgf@pattern@name@#1\endcsname{\the\@tempcnta}% + \expandafter\gdef\csname pgf@pattern@type@#1\endcsname{#6}% + \xdef\pgf@marshal{\noexpand\pgfsys@declarepattern + {\csname pgf@pattern@name@#1\endcsname} + {\the\pgf@xa}{\the\pgf@ya}{\the\pgf@xb}{\the\pgf@yb}{\the\pgf@xc}{\the\pgf@yc}{\pgf@pattern@code}{#6}}% + }% + \pgfsysprotocol@setcurrentprotocol\pgf@pattern@temp% + \expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\pgf@marshal% + } + {% + \PackageError{pgfbasepatterns}{Pattern `#1' already defined}{}% + }% +} + +\def\pgf@pattern@number{0}% + +\def\pgf@ifpatternisinherentlycolored#1#2#3{% + \expandafter\ifnum\csname pgf@pattern@type@#1\endcsname=1\relax#2\else#3\fi% +} + + + +% Set an pattern as fill color +% +% #1 = Name of the pattern +% #2 = Color to be used for the pattern. If the pattern is already +% colored, this parameter is ignored. +% +% Description: +% +% Sets the pattern for subsequent filling operations. +% +% Example: +% +% \pgfsetfillpattern{stars}{red} + +\def\pgfsetfillpattern#1#2{% + \pgf@ifundefined{pgf@pattern@name@#1}{% + \PackageError{pgfbasepatterns}{Undefined pattern `#1'}{}} + {% + \csname pgf@pattern@instantiate@#1\endcsname% + \expandafter\global\expandafter\let\csname pgf@pattern@instantiate@#1\endcsname=\relax% + \pgf@ifpatternisinherentlycolored{#1}{% + \pgfsys@setpatterncolored{\csname pgf@pattern@name@#1\endcsname}% + }{% + \colorlet{pgf@tempcolor}{#2}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \extractcolorspec{pgf@tempcolor}{\pgf@tempcolor}% + \expandafter\convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% + \expandafter\pgf@set@fill@patternuncolored\pgf@rgbcolor\relax{#1}% + }% + }% +} +\def\pgf@set@fill@patternuncolored#1,#2,#3\relax#4{% + \pgfsys@setpatternuncolored{\csname pgf@pattern@name@#4\endcsname}{#1}{#2}{#3}% +} + + + + +\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 index f3d9e4f49a7..ffebbfacc0f 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseplot.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseplot.code.tex,v 1.2 2005/07/06 15:58:57 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.4 2006/10/11 15:22:25 tantau Exp $ % PGF's plotting interface works as follows: @@ -103,7 +106,7 @@ \def\pgfplothandlerlineto{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@line@handler% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\relax% }% } @@ -130,8 +133,8 @@ \def\pgfplothandlerdiscard{% \def\pgf@plotstreamstart{% - \global\let\pgf@plotstreampoint=\@gobble% - \global\let\pgf@plotstreamspecial=\@gobble% + \global\let\pgf@plotstreampoint=\pgf@gobble% + \global\let\pgf@plotstreamspecial=\pgf@gobble% \global\let\pgf@plotstreamend=\relax% }% } @@ -200,7 +203,7 @@ \read1 to \pgf@temp% \let\par=\@@par% \edef\pgf@temp{\pgf@temp}% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \else\ifx\pgf@temp\pgf@partext% \else% \expandafter\pgf@parsexyline\pgf@temp\pgf@stop% @@ -245,7 +248,7 @@ \def\pgf@readxyzfile{% \read1 to \pgf@temp% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \else\ifx\pgf@temp\pgf@partext% \else% \expandafter\pgf@parsexyzline\pgf@temp\pgf@stop% @@ -287,7 +290,7 @@ \newwrite\pgf@plotwrite \newif\ifpgf@resample@plot -\def\pgfplotgnuplot{\@ifnextchar[{\pgf@plotgnuplot}{\pgf@plotgnuplot[\jobname]}}%} +\def\pgfplotgnuplot{\pgf@ifnextchar[{\pgf@plotgnuplot}{\pgf@plotgnuplot[\jobname]}}%} \def\pgf@plotgnuplot[#1]#2{% \pgf@resample@plottrue% % Check, whether it is up-to-date diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex index 494f328994d..b6e8140abe3 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbaseshapes.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbaseshapes.code.tex,v 1.9 2005/10/13 10:12:31 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.14 2006/10/11 15:22:25 tantau Exp $ \newbox\pgfnodeparttextbox @@ -33,11 +36,11 @@ % \pgfmultipartnode{rectangle}{center}{Hello}{hellonode}{\pgfusepath{stroke}} \def\pgfmultipartnode#1#2#3#4{% - \@ifundefined{pgf@sh@s@#1}% + \pgf@ifundefined{pgf@sh@s@#1}% {\PackageError{pgf}{Unknown shape ``#1''}{}}% {% {% - \let\pgf@sh@savedpoints=\@empty% + \let\pgf@sh@savedpoints=\pgf@empty% \csname pgf@sh@s@#1\endcsname% \pgf@sh@savedpoints% \pgftransformshift{% @@ -47,19 +50,20 @@ }% % Save the saved points and the transformation matrix \edef\pgf@test{#3}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@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% - \@ifundefined{pgf@sh@bbg@#1}{} + \pgf@ifundefined{pgf@sh@bbg@#1}{} {{\pgfscope\csname pgf@sh@bbg@#1\endcsname\endpgfscope}}% - \@ifundefined{pgf@sh@bg@#1}{}% + \pgf@ifundefined{pgf@sh@bg@#1}{}% {\csname pgf@sh@bg@#1\endcsname#4}% - \@ifundefined{pgf@sh@fbg@#1}{} + \pgf@ifundefined{pgf@sh@fbg@#1}{} {{\pgfscope\csname pgf@sh@fbg@#1\endcsname\endpgfscope}}% {% \expandafter\@for\expandafter\pgf@shape@com\expandafter:\expandafter=\csname pgf@sh@boxes@#1\endcsname\do{% @@ -69,11 +73,11 @@ }% }% }% - \@ifundefined{pgf@sh@bfg@#1}{}% + \pgf@ifundefined{pgf@sh@bfg@#1}{}% {{\pgfscope\csname pgf@sh@bfg@#1\endcsname\endpgfscope}}% - \@ifundefined{pgf@sh@fg@#1}{}% + \pgf@ifundefined{pgf@sh@fg@#1}{}% {\csname pgf@sh@fg@#1\endcsname#4}% - \@ifundefined{pgf@sh@ffg@#1}{}% + \pgf@ifundefined{pgf@sh@ffg@#1}{}% {{\pgfscope\csname pgf@sh@ffg@#1\endcsname\endpgfscope}}% }% }% @@ -115,7 +119,7 @@ \def\pgf@sh@resavedanchor#1#2{% \pgf@process{#2}% \edef\pgf@sh@marshal{% - \noexpand\g@addto@macro\noexpand\pgf@sh@savedpoints{% + \noexpand\pgf@g@addto@macro\noexpand\pgf@sh@savedpoints{% \noexpand\def\noexpand#1{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% }}% \pgf@sh@marshal% @@ -125,7 +129,7 @@ \def\pgf@sh@resaveddimen#1#2{% {#2\global\pgf@x=\pgf@x}% \edef\pgf@sh@marshal{% - \noexpand\g@addto@macro\noexpand\pgf@sh@savedpoints{% + \noexpand\pgf@g@addto@macro\noexpand\pgf@sh@savedpoints{% \noexpand\def\noexpand#1{\the\pgf@x}% }}% \pgf@sh@marshal% @@ -133,7 +137,7 @@ % Invoke an anchor \def\pgf@sh@reanchor#1#2{% - \@ifundefined{pgf@anchor@#1@#2}% + \pgf@ifundefined{pgf@anchor@#1@#2}% {% \setcounter{pgf@counta}{#2}% \csname pgf@anchor@#1@border\endcsname{\pgfpointpolar{\c@pgf@counta}{1pt}}% @@ -159,7 +163,7 @@ \def\pgfpointanchor#1#2{% % Ok, check whether #1 is known! - \@ifundefined{pgf@sh@ns@#1} + \pgf@ifundefined{pgf@sh@ns@#1} {\PackageError{pgf}{No shape named #1 is known}{}% \pgfpointorigin}% {% @@ -173,6 +177,8 @@ \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}% @@ -180,6 +186,24 @@ }% } +\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 @@ -201,7 +225,7 @@ \def\pgfpointshapeborder#1#2{% % Ok, check whether #1 is known! - \@ifundefined{pgf@sh@ns@#1} + \pgf@ifundefined{pgf@sh@ns@#1} {\PackageError{pgf}{No shape named #1 is known}{}% \pgfpointorigin}% {% @@ -216,6 +240,7 @@ \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{\pgfpoint{\pgf@xa}{\pgf@ya}}% @@ -224,6 +249,8 @@ \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}% @@ -326,15 +353,15 @@ \anchorborder{\csname pgf@anchor@#1@center\endcsname}% \anchor{text}{\pgfpointorigin}% \nodeparts{text}% - \expandafter\global\expandafter\let\csname pgf@sh@s@\shape@name\endcsname=\@empty% + \expandafter\global\expandafter\let\csname pgf@sh@s@\shape@name\endcsname=\pgf@empty% #2 } } \def\pgf@sh@savedanchor#1#2{% - \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resavedanchor{#1}{#2}}} + \expandafter\pgf@g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resavedanchor{#1}{#2}}} \def\pgf@sh@saveddimen#1#2{% - \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\pgf@sh@resaveddimen{#1}{#2}}} + \expandafter\pgf@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}} @@ -346,7 +373,7 @@ \def\pgf@sh@boxes#1{\expandafter\gdef\csname pgf@sh@boxes@\shape@name\endcsname{#1}} \def\pgf@sh@inheritsavedanchors[from=#1]{% - \expandafter\g@addto@macro\csname pgf@sh@s@\shape@name\endcsname{\csname pgf@sh@s@#1\endcsname}} + \expandafter\pgf@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 @@ -667,6 +694,27 @@ \def\northeast{\pgfpoint{\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{\pgfpoint{\pgf@pathminx}{\pgf@pathminy}}% + \def\northeast{\pgfpoint{\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{\pgfpoint{0pt}{0pt}}% + \def\northeast{\pgfpoint{\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} diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex index 00169368ae1..b4842e3dc29 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfbasesnakes.code.tex @@ -1,10 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfbasesnakes.code.tex,v 1.6 2005/10/25 08:18:14 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.9 2006/10/11 15:22:25 tantau Exp $ \newdimen\pgfsnakeremainingdistance \newdimen\pgfsnakecompleteddistance @@ -42,7 +45,7 @@ \long\def\pgfdeclaresnake#1#2#3{% \def\pgf@snake@name{#1}% - \@namedef{pgf@snake@@#1@initial}{#2}% + \pgf@namedef{pgf@snake@@#1@initial}{#2}% \let\pgf@orig@state=\state% \let\state=\pgf@snake@state #3 @@ -85,10 +88,10 @@ % \pgfpathlineto{\pgfpoint{10pt}{0pt}} % } -\def\pgf@snake@state#1{\@ifnextchar[{\pgf@@snake@start#1}{\pgf@@snake@start#1[]}}%} +\def\pgf@snake@state#1{\pgf@ifnextchar[{\pgf@@snake@start#1}{\pgf@@snake@start#1[]}}%} \def\pgf@@snake@start#1[#2]#3{% - \@namedef{pgf@snake@@\pgf@snake@name @#1@options}{#2}% - \@namedef{pgf@snake@@\pgf@snake@name @#1@code}{#3}% + \pgf@namedef{pgf@snake@@\pgf@snake@name @#1@options}{#2}% + \pgf@namedef{pgf@snake@@\pgf@snake@name @#1@code}{#3}% } @@ -122,7 +125,7 @@ \pgf@process{\pgfpointnormalised{}}% % ok, now computer length (arghh...) % In theory that's easy: divide the larger of the values x or y by - % the normalizes x or y. Well... + % the normalized x or y. Well... % % First, make xa and ya positive: \ifdim\pgf@xa<0pt% @@ -162,7 +165,7 @@ \pgf@xb=\pgf@x% \pgf@yb=\pgf@y% \@for\pgf@temp:=\pgf@list\do{% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \else% \expandafter\pgf@snake@invoke\pgf@temp% \fi% @@ -224,7 +227,7 @@ % \pgfpathsnakealongvector{zig zag}{100pt}{\pgfpolar{30}{1pt}} \def\pgfpathsnakealongvector#1#2#3{% - \@ifundefined{pgf@snake@@#1@initial}{\PackageError{pgf}{Undefined snake ``#1''}{}} + \pgf@ifundefined{pgf@snake@@#1@initial}{\PackageError{pgf}{Undefined snake ``#1''}{}} { \begingroup% keep things local \pgftransformreset% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex index 0a3df3dec31..80e932c4571 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex @@ -1,9 +1,13 @@ -\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcore.code.tex,v 1.3 2005/10/25 08:18:14 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.4 2006/10/11 15:22:25 tantau Exp $ \newif\ifpgf@draftmode diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex index 0283f40c4d2..d813fe20973 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.2 2005/07/10 20:11:23 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorearrows.code.tex,v 1.5 2006/10/11 15:22:25 tantau Exp $ % Sets the end arrow @@ -17,13 +20,13 @@ \def\pgfsetarrowsend#1{\pgf@arrowset{end}{#1}} \def\pgf@arrowset#1#2{% - \@ifundefined{pgf@arrow@code@#2} + \pgf@ifundefined{pgf@arrow@code@#2} {\PackageError{pgf}{Arrow #1 type ``#2'' unknown}{}} {% \edef\pgf@arrow@temp{#2}% - \ifx\pgf@arrow@temp\@empty% ah. clear! - \expandafter\let\csname pgf@#1arrow\endcsname=\@empty% - \expandafter\let\csname pgf@shorten@#1\endcsname=\@empty% + \ifx\pgf@arrow@temp\pgf@empty% ah. clear! + \expandafter\let\csname pgf@#1arrow\endcsname=\pgf@empty% + \expandafter\let\csname pgf@shorten@#1\endcsname=\pgf@empty% \else% %\pgf@arrow@prepare{#2}% \expandafter\def\csname pgf@#1arrow\endcsname{\pgf@arrow@call{#2}}% @@ -66,18 +69,18 @@ } \def\pgf@arrows@checked#1#2#3{% - \@ifundefined{pgf@arrow@code@#2}% + \pgf@ifundefined{pgf@arrow@code@#2}% {% \PackageError{pgf}{Arrow end type ``#2'' unknown}{}}% {% - \@ifundefined{pgf@arrow@code@\csname pgf@arrows@invert#1\endcsname} + \pgf@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{% - \@ifundefined{pgf@arrow@code@#2} + \pgf@ifundefined{pgf@arrow@code@#2} {#3}% {\PackageError{pgf}{Arrow end type ``#2'' already defined}{}}% } @@ -93,7 +96,7 @@ \let\pgfusepath=\pgf@nousepath@here% \pgf@relevantforpicturesizefalse% \pgftransformreset% - \pgfsysprotocol@setcurrentprotocol\@empty% + \pgfsysprotocol@setcurrentprotocol\pgf@empty% \pgfsysprotocol@bufferedtrue% \pgfsys@beginscope% \csname pgf@arrow@code@#1\endcsname% @@ -101,8 +104,8 @@ \pgfsysprotocol@getcurrentprotocol\pgf@@arrow@temp% \global\let\pgf@@arrow@temp=\pgf@@arrow@temp% \endpgfinterruptpath% - \expandafter\xdef\csname pgf@arrow@prot@#1@\the\pgflinewidth\endcsname{% - \noexpand\pgfsys@invoke{\pgf@@arrow@temp}}% + \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% @@ -265,9 +268,9 @@ % \pgfarrowsdeclarecombine*{|<}{>|}{|}{|}{<}{>} % \pgfarrowsdeclarecombine{<<}{>>}{<}{>}{<}{>} -\def\pgfarrowsdeclarecombine{\@ifnextchar*{\pgfarrowsdeclarecombine@star}{\pgf@@arrowsdeclarecombine}} +\def\pgfarrowsdeclarecombine{\pgf@ifnextchar*{\pgfarrowsdeclarecombine@star}{\pgf@@arrowsdeclarecombine}} -\def\pgf@@arrowsdeclarecombine{\@ifnextchar[{\pgf@arrowsdeclarecombine}{\pgf@arrowsdeclarecombine[0pt]}} +\def\pgf@@arrowsdeclarecombine{\pgf@ifnextchar[{\pgf@arrowsdeclarecombine}{\pgf@arrowsdeclarecombine[0pt]}} \def\pgf@arrowsdeclarecombine[#1]#2#3#4#5#6#7{% \pgf@arrows@check@already{#2}{#3}% {% @@ -303,7 +306,7 @@ }% } -\def\pgfarrowsdeclarecombine@star*{\@ifnextchar[{\pgf@arrowsdeclarecombine@star}{\pgf@arrowsdeclarecombine@star[0pt]}} +\def\pgfarrowsdeclarecombine@star*{\pgf@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}% {% @@ -353,9 +356,9 @@ % % \pgfarrowsdeclaredouble{<<}{>>}{<}{>} -\def\pgfarrowsdeclaredouble{\@ifnextchar[{\pgf@arrowsdeclaredouble}{\pgf@arrowsdeclaredouble[0pt]}} +\def\pgfarrowsdeclaredouble{\pgf@ifnextchar[{\pgf@arrowsdeclaredouble}{\pgf@arrowsdeclaredouble[0pt]}} \def\pgf@arrowsdeclaredouble[#1]#2#3#4#5{\pgfarrowsdeclarecombine[#1]{#2}{#3}{#4}{#5}{#4}{#5}} -\def\pgfarrowsdeclaretriple{\@ifnextchar[{\pgf@arrowsdeclaretriple}{\pgf@arrowsdeclaretriple[0pt]}} +\def\pgfarrowsdeclaretriple{\pgf@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}% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex index f417efcab54..3eb07f2897a 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex,v 1.3 2005/09/21 00:05:34 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.5 2006/10/11 15:22:25 tantau Exp $ % Globals @@ -63,7 +67,7 @@ \let\pgf@next=\relax% \else% \setlength\pgf@x{#1}% - \ifx\pgf@temp\@empty% + \ifx\pgf@temp\pgf@empty% \edef\pgf@temp{\the\pgf@x}% \else% \edef\pgf@temp{\pgf@temp,\the\pgf@x}% @@ -81,7 +85,7 @@ \def\pgfsetstrokecolor#1{% \colorlet{pgf@tempcolor}{#1}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% \expandafter\expandafter\expandafter\pgf@setstrokecolor\csname\string\color@pgf@tempcolor\endcsname% } \def\pgf@setstrokecolor#1#2#3#4#5{% @@ -95,7 +99,7 @@ \def\pgf@uncomma#1,{% \def\pgf@coltest{#1}% - \ifx\pgf@coltest\@empty% + \ifx\pgf@coltest\pgf@empty% \let\pgf@colnext=\relax% \else% \expandafter\def\expandafter\pgf@colmarshal\expandafter{\pgf@colmarshal{#1}}% @@ -113,7 +117,7 @@ \def\pgfsetfillcolor#1{% \colorlet{pgf@tempcolor}{#1}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% \expandafter\expandafter\expandafter\pgf@setfillcolor\csname\string\color@pgf@tempcolor\endcsname% } \def\pgf@setfillcolor#1#2#3#4#5{% @@ -135,7 +139,7 @@ \def\pgfsetcolor#1{% \colorlet{pgf@tempcolor}{#1}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgf@tempcolor}}% \expandafter\expandafter\expandafter\pgf@setcolor\csname\string\color@pgf@tempcolor\endcsname% } \def\pgf@setcolor#1#2#3#4#5{% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoremath.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoremath.code.tex index a05d934f12b..44c4e208d5c 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoremath.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoremath.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoremath.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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/pgfcoremath.code.tex,v 1.2 2006/10/11 15:22:25 tantau Exp $ % Mathematical stuff diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex index fd12c5d9146..557558d82ef 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreobjects.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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 diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex index 97df7f0cf34..f6c61229ff1 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex @@ -1,9 +1,14 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.1 2005/10/25 08:18:14 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex,v 1.5 2006/10/11 15:22:25 tantau Exp $ + \newdimen\pgf@path@lastx \newdimen\pgf@path@lasty @@ -197,6 +202,7 @@ \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. @@ -336,6 +342,30 @@ \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 @@ -481,6 +511,7 @@ + % Append a rectangle to the current path % % #1 = lower left corner point of rectangle @@ -528,7 +559,7 @@ \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}% \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}% \pgfpathclose% - \pgfpathmoveto{\pgfpoint{\pgf@xb}{\pgf@xb}}% + \pgfpathmoveto{\pgfpoint{\pgf@xb}{\pgf@yb}}% } % Append a rectangle to the current path @@ -574,7 +605,7 @@ \define@key{pgfbase}{stepy}{\setlength{\pgf@y}{#1}\relax} \define@key{pgfbase}{step}{\pgf@process{#1}} -\def\pgfpathgrid{\@ifnextchar[{\pgf@pathgrid}{\pgf@pathgrid[]}} +\def\pgfpathgrid{\pgf@ifnextchar[{\pgf@pathgrid}{\pgf@pathgrid[]}} \def\pgf@pathgrid[#1]#2#3{% \setkeys{pgfbase}{stepx=1cm,stepy=1cm}% \setkeys{pgfbase}{#1}% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex index db2a9d7c068..4fbed5e37ea 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex,v 1.2 2005/10/03 15:52:27 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.4 2006/10/11 15:22:25 tantau Exp $ @@ -26,7 +30,7 @@ \def\pgfprocesspathcleanup#1{% {% - \let\pgf@newpath=\@empty% + \let\pgf@newpath=\pgf@empty% \expandafter\pgf@cleanupprocessor#1\pgf@stop% }% \let#1=\pgf@newpath% @@ -34,7 +38,7 @@ \def\pgf@cleanupprocessor#1{% \ifx#1\pgf@stop% - \let\next=\@gobble% ok, done + \let\next=\pgf@gobble% ok, done \else% \ifx#1\pgfsyssoftpath@movetotoken% \let\next=\pgf@cleanupmoveto% @@ -46,7 +50,7 @@ } \def\pgf@cleanupredo#1#2#3{% - \g@addto@macro\pgf@newpath{#1{#2}{#3}}% + \pgf@g@addto@macro\pgf@newpath{#1{#2}{#3}}% \pgf@cleanupprocessor% } @@ -54,7 +58,7 @@ \ifx#4\pgfsyssoftpath@movetotoken% % Ok, skip \else% - \g@addto@macro\pgf@newpath{#1{#2}{#3}}% + \pgf@g@addto@macro\pgf@newpath{#1{#2}{#3}}% \fi% \pgf@cleanupprocessor#4% } @@ -88,7 +92,7 @@ % % \pgfpointlastonpath is now \pgfpoint{40bp}{40bp} \def\pgfprocesspathextractpoints#1{% - \ifx#1\@empty% + \ifx#1\pgf@empty% \let\pgfpointfirstonpath=\pgfpointorigin% \let\pgfpointsecondonpath=\pgfpointorigin% \let\pgfpointsecondlastonpath=\pgfpointorigin% @@ -105,7 +109,7 @@ \let\pgfpointsecondonpath=\pgfpointfirstonpath% \let\pgfpointsecondlastonpath=\pgfpointfirstonpath% \let\pgfpointlastonpath=\pgfpointfirstonpath% - \let\next=\@gobble% + \let\next=\pgf@gobble% \else \let\next=\pgf@extractprocessorsecond% \fi% @@ -127,7 +131,7 @@ \let\pgfpointlastonpath=\pgfpointsecondonpath% \ifx#4\pgf@stop% % short path... - \let\next=\@gobble% + \let\next=\pgf@gobble% \else \let\next=\pgf@extractprocessorother% \fi% @@ -148,7 +152,7 @@ \def\pgfpointlastonpath{\pgfpoint{#2}{#3}}% \ifx#4\pgf@stop% % end! - \let\next=\@gobble% + \let\next=\pgf@gobble% \fi% \next#4% } @@ -171,14 +175,14 @@ \def\pgfprocesscheckclosed#1#2{% {% \global\let\pgf@proc@todo=\relax% - \let\pgfsyssoftpath@movetotoken=\@gobbletwo% - \let\pgfsyssoftpath@linetotoken=\@gobbletwo% - \let\pgfsyssoftpath@curvetosupportatoken=\@gobbletwo% - \let\pgfsyssoftpath@curvetosupportbtoken=\@gobbletwo% - \let\pgfsyssoftpath@curvetotoken=\@gobbletwo% - \def\pgfsyssoftpath@rectcornertoken{\gdef\pgf@proc@todo{#2}\@gobbletwo}% - \def\pgfsyssoftpath@rectsizetoken{\gdef\pgf@proc@todo{#2}\@gobbletwo}% - \def\pgfsyssoftpath@closepathtoken{\gdef\pgf@proc@todo{#2}\@gobbletwo}% + \let\pgfsyssoftpath@movetotoken=\pgf@gobbletwo% + \let\pgfsyssoftpath@linetotoken=\pgf@gobbletwo% + \let\pgfsyssoftpath@curvetosupportatoken=\pgf@gobbletwo% + \let\pgfsyssoftpath@curvetosupportbtoken=\pgf@gobbletwo% + \let\pgfsyssoftpath@curvetotoken=\pgf@gobbletwo% + \def\pgfsyssoftpath@rectcornertoken{\gdef\pgf@proc@todo{#2}\pgf@gobbletwo}% + \def\pgfsyssoftpath@rectsizetoken{\gdef\pgf@proc@todo{#2}\pgf@gobbletwo}% + \def\pgfsyssoftpath@closepathtoken{\gdef\pgf@proc@todo{#2}\pgf@gobbletwo}% #1% }% \pgf@proc@todo% @@ -204,7 +208,7 @@ \def\pgf@processroundcheck#1#2#3\pgfsyssoftpath@specialroundtoken#4\pgf@stop{% \def\pgf@test{#4}% - \ifx\pgf@test\@empty% + \ifx\pgf@test\pgf@empty% % ok, nothing to be done! \let#2=#1% \else% @@ -215,15 +219,15 @@ \def\pgf@@processround#1#2{% - \let\pgfprocess@newpath\@empty% - \let\pgfprocess@moveto\@empty% - \let\pgfprocess@firstto\@empty% - \let\pgfprocess@segment\@empty% + \let\pgfprocess@newpath\pgf@empty% + \let\pgfprocess@moveto\pgf@empty% + \let\pgfprocess@firstto\pgf@empty% + \let\pgfprocess@segment\pgf@empty% \pgf@xa=0pt% \pgf@ya=0pt% \expandafter\pgfprocess@round#1\pgf@stop{0pt}{0pt}% - \expandafter\g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% - \expandafter\g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% \let#2=\pgfprocess@newpath% } @@ -241,20 +245,20 @@ \fi% \fi% \else% - \ifx\pgfprocess@firstto\@empty% + \ifx\pgfprocess@firstto\pgf@empty% \def\pgfprocess@firstto{{#2}{#3}}% \fi% \pgf@xa=#2% \pgf@ya=#3% \ifx#1\pgfsyssoftpath@movetotoken% % ok, move old segment to newpath - \expandafter\g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% - \expandafter\g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@moveto}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@newpath\expandafter{\pgfprocess@segment}% \def\pgfprocess@moveto{#1{#2}{#3}}% - \let\pgfprocess@firstto=\@empty% - \let\pgfprocess@segment=\@empty% + \let\pgfprocess@firstto=\pgf@empty% + \let\pgfprocess@segment=\pgf@empty% \else% - \g@addto@macro\pgfprocess@segment{#1{#2}{#3}}% + \pgf@g@addto@macro\pgfprocess@segment{#1{#2}{#3}}% \fi% \let\next=\pgfprocess@round% \fi% @@ -263,7 +267,7 @@ } \def\pgfprocess@specialround#1#2#3{% - \ifx\pgfprocess@firstto\@empty% + \ifx\pgfprocess@firstto\pgf@empty% \def\pgfprocess@firstto{{#2}{#3}}% \fi% \let\next=\pgfprocess@round% default: do nothing @@ -319,7 +323,7 @@ } \def\pgfprocess@@specialround#1#2#3{% - \g@addto@macro\pgfprocess@segment{#1}% + \pgf@g@addto@macro\pgfprocess@segment{#1}% % calculate start coordinate of the curve \pgf@xb=#2% \pgf@yb=#3% @@ -332,7 +336,7 @@ \pgf@xa=\pgf@x% save start point of added curve \pgf@ya=\pgf@y% \edef\pgfprocess@addition{{\the\pgf@x}{\the\pgf@y}}% - \expandafter\g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% % % now add curve % @@ -352,7 +356,7 @@ \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\g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% }% % calculate second support: {% @@ -363,11 +367,11 @@ \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\g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% }% % add end: \edef\pgfprocess@addition{\noexpand\pgfsyssoftpath@curvetotoken{\the\pgf@xc}{\the\pgf@yc}}% - \expandafter\g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% + \expandafter\pgf@g@addto@macro\expandafter\pgfprocess@segment\expandafter{\pgfprocess@addition}% % % continue! % @@ -377,16 +381,16 @@ } \def\pgfprocess@specialroundcurveto#1#2#3#4#5#6{% - \g@addto@macro\pgfprocess@segment{#1{#2}{#3}#4{#5}{#6}}% supports + \pgf@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\@empty% + \ifx\pgfprocess@moveto\pgf@empty% \else% - \ifx\pgfprocess@firstto\@empty% + \ifx\pgfprocess@firstto\pgf@empty% \else% \expandafter\pgfprocess@@specialclosetarget\pgfprocess@firstto% \let\pgfprocess@continueafterrounding=\pgfprocess@cleanupafterclose% @@ -445,9 +449,9 @@ \def\pgfprocesspathreplacestartandend#1#2#3{% {% - \let\pgf@newpath=\@empty% - \let\pgf@prepath=\@empty% - \ifx#1\@empty% + \let\pgf@newpath=\pgf@empty% + \let\pgf@prepath=\pgf@empty% + \ifx#1\pgf@empty% \else% \pgf@process{#3}% \pgf@xa=\pgf@x% @@ -466,7 +470,7 @@ \def\pgf@temppath{#1{#2}{#3}}% \edef\pgf@newpath{\noexpand#1{\the\pgf@x}{\the\pgf@y}}% \ifx#4\pgf@stop% - \let\next=\@gobble% + \let\next=\pgf@gobble% \else% \let\next=\pgf@replaceprocessother% \fi% @@ -489,11 +493,11 @@ \def\pgf@@replaceprocessother#1#2#3#4{% \ifx#4\pgf@stop% \edef\pgf@newpathaddition{{\noexpand#1{\the\pgf@xa}{\the\pgf@ya}}}% - \expandafter\g@addto@macro\expandafter\pgf@newpath\pgf@newpathaddition% - \let\next=\@gobble% + \expandafter\pgf@g@addto@macro\expandafter\pgf@newpath\pgf@newpathaddition% + \let\next=\pgf@gobble% \else% - \g@addto@macro\pgf@temppath{#1{#2}{#3}}% - \g@addto@macro\pgf@newpath{#1{#2}{#3}}% + \pgf@g@addto@macro\pgf@temppath{#1{#2}{#3}}% + \pgf@g@addto@macro\pgf@newpath{#1{#2}{#3}}% \let\next=\pgf@replaceprocessother% \fi% \next#4% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex index 38bbdf07bba..0d5b5482a57 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.2 2005/07/17 22:34:19 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepathusage.code.tex,v 1.6 2006/10/11 15:22:25 tantau Exp $ % Stroke/fill/clip/etc. the current path. Depending on the options, @@ -36,18 +40,18 @@ \define@key{pgfup}{use as bounding box}[]{\def\pgf@up@bb{\pgf@relevantforpicturesizefalse}} \def\pgfusepath#1{% - \let\pgf@up@stroke\@empty% - \let\pgf@up@fill\@empty% - \let\pgf@up@clip\@empty% - \let\pgf@up@discard\@empty% - \let\pgf@up@bb\@empty% + \let\pgf@up@stroke\pgf@empty% + \let\pgf@up@fill\pgf@empty% + \let\pgf@up@clip\pgf@empty% + \let\pgf@up@discard\pgf@empty% + \let\pgf@up@bb\pgf@empty% \setkeys{pgfup}{#1}% \expandafter\def\expandafter\pgf@up@action\expandafter{\csname pgfsys@\pgf@up@fill\pgf@up@stroke\endcsname}% - \ifx\pgf@up@stroke\@empty% - \ifx\pgf@up@fill\@empty% - \ifx\pgf@up@clip\@empty% - \let\pgf@up@action=\@empty% - \pgfsyssoftpath@setcurrentpath\@empty% + \ifx\pgf@up@stroke\pgf@empty% + \ifx\pgf@up@fill\pgf@empty% + \ifx\pgf@up@clip\pgf@empty% + \let\pgf@up@action=\pgf@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \else% % only clipping \let\pgf@up@action=\pgfsys@discardpath% @@ -56,25 +60,28 @@ \fi% \pgfprocessround{\pgfsyssoftpath@currentpath}{\pgfsyssoftpath@currentpath}% change the current path % - % Check whether the path is stroked. If so, add half the path width + % Check whether the path is stroked. If so, add half the line width % to the bounding box. % \ifpgf@relevantforpicturesize% - \ifx\pgf@up@stroke\@empty% + \ifx\pgf@up@stroke\pgf@empty% \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% + \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\@empty% - \ifx\pgf@up@stroke\@empty% + \ifx\pgf@up@clip\pgf@empty% + \ifx\pgf@up@stroke\pgf@empty% \pgfsyssoftpath@invokecurrentpath% \pgfsyssoftpath@getcurrentpath\pgf@last@used@path% \pgf@up@action% @@ -85,7 +92,7 @@ \pgfsyssoftpath@invokecurrentpath% \pgfsyssoftpath@getcurrentpath\pgf@last@used@path% \pgf@up@action% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \pgf@add@arrows@as@needed% \else% \pgfsyssoftpath@invokecurrentpath% @@ -101,7 +108,7 @@ \pgf@relevantforpicturesizefalse% \fi% \pgf@up@bb% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \pgf@resetpathsizes% \ignorespaces% } @@ -128,13 +135,13 @@ \def\pgf@check@for@arrows{% \pgf@drawarrowsfalse% - \ifx\pgf@startarrow\@empty\else\pgf@drawarrowstrue\fi% - \ifx\pgf@endarrow\@empty\else\pgf@drawarrowstrue\fi% + \ifx\pgf@startarrow\pgf@empty\else\pgf@drawarrowstrue\fi% + \ifx\pgf@endarrow\pgf@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\@empty% + \ifx\pgf@arrowpath\pgf@empty% \pgf@drawarrowsfalse% \else% \pgfprocesscheckclosed{\pgf@arrowpath}{\pgf@drawarrowsfalse}% @@ -145,14 +152,14 @@ \newdimen\pgf@shorten@end@additional \newdimen\pgf@shorten@start@additional -\let\pgf@shorten@end=\@empty -\let\pgf@shorten@start=\@empty +\let\pgf@shorten@end=\pgf@empty +\let\pgf@shorten@start=\pgf@empty \def\pgf@shorten@path@as@needed{% \pgfprocesspathextractpoints{\pgf@arrowpath}% \let\pgf@arrow@next=\pgf@shorten@now% - \ifx\pgf@shorten@start\@empty% - \ifx\pgf@shorten@end\@empty% + \ifx\pgf@shorten@start\pgf@empty% + \ifx\pgf@shorten@end\pgf@empty% \ifdim\pgf@shorten@end@additional=0pt\relax% \ifdim\pgf@shorten@start@additional=0pt\relax% \let\pgf@arrow@next=\relax% @@ -169,33 +176,41 @@ \pgf@shorten@start% \advance\pgf@x by\pgf@shorten@start@additional% \pgf@xc=\pgf@x% - \pgf@process{\pgfpointlineatdistance{\pgf@xc}{\pgfpointfirstonpath}{\pgfpointsecondonpath}}% - \global\pgf@x=\pgf@x% - \global\pgf@y=\pgf@y% + \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\pgfpoint{\the\pgf@x}{\the\pgf@y}}% + \edef\pgfpointfirstonpath{\noexpand\pgfpoint{\the\pgf@xb}{\the\pgf@yb}}% + \edef\pgfpointsecondonpath{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% {% \pgf@x=0pt% \pgf@shorten@end% \advance\pgf@x by\pgf@shorten@end@additional% \pgf@xc=\pgf@x% - \pgf@process{\pgfpointlineatdistance{\pgf@xc}{\pgfpointlastonpath}{\pgfpointsecondlastonpath}}% - \global\pgf@x=\pgf@x% - \global\pgf@y=\pgf@y% + \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\pgfpoint{\the\pgf@x}{\the\pgf@y}}% + \edef\pgfpointlastonpath{\noexpand\pgfpoint{\the\pgf@xb}{\the\pgf@yb}}% + \edef\pgfpointsecondlastonpath{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}% \pgfprocesspathreplacestartandend{\pgf@arrowpath}{\pgfpointfirstonpath}{\pgfpointlastonpath}% \pgfsyssoftpath@setcurrentpath\pgf@arrowpath% } \def\pgf@add@arrows@as@needed{% - \ifx\pgf@startarrow\@empty% + \ifx\pgf@startarrow\pgf@empty% \else% \pgflowlevelobj% {\pgftransformarrow{\pgfpointsecondonpath}{\pgfpointfirstonpath}} {\pgf@startarrow}% \fi% - \ifx\pgf@endarrow\@empty% + \ifx\pgf@endarrow\pgf@empty% \else% \pgflowlevelobj% {\pgftransformarrow{\pgfpointsecondlastonpath}{\pgfpointlastonpath}} @@ -203,7 +218,7 @@ \fi% } -\let\pgf@startarrow=\@empty -\let\pgf@endarrow=\@empty +\let\pgf@startarrow=\pgf@empty +\let\pgf@endarrow=\pgf@empty \endinput diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex index 26e63666e02..e4cde74a4f8 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorepoints.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.5 2006/10/11 15:22:25 tantau Exp $ \newdimen\pgf@picminx \newdimen\pgf@picmaxx @@ -53,12 +57,29 @@ % % Example: % -% \pgfpathmoveto{\pgfpoint{2pt}{3cm}} +% \pgfpathmoveto{\pgfpoint{2pt+3cm}{3cm}} \def\pgfpoint#1#2{% \setlength\pgf@x{#1}% \setlength\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 @@ -283,6 +304,8 @@ % % 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: % @@ -380,19 +403,19 @@ -% Store a value in polar-coordinates +% A polar coordinate % % #1 = a degree -% #2 = a radius +% #2 = a radius -- either a dimension or two dimensions separated by a +% slash. % -% x = #2 * cos(#1) -% y = #2 * sin(#2) +% x = (first dimension in #2) * cos(#1) +% y = (second dimension in #2) * sin(#2) % % Example: % -% % Create a slanted rectangle -% % \pgfpathmoveto{\pgfpointpolar{30}{1cm}} +% \pgfpathlineto{\pgfpointpolar{30}{1cm/2cm}} \def\pgfpointpolar#1#2{% \pgfsincos{#1}% @@ -413,6 +436,83 @@ } +% 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{% + \pgfsincos{#1}% + \in@/{#2}% + \ifin@% + \pgf@polarxy@#2\@@% + \else% + \pgf@polarxy@#2/#2\@@% + \fi% + \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@#1/#2\@@{% + \pgf@xa=#1\pgf@y% + \pgf@ya=#2\pgf@x% +} + + + +% 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}% + \advance\pgf@x by #3\pgf@zx% + \advance\pgf@y by #3\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{% + \pgfsincos{#1}% + \pgf@xb=\pgf@sys@tonumber{\pgf@y}\pgf@xx% + \advance\pgf@xb by \pgf@sys@tonumber{\pgf@x}\pgf@yx% + \pgf@yb=\pgf@sys@tonumber{\pgf@y}\pgf@xy% + \advance\pgf@yb by \pgf@sys@tonumber{\pgf@x}\pgf@yy% + \pgfsincos{#2}% + \pgf@xc=\pgf@sys@tonumber{\pgf@y}\pgf@xb% + \advance\pgf@xc by \pgf@sys@tonumber{\pgf@x}\pgf@zx% + \pgf@yc=\pgf@sys@tonumber{\pgf@y}\pgf@yb% + \advance\pgf@yc by \pgf@sys@tonumber{\pgf@x}\pgf@zy% + \pgf@x=#3\pgf@xc% + \pgf@y=#3\pgf@yc% +} + % Store the vector #1 * x-vec + #2 * y-vec % @@ -800,7 +900,7 @@ \def\pgfextractx#1#2{% \pgf@process{#2}% - #1=1.00374\pgf@x\relax} + #1=\pgf@x\relax} % Extract the y-coordinate of a point to a dimensions @@ -816,7 +916,7 @@ \def\pgfextracty#1#2{% \pgf@process{#2}% - #1=1.00374\pgf@y\relax} + #1=\pgf@y\relax} \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 index 50c63ac22c7..84a432ceadb 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorequick.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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. diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex index f0b862575b7..bad6e237ecb 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex @@ -1,9 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.12 2005/11/15 17:46:37 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. + +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcorescopes.code.tex,v 1.18 2006/10/11 15:22:25 tantau Exp $ % Globals @@ -12,6 +16,61 @@ \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{\pgf@ifnextchar[{\use@pgflibrary}{\use@@pgflibrary}}%} +\def\use@pgflibrary[#1]{\use@@pgflibrary{#1}} +\def\use@@pgflibrary#1{% + \edef\pgf@list{#1}% + \@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=\pgf@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 @@ -27,7 +86,7 @@ % \end{pgfscope} \def\pgfscope{% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \pgfsys@beginscope% \pgf@resetpathsizes% \edef\pgfscope@linewidth{\the\pgflinewidth}% @@ -86,7 +145,7 @@ % \pgftransformshift{\pgfpoint{1cm}{0cm}} % \pgftext{Hello World!} -\def\pgftext{\@ifnextchar[\pgf@text{\pgf@text[]}}% +\def\pgftext{\pgf@ifnextchar[\pgf@text{\pgf@text[]}}% \def\pgf@text[#1]{% \def\pgf@text@options{#1}% \pgf@maketext\pgf@after@text} @@ -141,7 +200,7 @@ \let\next=% } \def\pgf@collectresetcolor{% - \@ifnextchar\reset@color% + \pgf@ifnextchar\reset@color% {\reset@color\afterassignment\pgf@collectresetcolor\let\pgf@temp=}% {\pgf@textdone}% } @@ -157,7 +216,6 @@ #1% \endpgfinterruptpicture% }}} - @@ -176,14 +234,16 @@ \def\pgfpicture{% \begingroup% - \pgfpicturetrue% - \pgf@picmaxx=-16000pt\relax% - \pgf@picminx=16000pt\relax% - \pgf@picmaxy=-16000pt\relax% - \pgf@picminy=16000pt\relax% - \pgf@relevantforpicturesizetrue% - \pgf@resetpathsizes% - \@ifnextchar\bgroup\pgf@oldpicture\pgf@picture} + \pgfpicturetrue% + \global\advance\pgf@picture@serial@count by1\relax% + \edef\pgfpictureid{pgfid@\the\pgf@picture@serial@count}% + \pgf@picmaxx=-16000pt\relax% + \pgf@picminx=16000pt\relax% + \pgf@picmaxy=-16000pt\relax% + \pgf@picminy=16000pt\relax% + \pgf@relevantforpicturesizetrue% + \pgf@resetpathsizes% + \pgf@ifnextchar\bgroup\pgf@oldpicture\pgf@picture} \def\pgf@oldpicture#1#2#3#4{% \setlength\pgf@picminx{#1}% \setlength\pgf@picminy{#2}% @@ -198,10 +258,10 @@ \pgfsys@beginpicture% \pgfsys@beginscope% \begingroup% - \color{.}% + \pgfsetcolor{.}% \pgfsetlinewidth{0.4pt}% \pgftransformreset% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \begingroup% \let\pgf@setlengthorig=\setlength% \let\pgf@addtolengthorig=\addtolength% @@ -214,8 +274,21 @@ \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: - \global\let\pgf@shift@baseline=\pgf@baseline% + \pgf@relevantforpicturesizefalse% + \pgf@process{\pgf@baseline}% + \gdef\pgf@shift@baseline{\the\pgf@y}% \endgroup% \hss% \egroup% @@ -228,14 +301,6 @@ \endgroup% \hss \egroup% - % ok, now let's position the box - \ifdim\pgf@picmaxx=-16000pt\relax% - % empty picture. make size 0. - \pgf@picmaxx=0pt\relax% - \pgf@picminx=0pt\relax% - \pgf@picmaxy=0pt\relax% - \pgf@picminy=0pt\relax% - \fi% \pgfsys@typesetpicturebox\pgfpic% \endgroup% } @@ -245,6 +310,41 @@ } + + +% 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 @@ -256,13 +356,12 @@ % % \pgfsetbaseline{1cm+2pt} -\def\pgfsetbaseline#1{\def\pgf@baseline{#1}} +\def\pgfsetbaseline#1{\pgfsetbaselinepointlater{\pgfpoint{0pt}{#1}}} \pgfsetbaseline{\pgf@picminy} - % Interrupt path % % Description: @@ -291,7 +390,7 @@ \edef\pgf@interrupt@savey{\the\pgf@path@lasty}% \pgf@getpathsizes\pgf@interrupt@pathsizes% \pgfsyssoftpath@getcurrentpath\pgf@interrupt@path% - \pgfsyssoftpath@setcurrentpath\@empty% + \pgfsyssoftpath@setcurrentpath\pgf@empty% \edef\pgfscope@linewidth{\the\pgflinewidth}% \let\pgf@interrupt@lastmoveto=\pgfsyssoftpath@lastmoveto% \begingroup% diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex index 707c1708789..2eebc7d6035 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreshade.code.tex,v 1.3 2005/07/17 22:34:19 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau +% +% This file may be distributed and/or modified % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% 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.6 2006/10/11 15:22:25 tantau Exp $ % % Parsing functions @@ -17,16 +20,16 @@ \edef\temp{{\pgf@rgbconv}}% \expandafter\pgf@@parsefunc\temp} \def\pgf@@parsefunc#1{% - \let\pgf@bounds=\@empty% - \let\pgf@funcs=\@empty% - \let\pgf@psfuncs=\@empty% - \let\pgf@encode=\@empty% - \let\pgf@sys@shading@ranges=\@empty% + \let\pgf@bounds=\pgf@empty% + \let\pgf@funcs=\pgf@empty% + \let\pgf@psfuncs=\pgf@empty% + \let\pgf@encode=\pgf@empty% + \let\pgf@sys@shading@ranges=\pgf@empty% \pgf@sys@shading@range@num=0\relax% \pgf@parsefirst[#1; ]% \pgf@parselastdom[#1; ]% \pgf@parsemid[#1; ]% - \ifx\pgf@bounds\@empty% + \ifx\pgf@bounds\pgf@empty% \edef\pgf@pdfparseddomain{0 1}% \edef\pgf@pdfparsedfunction{\pgf@singlefunc\space}% \else% @@ -51,7 +54,7 @@ \edef\pgf@prevcolor{\pgf@rgb}% \edef\pgf@firstcolor{\pgf@rgb}} \def\pgf@parselastdom[rgb(#1)=(#2,#3,#4); {% - \@ifnextchar]{% + \pgf@ifnextchar]{% \setlength\pgf@x{#1}% \edef\pgf@sys@shading@end@pos{\the\pgf@x}% \pgf@max=\pgf@x\relax% @@ -59,11 +62,11 @@ \edef\pgf@domb{\pgf@sys@tonumber{\pgf@x}}% \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% \edef\pgf@sys@shading@end@rgb{\pgf@sys@rgb}% - \@gobble}{\pgf@parselastdom[}} + \pgf@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% - \@ifnextchar]{% + \pgf@ifnextchar]{% \pgf@getrgbtuplewithmixin{#2}{#3}{#4}% \edef\pgf@singlefunc{\space% << /FunctionType 2 /Domain [0 1] /C0 @@ -76,7 +79,7 @@ \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% - \@gobble}{% + \pgf@gobble}{% \setlength\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}}}% @@ -98,7 +101,7 @@ \def\pgf@getrgbtuplewithmixin#1#2#3{% \definecolor{pgfshadetemp}{rgb}{#1,#2,#3}% - \@ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{pgfshadetemp}}% \extractcolorspec{pgfshadetemp}{\pgf@tempcolor}% \expandafter\convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% \expandafter\pgf@getrgb@@\pgf@rgbcolor!} @@ -113,15 +116,15 @@ \pgf@converttorgb#1]% } \def\pgf@converttorgb{% - \@ifnextchar]{\@gobble}%done! + \pgf@ifnextchar]{\pgf@gobble}%done! {% - \@ifnextchar;{\pgf@grabsemicolor}% + \pgf@ifnextchar;{\pgf@grabsemicolor}% {% - \@ifnextchar r{\pgf@grabrgb}% + \pgf@ifnextchar r{\pgf@grabrgb}% {% - \@ifnextchar g{\pgf@grabgray}% + \pgf@ifnextchar g{\pgf@grabgray}% {% - \@ifnextchar c{\pgf@grabcolor}% + \pgf@ifnextchar c{\pgf@grabcolor}% {\PackageError{pgfshade}{Illformed shading specification}{}\pgf@converttorgb}% }% @@ -171,15 +174,15 @@ % The following bar is 2cm long: \pgfuseshading{redtogreentoblue}. % \end{document} -\def\pgfdeclarehorizontalshading{\@ifnextchar[\pgf@declarehorizontalshading{\pgf@declarehorizontalshading[]}}% +\def\pgfdeclarehorizontalshading{\pgf@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\@empty% + \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgf@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=\@empty% + \expandafter\let\csname @pgfshading#2!\endcsname=\pgf@empty% \fi} @@ -200,15 +203,15 @@ % The following bar is 2cm high: \pgfuseshading{redtogreentoblue}. % \end{document} -\def\pgfdeclareverticalshading{\@ifnextchar[\pgf@declareverticalshading{\pgf@declareverticalshading[]}}% +\def\pgfdeclareverticalshading{\pgf@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\@empty% + \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgf@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=\@empty% + \expandafter\let\csname @pgfshading#2!\endcsname=\pgf@empty% \fi} @@ -242,15 +245,15 @@ % The following ball has diameter 3cm: \pgfuseshading{redtogreentoblue}. % \end{document} -\def\pgfdeclareradialshading{\@ifnextchar[\pgf@declareradialshading{\pgf@declareradialshading[]}}% +\def\pgfdeclareradialshading{\pgf@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\@empty% + \expandafter\ifx\csname pgf@deps@pgfshading#2!\endcsname\pgf@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=\@empty% + \expandafter\let\csname @pgfshading#2!\endcsname=\pgf@empty% \fi} @@ -266,19 +269,19 @@ \def\pgfuseshading#1{% \edef\pgf@shadingname{@pgfshading#1}% \pgf@tryextensions{\pgf@shadingname}{\pgfalternateextension}% - \expandafter\@ifundefined\expandafter{\pgf@shadingname}% + \expandafter\pgf@ifundefined\expandafter{\pgf@shadingname}% {\PackageError{pgfshade}{Undefined shading "#1"}{}}% {% {% \globalcolorsfalse% \def\pgf@shade@adds{}% - \@ifundefined{pgf@deps\pgf@shadingname}% + \pgf@ifundefined{pgf@deps\pgf@shadingname}% {}% {% \edef\@list{\csname pgf@deps\pgf@shadingname\endcsname}% \@for\@temp:=\@list\do{% {% - \@ifundefined{applycolormixins}{}{\applycolormixins{\@temp}}% + \pgf@ifundefined{applycolormixins}{}{\applycolormixins{\@temp}}% \extractcolorspec{\@temp}{\pgf@tempcolor}% \expandafter\convertcolorspec\pgf@tempcolor{rgb}{\pgf@rgbcolor}% \xdef\pgf@shade@adds{\pgf@shade@adds,\pgf@rgbcolor}% @@ -286,7 +289,7 @@ }% }% \expandafter\pgf@strip@shadename\pgf@shadingname!!% - \@ifundefined{@pgfshading\pgf@basename\pgf@shade@adds!}% + \pgf@ifundefined{@pgfshading\pgf@basename\pgf@shade@adds!}% {% {% \expandafter\def\expandafter\@temp\expandafter{\csname pgf@func\pgf@shadingname\endcsname}% @@ -352,6 +355,9 @@ % 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. % @@ -400,10 +406,31 @@ \pgfsys@transformcm% {\pgf@sys@tonumber{\pgf@y}}{\pgf@sys@tonumber{\pgf@x}}% {\pgf@sys@tonumber{\pgf@xa}}{\pgf@sys@tonumber{\pgf@y}}{0pt}{0pt}% + \ifx\pgf@shade@extra@transform\pgf@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=\pgf@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 index b9c1e51cff0..54eff0c9c0e 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex @@ -1,10 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.1.1.1 2005/06/29 12:14:04 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% 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. % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoretransformations.code.tex,v 1.4 2006/10/11 15:22:25 tantau Exp $ % Position transformations @@ -233,6 +236,37 @@ +% 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}}% +} @@ -333,12 +367,16 @@ -% The following two if's have the following effect: +% 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 @@ -347,6 +385,7 @@ % to the text, but you do want the rotation to applyu. \newif\ifpgfslopedattime +\newif\ifpgfallowupsidedownattime \newif\ifpgfresetnontranslationattime @@ -382,9 +421,12 @@ \pgf@process{#3}% \advance\pgf@x by-\pgf@xa% \advance\pgf@y by-\pgf@ya% - \ifdim\pgf@x<0pt% - \pgf@x=-\pgf@x% - \pgf@y=-\pgf@y% + \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% @@ -426,13 +468,16 @@ \pgftransformresetnontranslations% \fi% \ifpgfslopedattime% - \pgf@x=\pgf@xb% - \pgf@y=\pgf@yb% - \advance\pgf@x by-\pgf@xa% - \advance\pgf@y by-\pgf@ya% - \ifdim\pgf@x<0pt% - \pgf@x=-\pgf@x% - \pgf@y=-\pgf@y% + \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% |