diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty new file mode 100644 index 00000000000..bdf061ad417 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pgf/compatibility/pgfheaps.sty @@ -0,0 +1,103 @@ +\RequirePackage{pgfrcs} + +\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/latex/pgf/compatibility/pgfheaps.sty,v 1.2 2005/07/06 15:58:58 tantau Exp $ + +% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% +% This program can be redistributed and/or modified under the terms +% of the GNU Public License, version 2. + +\RequirePackage{pgf} + +\PackageWarning{pgfheaps}{This package is obsolete.} + +\ProcessOptions + +% +% Package for drawing heap diagrams. +% + +\newdimen\pgf@heapx +\newdimen\pgf@heapy + + + + +% Construct the path of a heap. +% +% #1 = Position of heap label. +% #2 = Position of left base +% #3 = Position of right base +% +% Example: +% +% \pgfheappath{\pgfxy(1,0)}{\pgfxy(-1,0)}{\pgfxy(1,0)} +% \pgffill + +\def\pgfheappath#1#2#3{% + \pgfdiff{#2}{#3}% + \pgf@heapx=-.25\pgf@x% + \pgf@heapy=-.25\pgf@y% + \pgfmoveto{#2}% + \pgfbezier% + {\pgfpartway{0.5}{#2}{\pgfrelative{#1}{\pgfpoint{\pgf@heapx}{\pgf@heapy}}}}% + {\pgfrelative{#1}{\pgfpoint{\pgf@heapx}{\pgf@heapy}}}% + {#1}% + \pgf@heapx=-\pgf@heapx% + \pgf@heapy=-\pgf@heapy% + \pgfbezier% + {\pgfrelative{#1}{\pgfpoint{\pgf@heapx}{\pgf@heapy}}}% + {\pgfpartway{0.5}{#3}{\pgfrelative{#1}{\pgfpoint{\pgf@heapx}{\pgf@heapy}}}}% + {#3}% + \ignorespaces} + + +% Draw a heap label. +% +% #1 = Position of heap label. +% #2 = Label text. +% +% Example: +% +% \pgfheaplabel{\pgfxy(1,0)}{Class P} + +\def\pgfheaplabel#1#2{% + \setbox\pgf@hbox=\hbox{\pgfinterruptpicture#2\endpgfinterruptpicture}% + \pgf@heapy=\ht\pgf@hbox% + \pgfputat{\pgfrelative{#1}{\pgfpoint{0pt}{-2\pgf@heapy}}}{\pgfbox[center,base]{#2}}% + \ignorespaces} + + +% Draw a labeled heap. +% +% #1 = Position of heap label. +% #2 = Position of left base +% #3 = Position of right base +% #4 = Label text. +% +% Example: +% +% \pgfheaplabeled{\pgfxy(1,0)}{\pgfxy(-1,0)}{\pgfxy(1,0)}{Class P} + +\def\pgfheaplabeled#1#2#3#4{% + \pgfheaplabel{#1}{#4}% + \pgfheappath{#1}{#2}{#3}% + \pgfstroke% + \ignorespaces} + + + +% Draw a labeled heap. +% +% #1 = Height of the label +% #2 = Left and right extension of the base. +% #3 = Label text. +% +% Example: +% +% \pgfheaplabeledcentered{1cm}{1cm}{Class P} + +\def\pgfheaplabeledcentered#1#2#3{% + \pgfheaplabeled{\pgfpoint{0pt}{#1}}{\pgfpoint{-#2}{0pt}}{\pgfpoint{#2}{0pt}}{#3}\ignorespaces} + +\endinput |