%%
%% This is file `pst-pdgr.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pst-pdgr.dtx  (with options: `tex')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from pst-pdgr.tex.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file pst-pdgr.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\csname PSTPedigreeLoaded\endcsname
\let\PSTPedigreeLoaded\endinput
\message{
[2006/04/18 v0.2a Medical Pedigree with PSTricks]
}
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
\ifx\PSTreeLoaded\endinput\else\input pst-tree.tex\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex\fi
\catcode`\@=11\relax
\pst@addfams{pst-pdgr}
\def\affectedbgcolor{gray}
\def\affectedfgcolor{white}
\def\affectedstyle{fillstyle=solid, fillcolor=\affectedbgcolor}
\def\pst@pdgr@instxtcolor{\relax}
\def\pst@pdgr@sex{0}
\define@choicekey[psset]{pst-pdgr}{sex}[\pst@pdgr@temp \pst@pdgr@sex]{%
  unknown,male,female}[unknown]{}
\def\pst@pdgr@condition{0}
\define@choicekey[psset]{pst-pdgr}{%
  condition}[\pst@pdgr@temp \pst@pdgr@condition]{%
  normal,obligatory,asymptomatic,affected}[normal]{}
\define@key[psset]{pst-pdgr}{unknown}[]{\psset{sex=unknown}}
\define@key[psset]{pst-pdgr}{male}[]{\psset{sex=male}}
\define@key[psset]{pst-pdgr}{female}[]{\psset{sex=female}}
\define@key[psset]{pst-pdgr}{normal}[]{\psset{condition=normal}}
\define@key[psset]{pst-pdgr}{obligatory}[]{\psset{condition=obligatory}}
\define@key[psset]{pst-pdgr}{asymptomatic}[]{\psset{condition=asymptomatic}}
\define@key[psset]{pst-pdgr}{affected}[]{\psset{condition=affected}}
\def\pst@pdgr@defineboolkey#1{%
\expandafter\newif\csname ifpst@pdgr@#1\endcsname%
\csname pst@pdgr@#1false\endcsname%
\define@key[psset]{pst-pdgr}{#1}[true]{%
  \@nameuse{pst@pdgr@#1##1}}}
\pst@pdgr@defineboolkey{deceased}
\pst@pdgr@defineboolkey{proband}
\pst@pdgr@defineboolkey{adopted}
\pst@pdgr@defineboolkey{evaluated}
\pst@pdgr@defineboolkey{sab}
\pst@pdgr@defineboolkey{infertile}
\pst@pdgr@defineboolkey{broken}
\pst@pdgr@defineboolkey{consanguinic}
\pst@pdgr@defineboolkey{monozygotic}
\pst@pdgr@defineboolkey{qzygotic}
\def\pst@pdgr@insidetext{}%
\define@key[psset]{pst-pdgr}{insidetext}{%
  \def\pst@pdgr@insidetext{#1}}%
\def\pst@pdgr@belowtext{}%
\define@key[psset]{pst-pdgr}{belowtext}{%
  \def\pst@pdgr@belowtext{#1}}%
\def\pst@pdgr@abovetext{}%
\define@key[psset]{pst-pdgr}{abovetext}{%
  \def\pst@pdgr@abovetext{#1}}%
\def\pst@pdgr@lefttext{}%
\define@key[psset]{pst-pdgr}{lefttext}{%
  \def\pst@pdgr@lefttext{#1}}%
\def\pst@pdgr@righttext{}%
\define@key[psset]{pst-pdgr}{righttext}{%
  \def\pst@pdgr@righttext{#1}}%
\def\pst@pdgr@descentnode{}%
\define@key[psset]{pst-pdgr}{descentnode}{%
  \def\pst@pdgr@descentnode{#1}}%
\def\pst@pdgr@rellinecmd{\ncline}%
\define@key[psset]{pst-pdgr}{rellinecmd}{%
  \def\pst@pdgr@rellinecmd{\@nameuse{#1}}}%
\def\pst@pdgr@abovetextrp{lB}%
\define@key[psset]{pst-pdgr}{abovetextrp}{%
  \def\pst@pdgr@abovetextrp{#1}}%
\def\pst@pdgr@belowtextrp{lt}%
\define@key[psset]{pst-pdgr}{belowtextrp}{%
  \def\pst@pdgr@belowtextrp{#1}}%
\def\pst@pdgr@lefttextrp{r}%
\define@key[psset]{pst-pdgr}{lefttextrp}{%
  \def\pst@pdgr@lefttextrp{#1}}%
\def\pst@pdgr@righttextrp{l}%
\define@key[psset]{pst-pdgr}{righttextrp}{%
  \def\pst@pdgr@righttextrp{#1}}%
\define@key[psset]{pst-pdgr}{addtwin}{\ncline{\pst@pdgr@tempnode}{#1}}%
\define@key[psset]{pst-pdgr}{descentnode}{%
  \def\pst@pdgr@descentnode{#1}}%
\def\pst@pdgr@descentnodepos{0.5}
\define@key[psset]{pst-pdgr}{descentnodepos}{%
  \pst@checknum{#1}\pst@pdgr@descentnodepos%
  \ifdim\pst@pdgr@descentnodepos \p@<\z@
  \def\pst@pdgr@descentnodepos{0.5}%
  \@pstrickserr{Bad `descentnodepos' value: `#1'. Must be >0}\@ehpa%
  \fi}%
\def\pst@pdgr@brokenpos{0.3}
\define@key[psset]{pst-pdgr}{brokenpos}{%
  \pst@checknum{#1}\pst@pdgr@brokenpos%
  \ifdim\pst@pdgr@brokenpos \p@<\z@
  \def\pst@pdgr@brokenpos{0.3}%
  \@pstrickserr{Bad `brokenpos' value: `#1'. Must be >0}\@ehpa%
  \fi}%
\def\pst@pdgr@mzlinepos{0.5}
\define@key[psset]{pst-pdgr}{mzlinepos}{%
  \pst@checknum{#1}\pst@pdgr@mzlinepos%
  \ifdim\pst@pdgr@mzlinepos \p@<\z@%
    \def\pst@pdgr@mzlinepos{0.5}%
    \@pstrickserr{Bad `mzlinepos' value: `#1'. Must be >0}\@ehpa%
  \fi%
  \ifdim\pst@pdgr@mzlinepos \p@>\p@\relax%
    \def\pst@pdgr@mzlinepos{0.5}%
    \@pstrickserr{Bad `mzlinepos' value: `#1'. Must be <1}\@ehpa%
  \fi}%
\def\pstPerson{\@ifnextchar[{\pstPerson@i}{\pstPerson@i[]}}
\def\pstPerson@i[#1]#2{%
  \rnode{#2}{%
   \psset{arrows=-, linestyle=solid}%
   \psset{#1}%
    \pspicture[shift=-0.25](-0.25,-0.25)(0.25,0.25)%
     \ifcase\pst@pdgr@condition\relax  % Nothing to do if normal
     \or  % obligatory
       \psdot(0,0)%
     \or % asymptomatic
       \qline(0,0.25)(0,-0.25)%
     \or % affected
        \expandafter\psset\expandafter{\affectedstyle}%
        \def\pst@pdgr@instxtcolor{\csname\affectedfgcolor\endcsname}%
     \fi%
     \ifcase\pst@pdgr@sex\relax  % First, unknown sex.  A diamond
         \pspolygon(0,0.25)(0.25,0)(0,-0.25)(-0.25,0)%
      \or  % Male.  A square with side 0.5
         \pspolygon(-0.25,-0.25)(-0.25,0.25)(0.25,0.25)(0.25,-0.25)%
      \or  % Female.  A circle with radius 0.25
          \pscircle{0.25}%
      \fi%
      \psset{fillstyle=none}%
     \ifpst@pdgr@deceased%
        \qline(-0.33,-0.33)(0.33,0.33)%
      \fi%
     \ifpst@pdgr@proband%
        \psline[arrows=->](-0.55,-0.55)(-0.29,-0.29)%
     \fi%
     \ifpst@pdgr@adopted%
       \psline(-0.25,-0.35)(-0.35,-0.35)(-0.35,0.35)(-0.25,0.35)%
       \psline(0.25,-0.35)(0.35,-0.35)(0.35,0.35)(0.25,0.35)%
     \fi%
     \ifpst@pdgr@evaluated%
        \rput(0.4,-0.4){$\ast$}%
      \fi%
     \ifx\pst@pdgr@abovetext\@empty\relax\else%
        \rput[\pst@pdgr@abovetextrp](0,0.4){%
          \kern2\pslinewidth\pst@pdgr@abovetext\kern2\pslinewidth}%
     \fi%
     \ifx\pst@pdgr@belowtext\@empty\relax\else%
        \rput[\pst@pdgr@belowtextrp](0,-0.4){%
          \kern2\pslinewidth\pst@pdgr@belowtext\kern2\pslinewidth}%
     \fi%
     \ifx\pst@pdgr@righttext\@empty\relax\else%
        \rput[\pst@pdgr@righttextrp](0.4,0){\pst@pdgr@righttext}%
     \fi%
     \ifx\pst@pdgr@lefttext\@empty\relax\else%
        \rput[\pst@pdgr@lefttextrp](-0.4,0){\pst@pdgr@lefttext}%
     \fi%
     \ifx\pst@pdgr@insidetext\@empty\relax\else%
        \rput(0,0){\pst@pdgr@instxtcolor\pst@pdgr@insidetext}%
     \fi%
     \endpspicture%
}}%
\def\pstAbortion{\@ifnextchar[{\pstAbortion@i}{\pstAbortion@i[]}}%
\def\pstAbortion@i[#1]#2{%
  \rnode{#2}{%
    \psset{arrows=-, linestyle=solid}%
    \psset{#1}%
     \pspicture[shift=-0.25](-0.25,-0.25)(0.25,0.5)%
     \ifcase\pst@pdgr@condition\relax  % Nothing to do if normal
     \or  \relax % Nothing to do if obligatory
     \or \relax  % Nothing to do if asymptomatic
     \or % affected
        \expandafter\psset\expandafter{\affectedstyle}%
     \fi%
    \ifpst@pdgr@sab\relax\else%
       \qline(-0.25,0.1)(0.25,0.6)%
     \fi%
    \pspolygon(-0.25,0.25)(0,0.5)(0.25,0.25)
     \ifx\pst@pdgr@abovetext\@empty\relax\else%
        \rput[\pst@pdgr@abovetextrp](0,0.65){%
          \kern2\pslinewidth\pst@pdgr@abovetext\kern2\pslinewidth}%
     \fi%
     \ifx\pst@pdgr@belowtext\@empty\relax\else%
        \rput[\pst@pdgr@belowtextrp](0,0.1){%
          \kern2\pslinewidth\pst@pdgr@belowtext\kern2\pslinewidth}%
     \fi%
     \ifx\pst@pdgr@righttext\@empty\relax\else%
        \rput[\pst@pdgr@righttextrp](0.4,0.35){\pst@pdgr@righttext}%
     \fi%
     \ifx\pst@pdgr@lefttext\@empty\relax\else%
        \rput[\pst@pdgr@lefttextrp](-0.4,0.35){\pst@pdgr@lefttext}%
     \fi%
     \endpspicture%
}}%
\def\pstChildless{\@ifnextchar[{\pstChildless@i}{\pstChildless@i[]}}%
\def\pstChildless@i[#1]#2{%
  \rnode{#2}{%
    \psset{arrows=-, linestyle=solid}%
    \psset{#1}%
    \ifpst@pdgr@infertile  % double line
      \pspicture[shift=-0.05](-0.2,-0.05)(0.2,0.05)%
        \qline(-0.2,-0.05)(0.2,-0.05)%
         \qline(-0.2,0.05)(0.2,0.05)%
      \endpspicture%
    \else  % single line
      \qline(-0.2,0)(0.2,0)%
    \fi%
     \ifx\pst@pdgr@belowtext\@empty\relax\else%
        \rput[t](0,-0.2){\pst@pdgr@belowtext}%
     \fi%
}}%
\def\pstRelationship{\@ifnextchar[{%
    \pstRelationship@i}{\pstRelationship@i[]}}%
\def\pstRelationship@i[#1]#2#3{%
  \begingroup%
  \psset{arrows=-, linestyle=solid, nodesep=0.7\pslinewidth}%
  \psset{#1}%
   \ifpst@pdgr@consanguinic%
      \psset{doubleline=true}%
   \else%
      \psset{doubleline=false}%
   \fi%
   \pst@pdgr@rellinecmd{#2}{#3}%
    \ifpst@pdgr@broken%
         \lput(\pst@pdgr@brokenpos){/\kern-0.7ex/}%
    \fi%
     \ifx\pst@pdgr@descentnode\@empty\relax%
     \else%
         \lput(\pst@pdgr@descentnodepos){\pnode{\pst@pdgr@descentnode}}%
      \fi%
      \endgroup%
}%
\def\pstDescent{\@ifnextchar[{\pstDescent@i}{\pstDescent@i[]}}%
\def\pstDescent@i[#1]#2#3{%
  \begingroup%
  \psset{arrows=-, linestyle=solid, angleA=90, %
         angleB=-90}%
  \psset{#1}%
  \ncangle{#3}{#2}%
  \endgroup}%
\def\pstTwins{\@ifnextchar[{\pstTwins@i}{\pstTwins@i[]}}%
\def\pstTwins@i[#1]#2#3#4#5{%
  \begingroup%
  \def\pst@pdgr@tempnode{#3}
  \psset{arrows=-, linestyle=solid, angleA=90, %
         angleB=-90}%
  \psset{#1}%
  \pstDescent{#2}{#3}%
  \ncline{#3}{#4}%
  \lput(\pst@pdgr@mzlinepos){\pnode{pst@pdgr@tempnodeA}}%
  \ncline{#3}{#5}%
  \lput(\pst@pdgr@mzlinepos){\pnode{pst@pdgr@tempnodeB}}%
  \ifpst@pdgr@monozygotic%
     \ncline{pst@pdgr@tempnodeA}{pst@pdgr@tempnodeB}%
  \else%
      \ifpst@pdgr@qzygotic%
         \ncline[linestyle=none]{pst@pdgr@tempnodeA}{pst@pdgr@tempnodeB}%
         \lput(0.5){?}%
      \fi%
  \fi%
  \endgroup}%
\def\pst@pdgr@makeTcommand#1{%
  \@namedef{T#1}{%
    \@ifnextchar[{\@nameuse{T#1@i}}{\@nameuse{T#1@i}[]}}%
  \@namedef{T#1@i}[##1]##2{%
      \Tr{\@nameuse{#1@i}[##1]{##2}}}}%
\pst@pdgr@makeTcommand{pstPerson}%
\pst@pdgr@makeTcommand{pstAbortion}%
\pst@pdgr@makeTcommand{pstChildless}%
\endinput
%%
%% End of file `pst-pdgr.tex'.
