diff options
Diffstat (limited to 'graphics/pgf/base/tex/pgfcomp-version-0-65.sty')
-rw-r--r-- | graphics/pgf/base/tex/pgfcomp-version-0-65.sty | 719 |
1 files changed, 719 insertions, 0 deletions
diff --git a/graphics/pgf/base/tex/pgfcomp-version-0-65.sty b/graphics/pgf/base/tex/pgfcomp-version-0-65.sty new file mode 100644 index 0000000000..571f2e5b3c --- /dev/null +++ b/graphics/pgf/base/tex/pgfcomp-version-0-65.sty @@ -0,0 +1,719 @@ +% 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. + +\RequirePackage{pgfrcs} + +\ProvidesPackageRCS{pgfcomp-version-0-65.sty} + +\def\pgfdirection#1{\csname pgf@direction#1\endcsname} + +\def\pgf@directionn{90} +\def\pgf@directionnorth{90} +\def\pgf@directionabove{90} +\def\pgf@directions{270} +\def\pgf@directionsouth{270} +\def\pgf@directionbelow{270} +\def\pgf@directionw{180} +\def\pgf@directionwest{180} +\def\pgf@directionleft{180} +\def\pgf@directione{0} +\def\pgf@directioneast{0} +\def\pgf@directionright{0} +\def\pgf@directionne{45} +\def\pgf@directionse{315} +\def\pgf@directionnw{135} +\def\pgf@directionsw{-135} + + +\def\pgfpictureboxed#1#2#3#4{% + \pgfpicture{#1}{#2}{#3}{#4}% + \pgfmoveto{\pgfpoint{#1}{#2}}% + \pgflineto{\pgfpoint{#1}{#4}}% + \pgflineto{\pgfpoint{#3}{#4}}% + \pgflineto{\pgfpoint{#3}{#2}}% + \pgfclosestroke\ignorespaces} +\def\endpgfpictureboxed{\endpgfpicture} + +\def\pgfxyline(#1,#2)(#3,#4){% + \pgfmoveto{\pgfxy(#1,#2)}% + \pgflineto{\pgfxy(#3,#4)}% + \pgfstroke} + +\def\pgfxycurve(#1,#2)(#3,#4)(#5,#6)(#7,#8){% + \pgfmoveto{\pgfxy(#1,#2)}% + \pgfbezier{\pgfxy(#3,#4)}{\pgfxy(#5,#6)}{\pgfxy(#7,#8)}% + \pgfstroke} + +\def\pgfline#1#2{% + \pgfmoveto{#1}% + \pgflineto{#2}% + \pgfstroke} + +\let\pgflineto=\pgfpathlineto +\let\pgfmoveto=\pgfpathmoveto +\let\pgfcurveto=\pgfpathcurveto +\let\pgfbezier=\pgfpathcurveto +\let\pgfarc=\pgfpatharc + +\def\pgfzerocircle#1{\pgfcircle{\pgforigin}{#1}} +\def\pgfzeroellipse#1#2{\pgfellipse{\pgforigin}{#1}{#2}} +\def\pgfeofill{{\pgfseteorule\pgfsys@flushpath\pgfsys@fill}\pgf@resetpathsizes\ignorespaces} +\def\pgfeofillstroke{{\pgfseteorule\pgfsys@flushpath\pgfsys@fillstroke}\pgf@resetpathsizes\ignorespaces} +\def\pgf@perform@eofill{\pgfeofill} +\def\pgf@perform@eofillstroke{\pgfeofillstroke} +\let\pgfdiff=\pgfpointdiff +\let\pgfrelative=\pgfpointadd +\let\pgfpartway=\pgfpointlineattime +\let\pgfbackoff=\pgfpointlineatdistance +\def\pgflabel#1#2#3#4{% + % First, calculate base point + \pgfpointlineattime{#1}{#2}{#3}% + \pgf@xb=\pgf@x% + \pgf@yb=\pgf@y% + \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% + \pgf@process{\pgfpointnormalised{}}% x/y = normalised vector + \setlength\pgf@ya{#4}% + \pgf@xa=-\pgf@ya\relax% + \pgf@xa=\pgf@sys@tonumber{\pgf@y}\pgf@xa% + \pgf@ya=\pgf@sys@tonumber{\pgf@x}\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} +\let\pgfnormalise=\pgfpointnormalised +\let\pgfpolar=\pgfpointpolar +\let\pgforigin=\pgfpointorigin +\let\pgfclosepath=\pgfpathclose + +\def\pgfxy(#1,#2){\pgfpointxy{#1}{#2}} +\def\pgfxyz(#1,#2,#3){\pgfpointxyz{#1}{#2}{#3}} +\newcommand\pgfgrid[3][]{\pgfpathgrid[#1]{#2}{#3}\pgfqstroke} +\newcommand\pgfellipse[4][]{% + \pgfpathellipse{#2}{#3}{#4}% + \csname pgf@perform@#1\endcsname\ignorespaces +} +\newcommand\pgfcircle[3][]{\pgfellipse[#1]{#2}{\pgfpoint{#3}{0pt}}{\pgfpoint{0pt}{#3}}} +\newcommand\pgfrect[3][]{% + \pgfpathrectangle{#2}{#3}% + \csname pgf@perform@#1\endcsname% +} +\def\pgf@perform@stroke{\pgfqstroke} +\def\pgf@perform@fill{\pgffill} +\def\pgf@perform@fillstroke{\pgffillstroke} +\def\pgf@perform@clip{\pgfclip} + +\def\pgfsincos#1{% + \pgfmathparse{#1}% + \pgfmathcos@{#1}\pgf@y\pgfmathresult pt% + \pgfmathsin@{#1}\pgf@x\pgfmathresult pt% +} + +\let\pgfdegree=\pgfsincos + +\newenvironment{pgfmagnify}[2]{\pgflowlevelscope{\pgftransformcm{#1}{0}{0}{#2}{\pgfpointorigin}}}{\endpgflowlevelscope} +\newenvironment{pgftranslate}[1]{\pgflowlevelscope{\pgftransformshift{#1}}}{\endpgflowlevelscope} +\newcommand{\pgftranslateto}[1]{\pgflowlevel{\pgftransformshift{#1}}} +\newenvironment{pgfrotateby}[1]{% + \pgf@process{#1}% + \pgf@xa=-\pgf@x% + \edef\pgf@temp{\noexpand\pgflowlevelscope{\noexpand\pgftransformcm{\pgf@sys@tonumber{\pgf@y}}{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@xa}}{\pgf@sys@tonumber{\pgf@y}}{\noexpand\pgfpointorigin}}}% + \pgf@temp} +{\endpgflowlevelscope} + +\long\def\pgfputat#1#2{\begin{pgftranslate}{#1}#2\end{pgftranslate}} +\def\pgfputlabelrotated#1#2#3#4#5{% + \pgflabel{#1}{#2}{#3}{#4}% + \pgfputat{}{% + \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% + \pgfnormalise{}% x/y = normalised vector + \pgf@ya=-\pgf@y% + \pgfsys@transformcm{\pgf@sys@tonumber{\pgf@x}}{\pgf@sys@tonumber{\pgf@y}}{\pgf@sys@tonumber{\pgf@ya}}{\pgf@sys@tonumber{\pgf@x}}{0pt}{0pt}% + #5}% + \ignorespaces} +\def\pgfqcurveto#1#2#3#4#5#6{\pgfpathqcurveto{#1bp}{#2bp}{#3bp}{#4bp}{#5bp}{#6bp}} +\let\pgfqbezier=\pgfqcurveto +\def\pgfqlineto#1#2{\pgfpathqlineto{#1bp}{#2bp}} +\def\pgfqmoveto#1#2{\pgfpathqmoveto{#1bp}{#2bp}} +\let\pgfqstroke=\pgfusepathqstroke + +\def\pgfstroke{\pgfusepath{stroke}} +\def\pgfclip{\pgfusepath{clip}} +\def\pgffill{\pgfusepath{fill}} +\def\pgfclosestroke{\pgfpathclose\pgfusepath{stroke}} +\def\pgffillstroke{\pgfusepath{fill,stroke}} +\def\pgfstrokeclip{\pgfusepath{clip,stroke}} +\def\pgffillclip{\pgfusepath{clip,stroke}} +\def\pgfclosestrokeclip{\pgfpathclose\pgfusepath{stroke,clip}} +\def\pgffillstrokeclip{\pgfusepath{stroke,fill,clip}} +\def\pgfclearendarrow{\pgfsetendarrow{}} +\def\pgfclearstartarrow{\pgfsetstartarrow{}} + +\def\pgfputarrow#1#2#3{\pgflowlevelobj{\pgftransformarrow{#1}{#2}}{\pgfsys@setdash{}{0pt}#3}} + +\def\pgfsetstartarrow#1{\def\pgf@startarrow{#1}\def\pgf@shorten@start{\pgf@x=0.0pt}} +\def\pgfsetendarrow#1{\def\pgf@endarrow{#1}\def\pgf@shorten@end{\pgf@x=0.0pt}} + +\def\pgfdefarrow#1#2#3#4{% + \pgfdefobject{pgf@#1}{#2}{#3}{\pgfsys@setlinewidth{1bp}#4}% + \expandafter\gdef\csname#1\endcsname{% + \pgf@x=\pgflinewidth% + \pgf@y=\pgflinewidth% + \pgfuseobjectmagnify{pgf@#1}\ignorespaces}} +\def\pgfdefarrowabs#1#2#3#4{% + \pgfdefobject{pgf@#1}{#2}{#3}{\pgfarrowlinewidthscale{1}#4}% + \expandafter\gdef\csname#1\endcsname{% + \pgfuseobject{pgf@#1}\ignorespaces} + } +\def\pgfarrowlinewidthscale#1{\pgfsys@setlinewidth{#1bp}\ignorespaces} +\pgfdefarrow{pgfarrowsingle}{\pgfpoint{-7pt}{-5pt}}{\pgfpoint{3pt}{5pt}}{% + \pgfqmoveto{2}{0} + \pgfqlineto{-6}{4} + \pgfqlineto{-3}{0} + \pgfqlineto{-6}{-4} + \pgfusepathqfill} +\def\pgfarrowswap#1{\pgflowlevelobj{\pgftransformxscale{-1}}{#1}} +\def\pgfarrowcombine#1#2{% + #1% + \pgflowlevelobj{\pgftransformshift{\pgfpoint{-7\pgflinewidth}{0pt}}}{#2}} +\def\pgfarrowcombineloose#1#2{#1\pgflowlevelobj{\pgftransformshift{\pgfpoint{-14\pgflinewidth}{0pt}}}{#2}} +\def\pgfarrowdouble#1{\pgfarrowcombine{#1}{#1}} +\def\pgfarrowtriple#1{% + #1% + \pgflowlevelobj{\pgftransformshift{\pgfpoint{-7\pgflinewidth}{0pt}}}{#1}% + \pgflowlevelobj{\pgftransformshift{\pgfpoint{-14\pgflinewidth}{0pt}}}{#1}} +\pgfdefarrow{pgfarrowto}{\pgfpoint{-4pt}{-5pt}}{\pgfpoint{2pt}{5pt}}{% + \pgfarrowlinewidthscale{0.8} + \pgfsetdash{}{0pt} + \pgfsetroundcap + \pgfsetroundjoin + \pgfqmoveto{-3}{4} + \pgfqcurveto{-2.75}{2.5}{0}{0.25}{0.75}{0} + \pgfqcurveto{0}{-0.25}{-2.75}{-2.5}{-3}{-4} + \pgfusepathqstroke} +\pgfdefarrow{pgfarrowbar}{\pgfpoint{-1pt}{-6pt}}{\pgfpoint{1pt}{6pt}}{% + \pgfsetdash{}{0pt} + \pgfqmoveto{0}{-5} + \pgfqlineto{0}{5} + \pgfusepathqstroke} +\pgfdefarrow{pgfarrowsquare}{\pgfpoint{-4pt}{-6pt}}{\pgfpoint{1pt}{6pt}}{% + \pgfsetdash{}{0pt} + \pgfqmoveto{-3}{-5} + \pgfqlineto{0}{-5} + \pgfqlineto{0}{5} + \pgfqlineto{-3}{5} + \pgfusepathqstroke} +\pgfdefarrow{pgfarrowround}{\pgfpoint{-3pt}{-6pt}}{\pgfpoint{2pt}{6pt}}{% + \pgfsetdash{}{0pt} + \pgfqmoveto{-2}{-5} + \pgfqcurveto{1}{-3}{1}{3}{-2}{5} + \pgfusepathqstroke} +\pgfdefarrow{pgfarrowpointed}{\pgfpoint{-6pt}{-6pt}}{\pgfpoint{2pt}{6pt}}{% + \pgfsetdash{}{0pt} + \pgfqmoveto{-4.5}{-5} + \pgfqlineto{0.5}{0} + \pgfqlineto{-4.5}{5} + \pgfusepathqstroke} +\pgfdefarrow{pgfarrowdot}{\pgfpoint{-7pt}{-4pt}}{\pgfpoint{2pt}{4pt}}{% + \pgfsys@transformshift{-2.5bp}{0bp}% + \pgfsetdash{}{0pt} + \pgfpathqcircle{3bp} + \pgfusepathqfillstroke} +\pgfdefarrow{pgfarrowdiamond}{\pgfpoint{-12pt}{-4pt}}{\pgfpoint{2pt}{4pt}}{% + \pgfsetdash{}{0pt} + \pgfqmoveto{1}{0} + \pgfqlineto{-5}{3} + \pgfqlineto{-11}{0} + \pgfqlineto{-5}{-3} + \pgfpathclose + \pgfusepathqfillstroke} +\def\pgfarrowcircle#1{% + \pgfsetdash{}{0pt} + \setlength\pgf@xa{#1}% + \pgf@xb=\pgf@xa% + \advance\pgf@xa by-0.5\pgflinewidth + \begin{pgflowlevelscope}{\pgftransformshift{\pgfpoint{-\pgf@xa}{0pt}}}% + \pgfpathqcircle{\pgf@sys@tonumber{\pgf@xb}bp} + \pgfusepathqfillstroke + \end{pgflowlevelscope}} +\def\pgfarrowtriangle#1{% + \pgfsetdash{}{0pt} + \begin{pgfscope}% + \setlength\pgf@xa{#1}% + \pgf@ya=0.577\pgf@xa% + \advance\pgf@xb by-\pgflinewidth% + \pgfpathmoveto{\pgfpoint{-\pgf@xa}{-\pgf@ya}}% + \pgfpathlineto{\pgfpoint{\pgflinewidth}{0pt}}% + \pgfpathlineto{\pgfpoint{-\pgf@xa}{\pgf@ya}}% + \pgfpathclose% + \pgfusepathqfillstroke% + \end{pgfscope}} +\def\pgfarrowlargepointed#1{% + \pgfsetdash{}{0pt} + \begin{pgfscope}% + \setlength\pgf@xa{#1}% + \pgfpathmoveto{\pgfpoint{-\pgf@xa}{-\pgf@xa}} + \pgfpathlineto{\pgfpointorigin} + \pgfpathlineto{\pgfpoint{-\pgf@xa}{\pgf@xa}} + \pgfusepathqstroke + \end{pgfscope}} + +\newcommand\pgfcorner[3][sw]{% + \pgf@process{#2}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{#3}% + \ifdim\pgf@xa<\pgf@x% + \pgf@xb=\pgf@x% + \pgf@x=\pgf@xa% + \pgf@xa=\pgf@xb% + \fi% + \ifdim\pgf@ya<\pgf@y% + \pgf@yb=\pgf@y% + \pgf@y=\pgf@ya% + \pgf@ya=\pgf@yb% + \fi% + \csname pgf@corner@#1\endcsname\relax% +} +\def\pgf@corner@se{\pgf@x=\pgf@xa} +\def\pgf@corner@ne{\pgf@x=\pgf@xa\pgf@y=\pgf@ya} +\def\pgf@corner@nw{\pgf@y=\pgf@ya} +\def\pgf@corner@sw{} +\def\pgf@corner@s{\pgf@x=.5\pgf@x\advance\pgf@x by.5\pgf@xa} +\def\pgf@corner@n{\pgf@x=.5\pgf@x\advance\pgf@x by.5\pgf@xa\pgf@y=\pgf@ya} +\def\pgf@corner@w{\pgf@y=.5\pgf@y\advance\pgf@y by.5\pgf@ya} +\def\pgf@corner@e{\pgf@y=.5\pgf@y\advance\pgf@y by.5\pgf@ya\pgf@x=\pgf@xa} + +% Defines a circle node of name #1 at position #3 of radius #4. +% +% #1 = a name +% #2 = ``stroke'' or ``fill'' or ``fillstroke'' or ``virtual'' (= draw +% nothing) +% #3 = a point +% #4 = a radius +% +% Example: +% +% \pgfnodecircle{mynode}[stroke]{\pgfxy(1,1)}{2cm} + +\def\pgfnodecircle#1[#2]#3#4{% + \pgf@process{#3}% + \expandafter\def\csname pgfno@#1\endcsname{\pgf@backoffcircle{#4}}% + \expandafter\def\csname pgfnob@#1\endcsname{\pgf@anglecircle{#4}}% + \expandafter\edef\csname pgfnom@#1\endcsname{\noexpand\pgf@x=\pgf@sys@tonumber{\pgf@x}pt\noexpand\pgf@y=\pgf@sys@tonumber{\pgf@y}pt}% + \expandafter\ifx\csname pgf@@#2\endcsname\pgf@@virtual% + \else% + \pgfcircle[#2]{\csname pgfnom@#1\endcsname}{#4}% + \fi\ignorespaces} + +\def\pgf@@virtual{} + + +% Defines a rectangular node of name #1 with center at position #3 and +% width/height vector #4 +% +% #1 = a name +% #2 = ``stroke'' or ``fill'' or ``fillstroke'' or ``virtual'' (= draw +% nothing) +% #3 = a center +% #4 = width/height vector +% +% Example: +% +% \pgfnoderect{mynode}[stroke]{\pgfxy(1,1)}{\pgfxy(2,2)} + +\def\pgfnoderect#1[#2]#3#4{% + \pgf@process{#3}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{#4}% + \pgf@x=.5\pgf@x% + \pgf@y=.5\pgf@y% + \expandafter\edef\csname pgfno@#1\endcsname{\noexpand\pgf@backoffrect% + {\pgf@sys@tonumber{\pgf@x}pt}{\pgf@sys@tonumber{\pgf@y}pt}}% + \expandafter\edef\csname pgfnob@#1\endcsname{\noexpand\pgf@anglerect% + {\pgf@sys@tonumber{\pgf@x}pt}{\pgf@sys@tonumber{\pgf@y}pt}}% + \expandafter\edef\csname + pgfnom@#1\endcsname{\noexpand\pgf@x=\pgf@sys@tonumber{\pgf@xa}pt\noexpand\pgf@y=\pgf@sys@tonumber{\pgf@ya}pt}% + \expandafter\ifx\csname pgf@@#2\endcsname\pgf@@virtual% + \else% + \advance\pgf@xa by-\pgf@x% + \advance\pgf@ya by-\pgf@y% + \edef\pgf@temp{\noexpand\pgf@x=\pgf@sys@tonumber{\pgf@xa}pt\noexpand\pgf@y=\pgf@sys@tonumber{\pgf@ya}pt}% + \pgfrect[#2]{\pgf@temp}{#4}% + \fi\ignorespaces} + + +% Defines a rectangular node of name #1 with center at position #3 +% contaning a box #4 +% +% #1 = a name +% #2 = ``stroke'' or ``fill'' or ``fillstroke'' or ``virtual'' (= draw +% nothing) +% #3 = a center +% #4 = TeX text that will be boxed +% #5 = a horizontal border offset +% #6 = a vertical border offset +% +% Example: +% +% \pgfnodebox{mynode}[stroke]{\pgfxy(1,1)}{start}{2pt}{2pt} + +\def\pgfnodebox#1[#2]#3#4#5#6{% + \pgf@makehbox{#4}% + \pgf@x=\wd\pgf@hbox% + \pgf@y=\ht\pgf@hbox% + \advance\pgf@y by \dp\pgf@hbox% + \addtolength\pgf@x{#5}% + \addtolength\pgf@x{#5}% + \addtolength\pgf@y{#6}% + \addtolength\pgf@y{#6}% + \edef\pgf@boxsize{\noexpand\pgf@x=\the\pgf@x\noexpand\pgf@y=\the\pgf@y}% + \csname pgf@haligncompcenter\endcsname% + \csname pgf@valigncompcenter\endcsname% + \wd\pgf@hbox=0pt% + \pgfputat{#3}{% + \pgfsys@hbox\pgf@hbox}% + \pgfnoderect{#1}[#2]{#3}{\pgf@boxsize}\ignorespaces} + + + + +% Retrieves the center of #1. +% +% #1 = a node name +% +% Example: +% +% \pgfpathmoveto{\pgfnodecenter{mynode}} + +\def\pgfnodecenter#1{% + \expandafter\ifx\csname pgfnom@#1\endcsname\relax% + \GenericError{\space\space\space\@spaces\@spaces\@spaces}% + {PGF Error: Node "#1" undefined.}{}{\@ehc}% + \pgfpoint{0pt}{0pt}% + \else\csname pgfnom@#1\endcsname\fi\ignorespaces} + + + +% Returns a position relative to the center of #1. +% +% #1 = a node name +% #2 = a direction (see \pgfdirection) +% #3 = a distance +% +% Example: +% +% \pgfpathmoveto{\pgfnoderelative{mynode}[north]{1cm}} + +\def\pgfnoderelative#1[#2]#3{% + \pgfrelative{\pgfnodecenter{#1}}{\pgfpolar{\pgfdirection{#2}}{#3}}\ignorespaces} + + + +% Retrieves a border point of #1 at angle #2 and distance #3 from +% border. +% +% #1 = a node name +% #2 = an angle +% #3 = a distance from the border +% +% Example: +% +% \pgfpathmoveto{\pgfnodeborder{first}{30}{0pt}} +% \pgfpathlineto{\pgfnodeborder{second}{180}{2pt}} +% \pgfstroke + +\def\pgfnodeborder#1#2#3{% + \csname pgfnob@#1\endcsname{#3}{#2}{\pgfnodecenter{#1}}\ignorespaces} + + + +% Gives the beginning of a connection of #2 and #3, taking a +% separation distance of #1 into account. +% +% #1 = a separation distance +% #2 = a node name +% #3 = a second node name +% +% Example: +% +% \pgfpathmoveto{\pgfnodeconnstart{first}{second}} +% \pgfpathlineto{\pgfnodeconnstart{second}{first}} + +\def\pgfnodeconnstart[#1]#2#3{% + \csname pgfno@#2\endcsname[#1]{\pgfnodecenter{#2}}{\pgfnodecenter{#3}}% + \ignorespaces} + + + +\newdimen\pgf@nodesepstart +\newdimen\pgf@nodesepend + +% Sets the node separation for starts of lines. +% +% #1 = a distance +% +% Example: +% +% \pgfnodesetsepstart{2pt} + +\def\pgfnodesetsepstart#1{\setlength\pgf@nodesepstart{#1}\ignorespaces} + +\pgfnodesetsepstart{0pt} + + +% Sets the node separation for end of lines. +% +% #1 = a distance +% +% Example: +% +% \pgfnodesetsepend{2pt} + +\def\pgfnodesetsepend#1{\setlength\pgf@nodesepend{#1}\ignorespaces} + +\pgfnodesetsepend{0pt} + + + + +% Draws a line from #1 to #2. +% +% #1 = a node name +% #2 = a second node name +% +% Example: +% +% \pgfnodeconnline{first}{second} + +\def\pgfnodeconnline#1#2{% + \pgfpathmoveto{\pgfnodeconnstart[\pgf@nodesepstart]{#1}{#2}}% + \pgfpathlineto{\pgfnodeconnstart[\pgf@nodesepend]{#2}{#1}}% + \pgfstroke% + \ignorespaces} + + + +% Draws a curve from #1 to #2. The starting angle at #1 is #3 and the +% length to the first support point is #5. The starting angle at #2 +% is #4 and the length to the second support point is #6. +% +% #1 = a node name +% #2 = a second node name +% #3 = angle at first node +% #4 = angle at second node +% #5 = distance to support point at first node +% #6 = distance to support point at second node +% +% Example: +% +% \pgfnodeconncurve{first}{second}{10}{-10}{1cm}{1cm} + +\def\pgfnodeconncurve#1#2#3#4#5#6{% + \pgfpathmoveto{\pgfnodeborder{#1}{#3}{\pgf@nodesepstart}}% + \pgfpathcurveto{\pgfnodeborder{#1}{#3}{#5}}{\pgfnodeborder{#2}{#4}{#6}}% + {\pgfnodeborder{#2}{#4}{\pgf@nodesepend}}% + \pgfstroke\ignorespaces} + + + + +% Put a label on a line from #1 to #2. +% +% #1 = a node name +% #2 = a second node name +% #3 = fraction of way from #1 to #2 +% #4 = vertical offset +% #5 = label +% +% Example: +% +% \pgfnodelabel{first}{second}[.5][2pt]{\pgfbox[center,base]{owns}} + +\def\pgfnodelabel#1#2[#3][#4]#5{% + \pgfputat{\pgflabel% + {#3}% + {\pgfnodeconnstart[\pgf@nodesepstart]{#1}{#2}}% + {\pgfnodeconnstart[\pgf@nodesepend]{#2}{#1}}% + {#4}}% + {#5}\ignorespaces} + + +% Put a rotated label on a line from #1 to #2. +% +% #1 = a node name +% #2 = a second node name +% #3 = fraction of way from #1 to #2 +% #4 = vertical offset +% #5 = label +% +% Example: +% +% \pgfnodelabelrotated{first}{second}[.5][2pt]{\pgfbox[center,base]{owns}} + +\def\pgfnodelabelrotated#1#2[#3][#4]#5{% + \pgfputlabelrotated% + {#3}% + {\pgfnodeconnstart[\pgf@nodesepstart]{#1}{#2}}% + {\pgfnodeconnstart[\pgf@nodesepend]{#2}{#1}}% + {#4}% + {#5}\ignorespaces} + + + +% Internals + +\def\pgf@backoffcircle#1[#2]#3#4{% + % Calculate backoff for a circle of radius + % #1 and offset separation #2. #3 is the center of the circle, #4 + % is the target point. + \setlength\pgf@x{#1}% + \addtolength\pgf@x{#2}% + \edef\pgf@temp{{\pgf@sys@tonumber{\pgf@x}pt}}% + \expandafter\pgfbackoff\pgf@temp{#3}{#4}\ignorespaces} + +\def\pgf@mult#1#2#3{#1=#2#3} + +\def\pgf@anglecircle#1#2#3#4{% + % Calculate border point. #1 is radius, #2 is additional backoff, #3 + % is an angle, #4 is the center of the circle. + \pgfsincos{#3}% + \setlength\pgf@xa{#1}% + \addtolength\pgf@xa{#2}% + \pgf@ya=\pgf@xa\relax% + \pgf@mult{\pgf@xa}{\pgf@sys@tonumber{\pgf@x}}{\pgf@xa}% + \pgf@mult{\pgf@ya}{\pgf@sys@tonumber{\pgf@y}}{\pgf@ya}% + \pgf@process{#4}% + \advance\pgf@y by\pgf@xa\relax% + \advance\pgf@x by\pgf@ya\ignorespaces} + +\def\pgf@backoffrect#1#2[#3]#4#5{% + % Calculate backoff for a rect with half width #1, + % half height #2, offset separation #3. #4 is the center of the rect, #5 + % is the target point. + \pgfdiff{#4}{#5}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \setlength\pgf@xb{#1}% + \setlength\pgf@yb{#2}% + \addtolength\pgf@xb{#3}% + \addtolength\pgf@yb{#3}% + \ifnum\pgf@xa<0\relax% move into first quadrant + \pgf@x=-\pgf@x% + \fi% + \ifnum\pgf@ya<0\relax% + \pgf@y=-\pgf@y% + \fi% + \c@pgf@counta=\pgf@x% + \c@pgf@countb=\pgf@y% + \divide\c@pgf@counta by 256\relax% + \divide\c@pgf@countb by 256\relax% + \ifnum\c@pgf@countb<\c@pgf@counta% + \ifnum\c@pgf@counta<1\relax% + \pgf@y=\pgf@yb\relax% + \pgf@x=0pt\relax% + \else% + \pgf@y=16\pgf@y% + \divide\pgf@y by \c@pgf@counta% + \pgf@y=16\pgf@y% + \pgf@mult{\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<1\relax% + \pgf@x=\pgf@xb\relax% + \pgf@y=0pt\relax% + \else% + \pgf@x=16\pgf@x% + \divide\pgf@x by \c@pgf@countb% + \pgf@x=16\pgf@x% + \pgf@mult{\pgf@x}{\pgf@sys@tonumber{\pgf@yb}}{\pgf@x}% + \pgf@y=\pgf@yb% + \fi% + \fi% + \fi% + \else% + \ifnum\c@pgf@countb<1\relax% + \pgf@x=\pgf@xb\relax% + \pgf@y=0pt\relax% + \else% + \pgf@x=16\pgf@x% + \divide\pgf@x by \c@pgf@countb% + \pgf@x=16\pgf@x% + \pgf@mult{\pgf@x}{\pgf@sys@tonumber{\pgf@yb}}{\pgf@x}% + \ifnum\pgf@x<\pgf@xb% + \pgf@y=\pgf@yb% + \else% + \ifnum\c@pgf@counta<1\relax% + \pgf@y=\pgf@yb\relax% + \pgf@x=0pt\relax% + \else% + \pgf@y=16\pgf@y% + \divide\pgf@y by \c@pgf@counta% + \pgf@y=16\pgf@y% + \pgf@mult{\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% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgf@process{#4}% + \advance\pgf@x by\pgf@xa% + \advance\pgf@y by\pgf@ya\ignorespaces} + +\def\pgf@anglerect#1#2#3#4#5{% + % Calculate border point. #1/#2 is half width/height, #3 is additional backoff, #4 + % is an angle, #5 is the center of the rect. + \pgfsincos{#4}% + \pgf@xa=100\pgf@x% + \pgf@ya=100\pgf@y% + \pgf@process{#5}% + \advance\pgf@x by\pgf@ya% + \advance\pgf@y by\pgf@xa% + \edef\pgf@temp{{\noexpand\pgf@x=\the\pgf@x\noexpand\pgf@y=\the\pgf@y}}% + \expandafter\pgf@caller\pgf@temp{#1}{#2}{#3}{#5}\ignorespaces} + +\def\pgf@caller#1#2#3#4#5{\pgf@backoffrect{#2}{#3}[#4]{#5}{#1}} + +\long\def\pgfbox[#1,#2]#3{% + \pgf@makehbox{#3}% + \csname pgf@haligncomp#1\endcsname% + \csname pgf@valigncomp#2\endcsname% + \wd\pgf@hbox=0pt% + \ht\pgf@hbox=0pt% + \dp\pgf@hbox=0pt% + \pgfqbox{\pgf@hbox}% + \ignorespaces} + +\def\pgf@haligncompleft{}% do nothing +\def\pgf@haligncompcenter{\setbox\pgf@hbox=\hbox{\hskip-.5\wd\pgf@hbox\box\pgf@hbox}} +\def\pgf@haligncompright{\setbox\pgf@hbox=\hbox{\hskip-\wd\pgf@hbox\box\pgf@hbox}} +\def\pgf@valigncompbase{}% do nothing +\def\pgf@valigncompbottom{\setbox\pgf@hbox=\hbox{\raise\dp\pgf@hbox\box\pgf@hbox}} +\def\pgf@valigncompcenter{% + \setbox\pgf@hbox=\hbox{\raise.5\dp\pgf@hbox\hbox{\lower.5\ht\pgf@hbox\box\pgf@hbox}}}% +\def\pgf@valigncomptop{\setbox\pgf@hbox=\hbox{\lower\ht\pgf@hbox\box\pgf@hbox}} + + +\endinput |