diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:51:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:51:53 +0000 |
commit | c11a98e10de0410a50337e5ab4e3b63b210eec13 (patch) | |
tree | 690b00bd75ff04ce9740a64e6ab1aeaed65a3836 /Master/texmf-dist/tex/latex/bardiag/bardiag.bar | |
parent | 27ac78b71207f7568bad5b936aa5b3109e5eea82 (diff) |
bardiag
git-svn-id: svn://tug.org/texlive/trunk@692 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bardiag/bardiag.bar')
-rw-r--r-- | Master/texmf-dist/tex/latex/bardiag/bardiag.bar | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/bardiag/bardiag.bar b/Master/texmf-dist/tex/latex/bardiag/bardiag.bar new file mode 100644 index 00000000000..be523f105e2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/bardiag/bardiag.bar @@ -0,0 +1,82 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% bar primitives +\newcommand{\barRect}[6][fillstyle=solid] +{ + {\psframe[linestyle=none,fillcolor=#6,#1](#2,#3)(#4,#5)} +} +% - - - - - - +\newcommand{\xtd}{0} +\newcommand{\ytd}{0} +\newcommand{\xtda}{0} +\newcommand{\ytda}{0} +\newcommand{\xtdb}{0} +\newcommand{\ytdb}{0} + +\newcommand{\barTDRect}[6][fillstyle=solid] +{ +% + \psframe[linestyle=solid,fillcolor=#6,#1](#2,#3)(#4,#5) + + % let's draw polygons: left and upper + % left-> (#4;#3)(#4+\bdar\tdhor;#3+\dbar\tdver) + % (#4+\dbar\tdhor;#5+\dbar\tdver)(#4;#5) + % right->(#4;#5)(#4+\dbar\tdhor;#5+\dbar\tdver) + % (#3+\dbar\tdhor;#5+\dbar\tdver)(#2;#3) + % + + \FPmul{\xtd}{\dbar}{\tdhor} + \FPmul{\ytd}{\dbar}{\tdver} + + \FPfadd{\xtda}{#2}{\xtd} + \FPfadd{\xtdb}{#4}{\xtd} + \FPfadd{\ytda}{#3}{\ytd} + \FPfadd{\ytdb}{#5}{\ytd} + + \pspolygon[linestyle=solid,fillcolor=#6,#1](#4,#3)(\xtdb,\ytda)(\xtdb,\ytdb)(#4,#5)(#4,#3) + \pspolygon[linestyle=solid,fillcolor=#6,#1](#4,#5)(\xtdb,\ytdb)(\xtda,\ytdb)(#2,#5)(#4,#5) +} + +\newcommand{\elRx}{0} +\newcommand{\elRy}{0} +\newcommand{\barCylinder}[6][none] +{ + \FPmul{\xtd}{\dbar}{\tdx} + \FPmul{\ytd}{\dbar}{\tdy} + + \FPdiv{\elRx}{\dbar}{2} + \FPdiv{\elRy}{\ytd}{2} + + \ifthenelse{\bdorientation = \bdvert} + { + \FPfadd{\tmpvar}{#2}{#4} + \FPdiv{\xtda}{\tmpvar}{2} % Xcenter of the bottom ellipse + \FPdiv{\tmpvar}{\ytd}{2} + \FPfadd{\ytda}{\tmpvar}{#3} % Ycenter of the bottom ellipse + % Draw the bottom ellipse + \psellipse[fillstyle=solid,fillcolor=#6](\xtda,\ytda)(\elRx,\elRy) + \FPdiv{\tmpvar}{\ytd}{2} + \FPfadd{\ytdb}{\tmpvar}{#5} % Ycenter of the top ellipse + % Draw the rectangle + \psframe[fillstyle=solid,fillcolor=#6,linecolor=#6](#2,\ytda)(#4,\ytdb) + \psline(#2,\ytda)(#2,\ytdb) + \psline(#4,\ytda)(#4,\ytdb) + % Draw the top ellipse + \psellipse[fillstyle=solid,fillcolor=#6](\xtda,\ytdb)(\elRx,\elRy) + } + { \FPfadd{\tmpvar}{#3}{#5} + \FPdiv{\ytda}{\tmpvar}{2} + \FPdiv{\tmpvar}{\ytd}{2} + \FPfadd{\xtda}{\tmpvar}{#2} + % Draw the left ellipse + \psellipse[fillstyle=solid,fillcolor=#6](\xtda,\ytda,)(\elRy,\elRx) + \FPdiv{\tmpvar}{\ytd}{2} + \FPfadd{\ytdb}{\tmpvar}{#4} + % Draw the rectangle + \psframe[fillstyle=solid,fillcolor=#6,linecolor=#6](\xtda,#3)(\ytdb,#5) + \psline(\xtda,#3)(\ytdb,#3) + \psline(\xtda,#5)(\ytdb,#5) + % Draw the right ellipse + \psellipse[fillstyle=solid,fillcolor=#6](\ytdb,\ytda)(\elRy,\elRx) + } +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |