diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/bardiag/doc/bardiag.cfg |
Initial commit
Diffstat (limited to 'graphics/bardiag/doc/bardiag.cfg')
-rw-r--r-- | graphics/bardiag/doc/bardiag.cfg | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/graphics/bardiag/doc/bardiag.cfg b/graphics/bardiag/doc/bardiag.cfg new file mode 100644 index 0000000000..b5910c1442 --- /dev/null +++ b/graphics/bardiag/doc/bardiag.cfg @@ -0,0 +1,126 @@ +% New colors defined +\definecolor{brown}{rgb}{.65, .16, .16} + +\definecolor{lightblue}{rgb}{.68, .85, .9} +\definecolor{lightred}{rgb}{1.0, .65, .65} + +\definecolor{darkyellow}{rgb}{0.6, 0.6, 0.3} + +\definecolor{palegreen}{rgb}{.6, .98, .6} +\definecolor{pink}{rgb}{1, .75, .8} +\definecolor{wheat}{rgb}{.96, .87, .7} +\definecolor{verylightgray}{gray}{0.95} + + +\newcommand{\arrowheight}{\dbar} +\newcommand{\arrowwidth}{\dbar} + +\newcommand{\ARbot}{0} +\newcommand{\RECTmid}{0} +\newcommand{\RECTwidth}{0.7} % 70% from \dbar +\newcommand{\RECTleft}{0} +\newcommand{\RECTright}{0} + +\newcommand{\mytempx}{0} +\newcommand{\mytempxx}{0} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Additional bar primitives % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\barArrowRect}[6][fillstyle=solid] +{\ifthenelse{\bdorientation = \bdvert} + {\FPfadd{\mytempx}{#2}{#4} + \FPdiv{\RECTmid}{\mytempx}{2} + + \FPfsub{\ARbot}{#5}{\arrowheight} + + \FPmul{\mytempx}{\dbar}{\RECTwidth} + \FPdiv{\mytempxx}{\mytempx}{2} + \FPfsub{\RECTleft}{\RECTmid}{\mytempxx} + \FPfadd{\RECTright}{\RECTmid}{\mytempxx} + + \psframe[linestyle=none,fillcolor=#6,linecolor=#6,#1](\RECTleft,#3)(\RECTright,\ARbot) + \pspolygon[fillcolor=#6,linecolor=#6,#1](#2,\ARbot)(\RECTmid,#5)(#4,\ARbot)(#2,\ARbot) + } + {\FPfadd{\mytempx}{#3}{#5} + \FPdiv{\RECTmid}{\mytempx}{2} + \FPfsub{\ARbot}{#4}{\arrowheight} + \FPmul{\mytempx}{\dbar}{\RECTwidth} + \FPdiv{\mytempxx}{\mytempx}{2} + \FPfsub{\RECTleft}{\RECTmid}{\mytempxx} + \FPfadd{\RECTright}{\RECTmid}{\mytempxx} + \psframe[linestyle=none,fillcolor=#6,linecolor=#6,#1](#2,\RECTleft)(\ARbot,\RECTright) + \pspolygon[fillcolor=#6,linecolor=#6,#1](\ARbot,#3)(#4,\RECTmid)(\ARbot,#5)(\ARbot,#3) + } +} +%--------------------------------------- +\newcommand{\barGradRect}[6][fillstyle=gradient] +{\ifthenelse{\bdorientation = \bdvert} + {\psframe[gradbegin=#6,gradend=white,gradmidpoint=1,gradangle=45, + fillstyle=gradient,linestyle=none,linecolor=#6](#2,#3)(#4,#5) + } + {\psframe[gradbegin=#6,gradend=white,gradmidpoint=1,gradangle=-45, + fillstyle=gradient,linestyle=none,linecolor=#6](#2,#3)(#4,#5) + } +} + +\newcommand{\barGradMidRect}[6][fillstyle=gradient] +{\ifthenelse{\bdorientation = \bdvert} + {\psframe[gradbegin=#6,gradend=white,gradmidpoint=0.3,gradangle=90, + fillstyle=gradient,linestyle=none,linecolor=#6](#2,#3)(#4,#5) + } + {\psframe[gradbegin=#6,gradend=white,gradmidpoint=0.3,gradangle=0, + fillstyle=gradient,linestyle=none,linecolor=#6](#2,#3)(#4,#5) + } +} +%--------------------------------------- +\newcommand{\barGradCylinder}[6][fillstyle=gradient] +{ \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 + \newpsstyle{gradcylstyle}{gradbegin=#6,gradend=white,gradmidpoint=0.25,gradangle=90,fillstyle=gradient,linestyle=none,linecolor=#6} + % Draw the bottom ellipse + \psellipse[style=gradcylstyle](\xtda,\ytda)(\elRx,\elRy) + \FPdiv{\tmpvar}{\ytd}{2} + \FPfadd{\ytdb}{\tmpvar}{#5} % Ycenter of the top ellipse + % Draw the rectangle + \psframe[style=gradcylstyle](#2,\ytda)(#4,\ytdb) + % Draw the top ellipse + \psellipse[fillstyle=solid,fillcolor=#6,linecolor=#6](\xtda,\ytdb)(\elRx,\elRy) + } + { \FPfadd{\tmpvar}{#3}{#5} + \FPdiv{\ytda}{\tmpvar}{2} + \FPdiv{\tmpvar}{\ytd}{2} + \FPfadd{\xtda}{\tmpvar}{#2} + \newpsstyle{gradcylstyle}{gradbegin=#6,gradend=white,gradmidpoint=0.25,gradangle=0,fillstyle=gradient,linestyle=none,linecolor=#6} + % Draw the left ellipse + \psellipse[style=gradcylstyle](\xtda,\ytda,)(\elRy,\elRx) + \FPdiv{\tmpvar}{\ytd}{2} + \FPfadd{\ytdb}{\tmpvar}{#4} + % Draw the rectangle + \psframe[style=gradcylstyle](\xtda,#3)(\ytdb,#5) + % Draw the right ellipse + \psellipse[fillstyle=solid,fillcolor=#6,linecolor=#6](\ytdb,\ytda)(\elRy,\elRx) + } +} +%--------------------------------------- +\newcommand{\barCoil}[6][qq] +{\ifthenelse{\bdorientation = \bdvert} + {\FPfadd{\mytempx}{#2}{#4} + \FPdiv{\RECTmid}{\mytempx}{2} + \pscoil[linecolor=#6,linewidth=3pt]{->}(\RECTmid,#3)(\RECTmid,#5) + } + {\FPfadd{\mytempx}{#3}{#5} + \FPdiv{\RECTmid}{\mytempx}{2} + \pscoil[linecolor=#5,linewidth=3pt]{->}(#2,\RECTmid)(#4,\RECTmid) + } +} |