summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-07-11 00:23:38 +0000
committerKarl Berry <karl@freefriends.org>2012-07-11 00:23:38 +0000
commit098bf061faf05059dd90a3b9ee89bb5d85abebda (patch)
tree376bc695a21802678e76ef4afafd299929681376 /Master/texmf-dist/tex
parentc353e13397245a2ace91c7d3ce5eed2e590447d0 (diff)
pst-optexp (10jul12)
git-svn-id: svn://tug.org/texlive/trunk@26992 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex2455
-rw-r--r--Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty4114
2 files changed, 4106 insertions, 2463 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex b/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex
deleted file mode 100644
index 03b23973d64..00000000000
--- a/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex
+++ /dev/null
@@ -1,2455 +0,0 @@
-%%
-%% This is file `pst-optexp.tex',
-%%
-%% IMPORTANT NOTICE:
-%%
-%% Package `pst-optexp.tex'
-%%
-%% Christoph Bersch <usenet _at_ bersch.net>
-%%
-%% This program can be redistributed and/or modified under the terms
-%% of the LaTeX Project Public License Distributed from CTAN archives
-%% in directory CTAN:/macros/latex/base/lppl.txt.
-%%
-%% DESCRIPTION:
-%% `pst-optexp' is a PSTricks package to draw optical experimental setups
-%%
-%% HISTORY -> see file Changes
-%%
-%% Naming conventions:
-%% macros starting with
-%% \POS are _P_STricks _O_ptexp _S_trings
-%% \POK are _P_STricks _O_ptexp _K_eys
-%% \ifPOE are _P_STricks _O_pt_e_xp ifs
-%%
-\csname PSToptexpLoaded\endcsname
-\let\PSToptexpLoaded\endinput
-%
-%
-\def\fileversion{2.1}
-\def\filedate{2009/11/05}
-\message{`pst-optexp' v\fileversion, \filedate\space (CB)}
-%
-\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
-\pst@addfams{optexp}
-\pstheader{pst-optexp.pro}
-\def\pst@optexpdict{tx@OptexpDict begin }
-\SpecialCoor
-%
-%
-% IF's
-%
-\newif\ifPOE@variable
-\newif\ifPOE@crystal@voltage
-\newif\ifPOE@crystal@caxisinv
-\newif\ifPOE@reverse
-\newif\ifPOE@crystal@lamp
-\newif\ifPOE@component@optional
-\newif\ifPOE@debug@showoptdots
-\newif\ifPOE@endbox
-\newif\ifPOE@thicklens
-\newif\ifPOE@usefiberstyle
-\newif\ifPOE@connjoin
-\newif\ifPOE@fiber@
-%
-\newdimen\optboxwidth
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Strings
-%
-\def\POS@pol@polperp{perp}
-\def\POS@pol@polparallel{parallel}
-\def\POS@pol@polmisc{misc}
-\def\POS@pol@polrcirc{rcirc}
-\def\POS@pol@pollcirc{lcirc}
-\def\POS@mirror@type@piezo{piezo}
-\def\POS@mirror@type@plain{plain}
-\def\POS@mirror@type@extended{extended}
-\def\POS@optgrid@type@blazed{blazed}
-\def\POS@optgrid@type@binary{binary}
-%
-\def\POS@lens@type@plainconvex{plainconvex}
-\def\POS@lens@type@convexplain{convexplain}
-\def\POS@lens@type@biconvex{biconvex}
-\def\POS@lens@type@plainconcave{plainconcave}
-\def\POS@lens@type@concaveplain{concaveplain}
-\def\POS@lens@type@biconcave{biconcave}
-%
-\def\POS@labelref@relative{relative}
-\def\POS@labelref@relgrav{relgrav}
-\def\POS@labelref@global{global}
-%
-\edef\POS@filter@type@bandpass{bandpass}
-\edef\POS@filter@type@bandstop{bandstop}
-%
-\edef\POS@coupler@type@none{none}
-\edef\POS@coupler@type@elliptic{elliptic}
-%
-\edef\POS@optexp@top{top}
-\edef\POS@optexp@bottom{bottom}
-\edef\POS@optexp@center{center}
-\edef\POS@optexp@closed{closed}
-\edef\POS@optexp@opened{opened}
-\edef\POS@optexp@basicname@default{tempNode@}
-\edef\POS@optexp@basicname@postfix{Intern}
-\edef\POS@optexp@extnode@postfix{ExtNode}
-\edef\POS@detector@round{round}
-\edef\POS@detector@diode{diode}
-\edef\POS@bs@cube{cube}
-\edef\POS@bs@plate{plate}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% psstyles
-%
-\newpsstyle{OptionalStyle}{linestyle=dashed,dash=1.5pt 1pt}%
-\newpsstyle{ExtendedMirror}{linestyle=none,%
- hatchwidth=0.5\POK@mirror@linewidth,
- hatchsep=1.4\POK@mirror@linewidth,%
- fillstyle=hlines}%
-\newpsstyle{PiezoMirror}{fillstyle=solid,fillcolor=black!30}%
-\newpsstyle{Beam}{linecolor=green!90!black,linewidth=\pslinewidth}%
-\define@key[psset]{optexp}{newBeam}{\newpsstyle{Beam}{#1}}
-\define@key[psset]{optexp}{addtoBeam}{\addtopsstyle{Beam}{#1}}
-%
-\newpsstyle{Fiber}{}%
-\define@key[psset]{optexp}{newFiber}{\newpsstyle{Fiber}{#1}}
-\define@key[psset]{optexp}{addtoFiber}{\addtopsstyle{Fiber}{#1}}
-%
-\newpsstyle{FiberIn}{style=Fiber}%
-\define@key[psset]{optexp}{newFiberIn}{\newpsstyle{FiberIn}{#1}}
-\define@key[psset]{optexp}{addtoFiberIn}{\addtopsstyle{FiberIn}{#1}}
-%
-\newpsstyle{FiberOut}{style=Fiber}%
-\define@key[psset]{optexp}{newFiberOut}{\newpsstyle{FiberOut}{#1}}
-\define@key[psset]{optexp}{addtoFiberOut}{\addtopsstyle{FiberOut}{#1}}
-%
-\newpsstyle{FiberIn1}{style=FiberIn}%
-\define@key[psset]{optexp}{newFiberIn1}{\newpsstyle{FiberIn1}{#1}}
-\define@key[psset]{optexp}{addtoFiberIn1}{\addtopsstyle{FiberIn1}{#1}}
-%
-\newpsstyle{FiberIn2}{style=FiberIn}%
-\define@key[psset]{optexp}{newFiberIn2}{\newpsstyle{FiberIn2}{#1}}
-\define@key[psset]{optexp}{addtoFiberIn2}{\addtopsstyle{FiberIn2}{#1}}
-%
-\newpsstyle{FiberOut1}{style=FiberOut}%
-\define@key[psset]{optexp}{newFiberOut1}{\newpsstyle{FiberOut1}{#1}}
-\define@key[psset]{optexp}{addtoFiberOut1}{\addtopsstyle{FiberOut1}{#1}}
-%
-\newpsstyle{FiberOut2}{style=FiberOut}%
-\define@key[psset]{optexp}{newFiberOut2}{\newpsstyle{FiberOut2}{#1}}
-\define@key[psset]{optexp}{addtoFiberOut2}{\addtopsstyle{FiberOut2}{#1}}
-%
-\newpsstyle{OptComp}{}%
-\define@key[psset]{optexp}{newOptComp}{\newpsstyle{OptComp}{#1}}
-\define@key[psset]{optexp}{addtoOptComp}{\addtopsstyle{OptComp}{#1}}
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Parameterdefinitions
-%
-% General
-\define@boolkey[psset]{optexp}[POE@component@]{optional}[true]{}
-\define@key[psset]{optexp}{position}{\edef\POK@position{#1}}
-\define@key[psset]{optexp}{abspos}{\edef\POK@abspos{#1}}
-\define@key[psset]{optexp}{angle}{\edef\POK@angle{#1}}
-\define@boolkey[psset]{optexp}[POE@]{usefiberstyle}[true]{}
-%
-% Label
-\define@key[psset]{optexp}{labelangle}{\edef\POK@label@angle{#1}}
-\define@key[psset]{optexp}{labeloffset}{\edef\POK@label@offset{#1}}
-\define@key[psset]{optexp}{labelstyle}{\def\POK@label@style{#1}}
-\define@key[psset]{optexp}{labelalign}{\def\POK@label@align{#1}}
-\define@key[psset]{optexp}{labelref}{\edef\POK@label@ref{#1}}
-\define@key[psset]{optexp}{label}{%
- \pst@expandafter\psset@@label{#1} {} {} {} {} {}\@nil
-}%
-% offset angle align ref
-\def\psset@@label#1 #2 #3 #4 #5\@nil{%
- \edef\@empty@dot{.}%
- \edef\pst@temp{#4}%
- \ifx\pst@temp\@empty\else
- \ifx\pst@temp\@empty@dot\else
- \psset{labelref=#4}
- \fi
- \fi
- \edef\pst@temp{#3}
- \ifx\pst@temp\@empty\else
- \ifx\pst@temp\@empty@dot\else
- \psset{labelalign=#3}
- \fi
- \fi
- \edef\pst@temp{#2}%
- \ifx\pst@temp\@empty\else
- \ifx\pst@temp\@empty@dot\else
- \psset{labelangle=#2}%
- \fi
- \fi
- \edef\pst@temp{#1}%
- \ifx\pst@temp\@empty\else
- \ifx\pst@temp\@empty@dot\else
- \psset{labeloffset=#1}
- \fi
- \fi
-}%
-\define@boolkey[psset]{optexp}[POE@label@]{innerlabel}[true]{}
-% for internal use only
-\define@key[psset]{optexp}{ref@angle}{\edef\POK@label@refangle{#1}}
-% labelrelative is obsolete
-\define@choicekey[psset]{optexp}{labelrelative}[\val\nr]{true,false}[true]{%
- \ifcase\nr\relax
- \psset{labelref=relative}
- \or
- \psset{labelref=global}
- \fi
- \PackageWarning{pst-optexp}{labelrelative is obsolete, please use labelref=relative instead}
-}
-%
-% Debug
-\define@boolkey[psset]{optexp}[POE@debug@]{showoptdots}[true]{}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Parameters for free-ray components
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Lens
-\define@key[psset]{optexp}{lensheight}{\edef\POK@lens@height{#1}}
-\define@key[psset]{optexp}{lenswidth}{\edef\POK@lens@width{#1}}
-\define@key[psset]{optexp}{lensradiusleft}{\edef\POK@lens@radiusLeft{#1}}
-\define@key[psset]{optexp}{lensradiusright}{\edef\POK@lens@radiusRight{#1}}
-\define@boolkey[psset]{optexp}[POE@]{thicklens}[true]{}
-\define@key[psset]{optexp}{lensradius}{%
- \psset{lensradiusleft=#1,%
- lensradiusright=#1}%
- \edef\POK@lens@radius{#1}%
-}%
-% Lens Type (only for backward compatibility)
-% 0 -> plainconvex
-% 1 -> convexplain
-% 2 -> biconvex
-% 3 -> plainconcave
-% 4 -> concaveplain
-% 5 -> biconcave
-%
-\define@key[psset]{optexp}{lenstype}{%
- \def\pst@tempA{#1}
- \edef\POK@lens@type{%
- \ifx\POS@lens@type@plainconvex\pst@tempA 0\else
- \ifx\POS@lens@type@convexplain\pst@tempA 1\else
- \ifx\POS@lens@type@biconvex\pst@tempA 2\else
- \ifx\POS@lens@type@plainconcave\pst@tempA 3\else
- \ifx\POS@lens@type@concaveplain\pst@tempA 4\else
- \ifx\POS@lens@type@biconcave\pst@tempA 5%
- \fi\fi\fi\fi\fi\fi%
-}}
-\define@key[psset]{optexp}{lens}{%
- \pst@expandafter\psset@@lens{#1} {} {} {} {} {}\@nil
-}%
-\def\psset@@lens#1 #2 #3 #4 #5\@nil{%
- \edef\pst@temp{#4}%
- \ifx\pst@temp\@empty\else
- \psset{lenswidth=#4}%
- \fi
- \edef\pst@temp{#3}%
- \ifx\pst@temp\@empty\else
- \psset{lensheight=#3}
- \fi
- \edef\pst@temp{#2}%
- \ifx\pst@temp\@empty
- \psset{lensradiusright=#1}%
- \else
- \psset{lensradiusright=#2}%
- \fi
- \psset{lensradiusleft=#1}%
-}%
-%
-% Pinhole
-\define@key[psset]{optexp}{innerheight}{\edef\POK@pinhole@iheight{#1}}
-\define@key[psset]{optexp}{iwidth}{%
- \edef\POK@pinhole@iheight{#1}%
- \PackageWarning{pst-optexp}{iwidth is obsolete, use innerheight instead}
-}
-\define@key[psset]{optexp}{outerheight}{\edef\POK@pinhole@oheight{#1}}
-\define@key[psset]{optexp}{owidth}{%
- \edef\POK@pinhole@oheight{#1}%
- \PackageWarning{pst-optexp}{owidth is obsolete, use outerheight instead}
-}
-\define@key[psset]{optexp}{phlinewidth}{\edef\POK@pinhole@linewidth{#1}}
-%
-% Beamsplitter
-\define@key[psset]{optexp}{bssize}{\edef\POK@bssize{#1}}
-\define@key[psset]{optexp}{bsstyle}{\edef\POK@bsstyle{#1}}
-\define@key[psset]{optexp}{bswidth}{%
- \edef\POK@bssize{#1}%
- \PackageWarning{pst-optexp}{bswidth is obsolete, use bssize instead}%
-}
-%
-% Crystal
-\define@key[psset]{optexp}{crystalwidth}{\edef\POK@crystal@width{#1}}
-\define@key[psset]{optexp}{crystalheight}{\edef\POK@crystal@height{#1}}
-\define@key[psset]{optexp}{caxislength}{\edef\POK@crystal@caxislength{#1}}
-\define@boolkey[psset]{optexp}[POE@crystal@]{voltage}[true]{}
-\define@boolkey[psset]{optexp}[POE@crystal@]{caxisinv}[true]{}
-\define@boolkey[psset]{optexp}[POE@crystal@]{lamp}[true]{}
-\define@key[psset]{optexp}{lampscale}{\def\POK@lamp@scale{#1}}
-%
-% Mirror
-\define@key[psset]{optexp}{mirrorwidth}{\edef\POK@mirror@width{#1}}
-\define@key[psset]{optexp}{mirrorlinewidth}{\edef\POK@mirror@linewidth{#1}}
-%\define@key[psset]{optexp}{mirrortype}{\edef\POK@mirror@type{#1}}% piezo, extended, plain
-\define@choicekey+[psset]{optexp}{mirrortype}[\val\nr]{piezo,extended,plain}%
- {\edef\POK@mirror@type{#1}}%
- {\PackageError{pst-optexp}{Unknown value '\val' for mirrortype}}
-\define@key[psset]{optexp}{mirrordepth}{\edef\POK@mirror@depth{#1}}
-\define@key[psset]{optexp}{mirrorradius}{\edef\POK@mirror@radius{#1}}
-\define@boolkey[psset]{optexp}[POE@]{variable}[true]{}
-%
-% Grid
-\define@key[psset]{optexp}{optgridcount}{\edef\POK@optgrid@count{#1}}
-\define@key[psset]{optexp}{optgridwidth}{\edef\POK@optgrid@width{#1}}
-\define@key[psset]{optexp}{optgridheight}{\edef\POK@optgrid@height{#1}}
-\define@choicekey+[psset]{optexp}{optgridtype}[\val\nr]{binary,blazed}%
- {\edef\POK@optgrid@type{#1}}
- {\PackageError{pst-optexp}{Unknown value '\val' for optgridtype}}
-\define@key[psset]{optexp}{optgriddepth}{\edef\POK@optgrid@depth{#1}}
-\define@key[psset]{optexp}{optgridlinewidth}{\edef\POK@optgrid@linewidth{#1}}
-\define@boolkey[psset]{optexp}[POE@]{reverse}[true]{}
-%
-% Box
-\define@key[psset]{optexp}{optboxwidth}{%
- \pssetlength\optboxwidth{#1}%
- \edef\POK@optbox@width{#1}%
-}
-\define@key[psset]{optexp}{optboxheight}{\edef\POK@optbox@height{#1}}
-\define@boolkey[psset]{optexp}[POE@]{endbox}[true]{}
-\define@key[psset]{optexp}{refractiveindex}{\edef\POK@optbox@n{#1}}
-%
-% Plate
-\define@key[psset]{optexp}{platelinewidth}{\edef\POK@plate@linewidth{#1}}
-\define@key[psset]{optexp}{plateheight}{\edef\POK@plate@height{#1}}
-%
-% Optical Retardation Plate
-\define@key[psset]{optexp}{platewidth}{\edef\POK@plate@width{#1}}
-%
-% Detector
-\define@key[psset]{optexp}{detsize}{\edef\POK@detector@size{#1}}
-\define@choicekey+[psset]{optexp}{dettype}[\val\nr]{round,diode}%
- {\edef\POK@detector@type{\val}}
- {\PackageError{pst-optexp}{Unknown value '\val' for key dettype}}
-%
-% Polarization
-\define@key[psset]{optexp}{polwidth}{%
- \edef\POK@polarization@size{#1}%
- \PackageWarning{pst-optexp}{polwidth is obsolete, use polsize instead}%
-}
-\define@key[psset]{optexp}{polsize}{\edef\POK@polarization@size{#1}}
-\define@key[psset]{optexp}{pollinewidth}{\edef\POK@polarization@linewidth{#1}}
-\define@choicekey+[psset]{optexp}{poltype}[\val\nr]{parallel,misc,perp,rcirc,lcirc}%
- {\edef\POK@pol@type{#1}}
- {\PackageError{pst-optexp}{Unknown value '\val' for key poltype}}
-\define@key[psset]{optexp}{pol}{%
- \edef\POK@poltype{#1}%
- \PackageWarning{pst-optexp}{pol is obsolete, use poltype instead}%
-}
-%
-% Optical Diode
-\define@key[psset]{optexp}{optdiodesize}{\edef\POK@diode@size{#1}}
-%
-% Penta Prism
-\define@key[psset]{optexp}{pentaprismsize}{\edef\POK@pentaprism@size{#1}}
-%
-% Right-Angle Prism
-\define@key[psset]{optexp}{raprismsize}{\edef\POK@raprism@size{#1}}
-%
-% Prism
-\define@key[psset]{optexp}{prismsize}{\edef\POK@prism@size{#1}}
-\define@key[psset]{optexp}{prismangle}{\edef\POK@prism@angle{#1}}
-%
-% Dove Prism
-\define@key[psset]{optexp}{doveprismsize}{\edef\POK@doveprism@size{#1}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Parameters for fiber-optical components
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Fiber
-\define@key[psset]{optexp}{fiberloops}{\edef\POK@fiber@count{#1}}
-\define@key[psset]{optexp}{fiberloopradius}{\edef\POK@fiber@radius{#1}}
-\define@key[psset]{optexp}{fiberloopsep}{\edef\POK@fiber@sep{#1}}
-%
-% Filter
-\define@key[psset]{optexp}{filtersize}{\edef\POK@filter@size{#1}}
-\define@choicekey+[psset]{optexp}{filtertype}[\val\nr]{bandstop,bandpass}%
- {\edef\POK@filter@type{#1}}%
- {\PackageError{pst-optexp}{Unknown value '\val' for key filtertype}}
-%
-% Polarization controller
-\define@key[psset]{optexp}{polcontrolsize}{\edef\POK@polcontrol@size{#1}}
-%
-% Optical amplifier
-\define@key[psset]{optexp}{optampsize}{\edef\POK@optamp@size{#1}}
-%
-% Mach-Zehnder-Modulator
-\define@key[psset]{optexp}{optmzmsize}{\edef\POK@optmzm@size{#1}}
-%
-% Isolator
-\define@key[psset]{optexp}{isolatorsize}{\edef\POK@isolator@size{#1}}
-%
-% Fiber polarizer
-\define@key[psset]{optexp}{fiberpolsize}{\edef\POK@fiberpol@size{#1}}
-%
-% Optical switch
-\define@key[psset]{optexp}{switchsize}{\edef\POK@switch@size{#1}}
-\define@choicekey+[psset]{optexp}{switchstyle}[\val\nr]{opened,closed}%
- {\edef\POK@switch@style{#1}}%
- {\PackageError{pst-optexp}{Unknown value '\val' for key switchstyle}}
-%
-% Fiber delay line
-\define@key[psset]{optexp}{fdlsize}{\edef\POK@fdl@size{#1}}
-%
-% Fiber collimator
-\define@key[psset]{optexp}{fibercolsize}{\edef\POK@fibercol@size{#1}}
-%
-% Coupler
-\define@key[psset]{optexp}{couplersize}{\edef\POK@coupler@size{#1}}
-\define@key[psset]{optexp}{couplersep}{\edef\POK@coupler@sep{#1}}
-\define@choicekey+[psset]{optexp}{couplertype}[\val\nr]{none,elliptic}%
- {\edef\POK@coupler@type{#1}}%
- {\PackageError{pst-optexp}{Unknown value '\val' for key couplertype}}
-\define@key[psset]{optexp}{align}{\edef\POK@align{#1}}
-%
-%
-\define@key[psset]{optexp}{compshift}{\edef\POK@comp@shift{#1}}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Code for the extnode parameter (additional input node)
-%
-\define@key[psset]{optexp}{extnoden@me}{\edef\POK@extnode@name{#1}}
-%
-% (this part was copied and adapted from \psset@@ref from pstricks.tex)
-\define@key[psset]{optexp}{extnode}{%
- \edef\POK@extnode{#1}%
- \ifx\@empty\POK@extnode\else
- \pst@expandafter\psset@@extnode{#1}\@empty,,\@nil
- \fi
-}%
-\def\POK@xref{0}%
-\def\POK@yref{0}%
-\def\psset@@extnode#1#2,#3,#4\@nil{%
- \def\POK@xref{0}%
- \def\POK@yref{0}%
- \ifx\@empty#3\@empty
- \@nameuse{getref@optexp@#1}%
- \@nameuse{getref@optexp@#2}%
- \else
- \pst@checknum{#1#2}\POK@xref%
- \pst@checknum{#3}\POK@yref%
- \fi}%
-\def\getref@optexp@c{}%
-\def\getref@optexp@t{\def\POK@yref{1}}%
-\def\getref@optexp@b{\def\POK@yref{-1}}%
-\def\getref@optexp@l{\def\POK@xref{-1}}%
-\def\getref@optexp@r{\def\POK@xref{1}}%
-%
-%
-\define@key[psset]{optexp}{rotateref}{%
- \def\pst@temp{#1}%
- \ifx\@empty\pst@temp\else
- \pst@expandafter\psset@@rotateref{#1}\@empty,,\@nil
- \fi
-}%
-\def\POK@rotate@xref{0}%
-\def\POK@rotate@yref{0}%
-\def\psset@@rotateref#1#2,#3,#4\@nil{%
- \def\POK@rotate@xref{0}%
- \def\POK@rotate@yref{0}%
- \ifx\@empty#3\@empty
- \@nameuse{getref@optexp@rotate@#1}%
- \@nameuse{getref@optexp@rotate@#2}%
- \else
- \pst@checknum{#1#2}\POK@rotate@xref%
- \pst@checknum{#3}\POK@rotate@yref%
- \fi}%
-\def\getref@optexp@rotate@c{}%
-\def\getref@optexp@rotate@t{\def\POK@rotate@yref{1}}%
-\def\getref@optexp@rotate@b{\def\POK@rotate@yref{-1}}%
-\def\getref@optexp@rotate@l{\def\POK@rotate@xref{-1}}%
-\def\getref@optexp@rotate@r{\def\POK@rotate@xref{1}}%
-%
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% THIS IS THE COMPLETE AND NEW CODE FOR ALL CONNECTIONS %%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-\define@key[psset]{optexp}{b@sicname}{%
- \edef\pst@temp{#1}%
- \ifx\pst@temp\@empty%
- \edef\POK@basicname{\POS@optexp@basicname@default}%
- \else%
- \edef\POK@basicname{#1\POS@optexp@basicname@postfix}%
- \fi%
-}%
-\def\POE@complist{}%
-\g@addto@macro{\endpspicture}{\gdef\POE@complist{}}%
-\define@key[psset]{optexp}{@compname}{%
- \edef\POK@compname{#1}%
- \psset{b@sicname=#1}%
- \psset{extnoden@me=#1\POS@optexp@extnode@postfix}%
- % check if compname was already defined
- \ifx\POK@compname\@empty\else
- \@expandtwoargs\in@{,#1,}{,\POE@complist,}%
- \ifin@
- \PackageWarning{pst-optexp}%
- {^^Jcompname '#1' already used. Previously defined nodes will be overwritten!^^J}%
- \else
- % Use definition of \XKV@addtolist@x with an \xdef instead of \edef in order
- % to keep the bookkeeping global
- \xdef\POE@complist{\POE@complist\ifx\POE@complist\@empty\else,\fi#1}%
- \fi
- \fi
-}%
-\define@key[psset]{optexp}{connjoin}{%
- \edef\pst@temp{#1}%
- \ifnum\pst@temp<0
- \POE@connjoinfalse
- \else\ifnum\pst@temp>2
- \POE@connjoinfalse
- \else
- \POE@connjointrue
- \edef\POK@connjoin{\pst@temp}
- \fi\fi
-}%
-\define@key[psset]{optexp}{conn}{%
- \edef\pst@tempg{#1}%
- \expandafter\psset@@conn\pst@tempg\@empty-\@empty\@nil
- \if@pst\else
- \pstrickserr{Bad connection specification: #1}\@ehpa
- \fi
-}%
-\def\psset@@conn#1-#2\@empty#3\@nil{%
- \@psttrue
- \def\next##1,#1-##2,##3\@nil{\def\pst@tempg{##2}}%
- \expandafter\next\pst@optexp@conntable,#1-#1,\@nil
- \@ifundefined{psoe@cs@in@\pst@tempg}%
- {\@pstfalse\def\psk@connIn{}}%
- {\edef\psk@connIn{psoe@cs@in@\pst@tempg}}%
- \@ifundefined{psoe@cs@out@#2}%
- {\@pstfalse\def\psk@connOut{}}%
- {\def\psk@connOut{psoe@cs@out@#2}}%
-}%
-\def\psk@connIn{}%
-\def\psk@connOut{}%
-% this is the conntable for the direct drawing of the connections
-\def\pst@optexp@conntable{,o-o,i-i,f-f}%
-%
-\def\psoe@cs@out@{}%
-\def\psoe@cs@in@{}%
-\def\psoe@cs@in@o{\psline[style=Beam](\POS@optexp@basicname@default A)(\optexp@nodeA)}%
-\def\psoe@cs@out@o{\psline[style=Beam](\optexp@nodeB)(\POS@optexp@basicname@default B)}%
-\def\psoe@cs@in@f{%
- \pccurve[angleA=!\pst@optexpdict FiberAngleA end,
- angleB=!\pst@optexpdict FiberAngleB end,
- style=FiberIn](\POS@optexp@basicname@default A)(\optexp@nodeA)%
-}%
-\def\psoe@cs@out@f{%
- \pccurve[angleA=!\pst@optexpdict FiberAngleA end,
- angleB=!\pst@optexpdict FiberAngleB end,
- style=FiberOut](\optexp@nodeB)(\POS@optexp@basicname@default B)%
-}%
-\def\psoe@cs@in@i{%
- \def\pst@par{style=Beam}
- \begin@OpenObj
- \addto@pscode{%
- [
- \pst@optexpdict
- (\POK@basicname) false GetInternalBeamNodes
- /N@\POS@optexp@basicname@default A tx@NodeDict begin load GetCenter end
- end
- }%
- \psline@ii
-}%
-\def\psoe@cs@out@i{%
- \def\pst@par{style=Beam}
- \begin@OpenObj
- \addto@pscode{%
- [
- \pst@optexpdict
- /N@\POS@optexp@basicname@default B tx@NodeDict begin load GetCenter end
- (\POK@basicname) false GetInternalBeamNodes
- end
- }%
- \psline@ii
-}%
-%
-%
-\def\drawbeam{%
- \def\conntable{,a-a,b-b,A-A,B-B}%
- \begingroup
- \psset{style=Beam}%
- \pst@object{drawbeam}
-}%
-\def\drawbeam@i#1#2{%
- \def\pst@tempA{\pst@optexp@getfirstchar#1\@nil}%
- \def\pst@tempB{\pst@optexp@getfirstchar#2\@nil}%
- \ifPOE@connjoin
- \psset{linejoin=\POK@connjoin}%
- \fi
- \begin@OpenObj%
- \if(\pst@tempB
- % second parameter is a node
- \pst@optexp@@getcoor#2
- \def\psk@connOut{pst@coor}%
- \else
- \pst@optexp@check@compname{#2}%
- \edef\POK@basicnameB{#2\POS@optexp@basicname@postfix}%
- \fi
- \if(\pst@tempA
- % % first parameter is a node
- \pst@optexp@@getcoor#1%
- \def\psk@connIn{pst@coor}%
- \else
- \pst@optexp@check@compname{#1}%
- \edef\POK@basicnameA{#1\POS@optexp@basicname@postfix}%
- \fi
- \let\POK@basicname\POK@basicnameB
- \addto@pscode{[ \@nameuse{\psk@connOut}}%
- \let\POK@basicname\POK@basicnameA
- \addto@pscode{\@nameuse{\psk@connIn}}%
- \psline@ii
- \endgroup
-\ignorespaces}%
-%
-\def\pst@optexp@check@compname#1{%
- % check if 'compname' is defined
- \@expandtwoargs\in@{,#1,}{,\POE@complist,}%
- \ifin@\else
- \PackageError{pst-optexp}{^^Jcompname '#1' undefined!^^J}
- \fi
-}%
-\def\pst@optexp@getfirstchar#1#2\@nil{#1}%
-\def\pst@optexp@@getcoor(#1){%
- \pst@@getcoor{#1}%
-\ignorespaces}%
-%
-% IN
-\def\psoe@cs@in@a{tx@NodeDict begin /N@\POK@basicname 1 load GetCenter end }%
-\def\psoe@cs@in@A{\pst@optexpdict (\POK@basicname) true GetInternalBeamNodes end }%
-\def\psoe@cs@in@b{tx@NodeDict begin /N@\POK@basicname N load GetCenter end }%
-\def\psoe@cs@in@B{\pst@optexpdict (\POK@basicname) false GetInternalBeamNodes end }%
-%
-% OUT
-%
-\def\psoe@cs@out@a{tx@NodeDict begin N@\POK@basicname 1 GetCenter end }%
-\def\psoe@cs@out@A{\pst@optexpdict (\POK@basicname) false GetInternalBeamNodes end }%
-\def\psoe@cs@out@b{tx@NodeDict begin N@\POK@basicname N GetCenter end }%
-\def\psoe@cs@out@B{\pst@optexpdict (\POK@basicname) true GetInternalBeamNodes end }%
-%
-%
-\define@choicekey[psset]{optexp}{beam}[\val\nr]{}[]{%
- \psset{conn=i-o}%
-}
-\define@choicekey[psset]{optexp}{fiber}[\val\nr]{}[]{%
- \psset{conn=f-f, fiber@=true}%
-}
-%
-% The fiber@ parameter is for internal use only to allow using \pscustom and connjoin
-% when drawing internal beams.
-\define@boolkey[psset]{optexp}[POE@]{fiber@}[true]{}
-\def\optexp@nodeA{\POK@basicname 1}%
-\def\optexp@nodeB{\POK@basicname N}%
-\def\optexp@node#1{\POK@basicname #1}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% BASIC MACROS
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-\def\pst@OptexpVerb#1{\pst@Verb{\pst@optexpdict #1 end }}%
-\def\begin@OptexpObj{%
- \define@key[psset]{optexp}{compname}{\psset{@compname=##1}}
- \pst@killglue
- \begingroup
- \pst@OptexpVerb{InitOptexpComp}%
- \use@par
- % Usually the shift refers to the y-direction, shifting in x-direction
- % is done by 'abspos' or 'position'
- \let\POK@comp@Yshift\POK@comp@shift%
- \def\POK@comp@Xshift{0}%
-}%
-\def\begin@OptexpMultipole{%
- \begin@OptexpObj
- % for multipoles the default shifting is in x-direction
- \let\POK@comp@Xshift\POK@comp@shift%
- \def\POK@comp@Yshift{0}%
-}%
-\def\end@OptexpObj{%
- \pst@OptexpVerb{(\POS@optexp@basicname@default) (\POK@basicname) CloseOptexpComp}%
- \endgroup
- \ignorespaces%
-}%
-\let\end@OptexpDipole\end@OptexpObj
-\let\end@OptexpMultipole\end@OptexpObj
-%
-% Command analog to addbefore@par which is defined in pstricks.tex
-% addafter@par inserts new options at the _end_ of the current token register.
-% This can be useful to preset options that are not allowed to be changed by the
-% user.
-%
-\def\addafter@par#1{%
- \ifx\pst@par\@empty
- \def\pst@par{#1}%
- \else
- \toks@{#1}%
- \pst@toks\expandafter{\pst@par}%
- \edef\pst@par{\the\pst@toks,\the\toks@}%
- \fi%
-}%
-\def\getCLWH{CLW \pst@number\psxunit 2 mul div\space}%
-\def\getCLW{CLW \pst@number\psxunit div\space}%
-% Define new node '#3' which is shifted by (#1) relative to an existing
-% node '#2'
-\def\defShiftedNode(#1)(#2)#3{%
- \pst@getcoor{#1}\pst@tempOrig%
- \pst@getcoor{#2}\pst@tempDiff%
- \pnode(!%
- \pst@tempDiff \pst@tempOrig
- 3 -1 roll add \pst@number\psyunit div
- 3 1 roll add \pst@number\psxunit div exch){#3}%
-}%
-%
-% New high-level macros
-% 1) Allow a compressed notation of all provided elements, as most of the organizing code
-% is mostly equal.
-%
-% 2) Provide a rather easy-to-use interface for the user to allow new user-defined elements
-%
-\def\newOptexpDipole{\@ifnextchar[{\new@optexpdipole}{\new@optexpdipole[]}}
-\def\newOptexpDipoleNolabel{\@ifnextchar[{\new@optexpdipolenolabel}{\new@optexpdipolenolabel[]}}
-\def\newOptexpTripole{\@ifnextchar[{\new@optexptripole}{\new@optexptripole[]}}
-\def\newOptexpFiberDipole{\@ifnextchar[{\new@optexpfiberdipole}{\new@optexpfiberdipole[]}}
-\def\newOptexpFiberQuadrupole{\@ifnextchar[{\new@optexpfiberquadrupole}{\new@optexpfiberquadrupole[]}}
-\def\new@optexpfiberdipole[#1]#2#3{%
- \new@optexpdipole[fiber,#1]{#2}{#3}%
-}%
-%
-\def\draw@InternalConnections{%
- \ifPOE@endbox
- \@nameuse{\psk@connIn}
- \else
- \ifPOE@fiber@
- \@nameuse{\psk@connIn}
- \@nameuse{\psk@connOut}
- \else
- \ifPOE@connjoin
- \def\tmp@A{psoe@cs@in@i}%
- \ifx\tmp@A\psk@connIn
- \def\tmp@B{psoe@cs@out@o}
- \ifx\tmp@B\psk@connOut
- \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
- \else\ifx\@empty\psk@connOut
- \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
- \else
- \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
- \fi\fi
- \else
- \def\tmp@A{psoe@cs@out@i}%
- \ifx\tmp@A\psk@connOut
- \def\tmp@B{psoe@cs@in@o}
- \ifx\tmp@B\psk@connIn
- \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
- \else\ifx\@empty\psk@connIn
- \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
- \else
- \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
- \fi\fi
- \else
- \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
- \fi
- \fi
- \else
- \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
- \fi
- \fi
- \fi
-}%
-%
-% Creates new macros ...@i and ...@ii which provide most code for the arrangement
-% of the objects. A tempNode@Label is predefined as well as two internal nodes if compname is
-% defined.
-% ...@iii must be defined manually and should contain all the stroking code
-\def\new@optexpdipole[#1]#2#3{%
- \@ifundefined{#2@i}{%
- \@namedef{#2}{\pst@object{#2}}%
- \expandafter\def\csname #2@i\endcsname(##1)(##2)##3{%
- \addbefore@par{#3}%
- \addafter@par{#1}%
- \pst@regNodes{##1}{##2}
- \begin@OptexpObj
- \pst@adjustTempNodes
- \pst@draw@component{##3}{\@nameuse{#2@ii}}
- % connect
- \draw@InternalConnections
- \end@OptexpObj
- }%
- \@namedef{#2@ii}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- \@nameuse{#2@iii}%
- }%
- }{%
- \@pstrickserr{OptExp dipole object `#2' already defined}\@eha}%
-\ignorespaces}%
-%
-% Equivalent to new@optexdipole, only that objects without labels are created.
-\def\new@optexpdipolenolabel[#1]#2#3{%
- \@ifundefined{#2@i}{%
- \@namedef{#2}{\pst@object{#2}}%
- \expandafter\def\csname #2@i\endcsname(##1)(##2){%
- \addbefore@par{#3}%
- \addafter@par{#1}%
- \pst@regNodes{##1}{##2}
- \begin@OptexpObj
- \pst@adjustTempNodes
- \pst@draw@component{}{\@nameuse{#2@ii}}
- % connect
- \draw@InternalConnections
- \end@OptexpObj
- }%
- \@namedef{#2@ii}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- \@nameuse{#2@iii}%
- }%
- }{%
- \@pstrickserr{OptExp dipole object `#2' already defined}\@eha}%
-\ignorespaces}%
-%
-% Equivalent to new@optexpdipole for tripole objects.
-\def\new@optexptripole[#1]#2#3{%
- \@ifundefined{#2@i}{%
- \@namedef{#2}{\pst@object{#2}}%
- \expandafter\def\csname #2@i\endcsname(##1)(##2)(##3)##4{%
- \addbefore@par{#3}%
- \addafter@par{ref@angle=180,#1}%
- \pst@calcNodes{##1}{##2}{##3}
- \begin@OptexpMultipole
- \pst@draw@component{##4}{\@nameuse{#2@ii}}
- % adjust tempNode@A and tempNode@B for the connections
- % \pnode(##1){tempNode@A}
- % \pnode(##3){tempNode@B}
- % check if node must be switched, therefore we implement this
- % directly as PS code
- \pst@getcoor{##1}\pst@tempA%
- \pst@getcoor{##3}\pst@tempB%
- \pst@Verb{%
- \pst@optexpdict
- tx@NodeDict begin
- {\pst@tempA } false chirality 0 le { /N@tempNode@B }{ /N@tempNode@A } ifelse
- 10 {InitPnode } NewNode
- {\pst@tempB } false chirality 0 le { /N@tempNode@A }{ /N@tempNode@B } ifelse
- 10 {InitPnode } NewNode
- end end
- }%
- \draw@InternalConnections
- \end@OptexpMultipole
- }%
- \@namedef{#2@ii}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- \@nameuse{#2@iii}%
- }%
- }{%
- \@pstrickserr{OptExp tripole object `#2' already defined}\@eha}%
-\ignorespaces}%
-%
-%
-\def\new@optexpfiberquadrupole[#1]#2#3{%
- \@ifundefined{#2@i}{%
- \@namedef{#2}{\pst@object{#2}}%
- \expandafter\def\csname #2@i\endcsname(##1)(##2)(##3)(##4)##5{%
- \addbefore@par{#3}%
- \addafter@par{#1}%
- %
- \begin@OptexpObj
- %
- \ifx\POK@align\POS@optexp@top
- \pnode(##1){tempNode@A}
- \pnode(##3){tempNode@B}
- \else\ifx\POK@align\POS@optexp@bottom
- \pnode(##2){tempNode@A}
- \pnode(##4){tempNode@B}
- \else
- \pst@getcoor{##1}\pst@tempA%
- \pst@getcoor{##2}\pst@tempB%
- \pnode(!\pst@tempA\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@optexpdict mwNode end){tempNode@A}
- \pst@getcoor{##3}\pst@tempA%
- \pst@getcoor{##4}\pst@tempB%
- \pnode(!\pst@tempA\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@optexpdict mwNode end){tempNode@B}
- \fi\fi
- %
- \pst@draw@component{##5}{\@nameuse{#2@ii}}
- %
- % connect the fibers
- \psset{angleA=! \pst@optexpdict FiberAngleA end,
- angleB=! \pst@optexpdict FiberAngleB end}
- \pccurve[style=FiberIn1](##1)(tempNode@A@1)
- \pccurve[style=FiberIn2](##2)(tempNode@A@2)
- \pccurve[style=FiberOut1](tempNode@B@1)(##3)
- \pccurve[style=FiberOut2](tempNode@B@2)(##4)
- \end@OptexpObj
- }%
- \@namedef{#2@ii}{%
- \pnode(0,0){tempNode@Label}%
- \@nameuse{#2@iii}%
- }%
- }{%
- \@pstrickserr{OptExp fiber quadrupole object `#2' already defined}\@eha}%
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Fiber tripole macros
-%
-\def\wdmsplitter{\pst@object{wdmsplitter}}%
-\def\wdmsplitter@i(#1)(#2)(#3)#4{%
- \begin@OptexpObj
- \pnode(#1){tempNode@A}
- \ifx\POK@align\POS@optexp@top
- \pnode(#2){tempNode@B}
- \else\ifx\POK@align\POS@optexp@bottom
- \pnode(#3){tempNode@B}
- \else
- \pst@getcoor{#2}\pst@tempA%
- \pst@getcoor{#3}\pst@tempB%
- \pnode(!\pst@tempA\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@optexpdict mwNode end){tempNode@B}
- \fi\fi
- %
- \pst@draw@component{#4}\wdmsplitter@ii
- %
- % default connection angles
- \psset{angleA=! \pst@optexpdict FiberAngleA end,
- angleB=! \pst@optexpdict FiberAngleB end}
- %
- % connect the fibers
- \pccurve[style=FiberIn](#1)(tempNode@A@)
- \pccurve[style=FiberOut1](tempNode@B@1)(#2)
- \pccurve[style=FiberOut2](tempNode@B@2)(#3)
- \end@OptexpObj
-}%
-%
-%
-\def\wdmcoupler{\pst@object{wdmcoupler}}%
-\def\wdmcoupler@i(#1)(#2)(#3)#4{%
- \begin@OptexpObj
- \pnode(#3){tempNode@B}
- \ifx\POK@align\POS@optexp@top
- \pnode(#1){tempNode@A}
- \else\ifx\POK@align\POS@optexp@bottom
- \pnode(#2){tempNode@A}
- \else
- \pst@getcoor{#1}\pst@tempA%
- \pst@getcoor{#2}\pst@tempB%
- \pnode(!\pst@tempA\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@optexpdict mwNode end){tempNode@A}
- \fi\fi
- %
- \pst@draw@component{#4}\wdmcoupler@ii
- %
- % default connection angles
- \psset{angleA=! \pst@optexpdict FiberAngleA end,
- angleB=! \pst@optexpdict FiberAngleB end}
- %
- % connect the fibers
- \pccurve[style=FiberOut](tempNode@B@)(#3)
- \pccurve[style=FiberIn1](#1)(tempNode@A@1)
- \pccurve[style=FiberIn2](#2)(tempNode@A@2)
- \end@OptexpObj
-}%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Some of the components need three points to be positioned.
-% These are:
-%
-% 1. starting point of the beam (in the PS-Code: (XA,YA))
-% 2. reflection point on the surface (XG, YG)
-% 3. end point (XB,YB)
-%
-% With these three points \pst@calcNodes calculates two new points 'tempNode@A'
-% and 'tempNode@B', between which the component is placed by the macro
-% \pst@draw@component in the way, that 'angle of incidence' == 'angle of deflection'
-% regarding the reflection surface (mirror, diagonal of the beamsplitter,
-% grid etc.)
-%
-\def\pst@calcNodes#1#2#3{{%
- \pst@getcoor{#1}\pst@tempa%
- \pst@getcoor{#2}\pst@tempb%
- \pst@getcoor{#3}\pst@tempc%
- \pnode(!%
- \pst@optexpdict
- \pst@tempa \pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempc \pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempb \pst@number\psyunit div exch \pst@number\psxunit div exch
- calcNodes
- /ExchCoorSwitch
- Y@A X@A neg Y@B X@B neg ExchCoor def
- X@A Y@A end){tempNode@A}%
- \pnode(! \pst@optexpdict X@B Y@B end){tempNode@B}%
-}\ignorespaces}%
-%
-%
-% If a macro needs only two points, they are equivalent to
-% 'tempNode@A' and 'tempNode@B'. But for easier implementation of other
-% macros the given points are assigned to the temporary nodes.
-%
-\def\pst@regNodes#1#2{%
- \pnode(#1){tempNode@A}
- \pnode(#2){tempNode@B}
-\ignorespaces}%
-\def\pst@adjustTempNodes{%
- \pst@Verb{tx@NodeDict begin N@tempNode@A GetCenter N@tempNode@B GetCenter end
- \pst@optexpdict ExchCoor dup end
- {/@xref \POK@xref\space neg def /@yref \POK@yref\space neg def}
- {/@xref \POK@xref\space def /@yref \POK@yref\space def} ifelse
- \pst@optexpdict /ExchCoorSwitch ED end
- tx@OptexpDict /chirality known not {\pst@optexpdict /chirality 1 def
- end } if
- }%
-\ignorespaces}%
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Some other usefuls macros
-%
-% Define a new node #3 shifted by (#1) relative to existing node #2.
-% Aditionally rotate the new node by #4 degree around existing node as origin.
-%
-\def\pst@defShiftedRotLabelNode(#1)#2#3#4{%
- \pst@getcoor{#1}\pst@tempDiff%
- \pnode(!%
- \pst@tempDiff /YDiff ED /XDiff ED %
- /N@#2 load GetCenter /YShifted ED /XShifted ED
- /rot@angle #4 \POK@label@refangle\space add def
- /XDiff@Rot rot@angle cos XDiff mul rot@angle sin YDiff mul add def
- /YDiff@Rot rot@angle cos YDiff mul rot@angle sin XDiff mul sub def
- XShifted XDiff@Rot add \pst@number\psxunit div
- YShifted YDiff@Rot add \pst@number\psyunit div neg
- ){#3}%
- % reset reference label to 0
- \psset{ref@angle=0}
-}%
-%
-% Define a new node #3 that is shifted by (#1)
-% with respect to the existing node #2
-\def\pst@defShiftedLabelNode(#1)#2#3{%
- \pst@defShiftedRotLabelNode(#1){#2}{#3}{0}%
-}%
-%
-% Used to put the label for labelref=relative
-%
-\def\put@RelLabel#1{%
- \nput[labelsep=0]{\POK@label@angle}%
- {tempNode@LabelShifted}%
- {\rput[\POK@label@align](0,0){\POK@label@style #1}}%
-}%
-%
-% Place the component in argument #1 and define a new node 'tempNode@LabelShifted'
-% for positioning of the label
-\def\put@Comp#1{%
- \rput(\POK@comp@Xshift,\POK@comp@Yshift){%
- #1%
- \pst@defShiftedRotLabelNode(0,\POK@label@offset)%
- {tempNode@Label}%
- {tempNode@LabelShifted}%
- {\POK@label@angle}%
- }%
-}%
-%
-% Positioning of the label depending on the reference coordinates.
-% Needs possibly a previously defined node tempNode@LabelShifted which
-% marks exactly the position of the label relative to the component.
-% This is defined by calling \put@Comp.
-%
-% Parameter 'labelref' which sets the reference coordinates can have
-% the values
-% global => labelangle rotates the label origin in global coordinate
-% system, text is not rotated
-% relgrav => labelangle rotates the label origin relativ to the local
-% coordinate system of the component, text is not rotated
-% relative => as relgrav but text is rotated together with object.
-%
-\def\put@Label#1{%
- \def\pst@temp{#1}%
- \ifx\pst@temp\@empty\else
- \ifx\POK@label@ref\POS@labelref@global
- %
- % global
- \nput[labelsep=\POK@label@offset]%
- {\POK@label@angle}%
- {tempNode@Label}%
- {\rput[\POK@label@align](0,0){\POK@label@style #1}}%
- %
- \else\ifx\POK@label@ref\POS@labelref@relgrav
- %
- % relgrav
- \rput[\POK@label@align](tempNode@LabelShifted){\POK@label@style #1}%
- %
- \else\ifx\POK@label@ref\POS@labelref@relative
- %
- % relative
- \begingroup
- %
- % Redefine InitNC only for positioning of the label with
- % labelref=relative
- %
- \pst@def{InitNC}< % kindly contributed by Herbert Voss
- /b ED /a ED % second and first node
- /NodeSepTypeB ED /NodeSepTypeA ED
- /NodeSepB ED /NodeSepA ED
- /OffsetB ED /OffsetA ED
- tx@NodeDict a known tx@NodeDict b known and dup {
- /NodeA a load def /NodeB b load def
- NodeA GetCenter NodeB GetCenter % xA yA xB yB
- 4 copy exch 4 -1 roll 2 copy gt % yA yB xB xA
-% 4 copy pop exch pop le % xA xB
- { pop pop pop pop /yB ED /xB ED /yA ED /xA ED }
- { eq 3 1 roll lt and
- { /yB ED /xB ED /yA ED /xA ED}
- { /yA ED /xA ED /yB ED /xB ED} ifelse
- } ifelse
- } if >%
- %
- \ncline[linestyle=none,fillstyle=none,npos=]{tempNode@A}{tempNode@B}%
- %
- %
- \ifx\POK@position\@empty
- \ifx\POK@abspos\@empty
- \ncput[nrot=:U,npos=]{\put@RelLabel{#1}}
- \else
- \nlput[nrot=:U](tempNode@A)(tempNode@B){\POK@abspos}{\put@RelLabel{#1}}
- \fi
- \else
- \ncput[nrot=:U,npos=\POK@position]{\put@RelLabel{#1}}
- \fi
- %
- \endgroup
- \fi\fi\fi
- \fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FREE-RAY COMPONENTS
-%
-% DIPOLES
-%
-\newOptexpDipole{lens}{}%
-\newOptexpDipole{pinhole}{}%
-\newOptexpDipole{crystal}{}%
-\newOptexpDipoleNolabel{polarization}{}%
-\newOptexpDipole{optbox}{}%
-\newOptexpDipole{optplate}{}%
-\newOptexpDipole{optretplate}{}%
-\newOptexpDipole[endbox]{optdetector}{}%
-\@ifundefined{PSTcircLoaded}{\newpsobject{detector}{optdetector}}{}{}%
-\newOptexpDipole{optdiode}{}%
-\newOptexpDipole{doveprism}{}%
-%
-% TRIPOLES
-%
-\newOptexpTripole{mirror}{}%
-\newOptexpTripole[ref@angle=-135]{beamsplitter}{}%
-\newOptexpTripole{optgrid}{}%
-\newOptexpTripole[ref@angle=-135]{pentaprism}{}%
-\newOptexpTripole[ref@angle=-135]{rightangleprism}{}%
-\newOptexpTripole[ref@angle=-135]{optprism}{}%
-%
-% SPECIAL OBJECTS
-%
-\def\optdipole{\pst@object{optdipole}}
-\def\optdipole@i(#1)(#2)#3#4{%
- \pst@regNodes{#1}{#2}
- \begin@OptexpObj
- \pst@adjustTempNodes
- \pst@draw@component{#4}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- #3
- }%
- \draw@InternalConnections
- \end@OptexpObj
-}%
-\def\opttripole{\pst@object{opttripole}}
-\def\opttripole@i(#1)(#2)(#3)#4#5{%
- \pst@calcNodes{#1}{#2}{#3}
- \begin@OptexpMultipole
- \pst@draw@component{#5}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- #4
- }%
- % adjust tempNode@A and tempNode@B for the connections
- % \pnode(##1){tempNode@A}
- % \pnode(##3){tempNode@B}
- % check if node must be switched, therefore we implement this
- % directly as PS code
- \pst@getcoor{#1}\pst@tempA%
- \pst@getcoor{#3}\pst@tempB%
- \pst@Verb{%
- \pst@optexpdict
- tx@NodeDict begin
- {\pst@tempA } false chirality 0 le { /N@tempNode@B }{ /N@tempNode@A } ifelse
- 10 {InitPnode } NewNode
- {\pst@tempB } false chirality 0 le { /N@tempNode@A }{ /N@tempNode@B } ifelse
- 10 {InitPnode } NewNode
- end end
- }%
- \draw@InternalConnections
- \end@OptexpMultipole
-}%
-\def\fibercollimator{\pst@object{fibercollimator}}
-\def\fibercollimator@i(#1)(#2){%
- \addbefore@par{conn=o-f}
- \def\pst@tempA{#1}%
- \def\pst@tempB{#2}%
- \def\pst@tempC{}%
- \def\pst@tempD{}%
- \pst@regNodes{\pst@tempA}{\pst@tempB}
- \pst@adjustTempNodes
- \@ifnextchar({\fibercollimator@ii}{\fibercollimator@iv}%
-}%
-%
-\def\fibercollimator@ii(#1){%
- \def\pst@tempC{#1}%
- \@ifnextchar({\fibercollimator@iii}{\fibercollimator@iv}%
-}%
-%
-\def\fibercollimator@iii(#1)#2{%
- \def\pst@tempD{#1}%
- \fibercollimator@iv{#2}%
-}
-\def\fibercollimator@iv#1{%
- \begin@OptexpObj
- \pst@draw@component{#1}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- \fibercollimator@v%
- }%
- \@nameuse{\psk@connIn}%
- \ifx\@empty\pst@tempC
- \@nameuse{\psk@connOut}%
- \else\ifx\@empty\pst@tempD
- \psbezier[style=FiberOut](\pst@tempC)(\pst@tempB)(\pst@tempB)(\optexp@nodeB)%
- \else
- \psbezier[style=FiberOut](\pst@tempD)(\pst@tempC)(\pst@tempB)(\optexp@nodeB)%
- \fi\fi
- \end@OptexpObj
-}%
-% \def\fibercollimator@i(#1)(#2){%
-% \addbefore@par{conn=o-f}
-% \def\pst@tempA{#1}%
-% \def\pst@tempB{#2}%
-% \@ifnextchar({\fibercollimator@ii}{\fibercollimator@iii}%
-% }%
-% %
-% \def\fibercollimator@ii(#1)#2{%
-% \pst@regNodes{\pst@tempA}{\pst@tempB}
-% \pst@adjustTempNodes
-% \begin@OptexpObj
-% \pst@draw@component{#2}{%
-% \pnode(0,0){tempNode@Label}%
-% \pnode(0,0){\optexp@nodeA}%
-% \pnode(0,0){\optexp@nodeB}%
-% \fibercollimator@iv%
-% }%
-% \@nameuse{\psk@connIn}%
-% \psbezier[style=FiberOut](#1)(\pst@tempB)(\pst@tempB)(\optexp@nodeB)%
-% \end@OptexpObj
-% }%
-% %
-% \def\fibercollimator@iii#1{%
-% \pst@regNodes{\pst@tempA}{\pst@tempB}
-% \begin@OptexpObj
-% \pst@adjustTempNodes
-% \pst@draw@component{#1}{%
-% \pnode(0,0){tempNode@Label}%
-% \pnode(0,0){\optexp@nodeA}%
-% \pnode(0,0){\optexp@nodeB}%
-% \fibercollimator@iv%
-% }%
-% \@nameuse{\psk@connIn}%
-% \@nameuse{\psk@connOut}%
-% \end@OptexpObj
-% }%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER COMPONENTS
-\newOptexpFiberDipole{optfiber}{}
-\newOptexpFiberDipole{optamp}{}
-\newOptexpFiberDipole{optmzm}{}
-\newOptexpFiberDipole{optfilter}{}
-\newOptexpFiberDipole{polcontrol}{}
-\newOptexpFiberDipole{optisolator}{}
-\newOptexpFiberDipole{optfiberpolarizer}{}
-\newOptexpFiberDipole{optswitch}{}
-\newOptexpFiberDipole{fiberdelayline}{}
-\newOptexpFiberQuadrupole{optcoupler}{}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% default settings
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\psset{%
-% general
- position=\@empty
- ,abspos=\@empty
- ,angle=0
- ,rotateref=c
-% lens
- ,lenswidth=0.2
- ,lensheight=1
- ,lenstype=\@empty
- ,lensradius=\@empty
- ,lensradiusleft=1
- ,lensradiusright=1
- ,thicklens=false
-% pinhole
- ,phlinewidth=2\pslinewidth
- ,outerheight=1
- ,innerheight=0.1
-% beamsplitter
- ,bssize=0.8
-% ,bsstyle=cube
-% crystal
- ,crystalwidth=1.4
- ,crystalheight=0.6
- ,caxislength=0.6
- ,lampscale=0.3
-% mirror
- ,mirrorwidth=1
- ,mirrordepth=0.1
- ,mirrorradius=0
- % can't use the \POS@mirror@type@plain macro as \define@choicekey
- % does not expand the list containing the alternatives
- ,mirrortype=plain
- ,mirrorlinewidth=2\pslinewidth
- ,variable=false
-% optgrid
- ,optgridcount=10
- ,optgridwidth=1
- ,optgridheight=0.15
- ,optgriddepth=0.075
- ,optgridtype=blazed
- ,optgridlinewidth=0.7\pslinewidth
- ,reverse=false
-% optbox
- ,optboxwidth=1.4
- ,optboxheight=0.8
- ,refractiveindex=\@empty
-% optplate
- ,plateheight=1
- ,platelinewidth=2\pslinewidth
-% optretplate
- ,platewidth=0.1
-% detector
- ,detsize=0.8
- ,dettype=round
-% polarization
- ,poltype=parallel
- ,polsize=0.6
- ,pollinewidth=0.7\pslinewidth
-% optdiode
- ,optdiodesize=0.8
-% pentaprism
- ,pentaprismsize=0.7
-% rightangleprism
- ,raprismsize=1.5
-% optprism
- ,prismsize=1
- ,prismangle=60
-% doveprism
- ,doveprismsize=0.6
-% label
- ,labeloffset=0.8
- ,labelangle=0
- ,labelstyle=\small
- ,labelalign=c
- ,labelref=relgrav
- ,ref@angle=0
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% fiber optics
- ,@compname=\@empty
- ,extnode=\@empty
- ,fiberloops=3
- ,fiberloopradius=0.4
- ,fiberloopsep=0.3
- ,optmzmsize=0.8
- ,optampsize=0.8
- ,filtersize=0.8
- ,filtertype=bandpass
- ,polcontrolsize=0.15
- ,isolatorsize=0.6
- ,fiberpolsize=0.6
- ,couplersize=0.2
- ,couplersep=0.05
- ,couplertype=elliptic
- ,switchsize=0.8
- ,switchstyle=opened
- ,fdlsize=0.6
- ,fibercolsize=0.3
- ,conn=-
- ,usefiberstyle=false
- ,bsstyle=cube
- ,compshift=0
- ,connjoin=1
-}%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DRAW COMPONENTS
-%
-% This macro is called by every unit
-%
-\def\pst@draw@component#1#2{%
- %
- \def\@@comp{%
- #2
- \ifx\POK@extnode\@empty\else
- \pnode(! \pst@optexpdict ExtNode end){\POK@extnode@name}
- \fi
- }%
- \ifPOE@endbox%
- \ifx\POK@label@offset\@empty
- \psset{labeloffset=0}
- \fi
- \psset{position=1}%
- \fi%
- %
- \ncline[linestyle=none,fillstyle=none,npos=]{tempNode@A}{tempNode@B}%
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Positioning of the component
- %
- \begingroup
- %
- \psset{style=OptComp}
- %
- % linestyle to use, if component should be marked as optional
- \ifPOE@component@optional
- \psset{style=OptionalStyle}%
- \fi
- % if parameter 'position' is given, use it for 'npos'
- \ifx\POK@position\@empty
- %
- % then check if absolute positioning is wanted
- \ifx\POK@abspos\@empty
- \ncput[nrot=:U,npos=]{\put@Comp{\@@comp}}
- \else
- \nlput[nrot=:U](tempNode@A)(tempNode@B){\POK@abspos}{\put@Comp{\@@comp}}
- \fi
- \else
- \ncput[nrot=:U,npos=\POK@position]{\put@Comp{\@@comp}}
- \fi
- \endgroup
- %
- % Now put the label
- \ifPOE@label@innerlabel
- \ifdim\optboxwidth>0pt
- \psset{labeloffset=0, labelref=relative}
- \put@Label{\parbox{\optboxwidth}{#1}}%
- \else
- \put@Label{#1}%
- \fi
- \else
- \put@Label{#1}%
- \fi
- %
- % Show some special dots for debugging
- \ifPOE@debug@showoptdots
- \psdot[linecolor=red](tempNode@Label)
- \psdot[linecolor=red](tempNode@LabelShifted)
- \psdot[linecolor=black](tempNode@A)
- \psdot[linecolor=black](tempNode@B)
- \fi
- %
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% IMPLEMENTATIONS OF ALL ...@iii MACROS
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% MIRROR
-%
-\def\mirror@iii{%
- \edef\@mirror@ht{\POK@mirror@width\space\pst@number\psyunit mul 2 div }%
- \edef\@mirror@dp{\POK@mirror@depth\space\pst@number\psxunit mul }%
- \edef\@mirror@r{\POK@mirror@radius\space\pst@number\psxunit mul }%
- \edef\@mirror@postcode{neg 5 -1 roll exch 5 2 roll 90 add exch 90 add exch ArcR }%
- \edef\@mirror@extpostcode{neg \@mirror@dp add 5 -1 roll exch 5 2 roll 90 add exch 90 add }%
- %
- %
- % concave mirrors
- %
- \ifdim\POK@mirror@radius pt<0pt
- % always draw the input plane
- \begin@OpenObj
- \addto@pscode{\pst@optexpdict \@mirror@ht \@mirror@r rightConcave \@mirror@postcode end}%
- \end@OpenObj
- \ifx\POK@mirror@type\POS@mirror@type@extended
- %
- % extended concave mirror
- \psset{style=ExtendedMirror}
- \begin@ClosedObj
- \addto@pscode{\pst@optexpdict \@mirror@ht \@mirror@r rightConcave \@mirror@postcode
- \@mirror@ht \@mirror@r rightConcave \@mirror@extpostcode arc
- closepath end}%
- \end@ClosedObj
- \fi
- %
- %
- % convex mirrors
- %
- \else\ifdim\POK@mirror@radius pt>0pt
- % always draw the input plane
- \begin@OpenObj
- \addto@pscode{\pst@optexpdict \@mirror@ht \@mirror@r rightConvex \@mirror@postcode end}%
- \end@OpenObj
- \ifx\POK@mirror@type\POS@mirror@type@extended
- %
- % extended convex mirror
- \psset{style=ExtendedMirror}
- \begin@ClosedObj
- \addto@pscode{\pst@optexpdict \@mirror@ht \@mirror@r rightConvex \@mirror@postcode
- \@mirror@ht \@mirror@r rightConvex \@mirror@extpostcode arcn
- closepath end}%
- \end@ClosedObj
- \fi
- \else
- %
- % plain mirror
- %
- \edef\@m@wd{\POK@mirror@width\space 2 div }
- \ifPOE@variable
- \psarc[linewidth=0.8\pslinewidth,arrowinset=0,arrowscale=0.8]{<->}
- (! \@m@wd 0.4 sub 0){0.6}{-20}{20}
- \psarc[linewidth=0.8\pslinewidth,arrowinset=0,arrowscale=0.8]{<->}
- (! \@m@wd 0.4 sub neg 0){0.6}{160}{200}
- \fi
- \psline[linewidth=\POK@mirror@linewidth](! \@m@wd neg \getCLWH)(! \@m@wd \getCLWH)
- %
- % mirrortype
- \ifx\POK@mirror@type\POS@mirror@type@piezo%
- %
- % piezo
- \psframe[style=PiezoMirror,dimen=outer](! \@m@wd 4 div 0)(! \@m@wd -4 div \@m@wd 2.5 div)
- \ifx\POK@extnode\@empty
- \psbezier(! 0 \@m@wd 2.5 div)%
- (! 0 \@m@wd 1.5 div)%
- (! \@m@wd 2 div \@m@wd 2 div)%
- (! \@m@wd 4 div \@m@wd)%
- \else
- \pst@Verb{/@@y0 \@m@wd 2.5 div def }%
- \fi
- \else\ifx\POK@mirror@type\POS@mirror@type@extended%
- %
- % extended
- \psframe[style=ExtendedMirror]%
- (! \@m@wd neg \POK@mirror@depth\space )%
- (! \@m@wd 0)%
- \fi\fi
- \fi\fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% LENS
-%
-\def\lens@iii{%
- %
- % use old lens code to maintain backward compatibility
- \ifx\POK@lens@type\@empty
- % NEW CODE!
- \begin@ClosedObj
- \edef\@lens@newwd{0\space}%
- \edef\@lens@wd{\POK@lens@width\space\pst@number\psxunit mul 2 div }%
- \edef\@lens@th{0}%
- \addto@pscode{%
- \pst@optexpdict
- /@wd \POK@lens@width\space\pst@number\psxunit mul 2 div def
- /@ht \POK@lens@height\space\pst@number\psyunit mul 2 div def
- /@rL \POK@lens@radiusLeft\space\pst@number\psxunit mul def
- /@rR \POK@lens@radiusRight\space\pst@number\psxunit mul def
- /@th 0 def
- }%
- %
- % distinguish between all the different lens-combination possibilities
- %
- \ifdim\POK@lens@radiusLeft pt=0pt\else
- % this takes the /a1 definition from the leftC* procedures
- % the macro is necessary for the outer nodes
- \edef\@lens@newwd{%
- \POK@lens@radiusLeft\space\POK@lens@height\space 2 div segLen
- \ifdim\POK@lens@radiusLeft pt<0pt
- 0.5 mul
- \fi\space
- }%
- %
- \edef\@lens@th{\ifPOE@thicklens \POK@lens@width\space 2 div \else \POK@lens@radiusLeft\space\POK@lens@height\space 2 div segLen \fi}%
- \addto@pscode{%
- /@th \ifPOE@thicklens @wd \else @rL @ht segLen \fi def
- @ht @rL
- \ifdim\POK@lens@radiusLeft pt<0pt
- leftConcave
- \else
- leftConvex
- \fi
- }%
- \fi
- \ifdim\POK@lens@radiusRight pt=0pt\else
- % this takes the /a1 definition from the rightC* procedures
- % the macro is necessary for the outer nodes
- \edef\@lens@th{\@lens@th\space\ifPOE@thicklens \POK@lens@width\space 2 div\else \POK@lens@radiusRight\space\POK@lens@height\space 2 div segLen \fi\space add}%
- \addto@pscode{%
- /@th @th \ifPOE@thicklens @wd \else @rR @ht segLen \fi add def
- @ht @rR
- \ifdim\POK@lens@radiusRight pt<0pt
- rightConcave
- \else
- rightConvex
- \fi
- }%
- \fi
- %
- % check some special cases
- %
- % 1) Left is plain - right concave
- % \- right convex
- \ifdim\POK@lens@radiusLeft pt=0pt
- \ifdim\POK@lens@radiusRight pt=0pt\else
- \addto@pscode{%
- @th 2 div sub neg 5 1 roll
- @th 2 div neg @ht neg moveto ArcR
- @th 2 div neg @ht lineto
- }%
- \fi
- \fi
- %
- %
- % 2) Right is plain - left concave
- % \- left convex
- \ifdim\POK@lens@radiusRight pt=0pt
- \ifdim\POK@lens@radiusLeft pt=0pt\else
- \addto@pscode{%
- @th 2 div sub 5 1 roll
- @th 2 div @ht moveto ArcL
- @th 2 div @ht neg lineto
- }%
- \fi
- \fi
- %
- % 3) right and left are both curved
- \ifdim\POK@lens@radiusRight pt=0pt\else
- \ifdim\POK@lens@radiusLeft pt=0pt\else
- \addto@pscode{%
- @th 2 div dup
- 7 1 roll sub neg 5 1 roll
- ArcR sub 5 1 roll ArcL
- }%
- \fi
- \fi
- %
- % now complete the object
- \addto@pscode{closepath 1 setlinejoin end }%
- \pnode(! \pst@optexpdict\space\@lens@th\space -2 div 0 end){\optexp@nodeA}
- \pnode(! \pst@optexpdict\space\@lens@th\space 2 div 0 end){\optexp@nodeB}
- \end@ClosedObj
- %
- % OLD CODE (compatibility)
- \else
- \pst@draw@lens
- \fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% LENS (old) maintained for backward compatibility
-% used only if lensheight and lenswidth must be used to draw the lens
-% (i.e. when lensradius is not defined)
-%
-\def\pst@draw@lens{%
-%
- \edef\@l@h{\POK@lens@height\space 2 div\space}%
- \edef\@l@a{\POK@lens@width\space 2 div\space}%
- %
- \ifnum\POK@lens@type<3
- % CONVEX
- \ifx\POK@lens@radius\@empty
- \edef\@l@r{\@l@a 2 div \@l@h dup mul 2 \@l@a mul div add\space}%
- \else
- \edef\@l@r{\POK@lens@radius\space}%
- \edef\@l@a{\@l@r dup dup mul \@l@h dup mul sub sqrt sub\space}%
- \fi
- %
- % define some parameters only for convex lenses
- \edef\@l@d{\@l@r \@l@a sub\space}%
- \edef\@l@alpha{\@l@h \@l@d atan\space}%
- \edef\@l@y{\@l@d\space}%
- \else
- % CONCAVE
- \ifx\POK@lens@radius\@empty
- \edef\@l@r{\@l@h 1.5 mul\space}%
- \else
- \edef\@l@r{\POK@lens@radius\space}%
- \fi%
- %
- % define some parameters only for concave lenses
- \edef\@l@d{\@l@r dup mul \@l@h dup mul sub sqrt\space}%
- \edef\@l@alpha{\@l@h \@l@d atan\space}%
- \edef\@l@y{\@l@r \@l@a add\space}%
- \fi%
- %
- %
- \def\temp@LeftPlot{%
- \parametricplot[liftpen=1]{-1}{1}{%
- \@l@r \@l@alpha t mul 180 add cos mul \@l@y add \@l@r \@l@alpha t mul 180 add sin mul}%
- }%
- \def\temp@RightPlot{%
- \parametricplot[liftpen=1]{-1}{1}{%
- \@l@r \@l@alpha t mul cos mul \@l@y sub \@l@r \@l@alpha t mul sin mul}%
- }%
- %
- %
- \pscustom{%
- \ifcase\POK@lens@type
- % plainconvex
- \temp@RightPlot%
- \closepath%
- \or
- % convexplain
- \temp@LeftPlot%
- \closepath%
- \or
- % biconvex
- \temp@LeftPlot%
- \temp@RightPlot%
- \closepath
- \or
- % plainconcave
- \temp@LeftPlot%
- \psline[liftpen=1](! 0 \@l@h neg)%
- (! 0 \@l@h)%
- (! \@l@r \@l@d sub \@l@a add \@l@h)%
- \closepath
- \or%
- % concaveplain
- \temp@RightPlot%
- \psline[liftpen=1](! 0 \@l@h)%
- (! 0 \@l@h neg)%
- (! \@l@r \@l@d sub \@l@a add neg \@l@h neg)%
- \closepath
- \or
- % biconcave
- \temp@RightPlot%
- \temp@LeftPlot%
- \closepath
- \fi
- }%
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% PINHOLE
-%
-\def\pinhole@iii{%
- \psline[linewidth=\POK@pinhole@linewidth]%
- (! 0 \POK@pinhole@oheight\space 2 div)%
- (! 0 \POK@pinhole@iheight\space 2 div)%
- \psline[linewidth=\POK@pinhole@linewidth]%
- (! 0 \POK@pinhole@oheight\space -2 div)%
- (! 0 \POK@pinhole@iheight\space -2 div)%
-\ignorespaces}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% BEAMSPLITTER
-%
-\def\beamsplitter@iii{%
- \edef\@bs@wd{\POK@bssize\space 2.0 div\space}%
- \ifx\POK@bsstyle\POS@bs@cube
- \psline{cc-cc}(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
- \rput[c]{45}(0,0){\psframe(! \@bs@wd neg \@bs@wd neg)(! \@bs@wd \@bs@wd)}
- \else\ifx\POK@bsstyle\POS@bs@plate
- \psline(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
- \fi\fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% CRYSTAL
-%
-\def\crystal@iii{%
- \pst@Verb{%
- /@@x \POK@crystal@width\space 0.5 mul def
- /@@y \POK@crystal@height\space 0.5 mul def
- }%
- \psrotate(! @@x \POK@rotate@xref\space mul @@y \POK@rotate@yref\space mul)
- {\POK@angle}{%
- \psframe(! @@x neg @@y neg)(! @@x @@y)
- \ifPOE@crystal@voltage%
- \psline(! @@x 4 div 3 mul neg @@y)%
- (! @@x 4 div 3 mul neg @@y 0.2 add)
- \pscircle[fillstyle=solid,%
- fillcolor=white](! @@x 4 div 3 mul neg @@y 0.2 add){0.04}
- \psline(! @@x 4 div 3 mul neg @@y neg)%
- (! @@x 4 div 3 mul neg @@y neg 0.2 sub)%
- \psline(! @@x 4 div 3 mul neg 0.15 sub @@y neg 0.2 sub)%
- (! @@x 4 div 3 mul neg 0.15 add @@y neg 0.2 sub)%
- \fi
- %
- \ifPOE@crystal@lamp
- \rput{180}(! @@x @@y 1.4 \POK@lamp@scale\space mul add){\crystal@lamp}%
- \fi
- % plot c-axis only, if caxislength > 0
- \ifdim\POK@crystal@caxislength pt>0pt
- \edef\@c@caxisL{\POK@crystal@caxislength\space 2 div\space}%
- \ifPOE@crystal@caxisinv
- %
- % invert the c-axis
- \psline[linestyle=dashed,%
- dash=2pt 2pt,%
- linewidth=0.7\pslinewidth,%
- arrowinset=0]{->}%
- (! 0 @@y neg)(! 0 @@y \@c@caxisL add)%
- \else
- \psline[linestyle=dashed,%
- dash=2pt 2pt,%
- linewidth=0.7\pslinewidth,%
- arrowinset=0]{->}%
- (! 0 @@y)(! 0 @@y neg \@c@caxisL sub)%
- \fi
- \fi
- \pnode(0,0){tempNode@Label}
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x
- \ifx\POK@optbox@n\@empty 0 \else
- \POK@angle\space sin neg dup dup mul neg \POK@optbox@n\space dup mul add sqrt div 2 @@x mul mul
- \fi
- ){\optexp@nodeB}
- %\pnode(! \@c@wd neg 0){\optexp@nodeA}
- %\pnode(! \@c@wd 0){\optexp@nodeB}
- }%
-\ignorespaces}%
-%
-% LAMP FOR THE CRYSTAL
-%
-\def\crystal@lamp{%
- \psset{linewidth=0.6\pslinewidth}
- \edef\@l@s{\POK@lamp@scale\space}%
- %
- \pscurve[fillstyle=none](! -0.05 \@l@s mul 0)%
- (! -0.1 \@l@s mul 0.15 \@l@s mul)%
- (! -0.2 \@l@s mul 0.25 \@l@s mul)%
- (! -0.25 \@l@s mul 0.5 \@l@s mul)%
- (! 0 0.7 \@l@s mul)%
- (! 0.25 \@l@s mul 0.5 \@l@s mul)%
- (! 0.2 \@l@s mul 0.25 \@l@s mul)%
- (! 0.1 \@l@s mul 0.15 \@l@s mul)%
- (! 0.05 \@l@s mul 0)
- \multido{\i=-210+40}{7}{%
- \rput{\i}(! 0 0.45 \@l@s mul){\psline(! -0.35 \@l@s mul 0)(! -0.6 \@l@s mul 0)}
- }
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% POLARIZATION
-%
-\def\polarization@iii{%
-%
- \edef\@pol@size{\POK@polarization@size\space 2 div\space}%
- \ifx\POK@pol@type\POS@pol@polparallel
- \psline[linestyle=solid,linewidth=\POK@polarization@linewidth,arrowscale=0.8]{<->}%
- (! 0 \@pol@size neg)(! 0 \@pol@size)%
- \fi
- \ifx\POK@pol@type\POS@pol@polperp
- \psdot[dotsize=0.05](0,0)%
- \pscircle[fillstyle=none,linestyle=solid,linewidth=\POK@polarization@linewidth](0,0){0.12}%
- \fi
- \ifx\POK@pol@type\POS@pol@polmisc
- \psline[linestyle=solid,linewidth=\POK@polarization@linewidth,arrowscale=0.8]{<->}%
- (! 0 \@pol@size neg)(! 0 \@pol@size)%
- \psdot[dotsize=0.05](0,0)%
- \pscircle[fillstyle=none,linestyle=solid,linewidth=0.7\pslinewidth](0,0){0.12}%
- \fi
- \ifx\POK@pol@type\POS@pol@polrcirc
- \psellipticarc[linewidth=\POK@polarization@linewidth]{->}%
- (0,0)(! \@pol@size 2 div \@pol@size){20}{-20}%
- \fi
- \ifx\POK@pol@type\POS@pol@pollcirc
- \psellipticarc[linewidth=\POK@polarization@linewidth]{<-}%
- (0,0)(! \@pol@size 2 div \@pol@size){20}{-20}
- \fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTICAL GRID
-%
-\def\optgrid@iii{%
- \edef\@g@cnt{\POK@optgrid@count\space}%
- \edef\@g@wd{\POK@optgrid@width\space 2 div\space}%
- \edef\@g@ht{\POK@optgrid@height\space}%
- \edef\@g@dp{\POK@optgrid@depth\space}%
- \edef\@g@step{\POK@optgrid@width\space\@g@cnt div\space}%
- \ifx\POK@optgrid@type\POS@optgrid@type@blazed
- \ifPOE@reverse%
- \pscustom[linewidth=\POK@optgrid@linewidth, linejoin=1]{%
- \psline[liftpen=1](! \@g@wd \@g@dp)(! \@g@wd \@g@ht)%
- (! \@g@wd neg \@g@ht)(! \@g@wd neg \@g@dp)
- \multido{\i=0+1}{\POK@optgrid@count}{%
- \psline[liftpen=1](! \@g@wd neg \i\space \@g@step mul add \@g@dp)%
- (! \@g@wd neg \i\space \@g@step mul add 0)%
- (! \@g@wd neg \i\space 1 add \@g@step mul add \@g@dp)%
- }%
- \closepath
- }%
- \else%
- \pscustom[linewidth=\POK@optgrid@linewidth, linejoin=1]{%
- \psline[liftpen=1](! \@g@wd \@g@dp)(! \@g@wd \@g@ht)%
- (! \@g@wd neg \@g@ht)(! \@g@wd neg \@g@dp)
- \multido{\i=0+1}{\POK@optgrid@count}{%
- \psline[liftpen=1](! \@g@wd neg \i\space \@g@step mul add \@g@dp)%
- (! \@g@wd neg \i\space 1 add \@g@step mul add 0)%
- (! \@g@wd neg \i\space 1 add \@g@step mul add \@g@dp)%
- }%
- \closepath
- }%
- \fi%
- \else\ifx\POK@optgrid@type\POS@optgrid@type@binary
- \pscustom[linewidth=\POK@optgrid@linewidth]{%
- \psline[liftpen=1](! \@g@wd \@g@dp)(! \@g@wd \@g@ht)%
- (! \@g@wd neg \@g@ht)(! \@g@wd neg \@g@dp)
- \multido{\i=0+1}{\POK@optgrid@count}{%
- \psline[liftpen=1](! \@g@wd neg \i\space \@g@step mul add \@g@dp)%
- (! \@g@wd neg \i\space \@g@step mul add 0)%
- (! \@g@wd neg \i\space 0.5 add \@g@step mul add 0)%
- (! \@g@wd neg \i\space 0.5 add \@g@step mul add \@g@dp)%
- (! \@g@wd neg \i\space 1 add \@g@step mul add \@g@dp)%
- }%
- }%
- \fi\fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTBOX
-%
-\def\optbox@iii{%
- \pst@Verb{%
- /@@x \POK@optbox@width\space 0.5 mul def
- /@@y \POK@optbox@height\space 0.5 mul def
- }%
- \ifPOE@endbox
- \pst@Verb{/@@x0 @@x def}%
- \psrotate(! @@x0 @@x \POK@rotate@xref\space mul add
- @@y0 @@y \POK@rotate@yref\space mul add){\POK@angle}{%
- \pnode(! @@x 0){tempNode@Label}%
- \psframe[dimen=outer](! 0 @@y neg)(! @@x 2 mul @@y)
- \pnode(tempNode@B){\optexp@nodeA}
- }%
- \else
- \psrotate(! @@x0 @@x \POK@rotate@xref\space mul add
- @@y0 @@y \POK@rotate@yref\space mul add){\POK@angle}{%
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x
- \ifx\POK@optbox@n\@empty 0 \else
- \POK@angle\space sin neg dup dup mul neg \POK@optbox@n\space dup mul add sqrt div 2 @@x mul mul
- \fi
- ){\optexp@nodeB}
- \pnode(0,0){tempNode@Label}
- \psframe[dimen=outer](! @@x neg @@y neg)(! @@x @@y)
- }%
- \fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTPLATE
-%
-\def\optplate@iii{%
- \psline[linewidth=\POK@plate@linewidth]%
- (! \POK@plate@height\space 2 div \POK@angle\space 2 copy sin mul 3 1 roll cos mul neg)%
- (! \POK@plate@height\space 2 div \POK@angle\space 2 copy sin mul neg 3 1 roll cos mul )%
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DETECTOR
-%
-\def\optdetector@iii{%
- \pnode(tempNode@B){\optexp@nodeA}
- \ifx\POK@detector@type\POS@detector@round
- \pnode(! \POK@detector@size\space .2 mul 0){tempNode@Label}%
- \begin@ClosedObj
- % I could have use pswedge but then a correction of the component size
- % depending on the current linewidth is not possible
- \addto@pscode{CLW 0.5 mul 0 \POK@detector@size\space\pst@number\psrunit mul 0.5 mul
- CLW sub -90 90 arc closepath }%
- \end@ClosedObj
- \pst@Verb{/@@x0 \POK@detector@size\space 0.5 mul def}%
- \else\ifx\POK@detector@type\POS@detector@diode
- \edef\@sz{\POK@detector@size\space 0.5 mul\space}%
- \psframe[dimen=outer](! 0 \@sz neg)(!\@sz 2 mul \@sz)
- \pspolygon(! \@sz 0.8 mul \@sz -0.4 mul)%
- (! \@sz 1.6 mul \@sz -0.4 mul)%
- (! \@sz 1.2 mul \@sz 0.4 mul)%
- \psline(! \@sz 0.8 mul \@sz 0.4 mul \getCLWH add)(! \@sz 1.6 mul \@sz 0.4 mul \getCLWH add)
- \psset{arrows=->, arrowinset=0, arrowscale=0.8}
- \psline(! \@sz 0.2 mul \@sz 0.6 mul)(! \@sz 0.7 mul \@sz 0.3 mul)
- \psline(! \@sz 0.2 mul \@sz 0.3 mul)(! \@sz 0.7 mul 0)
- \psline(! \@sz 0.2 mul 0)(! \@sz 0.7 mul \@sz -0.3 mul)
- \pst@Verb{/@@x0 \@sz def /@@x \@sz def /@@y \@sz def}%
- \pnode(! \@sz 0){tempNode@Label}
- \fi\fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTRETPLATE
-%
-\def\optretplate@iii{%
- \edef\@p@ht{\POK@plate@height\space 2 div\space}%
- \edef\@p@wd{\POK@plate@width\space 2 div\space}%
- \psframe(! \@p@wd neg \@p@ht neg)(! \@p@wd \@p@ht)
- \psline{cc-cc}(! \@p@wd neg \@p@ht)(! \@p@wd \@p@ht neg)
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTDIODE
-%
-\def\optdiode@iii{%
- \edef\@sz{\POK@diode@size\space}%
- \psframe[dimen=outer](! \@sz -0.5 mul dup)(!\@sz 0.5 mul dup)
- \pspolygon(! \@sz -0.2 mul \@sz -0.2 mul)
- (! \@sz -0.2 mul \@sz 0.2 mul)
- (! \@sz 0.2 mul 0)
- \psline(! \@sz 0.2 mul \getCLWH add \@sz 0.2 mul)(! \@sz 0.2 mul \getCLWH add \@sz -0.2 mul)
- \pnode(! \@sz -0.5 mul 0){\optexp@nodeA}
- \pnode(! \@sz 0.5 mul 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DOVE PRISM
-%
-\def\doveprism@iii{%
- \edef\@ht{\POK@doveprism@size\space 0.5 mul\space}%
- \edef\@wd{\POK@doveprism@size\space 1.5 mul\space}%
- \pspolygon(! \@wd neg \@ht neg)%
- (! \@wd \@ht neg)%
- (! \@ht dup)%
- (! \@ht neg \@ht)%
- \pnode(!\@wd \@ht add -0.5 mul 0){\optexp@nodeA}
- \pnode(! 0 \@ht neg){\optexp@node{2}}
- \pnode(!\@wd \@ht add 0.5 mul 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% PENTA PRISM
-%
-\def\pentaprism@iii{%
- \edef\@pp@size{\POK@pentaprism@size\space}%
- \pscustom{%
- \psline(! \@pp@size 2 sqrt div 0)%
- (! \@pp@size 2 sqrt div 67.5 cos \@pp@size mul 67.5 sin div sub \@pp@size)%
- (! 67.5 cos \@pp@size mul 67.5 sin div \@pp@size 2 sqrt div sub \@pp@size)%
- (! \@pp@size 2 sqrt div neg 0)%
- (! 0 \@pp@size 2 sqrt div neg)%
- \closepath
- }%
- \pnode(! \@pp@size 2 sqrt div 67.5 cos \@pp@size mul 67.5 sin 2 mul div sub \@pp@size 2 div){\optexp@nodeA}%
- \pnode(! 67.5 cos \@pp@size mul 67.5 sin 2 mul div \@pp@size 2 sqrt div sub \@pp@size 2 div){\optexp@nodeB}%
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% PRISM
-%
-\def\optprism@iii{%
- %
-% \pst@Verb{%
-% /@sz \POK@prism@size\space def
-% /@alpha \POK@prism@angle\space 0.5 mul def
-% /@hshift @sz 0.5 mul @alpha tan mul \pst@optexpdict OEangle end 0.5 mul tan div def
-% }%
-% \pspolygon(! @sz neg @alpha tan mul @sz -0.5 mul @hshift sub)
-% (! @sz @alpha tan mul @sz -0.5 mul @hshift sub)
-% (! 0 @sz 0.5 mul @hshift sub)
-% \pnode(! @sz -0.5 mul @alpha tan mul @hshift neg){\optexp@nodeA}
-% \pnode(! @sz 0.5 mul @alpha tan mul @hshift neg){\optexp@nodeB}
- \pst@Verb{%
- /@sz \POK@prism@size\space def
- /@alpha \POK@prism@angle\space 0.5 mul def
- /@hshift @sz 0.6 mul @alpha tan mul \pst@optexpdict OEangle end 0.5 mul tan div def
- }%
- \pspolygon(! @sz neg @alpha tan mul @sz -0.4 mul @hshift sub)
- (! @sz @alpha tan mul @sz -0.4 mul @hshift sub)
- (! 0 @sz 0.6 mul @hshift sub)
- \pnode(! @sz -0.6 mul @alpha tan mul @hshift neg){\optexp@nodeA}
- \pnode(! @sz 0.6 mul @alpha tan mul @hshift neg){\optexp@nodeB}
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% RIGHT-ANGLE PRISM
-%
-\def\rightangleprism@iii{%
- %
- \pst@Verb{%
- /prism@size \POK@raprism@size\space 0.5 mul def
- /h \pst@optexpdict OEangle 0.5 mul sin modA mul end def
- }%
- \pspolygon(! prism@size neg h \getCLW add prism@size sub)
- (! prism@size h \getCLW add prism@size sub)
- (! 0 h \getCLW 2 sqrt mul add)%
- \pnode(! h neg 0){\optexp@nodeA}
- \pnode(! h 0){\optexp@nodeB}
-}%
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER OPTICS
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER
-%
-\def\optfiber@iii{%
- \edef\@f@cnt{\POK@fiber@count\space}%
- \edef\@f@r{\POK@fiber@radius\space}%
- \edef\@f@sep{\POK@fiber@sep\space}%
- \parametricplot[plotpoints=200,style=Fiber]{0}{1}{%
- t 360 mul \@f@cnt mul sin \@f@r mul \@f@sep \@f@cnt 1 sub mul t 0.5 sub mul add
- 1 t 360 mul \@f@cnt mul cos sub \@f@r mul
- }%
- \pnode(!\@f@sep \@f@cnt 1 sub mul \@f@r mul 0.5 mul neg 0){\optexp@nodeA}
- \pnode(!\@f@sep \@f@cnt 1 sub mul \@f@r mul 0.5 mul 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTMZM
-%
-\def\optmzm@iii{%
- \pst@Verb{%
- /@@x \POK@optmzm@size\space 0.8 mul def
- /@@y \POK@optmzm@size\space 0.5 mul def
- }%
- \bgroup
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \psline(! @@x neg 0)(! @@x -0.7 mul 0)(! @@x -0.4 mul @@y 0.6 mul)%
- (! @@x 0.4 mul @@y 0.6 mul)(! @@x 0.7 mul 0)(! @@x 0)%
- (! @@x 0.7 mul 0)(! @@x 0.4 mul @@y -0.6 mul)%
- (! @@x -0.4 mul @@y -0.6 mul)(! @@x -0.7 mul 0)%
- \egroup
- \psframe[dimen=outer](! @@x neg @@y neg)(! @@x @@y)
- %
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTICAL FILTER
-%
-\def\optfilter@iii{%
- \pst@Verb{%
- /@@x \POK@filter@size\space 0.5 mul def
- /@@y @@x def
- }%
- \def\filter@curve{%
- \parametricplot[plotstyle=curve,arrows=c-c]{-1}{1}{%
- t @@x mul 0.7 mul t Pi mul RadtoDeg 90 add cos 0.2 @@x mul mul}%
- }%
- \psframe[dimen=outer](! @@x neg dup)(! @@x dup)
- \multips(! 0 -0.5 @@y mul)(! 0 0.5 @@y mul){3}{\filter@curve}
- \ifx\POK@filter@type\POS@filter@type@bandpass
- \psline(! -0.3 @@x mul -0.65 @@y mul)%
- (! 0.3 @@x mul -0.35 @@y mul)%
- \psline(! -0.3 @@x mul 0.35 @@y mul)%
- (! 0.3 @@x mul 0.65 @@y mul)%
- \rput(! 0 -0.5 @@y mul){\filter@curve}
- \rput(0, 0){%
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \filter@curve}
- \rput(! 0 0.5 @@y mul){\filter@curve}
- \else\ifx\POK@filter@type\POS@filter@type@bandstop
- \psline(! -0.3 @@x mul -0.15 @@y mul)%
- (! 0.3 @@x mul 0.15 @@y mul)%
- \rput(! 0 -0.5 @@y mul){%
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \filter@curve}
- \rput(0, 0){\filter@curve}
- \rput(! 0 0.5 @@y mul){%
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \filter@curve}
- \fi\fi
- %
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTICAL AMPLIFIER
-%
-\def\optamp@iii{%
- \edef\@sz{\POK@optamp@size\space 0.5 mul\space}%
- \edef\@xl{0.75 sqrt \@sz mul\space}%
- \pspolygon(! \@xl 0)(! \getCLWH \@xl sub \@sz)(! \getCLWH \@xl sub \@sz neg)
- \pnode(!\@xl neg 0){\optexp@nodeA}
- \pnode(!\@xl 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% POLARIZATION CONTROLLER
-%
-\def\polcontrol@iii{%
- \edef\@sz{\POK@polcontrol@size\space}%
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \multips(! -2.5 \@sz mul \@sz)(! 2.5 \@sz mul 0){3}{\pscircle(0,0){\POK@polcontrol@size}}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ISOLATOR
-%
-\def\optisolator@iii{%
- \edef\@ht{\POK@isolator@size\space 2 div\space}%
- \edef\@wd{\POK@isolator@size\space 0.8 mul\space}%
- \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
- \psline[linewidth=2\pslinewidth,arrowinset=0]{->}(! \@wd neg 0.6 mul 0)(!\@wd 0.6 mul 0)
- \pnode(! \@wd neg 0){\optexp@nodeA}
- \pnode(! \@wd 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER POLARIZER
-%
-\def\optfiberpolarizer@iii{%
- \edef\@ht{\POK@fiberpol@size\space 2 div\space}%
- \edef\@wd{\POK@fiberpol@size\space 0.8 mul\space}%
- \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
- \psline(! \@wd neg 0.2 mul \@ht neg)(!\@wd 0.2 mul \@ht)
- \pnode(! \@wd neg 0){\optexp@nodeA}
- \pnode(! \@wd 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% SWITCH
-%
-\def\optswitch@iii{%
- \pst@Verb{%
- /@@x \POK@switch@size\space 0.5 mul def
- /@@y @@x def
- }%
- \pnode(! @@x neg 0){\optexp@nodeA}%
- \pnode(! @@x 0){\optexp@nodeB}%
- % storing the linewidth of the object allows for some aesthetic fine tuning
- \pstVerb{tx@Dict begin /@lw \getCLW def end}%
- % the fiber parts
- \bgroup
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \psline[arrows=-](! @@x neg 0)(! @@x -0.6 mul @lw sub 0)%
- \psline[arrows=-](! @@x 0.6 mul 0)(! @@x 0)%
- \egroup
- % different styles
- \ifx\POK@switch@style\POS@optexp@closed%
- %
- \bgroup
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \psdot[dotsize=3\pslinewidth](! @@x 0.6 mul 0)%
- \psdot[dotsize=3\pslinewidth](! @@x -0.6 mul 0)%
- \psline[arrows=-, linewidth=1.5\pslinewidth](! @@x -0.6 mul @lw)(! @@x 0.6 mul @lw)%
- \egroup
- \else
- \psline[arrows=-, linewidth=1.5\pslinewidth](! @@x -0.6 mul @lw add @lw)(! @@x 0.6 mul dup)%
- \pscircle(! @@x -0.6 mul 0){\pslinewidth}%
- \psdot[dotsize=3\pslinewidth](! @@x 0.6 mul 0)%
- \fi
- \psframe[dimen=outer](! @@x neg dup)(! @@x dup)%
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER DELAY LINE
-%
-\def\fiberdelayline@iii{%
- \pst@Verb{%
- /@@x \POK@fdl@size\space 0.8 mul def
- /@@y \POK@fdl@size\space 0.5 mul def
- }%
- \psframe[dimen=outer](! @@x neg @@y neg)(! @@x @@y)
- \psline{->}(! @@x -0.3 mul @@y -1.5 mul)(! @@x 0.3 mul @@y 1.7 mul)
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% COUPLER
-%
-\def\optcoupler@iii{%
- \edef\@sz{\POK@coupler@size\space}%
- \edef\@sep{\POK@coupler@sep\space 0.5 mul\space}%
- \ifx\POK@align\POS@optexp@top
- \pst@Verb{/@yshift \@sep neg def}%
- \else\ifx\POK@align\POS@optexp@bottom
- \pst@Verb{/@yshift \@sep def}%
- \else
- \pst@Verb{/@yshift 0 def}%
- \fi\fi
- \ifx\POK@coupler@type\POS@coupler@type@elliptic
- \psellipse[dimen=outer](!0 @yshift)(! \@sz \@sz 0.4 mul)
- \ifPOE@variable
- \psline[arrowinset=0]{->}(!\@sz -0.5 mul \@sz neg @yshift add)(!\@sz 0.5 mul \@sz @yshift add)
- \fi
- \pnode(! \@sz neg \getCLW 0.3 mul add @yshift \@sep add){tempNode@A@1}
- \pnode(! \@sz neg \getCLW 0.3 mul add @yshift \@sep sub){tempNode@A@2}
- \pnode(! \@sz \getCLW 0.3 mul sub @yshift \@sep add){tempNode@B@1}
- \pnode(! \@sz \getCLW 0.3 mul sub @yshift \@sep sub){tempNode@B@2}
- \pnode(! 0 @yshift){tempNode@Label}
- \else\ifx\POK@coupler@type\POS@coupler@type@none
- \pnode(! \@sz -0.5 mul @yshift \@sep add){tempNode@A@1}
- \pnode(! \@sz -0.5 mul @yshift \@sep sub){tempNode@A@2}
- \pnode(! \@sz 0.5 mul @yshift \@sep add){tempNode@B@1}
- \pnode(! \@sz 0.5 mul @yshift \@sep sub){tempNode@B@2}
- \psline[style=Fiber](tempNode@A@1)(tempNode@B@1)
- \psline[style=Fiber](tempNode@A@2)(tempNode@B@2)
- \fi\fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% WDM COUPLER
-%
-\def\wdmcoupler@ii{%
- \edef\@sz{\POK@coupler@size\space}%
- \edef\@sep{\POK@coupler@sep\space 0.5 mul\space}%
- \ifx\POK@align\POS@optexp@top
- \pst@Verb{/@yshift \@sep neg def}%
- \else\ifx\POK@align\POS@optexp@bottom
- \pst@Verb{/@yshift \@sep def}%
- \else
- \pst@Verb{/@yshift 0 def}%
- \fi\fi
- \ifx\POK@coupler@type\POS@coupler@type@elliptic
- \psellipse[dimen=outer](!0 @yshift)(! \@sz \@sz 0.4 mul)
- \pnode(! \@sz neg \getCLW 0.3 mul add @yshift \@sep add){tempNode@A@1}
- \pnode(! \@sz neg \getCLW 0.3 mul add @yshift \@sep sub){tempNode@A@2}
- \pnode(!0 @yshift){tempNode@Label}
- \pnode(! \@sz \getCLW 0.3 mul sub 0){tempNode@B@}
- \else\ifx\POK@coupler@type\POS@coupler@type@none
- \pnode(0,0){tempNode@A@1}
- \pnode(0,0){tempNode@A@2}
- \pnode(0,0){tempNode@B@}
- \pnode(0,0){tempNode@Label}
- \fi\fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% WDM SPLITTER
-%
-\def\wdmsplitter@ii{%
- \edef\@sz{\POK@coupler@size\space}%
- \edef\@sep{\POK@coupler@sep\space 0.5 mul\space}%
- %
- \ifx\POK@align\POS@optexp@top
- \pst@Verb{/@yshift \@sep neg def}%
- \else\ifx\POK@align\POS@optexp@bottom
- \pst@Verb{/@yshift \@sep def}%
- \else
- \pst@Verb{/@yshift 0 def}%
- \fi\fi
- \ifx\POK@coupler@type\POS@coupler@type@elliptic
- \psellipse[dimen=outer](! 0 @yshift)(! \@sz \@sz 0.4 mul)
- \pnode(! \@sz neg \getCLW 0.3 mul add 0){tempNode@A@}
- \pnode(! \@sz \getCLW 0.3 mul sub @yshift \@sep add){tempNode@B@1}
- \pnode(! \@sz \getCLW 0.3 mul sub @yshift \@sep sub){tempNode@B@2}
- \pnode(! 0 @yshift){tempNode@Label}
- \else\ifx\POK@coupler@type\POS@coupler@type@none
- \pnode(0,0){tempNode@A@}
- \pnode(0,0){tempNode@B@1}
- \pnode(0,0){tempNode@B@2}
- \pnode(0,0){tempNode@Label}
- \fi\fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER COLLIMATOR
-%
-\def\fibercollimator@v{%
- \def\@sz{\POK@fibercol@size\space 0.5 mul\space}%
- \pspolygon(! \@sz neg \getCLWH add \@sz neg)(!\@sz 0)(!\@sz neg \getCLWH add \@sz)
- \pnode(!\@sz neg 0){\optexp@nodeA}
- \pnode(!\@sz 0){\optexp@nodeB}
-}%
-%
-%
-\endinput
-%
diff --git a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
index b4662177d39..015c381ec49 100644
--- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
+++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
@@ -1,15 +1,4113 @@
-\ProvidesPackage{pst-optexp}[2009/11/05 package wrapper for
-pst-optexp.tex]
+%%
+%% This is file `pst-optexp.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pst-optexp.dtx (with options: `stylefile')
+%%
+%% This is a generated file.
+%%
+%% Project: pst-optexp
+%% Version: 3.0 (2012/07/09)
+%%
+%% Copyright (C) 2007-2012 by Christoph Bersch <usenet@bersch.net>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The current maintainer of this work is Christoph Bersch.
+%%
+%% This work consists of the files pst-optexp.dtx and pst-optexp.ins
+%% and the derived files
+%% pst-optexp.sty, pst-optexp.pro.
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{pst-optexp}
+ [2012/07/09 v3.0 Optical experimental setups with PSTricks]
\RequirePackage{pstricks}
\RequirePackage{pst-xkey}
\RequirePackage{pst-node}
\RequirePackage{pst-plot}
\RequirePackage{multido}
+\RequirePackage{pst-eucl}
\RequirePackage{pstricks-add}
-%
-%
-\input{pst-optexp.tex}
-\ProvidesFile{pst-optexp.tex}
- [\filedate\space v\fileversion\space `PST-optexp' (cb)]
-\IfFileExists{pst-optexp.pro}{\@addtofilelist{pst-optexp.pro}}{}%
+\RequirePackage{environ}
+\@addtofilelist{pst-optexp.pro}{}%
+\pst@addfams{optexp}
+\pstheader{pst-optexp.pro}
+\gdef\POE@complist{}%
+\gdef\POE@beamlist{1}%
+\g@addto@macro{\endpspicture}{%
+ \expandafter\XKV@for@n\expandafter{\POE@beamlist}\POE@temp{%
+ \POE@Verb{%
+ /lastBeamPointUp\POE@temp\space
+ /lastBeamPointLow\POE@temp\space
+ /lastBeamPoint\POE@temp\space
+ 3 { currentdict exch undef } repeat
+ /N@\oenodeBeam{\POE@temp}
+ /N@\oenodeBeamUp{\POE@temp}
+ /N@\oenodeBeamLow{\POE@temp}
+ 3 { tx@NodeDict exch undef } repeat
+ }%
+ }%
+ \gdef\POE@complist{}\gdef\POE@beamlist{1}\global\POE@cnt=0\relax
+}%
+\def\pst@optexpdict{tx@OptexpDict begin }
+\def\POE@dict#1{\pst@optexpdict #1 end}
+\SpecialCoor
+\newif\ifPOE@connjoin
+\newif\ifPOE@backlayer
+\newif\ifPOE@frontlayer
+\newif\ifPOE@optexpenv
+\newif\ifPOE@variable
+\newif\ifPOE@voltage
+\newif\ifPOE@caxisinv
+\newif\ifPOE@reverse
+\newif\ifPOE@lamp
+\newif\ifPOE@component@optional
+\newif\ifPOE@debug@showoptdots
+\newif\ifPOE@debug@showifcnodes
+\newif\ifPOE@endbox
+\newif\ifPOE@startbox
+\newif\ifPOE@thicklens
+\newif\ifPOE@usefiberstyle
+\newif\ifPOE@fiber@
+\newif\ifPOE@nofiber@
+\newif\ifPOE@fiberin@
+\newif\ifPOE@fiberin@top
+\newif\ifPOE@fiberin@bottom
+\newif\ifPOE@fiberout@
+\newif\ifPOE@fiberout@top
+\newif\ifPOE@fiberout@bottom
+\newif\ifPOE@fiberpreset@
+\newif\ifPOE@nofiberpreset@
+\newif\ifPOE@fiberpresetin@
+\newif\ifPOE@fiberpresetin@top
+\newif\ifPOE@fiberpresetin@bottom
+\newif\ifPOE@fiberpresetout@
+\newif\ifPOE@fiberpresetout@top
+\newif\ifPOE@fiberpresetout@bottom
+\newif\ifPOE@beam
+\newif\ifPOE@startinside
+\newif\ifPOE@stopinside
+\newif\ifPOE@beaminsidefirst
+\newif\ifPOE@beaminsidelast
+\newif\ifPOE@savebeam
+\newif\ifPOE@loadbeam
+\newif\ifPOE@beaminside
+\newif\ifPOE@raytrace
+\newif\ifPOE@pswarning
+\newif\ifPOE@useNA
+\newif\ifPOE@insideobj\POE@insideobjfalse
+\newcount\POE@cnt
+\newcount\POE@oldcnt
+\newcount\POE@nodecnt
+\newdimen\POE@dim
+\def\POE@str@pol@polperp{perp}
+\def\POE@str@pol@polparallel{parallel}
+\def\POE@str@pol@polmisc{misc}
+\def\POE@str@pol@polrcirc{rcirc}
+\def\POE@str@pol@pollcirc{lcirc}
+\def\POE@str@mirrortype@piezo{piezo}
+\def\POE@str@mirrortype@plain{plain}
+\def\POE@str@mirrortype@extended{extended}
+\def\POE@str@mirrortype@semitrans{semitrans}
+\def\POE@str@gratingtype@blazed{blazed}
+\def\POE@str@gratingtype@binary{binary}
+\def\POE@str@relative{relative}
+\def\POE@str@absolute{absolute}
+\def\POE@str@labelref@relgrav{relgrav}
+\def\POE@str@labelref@global{global}
+\def\POE@str@filtertype@bandpass{bandpass}
+\def\POE@str@filtertype@bandstop{bandstop}
+\def\POE@str@filtertype@lowpass{lowpass}
+\def\POE@str@filtertype@highpass{highpass}
+\def\POE@str@couplertype@none{none}
+\def\POE@str@couplertype@ellipse{ellipse}
+\def\POE@str@couplertype@elliptic{elliptic}
+\def\POE@str@couplertype@rectangle{rectangle}
+\def\POE@str@couplertype@cross{cross}
+\def\POE@str@polcontroltype@linear{linear}
+\def\POE@str@polcontroltype@triangle{triangle}
+\def\POE@str@top{top}
+\def\POE@str@bottom{bottom}
+\def\POE@str@center{center}
+\def\POE@str@closed{closed}
+\def\POE@str@opened{opened}
+\def\POE@str@dettype@round{round}
+\def\POE@str@dettype@diode{diode}
+\def\POE@str@bsstyle@cube{cube}
+\def\POE@str@bsstyle@plate{plate}
+\def\POE@str@auto{auto}
+\def\POE@str@center{center}
+\def\POE@str@verbose{verbose}
+\def\POE@str@quiet{quiet}
+\def\POE@Verb#1{\pst@Verb{\pst@optexpdict #1 end }}%
+\newpsstyle{OptComp}{}%
+\define@key[psset]{optexp}{newOptComp}{%
+ \newpsstyle{OptComp}{#1}%
+}
+\define@key[psset]{optexp}{addtoOptComp}{%
+ \addtopsstyle{OptComp}{#1}%
+}
+\newpsstyle{OptionalStyle}{linestyle=dashed,dash=1.5pt 1pt}%
+\newpsstyle{IfcNodeStyle}{dotstyle=x, dotscale=1.5, linecolor=blue}%
+\newpsstyle{Beam}{linecolor=green!90!black, linejoin=1}%
+\define@key[psset]{optexp}{newBeam}{%
+ \newpsstyle{Beam}{#1}%
+}
+\define@key[psset]{optexp}{addtoBeam}{%
+ \addtopsstyle{Beam}{#1}%
+}
+\newpsstyle{Fiber}{}%
+\define@key[psset]{optexp}{newFiber}{%
+ \newpsstyle{Fiber}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiber}{%
+ \addtopsstyle{Fiber}{#1}%
+}
+\newpsstyle{FiberIn}{style=Fiber}%
+\define@key[psset]{optexp}{newFiberIn}{%
+ \newpsstyle{FiberIn}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn}{%
+ \addtopsstyle{FiberIn}{#1}%
+}
+\newpsstyle{FiberOut}{style=Fiber}%
+\define@key[psset]{optexp}{newFiberOut}{%
+ \newpsstyle{FiberOut}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut}{%
+ \addtopsstyle{FiberOut}{#1}%
+}
+\newpsstyle{FiberIn1}{style=FiberIn}%
+\define@key[psset]{optexp}{newFiberIn1}{%
+ \newpsstyle{FiberIn1}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn1}{%
+ \addtopsstyle{FiberIn1}{#1}%
+}
+\newpsstyle{FiberIn2}{style=FiberIn}%
+\define@key[psset]{optexp}{newFiberIn2}{%
+ \newpsstyle{FiberIn2}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn2}{%
+ \addtopsstyle{FiberIn2}{#1}%
+}
+\newpsstyle{FiberOut1}{style=FiberOut}%
+\define@key[psset]{optexp}{newFiberOut1}{%
+ \newpsstyle{FiberOut1}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut1}{%
+ \addtopsstyle{FiberOut1}{#1}%
+}
+\newpsstyle{FiberOut2}{style=FiberOut}%
+\define@key[psset]{optexp}{newFiberOut2}{%
+ \newpsstyle{FiberOut2}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut2}{%
+ \addtopsstyle{FiberOut2}{#1}%
+}
+\newpsstyle{ExtendedMirror}{%
+ linestyle=none, hatchwidth=0.5\pslinewidth,
+ hatchsep=1.4\pslinewidth, fillstyle=hlines
+}%
+\newpsstyle{VariableStyle}{%
+ linewidth=0.8\pslinewidth, arrowinset=0, arrowscale=0.8, arrows=<->
+}
+\newpsstyle{SemitransMirror}{linestyle=none, fillstyle=solid,fillcolor=black!30}%
+\newpsstyle{PiezoMirror}{fillstyle=solid,fillcolor=black!30}%
+\newpsstyle{IsolatorArrow}{linewidth=2\pslinewidth, arrowinset=0}
+\newpsstyle{CrystalCaxis}{%
+ linestyle=dashed, dash=2pt 2pt, linewidth=0.7\pslinewidth,
+ arrowinset=0, arrows=->
+}
+\newpsstyle{CrystalLamp}{linewidth=0.6\pslinewidth}
+\newpsstyle{FdlArrow}{arrowinset=0, arrows=->}
+\newpsstyle{VariableCoupler}{arrowinset=0, arrows=->}
+\define@boolkey[psset]{optexp}[POE@component@]{optional}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{usefiberstyle}[true]{}
+\define@boolkey[psset]{optexp}[POE@debug@]{showoptdots}[true]{}
+\define@boolkey[psset]{optexp}[POE@debug@]{showifcnodes}[true]{}
+\define@choicekey*+[psset]{optexp}{position}[\val\nr]{start,end}{%
+ \ifcase\nr\relax
+ \psset[optexp]{startbox, endbox=false}%
+ \or
+ \psset[optexp]{startbox=false, endbox=true}%
+ \fi
+}{\edef\POE@key@position{#1}}%
+\define@choicekey*+[psset]{optexp}{abspos}[\val\nr]{start,end}{%
+ \ifcase\nr\relax
+ \psset[optexp]{startbox, endbox=false}%
+ \or
+ \psset[optexp]{startbox=false, endbox=true}%
+ \fi
+}{\edef\POE@key@abspos{#1}}%
+\define@key[psset]{optexp}{compshift}{%
+ \pst@checknum{#1}\POE@key@compshift
+}
+\define@key[psset]{optexp}{angle}{%
+ \pst@checknum{#1}\POE@key@angle
+}
+\psset[optexp]{%
+ position={},
+ abspos={},
+ compshift=0,
+ angle=0
+}%
+\define@boolkey[psset]{optexp}[POE@]{backlayer}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{frontlayer}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{optexpenv}[true]{}
+\psset[optexp]{backlayer, frontlayer}%
+\define@key[psset]{optexp}{labelangle}{%
+ \pst@checknum{#1}\POE@key@labelangle
+}
+\define@key[psset]{optexp}{labeloffset}{%
+ \pst@checknum{#1}\POE@key@labeloffset
+}
+\define@key[psset]{optexp}{labelstyle}{%
+ \def\POE@key@labelstyle{#1}%
+}
+\define@key[psset]{optexp}{labelalign}{%
+ \def\POE@key@labelalign{#1}%
+}
+\define@key[psset]{optexp}{labelref}{%
+ \edef\POE@key@labelref{#1}%
+}
+\define@choicekey*+[psset]{optexp}{innerlabel}%
+ [\val\nr]{true}[true]%
+ {\ifcase\nr\relax
+ \psset[optexp]{labeloffset=0, labelref=relative}%
+ \fi}
+ {\PackageError{pst-optexp}{Unknown value '\val' for innerlabel}}%
+\define@key[psset]{optexp}{label}{%
+ \pst@expandafter\POE@psset@@label{#1} {} {} {} {} {}\@nil
+}%
+\def\POE@psset@@label#1 #2 #3 #4 #5\@nil{%
+ \edef\POE@temp{#4}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelref=#4}%
+ \fi
+ \fi
+ \edef\POE@temp{#3}
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelalign=#3}%
+ \fi
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelangle=#2}%
+ \fi
+ \fi
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labeloffset=#1}%
+ \fi
+ \fi
+}%
+\define@key[psset]{optexp}{ref@angle}{%
+ \pst@checknum{#1}\POE@key@labelrefangle
+}%
+\psset[optexp]{%
+ labeloffset=0.8,
+ labelangle=0,
+ labelstyle=,
+ labelalign=c,
+ labelref=relgrav,
+ ref@angle=0
+}%
+\define@choicekey+[psset]{optexp}{extnodealign}%
+ [\val\nr]{rel,abs,relative,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@extnodealign\POE@str@relative
+ \or
+ \let\POE@key@extnodealign\POE@str@absolute
+ \else
+ \def\POE@key@extnodealign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for extnodealign.}}
+\define@key[psset]{optexp}{extnode}{%
+ \edef\POE@key@extnode{#1}%
+ \ifx\@empty\POE@key@extnode\else
+ \pst@expandafter\POE@psset@@extnode{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@key@extnode@xref{0}%
+\def\POE@key@extnode@yref{0}%
+\def\POE@psset@@extnode#1#2,#3,#4\@nil{%
+ \def\POE@key@extnode@xref{0}%
+ \def\POE@key@extnode@yref{0}%
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getref@#1}%
+ \@nameuse{POE@getref@#2}%
+ \else
+ \pst@checknum{#1#2}\POE@key@extnode@xref%
+ \pst@checknum{#3}\POE@key@extnode@yref%
+ \fi
+}%
+\def\POE@getref@c{}%
+\def\POE@getref@t{\def\POE@key@extnode@yref{1}}%
+\def\POE@getref@b{\def\POE@key@extnode@yref{-1}}%
+\def\POE@getref@l{\def\POE@key@extnode@xref{-1}}%
+\def\POE@getref@r{\def\POE@key@extnode@xref{1}}%
+\psset[optexp]{%
+ extnode=\@empty,
+ extnodealign=abs
+}%
+\define@key[psset]{optexp}{rotateref}{%
+ \def\POE@temp{#1}%
+ \ifx\@empty\POE@temp\else
+ \pst@expandafter\POE@psset@@rotateref{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@key@rotate@xref{0}%
+\def\POE@key@rotate@yref{0}%
+\def\POE@psset@@rotateref#1#2,#3,#4\@nil{%
+ \def\POE@key@rotate@xref{0}%
+ \def\POE@key@rotate@yref{0}%
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getref@rotate@#1}%
+ \@nameuse{POE@getref@rotate@#2}%
+ \else
+ \pst@checknum{#1#2}\POE@key@rotate@xref%
+ \pst@checknum{#3}\POE@key@rotate@yref%
+ \fi}%
+\def\POE@getref@rotate@c{}%
+\def\POE@getref@rotate@t{\def\POE@key@rotate@yref{1}}%
+\def\POE@getref@rotate@b{\def\POE@key@rotate@yref{-1}}%
+\def\POE@getref@rotate@l{\def\POE@key@rotate@xref{-1}}%
+\def\POE@getref@rotate@r{\def\POE@key@rotate@xref{1}}%
+\psset[optexp]{rotateref=c}%
+\define@choicekey*[psset]{optexp}{namingscheme}%
+ [\val\nr]{old,new}[new]{%
+ \ifcase\nr\relax
+ \edef\POE@str@basicname@default{tempNode}
+ \edef\POE@str@basicname@prefix{}
+ \gdef\POE@str@basicname@sep{Intern}
+ \edef\POE@str@extnode@postfix{ExtNode}
+ \or
+ \edef\POE@str@basicname@default{@}
+ \edef\POE@str@basicname@prefix{OE@}
+ \gdef\POE@str@basicname@sep{}
+ \edef\POE@str@extnode@postfix{Ext}
+ \fi
+}%
+\psset[optexp]{namingscheme=new}%
+\define@key[psset]{optexp}{b@sicname}{%
+ \edef\POE@key@b@sicname{\POE@str@basicname@prefix#1}%
+}%
+\define@key[psset]{optexp}{compname}{%
+ \ifPOE@insideobj\else
+ \PackageError{pst-optexp}{compname allowed only inside an object}
+ \fi
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty
+ \edef\POE@key@compname{\the\POE@cnt}%
+ \else
+ \edef\POE@key@compname{#1}%
+ \fi
+ \@expandtwoargs\in@{,\POE@key@compname,}{,\POE@complist,}%
+ \ifin@
+ \PackageWarning{pst-optexp}{%
+ ^^Jcompname '\POE@key@compname' already used,\MessageBreak
+ previous nodes will be overwritten!^^J
+ }%
+ \else
+ \xdef\POE@complist{%
+ \POE@key@compname\ifx\POE@complist\@empty\else,\fi\POE@complist
+ }%
+ \fi
+}%
+\POE@insideobjtrue
+\psset[optexp]{compname=\@empty}
+\POE@insideobjfalse
+\define@boolkey[psset]{optexp}[POE@]{pswarning}[true]{}
+\psset[optexp]{pswarning=false}%
+\define@key[psset]{optexp}{lensheight}{%
+ \pst@checknum{#1}\POE@key@lensheight
+}
+\define@key[psset]{optexp}{lenswidth}{%
+ \pst@checknum{#1}\POE@key@lenswidth
+ \ifdim\POE@key@lenswidth pt > 0pt
+ \psset[optexp]{thicklens=true}
+ \fi
+}
+\define@key[psset]{optexp}{lensradiusleft}{%
+ \pst@checknum{#1}\POE@key@lensradiusleft
+}
+\define@key[psset]{optexp}{lensradiusright}{%
+ \pst@checknum{#1}\POE@key@lensradiusright
+}
+\define@boolkey[psset]{optexp}[POE@]{thicklens}[true]{}
+\define@key[psset]{optexp}{lensradius}{%
+ \pst@expandafter\POE@psset@@lensradius{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@lensradius#1 #2 #3\@nil{%
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty\else
+ \psset[optexp]{lensradiusleft=#1}%
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty
+ \psset[optexp]{lensradiusright=#1}%
+ \else
+ \psset[optexp]{lensradiusright=#2}%
+ \fi
+}%
+\define@key[psset]{optexp}{lens}{%
+ \pst@expandafter\POE@psset@@lens{#1} {} {} {} {} {}\@nil
+}%
+\def\POE@psset@@lens#1 #2 #3 #4 #5\@nil{%
+ \edef\POE@temp{#4}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lenswidth=#4}%
+ \fi
+ \fi
+ \edef\POE@temp{#3}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensheight=#3}
+ \fi
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty
+ \psset[optexp]{lensradiusright=#1}%
+ \else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensradiusright=#2}%
+ \fi
+ \fi
+ \edef\POE@temp{#1}%
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensradiusleft=#1}%
+ \fi
+}%
+\psset[optexp]{%
+ lenswidth=0,
+ lensheight=1,
+ lensradiusleft=1,
+ lensradiusright=1
+}%
+\define@key[psset]{optexp}{innerheight}{%
+ \pst@checknum{#1}\POE@key@innerheight
+}
+\define@key[psset]{optexp}{outerheight}{%
+ \pst@checknum{#1}\POE@key@outerheight
+}
+\define@key[psset]{optexp}{phlinewidth}{%
+ \edef\POE@key@phlinewidth{#1}%
+}
+\define@key[psset]{optexp}{phwidth}{%
+ \edef\POE@key@phwidth{#1}%
+}
+\psset[optexp]{%
+ phlinewidth=2\pslinewidth,
+ phwidth=0,
+ outerheight=1,
+ innerheight=0.1
+}%
+\define@key[psset]{optexp}{crystalwidth}{%
+ \pst@checknum{#1}\POE@key@crystalwidth
+}
+\define@key[psset]{optexp}{crystalheight}{%
+ \pst@checknum{#1}\POE@key@crystalheight
+}
+\define@key[psset]{optexp}{crystalsize}{%
+ \pst@expandafter\POE@psset@@crystalsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@crystalsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'crystalsize' requires two numbers}%
+ \fi
+ \psset[optexp]{crystalwidth=#1}%
+ \psset[optexp]{crystalheight=#2}%
+}%
+\define@key[psset]{optexp}{caxislength}{%
+ \pst@checknum{#1}\POE@key@caxislength
+}
+\define@boolkey[psset]{optexp}[POE@]{voltage}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{caxisinv}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{lamp}[true]{}
+\define@key[psset]{optexp}{lampscale}{%
+ \pst@checknum{#1}\POE@key@lampscale
+ \pst@divide{\POE@key@lampscale pt}{0.3pt}{\POE@key@lampscale}
+ \addtopsstyle{CrystalLamp}{unit=\POE@key@lampscale}
+ \PackageWarning{pst-optexp}{%
+ Parameter 'lampscale' is deprecated, \MessageBreak
+ use style 'CrystalLamp' instead.}%
+}
+\psset[optexp]{%
+ crystalwidth=1.4,
+ crystalheight=0.6,
+ caxislength=0.3
+}%
+\define@key[psset]{optexp}{optboxwidth}{%
+ \pst@checknum{#1}\POE@key@optboxwidth
+}
+\define@key[psset]{optexp}{optboxheight}{%
+ \pst@checknum{#1}\POE@key@optboxheight
+}
+\define@key[psset]{optexp}{optboxsize}{%
+ \pst@expandafter\POE@psset@@optboxsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optboxsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optboxsize' requires two numbers}%
+ \fi
+ \psset[optexp]{optboxwidth=#1, optboxheight=#2}%
+}%
+\define@boolkey[psset]{optexp}[POE@]{endbox}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{startbox}[true]{}
+\psset[optexp]{%
+ optboxwidth=1.4,
+ optboxheight=0.8
+}%
+\define@key[psset]{optexp}{platelinewidth}{%
+ \edef\POE@key@platelinewidth{#1}%
+}
+\define@key[psset]{optexp}{plateheight}{%
+ \pst@checknum{#1}\POE@key@plateheight
+}
+\psset[optexp]{%
+ plateheight=1,
+ platelinewidth=2\pslinewidth
+}%
+\define@key[psset]{optexp}{platewidth}{%
+ \pst@checknum{#1}\POE@key@platewidth
+}
+\define@key[psset]{optexp}{platesize}{%
+ \pst@expandafter\POE@psset@@platesize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@platesize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'platesize' requires two numbers}%
+ \fi
+ \psset[optexp]{platewidth=#1, plateheight=#2}%
+}%
+\psset[optexp]{platewidth=0.1}%
+\define@key[psset]{optexp}{detsize}{%
+ \pst@expandafter\POE@psset@@detsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@detsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@detsize
+ \else
+ \let\POE@key@detsize\@empty
+ \pst@checknum{#1}\POE@key@detwidth
+ \pst@checknum{#2}\POE@key@detheight
+ \fi
+}%
+\define@choicekey*+[psset]{optexp}{dettype}[\val\nr]{round,diode}%
+ {\edef\POE@key@dettype{\val}}
+ {\PackageError{pst-optexp}{Unknown value '\val' for dettype.}}
+\newpsstyle{DetectorStyle}{}
+\psset[optexp]{%
+ detsize=0.8,
+ dettype=round
+}%
+\define@key[psset]{optexp}{polsize}{%
+ \pst@checknum{#1}\POE@key@polsize
+}
+\define@key[psset]{optexp}{pollinewidth}{%
+ \edef\POE@key@pollinewidth{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'pollinewidth' is deprecated, \MessageBreak
+ use style 'Polarization'.}%
+}%
+\def\POE@key@pollinewidth{0.7\pslinewidth}%
+\newpsstyle{Polarization}{%
+ linewidth=\POE@key@pollinewidth,
+ arrowscale=0.8, dotsize=3\pslinewidth}
+\define@choicekey+[psset]{optexp}{poltype}%
+ [\val\nr]{parallel,misc,perp,rcirc,lcirc}%
+ {\edef\POE@key@poltype{#1}}
+ {\PackageError{pst-optexp}{Unknown value '\val' for poltype.}%
+}
+\psset[optexp]{%
+ poltype=parallel,
+ polsize=0.6
+}%
+\define@key[psset]{optexp}{optdiodesize}{%
+ \pst@checknum{#1}\POE@key@optdiodesize
+}
+\psset[optexp]{optdiodesize=0.8}%
+\define@key[psset]{optexp}{doveprismsize}{%
+ \pst@expandafter\POE@psset@@doveprismsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@doveprismsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@doveprismheight
+ \pstFPmul\POE@key@doveprismwidth{3}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@doveprismwidth
+ \pst@checknum{#2}\POE@key@doveprismheight
+ \fi
+}%
+\psset[optexp]{doveprismsize=0.6}%
+\define@key[psset]{optexp}{bssize}{%
+ \pst@checknum{#1}\POE@key@bssize
+}
+\define@key[psset]{optexp}{bsstyle}{%
+ \edef\POE@key@bsstyle{#1}%
+}
+\psset[optexp]{%
+ bssize=0.8,
+ bsstyle=cube
+}%
+\define@key[psset]{optexp}{mirrorwidth}{%
+ \pst@checknum{#1}\POE@key@mirrorwidth
+}
+\define@key[psset]{optexp}{mirrorlinewidth}{%
+ \edef\POE@key@mirrorlinewidth{#1}%
+}
+\define@choicekey*[psset]{optexp}{mirrortype}%
+ [\val\nr]{piezo,extended,plain,semitrans}{%
+ \edef\POE@key@mirrortype{#1}%
+}
+\define@key[psset]{optexp}{mirrordepth}{%
+ \pst@checknum{#1}\POE@key@mirrordepth
+}
+\define@key[psset]{optexp}{mirrorradius}{%
+ \pst@checknum{#1}\POE@key@mirrorradius
+}
+\define@boolkey[psset]{optexp}[POE@]{variable}[true]{}
+\psset[optexp]{%
+ mirrorwidth=1,
+ mirrordepth=0.15,
+ mirrorradius=0,
+ mirrortype=plain,
+ mirrorlinewidth=2\pslinewidth
+}%
+\define@key[psset]{optexp}{optgridcount}{%
+ \pst@checknum{#1}\POE@key@gratingcount
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridcount' is deprecated,\MessageBreak
+ use 'gratingcount' instead.}%
+}%
+\define@key[psset]{optexp}{optgridwidth}{%
+ \pst@checknum{#1}\POE@key@gratingwidth
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridwidth' is deprecated,\MessageBreak
+ use 'gratingwidth' instead.}%
+}%
+\define@key[psset]{optexp}{optgridheight}{%
+ \pst@checknum{#1}\POE@key@gratingheight
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridheight' is deprecated,\MessageBreak
+ use 'gratingheight' instead.}%
+}%
+\define@choicekey*[psset]{optexp}{optgridtype}%
+ [\val\nr]{binary,blazed}{%
+ \edef\POE@key@gratingtype{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridtype' is deprecated,\MessageBreak
+ use 'gratingtype' instead.}%
+}%
+\define@key[psset]{optexp}{optgriddepth}{%
+ \pst@checknum{#1}\POE@key@gratingdepth
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgriddepth' is deprecated,\MessageBreak
+ use 'gratingdepth' instead.}%
+}%
+\define@key[psset]{optexp}{optgridlinewidth}{%
+ \edef\POE@key@gratinglinewidth{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridlinewidth' is deprecated,\MessageBreak
+ use 'gratinglinewidth' instead.}%
+}%
+\define@key[psset]{optexp}{gratingcount}{%
+ \pst@checknum{#1}\POE@key@gratingcount
+}
+\define@key[psset]{optexp}{gratingwidth}{%
+ \pst@checknum{#1}\POE@key@gratingwidth
+}
+\define@key[psset]{optexp}{gratingheight}{%
+ \pst@checknum{#1}\POE@key@gratingheight
+}
+\define@choicekey*[psset]{optexp}{gratingtype}%
+ [\val\nr]{binary,blazed}{%
+ \edef\POE@key@gratingtype{#1}%
+}
+\define@key[psset]{optexp}{gratingdepth}{%
+ \pst@checknum{#1}\POE@key@gratingdepth
+}
+\define@key[psset]{optexp}{gratinglinewidth}{%
+ \edef\POE@key@gratinglinewidth{#1}%
+}
+\define@boolkey[psset]{optexp}[POE@]{reverse}[true]{}
+\psset[optexp]{%
+ gratingcount=10,
+ gratingwidth=1,
+ gratingheight=0.15,
+ gratingdepth=0.075,
+ gratingtype=blazed,
+ gratinglinewidth=0.7\pslinewidth,
+}%
+\define@key[psset]{optexp}{pentaprismsize}{%
+ \pst@checknum{#1}\POE@key@pentaprismsize
+}
+\psset[optexp]{pentaprismsize=0.7}
+\define@key[psset]{optexp}{raprismsize}{%
+ \pst@checknum{#1}\POE@key@raprismsize
+}
+\psset[optexp]{raprismsize=1.5}
+\define@key[psset]{optexp}{prismsize}{%
+ \pst@checknum{#1}\POE@key@prismsize
+}
+\define@key[psset]{optexp}{prismangle}{%
+ \pst@checknum{#1}\POE@key@prismangle
+}
+\define@choicekey+[psset]{optexp}{prismalign}[\val\nr]%
+ {auto,center}%
+ {\def\POE@key@prismalign{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for prismalign.}}%
+\psset[optexp]{%
+ prismsize=1,
+ prismangle=60,
+ prismalign=auto
+}%
+\define@key[psset]{optexp}{fiberloops}{%
+ \pst@checknum{#1}\POE@key@fiberloops
+}
+\define@key[psset]{optexp}{fiberloopradius}{%
+ \pst@checknum{#1}\POE@key@fiberloopradius
+}
+\define@key[psset]{optexp}{fiberloopsep}{%
+ \pst@checknum{#1}\POE@key@fiberloopsep
+}
+\psset[optexp]{%
+ fiberloops=3,
+ fiberloopradius=0.4,
+ fiberloopsep=0.3
+}%
+\define@key[psset]{optexp}{filtersize}{%
+ \pst@checknum{#1}\POE@key@filtersize
+}
+\define@choicekey+[psset]{optexp}{filtertype}[\val\nr]%
+ {bandstop,bandpass,lowpass,highpass}%
+ {\def\POE@key@filtertype{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for filtertype}}
+\newpsstyle{FilterStyle}{}
+\psset[optexp]{%
+ filtersize=0.8,
+ filtertype=bandpass
+}%
+\define@key[psset]{optexp}{polcontrolsize}{%
+ \pst@checknum{#1}\POE@key@polcontrolsize
+}
+\define@choicekey+[psset]{optexp}{polcontroltype}[\val\nr]%
+ {linear,triangle}%
+ {\def\POE@key@polcontroltype{#1}}%
+ {\PackageError{pst-optexp}{Unknown polcontroltype '\val'}}
+\psset[optexp]{%
+ polcontrolsize=0.15,
+ polcontroltype=linear
+}%
+\define@key[psset]{optexp}{optampsize}{%
+ \pst@expandafter\POE@psset@@optampsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optampsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@optampheight
+ \pstFPmul\POE@key@optampwidth{0.866}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@optampwidth
+ \pst@checknum{#2}\POE@key@optampheight
+ \fi
+}%
+\psset[optexp]{optampsize=0.8}
+\define@key[psset]{optexp}{optmzmsize}{%
+ \pst@expandafter\POE@psset@@optmzmsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optmzmsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@optmzmheight
+ \pstFPmul\POE@key@optmzmwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@optmzmwidth
+ \pst@checknum{#2}\POE@key@optmzmheight
+ \fi
+}%
+\psset[optexp]{optmzmsize=0.8}
+\define@key[psset]{optexp}{isolatorsize}{%
+ \pst@expandafter\POE@psset@@isolatorsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@isolatorsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@isolatorheight
+ \pstFPmul\POE@key@isolatorwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@isolatorwidth
+ \pst@checknum{#2}\POE@key@isolatorheight
+ \fi
+}%
+\psset[optexp]{isolatorsize=0.6}%
+\define@key[psset]{optexp}{fiberpolsize}{%
+ \pst@expandafter\POE@psset@@fiberpolsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fiberpolsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fiberpolheight
+ \pstFPmul\POE@key@fiberpolwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fiberpolwidth
+ \pst@checknum{#2}\POE@key@fiberpolheight
+ \fi
+}%
+\psset[optexp]{fiberpolsize=0.6}%
+\define@key[psset]{optexp}{switchsize}{%
+ \pst@checknum{#1}\POE@key@switchsize
+}
+\define@choicekey+[psset]{optexp}{switchstyle}%
+ [\val\nr]{opened,closed}%
+ {\edef\POE@key@switchstyle{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for switchstyle.}}
+\psset[optexp]{%
+ switchsize=0.8,
+ switchstyle=opened
+}%
+\define@key[psset]{optexp}{fdlsize}{%
+ \pst@expandafter\POE@psset@@fdlsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fdlsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fdlheight
+ \pstFPmul\POE@key@fdlwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fdlwidth
+ \pst@checknum{#2}\POE@key@fdlheight
+ \fi
+}%
+\psset[optexp]{fdlsize=0.6}%
+\define@key[psset]{optexp}{fibercolsize}{%
+ \pst@expandafter\POE@psset@@fibercolsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fibercolsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fibercolheight
+ \pstFPmul\POE@key@fibercolwidth{0.866}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fibercolwidth
+ \pst@checknum{#2}\POE@key@fibercolheight
+ \fi
+}%
+\psset[optexp]{fibercolsize=0.3}%
+\define@key[psset]{optexp}{optcircsize}{%
+ \pst@checknum{#1}\POE@key@optcircsize
+}%
+\define@key[psset]{optexp}{optcircangleA}{%
+ \pst@checknum{#1}\POE@key@optcircangleA
+}%
+\define@key[psset]{optexp}{optcircangleB}{%
+ \pst@checknum{#1}\POE@key@optcircangleB
+}%
+\define@key[psset]{optexp}{optcircangle}{%
+ \pst@expandafter\POE@psset@@optcircangle{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optcircangle#1 #2 #3\@nil{%
+ \edef\POE@tempA{#1}%
+ \edef\POE@tempB{#2}%
+ \ifx\\#2\\
+ \PackageError{pst-optexp}{optcircangle requires two numbers}%
+ \else\ifx\\#1\\
+ \PackageError{pst-optexp}{optcircangle requires two numbers}%
+ \else
+ \psset[optexp]{optcircangleA=#1, optcircangleB=#2}%
+ \fi\fi
+}%
+\psset[optexp]{%
+ optcircsize=0.8,
+ optcircangle=-160 -20
+}%
+\newpsstyle{OptCircArrow}{unit=0.7, arrows=->, arrowinset=0}
+\define@key[psset]{optexp}{couplersize}{%
+ \pst@expandafter\POE@psset@@couplersize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@couplersize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pstFPmul\POE@key@couplerheight{0.8}{#1}
+ \pstFPmul\POE@key@couplerwidth{2}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@couplerwidth
+ \pst@checknum{#2}\POE@key@couplerheight
+ \fi
+}%
+\define@key[psset]{optexp}{couplersep}{%
+ \pst@checknum{#1}\POE@key@couplersep
+}
+\define@choicekey+[psset]{optexp}{couplertype}%
+ [\val\nr]{none,elliptic,ellipse,cross,rectangle}%
+ {%
+ \edef\POE@key@couplertype{#1}
+ \ifx\POE@key@couplertype\POE@str@couplertype@elliptic
+ \let\POE@key@couplertype\POE@str@couplertype@ellipse
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for couplertype.}}
+\define@key[psset]{optexp}{align}{%
+ \psset[optexp]{coupleralign=#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'align' is deprecated,\MessageBreak
+ use 'coupleralign' instead.}%
+}
+\define@choicekey+[psset]{optexp}{coupleralign}%
+ [\val\nr]{t,b,c,top,bottom,center}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@coupleralign\POE@str@top
+ \or
+ \let\POE@key@coupleralign\POE@str@bottom
+ \or
+ \let\POE@key@coupleralign\POE@str@center
+ \else
+ \def\POE@key@coupleralign{#1}%
+ \fi}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for coupleralign.}}
+\psset[optexp]{%
+ couplersize=0.2,
+ couplersep=0.05,
+ coupleralign=center,
+ couplertype=elliptic
+}%
+\define@boolkey[psset]{optexp}[POE@]{beam}[true]{}
+\define@key[psset]{optexp}{refractiveindex}{%
+ \psset[optexp]{n=#1}%
+ \PackageWarning{pst-optexp}{%
+ Option 'refractiveindex' is deprecated,\MessageBreak
+ use 'n' instead}%
+}%
+\define@key[psset]{optexp}{n}{%
+ \POE@parsealg{n}#1\@nil
+}
+\def\POE@parsealg#1#2#3\@nil{%
+ \ifx#2*\relax
+ \POE@@parsealg#3\@nil
+ \expandafter\let\csname POE@key@#1\endcsname\POE@tempA
+ \else
+ \@namedef{POE@key@#1}{[#2#3] }%
+ \fi
+}
+\def\POE@@parsealg#1#2\@nil{%
+ \edef\POE@tempA{tx@Dict begin (#1#2) AlgParser end }%
+}
+\define@key[psset]{optexp}{beamangle}{%
+ \edef\POE@key@beamangle{#1}%
+}%
+\define@key[psset]{optexp}{beampos}{%
+ \edef\POE@key@beampos{#1}%
+}%
+\define@key[psset]{optexp}{beamdiv}{%
+ \edef\POE@key@beamdiv{#1}%
+}%
+\define@key[psset]{optexp}{beamwidth}{%
+ \edef\POE@key@beamwidth{#1}%
+}%
+\define@boolkey[psset]{optexp}[POE@]{startinside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{stopinside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{beaminsidefirst}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{beaminsidelast}[true]{}%
+\define@choicekey+[psset]{optexp}{savebeampoints}%
+ [\val\nr]{true,false}[true]{%
+ \ifcase\nr\relax
+ \def\POE@key@savebeampoints{1}
+ \or
+ \def\POE@key@savebeampoints{0}
+ \fi
+ }{%
+ \ifnum9<1#1
+ \def\POE@key@savebeampoints{#1}
+ \else
+ \PackageError{pst-optexp}%
+ {savebeampoints must be a positive integer or 0.}%
+ \fi
+ \@expandtwoargs\in@{,\POE@key@savebeampoints,}{,\POE@beamlist,}%
+ \ifin@\else
+ \xdef\POE@beamlist{%
+ \POE@key@savebeampoints
+ \ifx\POE@beamlist\@empty\else,\fi\POE@beamlist
+ }%
+ \fi
+}%
+\define@choicekey+[psset]{optexp}{loadbeampoints}%
+ [\val\nr]{true,false}[true]{%
+ \ifcase\nr\relax
+ \def\POE@key@loadbeampoints{1}
+ \or
+ \def\POE@key@loadbeampoints{0}
+ \fi
+ }{%
+ \ifnum9<1#1
+ \def\POE@key@loadbeampoints{#1}%
+ \else
+ \PackageError{pst-optexp}%
+ {loadbeampoints must be a positive integer or 0.}%
+ \fi
+ \@expandtwoargs\in@{,\POE@key@loadbeampoints,}{,\POE@beamlist,}%
+ \ifin@\else
+ \xdef\POE@beamlist{%
+ \POE@key@loadbeampoints
+ \ifx\POE@beamlist\@empty\else,\fi\POE@beamlist
+ }%
+ \fi
+}%
+\define@key[psset]{optexp}{loadbeam}[true]{%
+ \setkeys+[psset]{optexp}{loadbeampoints=#1}%
+ \ifdim\POE@key@loadbeampoints pt>0pt
+ \POE@loadbeamtrue
+ \else
+ \POE@loadbeamfalse
+ \fi
+}%
+\define@key[psset]{optexp}{savebeam}[true]{%
+ \setkeys+[psset]{optexp}{savebeampoints=#1}%
+ \ifdim\POE@key@savebeampoints pt>0pt
+ \POE@savebeamtrue
+ \else
+ \POE@savebeamfalse
+ \fi
+}%
+\define@boolkey[psset]{optexp}[POE@]{beaminside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{allowbeaminside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{raytrace}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{useNA}[true]{}%
+\define@key[psset]{optexp}{skipconn}{%
+ \pst@checknum{#1}\POE@key@skipconn
+}%
+\define@choicekey+[psset]{optexp}{beamalign}%
+ [\val\nr]{rel,abs,relative,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@beamalign\POE@str@relative
+ \or
+ \let\POE@key@beamalign\POE@str@absolute
+ \else
+ \def\POE@key@beamalign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for beamalign.}}
+\define@key[psset]{optexp}{ArrowInsideMinLength}{%
+ \def\POE@key@ArrowInsideMinLength{#1}%
+}%
+\define@key[psset]{optexp}{ArrowInsideMaxLength}{%
+ \def\POE@key@ArrowInsideMaxLength{#1}%
+}%
+\psset[optexp]{%
+ raytrace=true
+ ,useNA=true
+ ,startinside=false
+ ,stopinside=false
+ ,allowbeaminside=true
+ ,beaminside=true
+ ,beaminsidefirst=false
+ ,beaminsidelast=false
+ ,loadbeam=false
+ ,savebeam=false
+ ,loadbeampoints=false
+ ,savebeampoints=true
+ ,beamangle=0
+ ,beampos=\@empty
+ ,beamalign=relative
+ ,beamwidth=0
+ ,beamdiv=0
+ ,n=1.5
+ ,skipconn=0
+ ,ArrowInsideMinLength=0.2
+ ,ArrowInsideMaxLength=-1
+}%
+\define@key[psset]{optexp}{fiber}[all]{%
+ \POE@psset@fibercheck#1\@nil
+}
+\def\POE@psset@fibercheck#1#2\@nil{%
+ \ifx#1*\relax
+ \ifx\\#2\\
+ \psset[optexp]{fiber@preset=all}%
+ \else
+ \psset[optexp]{fiber@preset=#2}%
+ \fi
+ \else\ifx#1+\relax
+ \ifx\\#2\\
+ \psset[optexp]{fiber@all=all}%
+ \else
+ \psset[optexp]{fiber@all=#2}%
+ \fi
+ \else
+ \psset[optexp]{fiber@all=#1#2}%
+ \psset[optexp]{fiber@preset=#1#2}%
+ \fi\fi
+}%
+\define@choicekey*+[psset]{optexp}{fiber@preset}%
+ [\val\nr]{false,none,true,all}[all]{%
+ \ifcase\nr\relax
+ \POE@getfiberpreset@none
+ \or
+ \POE@getfiberpreset@none
+ \or
+ \POE@getfiberpreset@all
+ \or
+ \POE@getfiberpreset@all
+ \fi
+}{%
+ \ifx\@empty\val
+ \POE@getfiberpreset@none
+ \else
+ \pst@expandafter\POE@psset@@fiberpreset{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@psset@@fiberpreset#1#2,#3,#4\@nil{%
+ \POE@getfiberpreset@all
+ \ifx\\#3\\
+ \@nameuse{POE@getfiberpreset@#1}%
+ \@nameuse{POE@getfiberpreset@#2}%
+ \fi
+}%
+\def\POE@getfiberpreset@none{%
+ \psset[optexp]{fiberpreset@=false}%
+}%
+\def\POE@getfiberpreset@all{%
+ \psset[optexp]{%
+ fiberpreset@, fiberpresetin@, fiberpresetout@,
+ fiberpresetin@top, fiberpresetin@bottom,
+ fiberpresetout@top, fiberpresetout@bottom}%
+}%
+\def\POE@getfiberpreset@t{%
+ \psset[optexp]{fiberpresetin@bottom=false, fiberpresetout@bottom=false}}%
+\def\POE@getfiberpreset@b{%
+ \psset[optexp]{fiberpresetin@top=false, fiberpresetout@top=false}}%
+\def\POE@getfiberpreset@l{\psset[optexp]{fiberpresetout@=false}}%
+\def\POE@getfiberpreset@r{\psset[optexp]{fiberpresetin@=false}}%
+\let\POE@getfiberpreset@i\POE@getfiberpreset@l
+\let\POE@getfiberpreset@o\POE@getfiberpreset@r
+\define@choicekey*+[psset]{optexp}{fiber@all}%
+ [\val\nr]{false,none,true,all}[all]{%
+ \ifcase\nr\relax
+ \POE@getfiber@none
+ \or
+ \POE@getfiber@none
+ \or
+ \POE@getfiber@all
+ \or
+ \POE@getfiber@all
+ \fi
+}{%
+ \ifx\@empty\val
+ \POE@getfiber@none
+ \else
+ \pst@expandafter\POE@psset@@fiber{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@psset@@fiber#1#2,#3,#4\@nil{%
+ \POE@getfiber@all
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getfiber@#1}%
+ \@nameuse{POE@getfiber@#2}%
+ \fi
+}%
+\def\POE@getfiber@none{%
+ \psset[optexp]{fiber@=false}%
+}%
+\def\POE@getfiber@all{%
+ \psset[optexp]{%
+ fiber@, fiberin@, fiberout@,
+ fiberin@top, fiberin@bottom,
+ fiberout@top, fiberout@bottom}%
+}%
+\def\POE@getfiber@t{%
+ \psset[optexp]{fiberin@bottom=false, fiberout@bottom=false}}%
+\def\POE@getfiber@b{%
+ \psset[optexp]{fiberin@top=false, fiberout@top=false}}%
+\def\POE@getfiber@l{\psset[optexp]{fiberout@=false}}%
+\def\POE@getfiber@r{\psset[optexp]{fiberin@=false}}%
+\let\POE@getfiber@i\POE@getfiber@l
+\let\POE@getfiber@o\POE@getfiber@r
+\define@boolkey[psset]{optexp}[POE@]{fiber@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{nofiber@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpreset@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{nofiberpreset@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@bottom}[true]{}
+\psset[optexp]{fiber=*all}%
+\define@key[psset]{optexp}{fiberangleA}{%
+ \pst@checknum{#1}\POE@key@fiberangleA
+}%
+\define@key[psset]{optexp}{fiberangleB}{%
+ \pst@checknum{#1}\POE@key@fiberangleB
+}%
+\define@choicekey+[psset]{optexp}{fiberalign}%
+ [\val\nr]{rel,abs,relative,center,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@fiberalign\POE@str@relative
+ \or
+ \let\POE@key@fiberalign\POE@str@absolute
+ \else
+ \def\POE@key@fiberalign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for fiberalign.}}%
+\define@key[psset]{optexp}{fiberstyle}{%
+ \@ifundefined{nc#1}%
+ {\PackageError{pst-optexp}{Unknown value '#1' for fiberstyle.}}%
+ {\def\POE@key@fiberstyle{#1}}}
+\psset[optexp]{%
+ fiberangleA=0,
+ fiberangleB=0,
+ fiberalign=relative,
+ fiberstyle=curve
+}%
+\define@choicekey+[psset]{optexp}{startnode}%
+ [\val\nr]{auto,1,2,3,4,N}%
+ {\edef\POE@key@startnode{\val}}
+ {\PackageError{pst-optexp}{Unknown startnode number '\val'}}
+\define@choicekey+[psset]{optexp}{stopnode}[\val\nr]{auto,1,2,3,4,N}%
+ {\edef\POE@key@stopnode{\val}}
+ {\PackageError{pst-optexp}{Unknown stopnode number '\val'}}
+\psset[optexp]{%
+ startnode=auto,
+ stopnode=auto
+}%
+\newenvironment{optexp}{\Collect@Body\POE@collect}{}
+\long\def\POE@collect#1{%
+ \psset[optexp]{optexpenv}
+ \global\POE@oldcnt=\POE@cnt
+ \bgroup
+ \psset[optexp]{backlayer=true, frontlayer=false}#1%
+ \egroup
+ \gdef\POE@complist{}\global\POE@cnt=\POE@oldcnt\relax
+ \psset[optexp]{backlayer=false, frontlayer=true}%
+ #1}%
+\def\backlayer#1{\ifPOE@backlayer #1\fi\ignorespaces}
+\def\frontlayer#1{\ifPOE@frontlayer #1\fi\ignorespaces}
+\def\POE@getnode#1#2\@nil{%
+ \ifx(#1\relax%)
+ \POE@getcoor#1#2
+ \edef\POE@temp{{\pst@coor}}%
+ \else
+ \edef\POE@temp{/\oenode{}{#1#2}\space}%
+ \fi%
+}%
+\def\POE@getcoor(#1){\pst@@getcoor{#1}}%
+\def\drawfiber{\drawfiber@{Fiber}}%
+\def\drawfiber@#1{%
+ \ifPst@custom\else
+ \def\pst@par{style=#1}%
+ \fi
+ \@ifnextchar[%]
+ {\drawfiber@i}{\drawfiber@i[]}%
+}%
+\def\drawfiber@i[#1]#2{%
+ \addafter@par{#1}%
+ \def\POE@tempe{#2}%
+ \@ifnextchar\bgroup{\drawfiber@ii}{}%
+}%
+\def\drawfiber@ii#1{%
+ \expandafter\drawfiber@iii\expandafter{\POE@tempe}{#1}%
+ \def\POE@tempe{#1}%
+ \@ifnextchar\bgroup{\drawfiber@ii}{}%
+}%
+\def\drawfiber@iii#1#2{%
+ \begingroup
+ \let\psk@angleA\relax
+ \let\psk@angleB\relax
+ \use@par
+ \def\POE@tempa{#1}
+ \ifx\POE@tempa\@empty
+ \edef\POE@comps{/\oenode{}{}\space}
+ \else
+ \expandafter\POE@getnode#1\@nil
+ \edef\POE@comps{\POE@temp}
+ \fi
+ \def\POE@tempb{#2}
+ \ifx\POE@tempb\@empty
+ \edef\POE@comps{/\oenode{}{}\space \POE@comps}
+ \else
+ \expandafter\POE@getnode#2\@nil
+ \edef\POE@comps{\POE@temp\space \POE@comps}
+ \fi
+ \ifPOE@backlayer
+ \ifx\POE@key@startnode\POE@str@auto\else
+ \POE@pnode{/\POE@key@startnode\space \POE@comps exch pop
+ \POE@dict{getsubnode} \tx@UserCoor}{@@A}
+ \fi
+ \ifx\POE@key@stopnode\POE@str@auto\else
+ \POE@pnode{/\POE@key@stopnode\space \POE@comps pop
+ \POE@dict{getsubnode} \tx@UserCoor}{@@B}
+ \fi
+ \ifx\POE@key@startnode\POE@str@auto
+ \ifx\POE@key@stopnode\POE@str@auto
+ \POE@pnode{\POE@comps exch \POE@dict{NearestNode}
+ \tx@UserCoor}{@@A}
+ \POE@pnode{\POE@comps pop
+ \POE@dict{/N@@@A @GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@B}
+ \else
+ \POE@pnode{\POE@comps exch pop /N@@@B
+ \POE@dict{@GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@A}
+ \fi
+ \else\ifx\POE@key@stopnode\POE@str@auto
+ \POE@pnode{\POE@comps pop /N@@@A
+ \POE@dict{@GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@B}
+ \fi\fi
+ \pst@getcoor{@@A}\POE@tempa
+ \pst@getcoor{@@B}\POE@tempb
+ \ifx\psk@angleA\relax
+ \ifx\POE@key@fiberalign\POE@str@absolute
+ \psset{angleA=\POE@key@fiberangleA}%
+ \else
+ \psset{angleA=! \POE@dict{%
+ \POE@tempb \POE@tempa \POE@comps exch
+ \POE@key@fiberalign\space RelFiberAngle
+ \POE@key@fiberangleA\space add }
+ }%
+ \fi
+ \fi
+ \ifx\psk@angleB\relax
+ \ifx\POE@key@fiberalign\POE@str@absolute
+ \psset{angleB=\POE@key@fiberangleB}%
+ \else
+ \psset{angleB=! \POE@dict{%
+ \POE@tempa \POE@tempb \POE@comps
+ \POE@key@fiberalign\space RelFiberAngle
+ \POE@key@fiberangleB\space add}
+ }%
+ \fi
+ \fi
+ \@nameuse{nc\POE@key@fiberstyle}{@@A}{@@B}
+ \fi
+ \endgroup
+}%
+\def\POE@pnode#1#2{%
+ \ifPst@custom
+ \code{%
+ gsave
+ /currentpoint load stopped { 0 0 moveto } if
+ 1 8.3021995 div dup neg scale
+ tx@NodeDict begin
+ {#1 \tx@ScreenCoor } false /N@#2 10 {InitPnode}
+ /NodeScale {} def NewNode
+ end
+ grestore
+ }%
+ \else
+ \pnode(!#1){#2}
+ \fi
+}%
+\def\begin@BeamObj{%
+ \addbefore@par{n=n}%
+ \begin@SpecialObj%
+ \addto@pscode{%
+ \pst@optexpdict
+ /loadbeampoints \POE@key@loadbeampoints\space def
+ /loadbeam \ifPOE@loadbeam true \else false \fi def
+ /beamangle \POE@key@beamangle\space def
+ /savebeampoints \POE@key@savebeampoints\space def
+ /savebeam \ifPOE@savebeam true \else false \fi def
+ /beaminsidefirst \ifPOE@beaminsidefirst true \else false \fi def
+ /beaminsidelast \ifPOE@beaminsidelast true \else false \fi def
+ /beaminside \ifPOE@beaminside true \else false \fi def
+ /startinside \ifPOE@startinside true \else false \fi def
+ /stopinside \ifPOE@stopinside true \else false \fi def
+ /connectifc \ifPOE@raytrace false \else true \fi def
+ /beamalign
+ \ifx\POE@key@beamalign\POE@str@absolute\space
+ absolute
+ \else
+ relative
+ \fi def
+ /skipconn \POE@key@skipconn\space def
+ /useNA \ifPOE@useNA true \else false \fi def
+ }%
+}%
+\def\begin@WideBeamObj{%
+ \addbefore@par{style=Beam}%
+ \begin@BeamObj
+ \let\pst@linetype\pst@arrowtype
+ \pst@addarrowdef%
+}%
+\let\begin@SingleBeamObj\begin@WideBeamObj
+\def\drawbeam{\pst@object{drawbeam}}%
+\def\drawbeam@i{%
+ \def\POE@conntable{,a-a,b-b,A-A,B-B}%
+ \begin@SingleBeamObj
+ \POE@getcomps[\drawbeam@ii%
+}%
+\def\drawwidebeam{\pst@object{drawwidebeam}}%
+\def\drawwidebeam@i{%
+ \begin@WideBeamObj
+ \POE@getcomps[\drawwidebeam@ii%
+}%
+\def\POE@beam@use@pscode{%
+ \pstverb{%
+ \pst@dict
+ \tx@STP
+ \pst@newpath
+ \psk@origin
+ \psk@swapaxes
+ \pst@code
+ end
+ count /ocount exch def
+ }%
+ \gdef\pst@code{}%
+}%
+\def\end@BeamObj{%
+ \addto@pscode{ end }%
+ \let\psk@fillstyle\relax
+ \ifPOE@optexpenv
+ \ifPOE@frontlayer
+ \def\pst@code{ false false }%
+ \fi
+ \fi
+ \let\use@pscode\POE@beam@use@pscode
+ \end@SpecialObj%
+}%
+\def\drawbeam@ii{%
+ \ifx\POE@key@conn\@empty
+ \drawbeam@iii
+ \else
+ \drawbeam@compat
+ \fi
+}
+\def\drawbeam@iii{%
+ \ifx\pslinestyle\@none
+ \addto@pscode{ false false }%
+ \else
+ \addto@pscode{%
+ {/nbeam {\POE@key@n cvx exec} bind def
+ \ifPOE@pswarning
+ /Warning /PrintWarning load def
+ \else
+ /Warning /pop load def
+ \fi}%
+ [ \POE@key@beampos\space counttomark dup
+ 0 eq {
+ pop 0 0
+ } {
+ 1 eq {
+ 0 exch
+ } if
+ } ifelse \tx@ScreenCoor] cvx
+ \POE@key@beamangle\space
+ currentdict /lastBeamPointTmp undef
+ currentdict /lastVecTmp undef
+ loadbeampoints 1 ge
+ tx@NodeDict /N@\oenodeBeam{\POE@key@loadbeampoints} known and {
+ /N@\oenodeBeam{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmp ED
+ } if
+ currentdict /lastVec\POE@key@loadbeampoints\space known
+ loadbeam and {
+ /lastVecTmp /lastVec\POE@key@loadbeampoints\space load def
+ } if
+ TraceBeam
+ \POE@strokesinglebeam
+ savebeampoints 1 ge
+ currentdict /lastBeamPointTmp known and dup {
+ lastBeamPointTmp
+ /N@\oenodeBeam{\POE@key@savebeampoints}\space 4 -1 roll
+ } if
+ savebeam currentdict /lastVecTmp known and dup {
+ /lastVec\POE@key@savebeampoints\space lastVecTmp 4 -1 roll
+ } if
+ }%
+ \fi
+ \end@BeamObj
+ \POE@Verb{%
+ { tx@OptexpDict begin ToVec def end } if
+ { \tx@NodeScale @NewNode } if
+ }%
+}%
+\def\tx@NodeScale{%
+ \pst@nodedict
+ /NodeScale {\ifx\pstnodescale\@undefined\else\pstnodescale\fi} def
+ end }
+\def\POE@strokesinglebeam{%
+ gsave
+ /Lineto /lineto load def
+ \tx@Drawbeam
+ \tx@setlinejoin
+ \pst@number\pslinewidth SLW
+ \pst@usecolor\pslinecolor
+ \tx@setStrokeTransparency
+ \@nameuse{psls@\pslinestyle}
+ grestore
+}%
+\def\drawwidebeam@ii{%
+ \def\pst@fill##1{ gsave ##1 grestore }%
+ \addto@pscode{%
+ {/nbeam {\POE@key@n cvx exec} bind def
+ \ifPOE@pswarning
+ /Warning /PrintWarning load def
+ \else
+ /Warning /pop load def
+ \fi}%
+ }%
+ \addto@pscode{%
+ \POE@key@beamangle\space dup
+ \POE@key@beamdiv\space 0.5 mul dup 4 -1 roll add 3 1 roll sub
+ }%
+ \addto@pscode{%
+ [ \POE@key@beampos\space counttomark dup
+ 0 eq {
+ pop 0 0
+ } {
+ 1 eq {
+ 0 exch
+ } if
+ } ifelse
+ mark \POE@key@beamwidth\space counttomark 0 eq {
+ 0
+ } {
+ 0.5 mul
+ } ifelse
+ exch pop
+ 3 copy add \tx@ScreenCoor\space ToVec
+ 5 1 roll sub \tx@ScreenCoor
+ ] cvx
+ }%
+ \addto@pscode{ exch 4 -1 roll 4 2 roll exch }%
+ \addto@pscode{%
+ counttomark mark exch 2 add 1 roll
+ gsave
+ \ifx\psk@fillstyle\relax
+ currentdict /fillBeam undef
+ \else
+ /fillBeam {\psk@fillstyle} def
+ \fi
+ /strokeBeam \ifx\pslinestyle\@none false \else true \fi def
+ [/lastBeamPointTmpLow /lastBeamPointTmpUp
+ /lastVecTmpLow /lastVecTmpUp]
+ {currentdict exch undef} forall
+ tx@NodeDict /N@\oenodeBeamLow{\POE@key@loadbeampoints} known
+ tx@NodeDict /N@\oenodeBeamUp{\POE@key@loadbeampoints} known
+ loadbeampoints 1 ge and and {
+ /N@\oenodeBeamLow{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmpLow ED
+ /N@\oenodeBeamUp{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmpUp ED
+ } if
+ loadbeam
+ currentdict /lastVecLow\POE@key@loadbeampoints\space known and
+ currentdict /lastVecUp\POE@key@loadbeampoints\space known and {
+ /lastVecTmpLow /lastVecLow\POE@key@loadbeampoints\space load def
+ /lastVecTmpUp /lastVecUp\POE@key@loadbeampoints\space load def
+ } if
+ TraceAndFillWideBeam
+ grestore pop % pop off the mark
+ counttomark 0 gt strokeBeam and {
+ counttomark dup /cnta ED /cntb ED
+ cnta 6 idiv {
+ cnta 3 roll /cnta cnta 3 sub def
+ /cntb cntb 3 sub def
+ cntb 3 roll /cntb cntb 3 sub def
+ } repeat
+ counttomark 2 idiv 1 add mark exch 1 roll
+ \POE@strokesinglebeam
+ \POE@strokesinglebeam
+ } {
+ pop % pop off the mark
+ } ifelse
+ currentdict /fillBeam known strokeBeam or
+ savebeampoints 1 ge and
+ currentdict /lastBeamPointTmpLow known and
+ currentdict /lastBeamPointTmpUp known and dup {
+ lastBeamPointTmpLow /N@\oenodeBeamLow{\POE@key@savebeampoints}
+ lastBeamPointTmpUp /N@\oenodeBeamUp{\POE@key@savebeampoints}
+ 7 -1 roll
+ } if
+ currentdict /fillBeam known strokeBeam or
+ savebeam and
+ currentdict /lastVecTmpLow known and
+ currentdict /lastVecTmpUp known and dup {
+ /lastVecLow\POE@key@savebeampoints\space lastVecTmpLow
+ /lastVecUp\POE@key@savebeampoints\space lastVecTmpUp
+ 7 -1 roll
+ } if
+ }%
+ \end@BeamObj
+ \POE@Verb{%
+ { tx@OptexpDict begin ToVec def ToVec def end } if
+ { \tx@NodeScale @NewNode @NewNode } if
+ }%
+}%
+\pst@def{Drawbeam}<
+ { counttomark 6 le {
+ exit
+ } if
+ 3 index not {
+ pop pop pop
+ }{
+ exit
+ } ifelse
+ } loop
+ { counttomark 3 le {
+ exit
+ } if
+ counttomark 3 sub index not {
+ counttomark -3 roll pop pop pop
+ }{
+ exit
+ } ifelse
+ } loop
+ counttomark 3 le {
+ cleartomark
+ }{
+ counttomark 3 div cvi /N ED
+ (\psk@ArrowInside) length 0 gt {
+ \ifx\psk@arrowA\arrowType@H % do we have a Hook arrow at the beginning?
+ \pst@number\pshooklength % yes
+ \else
+ \psk@arrowsize\space CLW mul add dup \psk@arrowlength\space mul exch \psk@arrowinset mul neg add
+ \fi
+ /arrowlength exch def
+ 6 copy pop % copy all four values for the arrow line
+ /y1 ED /x1 ED pop /y2 ED /x2 ED % save them
+ /Alpha y2 y1 sub x2 x1 sub Atan def % the gradient of the line
+ pop 3 -1 roll 5 1 roll
+ ArrowA
+ x1 Alpha cos arrowlength mul add % dx add
+ y1 Alpha sin arrowlength mul add % dy add, to get the current point at the end of the arrow tip
+ 5 -1 roll 3 1 roll true
+ /N N 1 sub def
+ N {
+ 6 copy pop
+ /y1 ED /x1 ED pop /y2 ED /x2 ED /draw ED
+ x1 y1 x2 y2 @ABDist dup
+ \POE@key@ArrowInsideMinLength\space\pst@number\psunit mul ge
+ exch \POE@key@ArrowInsideMaxLength\space\pst@number\psunit mul dup 0 lt
+ 3 1 roll le or and {
+ x1 y1
+ \psk@ArrowInsidePos\space 1 gt {
+ /Alpha y2 y1 sub x2 x1 sub Atan def
+ /ArrowPos \psk@ArrowInsideOffset\space def
+ /dArrowPos \psk@ArrowInsidePos\space abs def
+ \psk@ArrowInsideNo\space cvi {
+ /ArrowPos ArrowPos dArrowPos add def
+ x1 Alpha cos ArrowPos mul add
+ y1 Alpha sin ArrowPos mul add
+ 6 index { ArrowInside } if
+ pop pop
+ } repeat
+ }{
+ /ArrowPos \psk@ArrowInsideOffset\space def
+ /dArrowPos \psk@ArrowInsideNo 1 gt {%
+ 1.0 \psk@ArrowInsideNo 1.0 add div
+ }{\psk@ArrowInsidePos } ifelse def
+ \psk@ArrowInsideNo\space cvi {
+ /ArrowPos ArrowPos dArrowPos add def
+ x2 x1 sub ArrowPos mul x1 add
+ y2 y1 sub ArrowPos mul y1 add
+ 6 index { ArrowInside } if
+ pop pop
+ } repeat
+ } ifelse
+ pop pop
+ } if
+ draw {Lineto}{moveto} ifelse
+ } repeat
+ }{
+ pop 5 copy 3 -1 roll pop
+ ArrowA pop pop pop pop
+ counttomark 3 idiv -1 2 {
+ pop {
+ lineto
+ }{
+ moveto
+ } ifelse
+ } for
+ } ifelse
+ {CP 4 2 roll ArrowB lineto pop pop } {moveto} ifelse
+ pop
+ } ifelse
+>
+\def\POE@getcomprange#1-#2\@nil{%
+ \ifx\\#2\\%
+ \ifx\\#1\\%
+ % empty option
+ \edef\POE@firstcomp{\the\POE@cnt}%
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \edef\POE@firstcomp{#1}%
+ \edef\POE@lastcomp{#1}%
+ \fi
+ \else
+ \ifx\\#1\\%
+ \edef\POE@firstcomp{1}%
+ \else
+ \edef\POE@firstcomp{#1}%
+ \fi
+ \POE@getlastcomp#2%
+ \fi
+ \ifnum\POE@firstcomp<1
+ \def\POE@firstcomp{1}%
+ \else\ifnum\POE@firstcomp>\the\POE@cnt
+ \edef\POE@firstcomp{\the\POE@cnt}%
+ \fi\fi
+ \ifnum\POE@lastcomp>\the\POE@cnt
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else\ifnum\POE@lastcomp<1
+ \def\POE@lastcomp{1}%
+ \fi\fi
+}
+\def\POE@getlastcomp#1-{%
+ \ifx.#1.%
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \ifx\@empty#1\relax
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \edef\POE@lastcomp{#1}%
+ \fi
+ \fi
+}
+\def\POE@getcomps#1#2{%
+ \ifx\POE@key@conn\@empty
+ \def\POE@aftercomps{\addto@pscode{#1 \POE@comps }#2}%
+ \else
+ \def\POE@aftercomps{#2}%
+ \fi
+ \def\POE@comps{}%
+ \POE@@getcomps%
+}%
+\def\POE@@getcomps{%
+ \@ifnextchar\bgroup{\POE@@@getcomps}{\POE@aftercomps}%
+}%
+\def\POE@@@getcomps#1{%
+ \def\POE@temp{#1\@empty}%
+ \expandafter\POE@@@@getcomps\POE@temp\@nil
+}%
+\def\POE@@@@getcomps#1#2\@nil{%
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty
+ \POE@getcomp{(\oenode{}{})}%
+ \else\ifx(#1\relax%)
+ \POE@getplanenode#1#2%
+ \else\ifnum9<1#1\relax
+ \POE@getcomprange#1#2-\@nil
+ \POE@getcomp{%
+ (\POE@str@basicname@prefix\POE@str@basicname@default)
+ \POE@firstcomp\space\POE@lastcomp\space GetCompRange %
+ }%
+ \else\ifx-#1\relax
+ \POE@getcomprange#1#2-\@nil
+ \POE@getcomp{%
+ (\POE@str@basicname@prefix\POE@str@basicname@default)
+ \POE@firstcomp\space\POE@lastcomp\space GetCompRange %
+ }%
+ \else
+ \POE@getcomp{(\oenode{}{#1#2})}%
+ \fi\fi\fi\fi%
+ \POE@@getcomps%
+}%
+\def\POE@getplanenode(#1){%
+ \pst@@getcoor{#1}%
+ \ifx\POE@key@conn\@empty
+ \advance\POE@nodecnt by 1
+ \POE@getcomp{%
+ {\pst@coor} {0 1}
+ (\POE@str@basicname@default N@\the\POE@nodecnt)
+ {\tx@UserCoor} NewTempNodeComp
+ (\POE@str@basicname@default N@\the\POE@nodecnt)
+ }%
+ \else
+ \POE@getcomp{{\pst@coor} }%
+ \fi
+}%
+\def\POE@getcomp#1{%
+ \ifx\POE@comps\@empty
+ \edef\POE@tempc{#1}%
+ \else
+ \edef\POE@tempd{#1}%
+ \fi
+ \edef\POE@comps{#1 \POE@comps}%
+}%
+\def\POE@drawInternalConnections{%
+ \ifx\POE@key@conn\@empty
+ \POE@drawInternalConnectionsNew
+ \else
+ \POE@drawInternalConnectionsOld
+ \fi
+}%
+\def\POE@drawPresetFibers{%
+ \ifPOE@endbox
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \else\ifPOE@startbox
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \else
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \fi\fi
+}%
+\def\POE@drawInternalConnectionsNew{%
+ \ifPOE@beam
+ \ifPOE@endbox
+ \drawbeam[raytrace=false]{(\oenodeRefA{})}{}
+ \else\ifPOE@startbox
+ \drawbeam[raytrace=false]{}{(\oenodeRefB{})}
+ \else
+ \drawbeam[raytrace=false]{(\oenodeRefA{})}{}{(\oenodeRefB{})}
+ \fi\fi
+ \else\ifPOE@fiber@
+ \ifPOE@endbox
+ \ifPOE@fiberin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \else\ifPOE@startbox
+ \ifPOE@fiberout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \else
+ \ifPOE@fiberin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \ifPOE@fiberout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \fi\fi
+ \fi\fi
+}%
+\def\POE@drawInternalConnectionsOld{%
+ \ifPOE@endbox
+ \@nameuse{\POE@connIn}
+ \else
+ \ifPOE@fiber@
+ \ifPOE@fiberin@
+ \@nameuse{\POE@connIn}
+ \fi
+ \ifPOE@fiberout@
+ \@nameuse{\POE@connOut}
+ \fi
+ \else
+ \ifPOE@connjoin
+ \def\POE@tempa{POE@conn@in@i}%
+ \ifx\POE@tempa\POE@connIn
+ \def\POE@tempb{POE@conn@out@o}
+ \ifx\POE@tempb\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else\ifx\@empty\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi\fi
+ \else
+ \def\POE@tempa{POE@conn@in@o}%
+ \ifx\POE@tempa\POE@connIn
+ \def\POE@tempb{POE@conn@out@o}
+ \ifx\POE@tempb\POE@connOut
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \else\ifx\@empty\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \fi\fi
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi
+ \fi
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi
+ \fi
+ \fi
+}%
+\def\optexp@nodeA{\oenodeIn{}}%
+\def\optexp@nodeB{\oenodeOut{}}%
+\define@key[psset]{optexp}{connjoin}{%
+ \edef\POE@temp{#1}%
+ \ifnum\POE@temp<0
+ \POE@connjoinfalse
+ \else\ifnum\POE@temp>2
+ \POE@connjoinfalse
+ \else
+ \POE@connjointrue
+ \edef\POE@key@connjoin{\POE@temp}
+ \fi\fi
+}%
+\def\POE@key@conn{}%
+\define@key[psset]{optexp}{conn}{%
+ \edef\POE@key@conn{#1}%
+ \expandafter\POE@psset@@conn\POE@key@conn\@empty-\@empty\@nil
+ \if@pst\else
+ \PackageError{pst-optexp}{Bad connection specification: #1}%
+ \fi
+}%
+\def\POE@psset@@conn#1-#2\@empty#3\@nil{%
+ \@psttrue
+ \def\POE@next##1,#1-##2,##3\@nil{\def\POE@temp{##2}}%
+ \expandafter\POE@next\POE@conntable,#1-#1,\@nil
+ \@ifundefined{POE@conn@in@\POE@temp}%
+ {\@pstfalse\def\POE@connIn{}}%
+ {\edef\POE@connIn{POE@conn@in@\POE@temp}}%
+ \@ifundefined{POE@conn@out@#2}%
+ {\@pstfalse\def\POE@connOut{}}%
+ {\def\POE@connOut{POE@conn@out@#2}}%
+}%
+\def\POE@connIn{}%
+\def\POE@connOut{}%
+\def\POE@conntable{,o-o,i-i,f-f}%
+\def\POE@conn@out@{\ifPOE@insideobj\else\POE@conn@out@a\fi}%
+\def\POE@conn@in@{\ifPOE@insideobj\else\POE@conn@in@a\fi}%
+\def\POE@conn@in@o{%
+ \psline[style=Beam](\oenodeRefA{})(\optexp@nodeA)%
+}%
+\def\POE@conn@out@o{%
+ \psline[style=Beam](\optexp@nodeB)(\oenodeRefB{})%
+}%
+\def\POE@conn@in@f{%
+ \pccurve[%
+ angleA=!\POE@dict{/N@\oenodeRefA{} /N@\oenodeRefB{} SlopeAngle},
+ angleB=!\POE@dict{/N@\oenodeRefB{} /N@\oenodeRefA{} SlopeAngle},
+ style=FiberIn](\oenodeRefA{})(\optexp@nodeA)%
+}%
+\def\POE@conn@out@f{%
+ \pccurve[%
+ angleA=!\POE@dict{/N@\oenodeRefA{} /N@\oenodeRefB{} SlopeAngle},
+ angleB=!\POE@dict{/N@\oenodeRefB{} /N@\oenodeRefA{} SlopeAngle},
+ style=FiberOut](\optexp@nodeB)(\oenodeRefB{})%
+}%
+\def\POE@conn@in@i{%
+ \def\pst@par{style=Beam}
+ \begin@OpenObj
+ \addto@pscode{%
+ [%]
+ \pst@optexpdict
+ (\oenode{}{}) true GetInternalBeamNodesCompat
+ /N@\oenodeRefA{} @GetCenter
+ end
+ }%
+ \psline@ii
+}%
+\def\POE@conn@out@i{%
+ \def\pst@par{style=Beam}
+ \begin@OpenObj
+ \addto@pscode{%
+ [%]
+ \pst@optexpdict
+ /N@\oenodeRefB{} @GetCenter
+ (\oenode{}{}) true GetInternalBeamNodesCompat
+ end
+ }%
+ \psline@ii
+}%
+\def\POE@conn@in@a{%
+ dup xcheck not {
+ \POE@dict{1 GetInternalBeamNodeCompat}
+ } if
+ exec
+}%
+\def\POE@conn@in@A{%
+ dup xcheck not {
+ false \POE@dict{GetInternalBeamNodesCompat} %
+ } if
+ exec
+}%
+\def\POE@conn@in@b{%
+ dup xcheck not {
+ \POE@dict{(N) GetInternalBeamNodeCompat}
+ } if
+ exec
+}%
+\def\POE@conn@in@B{%
+ dup xcheck not {
+ true \POE@dict{GetInternalBeamNodesCompat} %
+ } if
+ exec
+}%
+\let\POE@conn@out@a\POE@conn@in@a
+\let\POE@conn@out@A\POE@conn@in@B
+\let\POE@conn@out@b\POE@conn@in@b
+\let\POE@conn@out@B\POE@conn@in@A
+\def\drawbeam@compat{%
+ \ifPOE@connjoin
+ \setkeys+[psset]{optexp}{linejoin=\POE@key@connjoin}%
+ \fi
+ \addto@pscode{[% ]
+ \POE@tempd\space
+ \@nameuse{\POE@connOut}
+ \POE@tempc\space
+ \@nameuse{\POE@connIn}}%
+ \psline@ii
+\ignorespaces}%
+\def\defShiftedNode(#1)(#2)#3{%
+ \PackageWarning{pst-optexp}{%
+ \string\defShiftedNode\space is deprecated,\MessageBreak
+ use \string\nodexn\space(pst-node) instead.}%
+ \pst@getcoor{#1}\pst@tempa%
+ \pst@getcoor{#2}\pst@tempb%
+ \pnode(! \pst@tempb \pst@tempa \POE@dict{VecAdd} \tx@UserCoor){#3}%
+}%
+\def\POE@checkcompname#1{%
+ \@expandtwoargs\in@{,#1,}{,\POE@complist,}%
+ \ifin@\else
+ \PackageError{pst-optexp}{^^Jcompname '#1' undefined!^^J}
+ \fi
+}%
+\def\POE@getlastcompname{%
+ \expandafter\POE@getlastcompname@i \POE@complist,\relax,\@nil
+}%
+\def\POE@getlastcompname@i#1,#2,#3\@nil{#1}%
+\def\oenode#1#2{%
+ \POE@str@basicname@prefix%
+ \ifx\\#2\\%
+ \ifnum9<1\POE@getlastcompname%
+ \POE@str@basicname@default%
+ \POE@getlastcompname%
+ \else%
+ \POE@getlastcompname%
+ \POE@str@basicname@sep%
+ \fi%
+ \else%
+ \ifnum9<1#2%
+ \POE@str@basicname@default%
+ #2%
+ \else%
+ #2\POE@str@basicname@sep%
+ \fi%
+ \fi%
+ #1%
+}%
+\def\oenodeExt#1{\oenode{\POE@str@extnode@postfix}{#1}}%
+\def\oenodeIn#1{\oenode{1}{#1}}%
+\def\oenodeOut#1{\oenode{N}{#1}}%
+\def\oenodeCenter#1{\oenode{Center}{#1}}%
+\def\oenodeLabel#1{\oenode{Label}{#1}}%
+\def\oenodeRefA#1{\oenode{A}{#1}}%
+\def\oenodeRefB#1{\oenode{B}{#1}}%
+\def\oenodeRotref#1{\oenode{Rotref}{#1}}%
+\def\oenodeTrefA#1{\oenode{TrefA}{#1}}%
+\def\oenodeTrefB#1{\oenode{TrefB}{#1}}%
+\def\oenode@RefA#1{\oenode{@A}{#1}}%
+\def\oenode@RefB#1{\oenode{@B}{#1}}%
+\def\oenode@TrefA#1{\oenode{@TrefA}{#1}}%
+\def\oenode@TrefB#1{\oenode{@TrefB}{#1}}%
+\def\oenodeIfc#1#2{%
+ \ifnum9<1#1 %
+ \oenode{#1}{#2}%
+ \else\ifx#1N %
+ \oenode{#1}{#2}%
+ \else\ifx#1C %
+ \oenode{#1}{#2}%
+ \else
+ \PackageWarning{pst-optexp}{%
+ \string\oenodeIfc\space node argument must be\MessageBreak
+ integer, 'N', or 'C'}
+ \fi\fi\fi
+}%
+\def\oenodeBeam#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default Beam%
+ \ifx\\#1\\1\else#1\fi
+}%
+\def\oenodeBeamUp#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default BeamUp%
+ \ifx\\#1\\1\else#1\fi
+}%
+\def\oenodeBeamLow#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default BeamLow%
+ \ifx\\#1\\1\else#1\fi
+}%
+\def\newOptexpComp@#1#2{%
+ \POE@Verb{%
+ \tx@NodeScale
+ [ #1 #2 \ifPOE@allowbeaminside true \else false \fi
+ (\oenode{}{}) {\tx@ScreenCoor}
+ NewOptexpComp
+ }%
+\ignorespaces}%
+\def\newOptexpComp#1{%
+ \newOptexpComp@{#1}{false}%
+\ignorespaces}%
+\def\newOptexpCompAmb#1{%
+ \newOptexpComp@{#1}{true}%
+\ignorespaces}%
+\def\newOptexpFiberComp#1{%
+ \POE@Verb{%
+ \tx@NodeScale
+ [ #1 (\oenode{}{}) {\tx@ScreenCoor}
+ NewOptexpFiberComp
+ }%
+\ignorespaces}%
+\def\POE@compalias#1#2{%
+ \POE@Verb{%
+ /\oenode{}{#1} dup currentdict exch known {
+ load /#2 ED
+ } {
+ pop
+ } ifelse
+ (#2) (\oenode{}{#1})
+ tx@NodeDict begin
+ 1 {
+ 3 copy inttostr dup
+ 3 1 roll 2 copy NodeName
+ currentdict exch known {
+ NodeName load 3 1 roll NodeName ED
+ 1 add
+ } {
+ pop (N) NodeName load 3 1 roll
+ pop (N) NodeName ED
+ pop exit
+ } ifelse
+ } loop
+ [ (A) (B) (@A) (@B) (Center) (Label) (Rotref)
+ (TrefA) (TrefB) (@TrefA) (@TrefB) (Ext)
+ counttomark {
+ counttomark 3 add -2 roll 2 copy counttomark 1 add 2 roll
+ 3 -1 roll dup 4 1 roll NodeName dup
+ currentdict exch known {
+ load 3 1 roll exch NodeName ED
+ } {
+ pop pop pop
+ } ifelse
+ } repeat pop pop pop
+ end
+ }%
+\ignorespaces}%
+\def\optplane{%
+ \@ifnextchar[%]
+ {\optplane@i}{\optplane@i[]}%
+}%
+\def\optplane@i[#1](#2){%
+ \pst@getcoor{#2}\POE@tempa
+ \optplate[#1, plateheight=0, linestyle=none]%
+ (! \POE@tempa exch 1 sub exch \tx@UserCoor)%
+ (! \POE@tempa exch 1 add exch \tx@UserCoor)%
+\ignorespaces}%
+\def\begin@OptexpObj{%
+ \global\advance\POE@cnt by 1
+ \addbefore@par{compname={}}%
+ \pst@killglue
+ \begingroup
+ \POE@insideobjtrue
+ \POE@Verb{InitOptexpComp }%
+ \use@par
+ \let\POE@key@comp@Yshift\POE@key@compshift%
+ \def\POE@key@comp@Xshift{0}%
+ \edef\POE@refnodeA{\oenodeRefA{}}%
+ \edef\POE@refnodeB{\oenodeRefB{}}%
+ \edef\POE@trefnodeA{\oenodeTrefA{}}%
+ \edef\POE@trefnodeB{\oenodeTrefB{}}%
+ \def\POE@transformnodes{%
+ \POE@transformnode{\oenodeRefA{}}{\oenodeTrefA{}}%
+ \POE@transformnode{\oenodeRefB{}}{\oenodeTrefB{}}%
+ }%
+}%
+\let\begin@OptexpFiberObj\begin@OptexpObj
+\let\POE@disablepos\relax
+\def\begin@OptexpTripole{%
+ \begin@OptexpObj
+ \def\POE@key@comp@Xshift{\POE@key@compshift\space neg }%
+ \def\POE@key@comp@Yshift{0}%
+ \def\POE@disablepos{%
+ \let\POE@key@abspos\@empty
+ \let\POE@key@position\@empty
+ }%
+ \POE@positionrefnodes
+}%
+\def\POE@positionrefnodes{%
+ \edef\POE@refnodeA{\oenode@RefA{}}%
+ \edef\POE@refnodeB{\oenode@RefB{}}%
+ \edef\POE@trefnodeA{\oenode@TrefA{}}%
+ \edef\POE@trefnodeB{\oenode@TrefB{}}%
+ \def\POE@transformnodes{%
+ \POE@transformnode{\oenodeRefA{}}{\oenodeTrefA{}}%
+ \POE@transformnode{\oenodeRefB{}}{\oenodeTrefB{}}%
+ \POE@transformnode{\oenode@RefA{}}{\oenode@TrefA{}}%
+ \POE@transformnode{\oenode@RefB{}}{\oenode@TrefB{}}%
+ }%
+}%
+\def\end@OptexpObj{%
+ \ifnum9<1\POE@key@compname\else
+ \POE@compalias{\POE@key@compname}{\oenode{}{\the\POE@cnt}}%
+ \fi
+ \endgroup
+ \ignorespaces%
+}%
+\let\end@OptexpDipole\end@OptexpObj
+\let\end@OptexpTripole\end@OptexpObj
+\def\addafter@par#1{%
+ \ifx\pst@par\@empty
+ \def\pst@par{#1}%
+ \else
+ \toks@{#1}%
+ \pst@toks\expandafter{\pst@par}%
+ \edef\pst@par{\the\pst@toks,\the\toks@}%
+ \fi%
+}%
+\def\getCLWH{CLW \pst@number\psxunit 2 mul div }%
+\def\getCLW{CLW \pst@number\psxunit div }%
+\let\POE@restorerefnodes\relax
+\def\newOptexpDipole{%
+ \@ifnextchar[%]
+ {\POE@newdipole}{\POE@newdipole[]}%
+}%
+\def\newOptexpDipoleNolabel{%
+ \PackageWarning{pst-optexp}{%
+ \string\newOptexpDipoleNolabel\space is deprecated,\MessageBreak
+ use \string\newOptexpDipole\space instead.}%
+ \newOptexpDipole
+}%
+\def\newOptexpTripole{%
+ \@ifnextchar[%]
+ {\POE@newtripole}{\POE@newtripole[]}%
+}%
+\def\newOptexpFiberDipole{%
+ \@ifnextchar[%]
+ {\POE@newfiberdipole}{\POE@newfiberdipole[]}%
+}%
+\def\POE@newdipole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{#2@i@}(##1)(##2)}%
+ {\@nameuse{#2@i@}(##1)(##2){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)##3{%
+ \addbefore@par{#3}%
+ \addafter@par{#1}%
+ \begin@OptexpObj
+ \ifPOE@backlayer
+ \POE@regNodes{##1}{##2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[#2]{##3}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{ (1) (N) (\oenode{}{}) CorrectDipoleIfc }%
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpDipole
+ }%
+ \dipole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ dipole component `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+\def\POE@newfiberdipole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{#2@i@}(##1)(##2)}%
+ {\@nameuse{#2@i@}(##1)(##2){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)##3{%
+ \addbefore@par{#3}%
+ \addafter@par{#1}%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{##1}{##2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[#2]{##3}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{ (1) (N) (\oenode{}{}) CorrectDipoleIfc }%
+ \ifPOE@fiberpreset@
+ \POE@drawPresetFibers
+ \fi
+ \fi
+ \end@OptexpDipole
+ }%
+ \fiberdipole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ fiber dipole object `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+\def\POE@newtripole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2)(##3){%
+ \@ifnextchar\bgroup{\@nameuse{#2@i@}(##1)(##2)(##3)}%
+ {\@nameuse{#2@i@}(##1)(##2)(##3){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)(##3)##4{%
+ \addbefore@par{#3}%
+ \addafter@par{ref@angle=180,#1}%
+ \begin@OptexpTripole
+ \ifPOE@backlayer
+ \POE@calcNodes{##1}{##2}{##3}%
+ \POE@regNodes{##1}{##3}%
+ \fi
+ \POE@drawcomponent[#2]{##4}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpTripole
+ }%
+ \tripole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ tripole object `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+\def\dipole@iimacro#1{%
+ \POE@iimacro{#1}{\dipole@nodes}%
+\ignorespaces}%
+\def\fiberdipole@iimacro#1{%
+ \POE@iimacro{#1}{\fiberdipole@nodes}%
+\ignorespaces}%
+\def\tripole@iimacro#1{%
+ \POE@iimacro{#1}{\tripole@nodes}%
+\ignorespaces}%
+\def\POE@iimacro#1#2{%
+ \@namedef{#1@ii}{%
+ \ifPOE@backlayer
+ \pnode(0,0){\oenodeCenter{}}%
+ \fi
+ \@ifundefined{#1@iii}{%
+ \ifPOE@backlayer
+ \@ifundefined{#1@nodes}{#2}{\@nameuse{#1@nodes}}%
+ \fi
+ \ifPOE@frontlayer
+ \@nameuse{#1@comp}%
+ \fi
+ }{%
+ \ifPOE@backlayer
+ \PackageWarning{pst-optexp}{%
+ Using #1@iii, please switch to the new\MessageBreak
+ interface system.}%
+ \@nameuse{#1@iii}%
+ \fi
+ }%
+ }%
+\ignorespaces}%
+\def\optcoupler{\pst@object{optcoupler}}%
+\def\optcoupler@i(#1)(#2)(#3)(#4){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{optcoupler@i@}(#1)(#2)(#3)(#4)}%
+ {\@nameuse{optcoupler@i@}(#1)(#2)(#3)(#4){}}%
+}%
+\def\optcoupler@i@(#1)(#2)(#3)(#4)#5{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#1){\oenodeRefA{}}
+ \pnode(#3){\oenodeRefB{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#2){\oenodeRefA{}}
+ \pnode(#4){\oenodeRefB{}}
+ \else
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefA{}}
+ \pst@getcoor{#3}\POE@tempa%
+ \pst@getcoor{#4}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefB{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[optcoupler]{#5}{\@nameuse{optcoupler@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (3) (\oenode{}{}) CorrectDipoleIfc
+ (2) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn1}[stopnode=1]{(#1)}%
+ {\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetin@bottom
+ \drawfiber@{FiberIn2}[stopnode=2]{(#2)}%
+ {\POE@key@compname}
+ \fi
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut}[startnode=3]{\POE@key@compname}%
+ {(#3)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=N]{\POE@key@compname}%
+ {(#4)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{optcoupler}%
+\def\wdmsplitter{\pst@object{wdmsplitter}}%
+\def\wdmsplitter@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\wdmsplitter@i@(#1)(#2)(#3)}%
+ {\wdmsplitter@i@(#1)(#2)(#3){}}%
+}%
+\def\wdmsplitter@i@(#1)(#2)(#3)#4{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \pnode(#1){\oenodeRefA{}}
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#2){\oenodeRefB{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#3){\oenodeRefB{}}
+ \else
+ \pst@getcoor{#2}\POE@tempa%
+ \pst@getcoor{#3}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefB{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[wdmsplitter]{#4}\wdmsplitter@ii
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (2) (\oenode{}{}) CorrectDipoleIfc
+ (1) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut1}[startnode=2]%
+ {\POE@key@compname}{(#2)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=N]%
+ {\POE@key@compname}{(#3)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{wdmsplitter}%
+\def\wdmcoupler{\pst@object{wdmcoupler}}%
+\def\wdmcoupler@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\wdmcoupler@i@(#1)(#2)(#3)}%
+ {\wdmcoupler@i@(#1)(#2)(#3){}}%
+}%
+\def\wdmcoupler@i@(#1)(#2)(#3)#4{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \pnode(#3){\oenodeRefB{}}
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#1){\oenodeRefA{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#2){\oenodeRefA{}}
+ \else
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefA{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[wdmcoupler]{#4}\wdmcoupler@ii
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (N) (\oenode{}{}) CorrectDipoleIfc
+ (2) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}[startnode=N]{\POE@key@compname}{(#3)}
+ \fi
+ \ifPOE@fiberpresetin@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn1}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetin@bottom
+ \drawfiber@{FiberIn2}[stopnode=2]{(#2)}{\POE@key@compname}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{wdmcoupler}%
+\def\optcirculator{\pst@object{optcirculator}}%
+\def\optcirculator@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\optcirculator@i@(#1)(#2)(#3)}%
+ {\optcirculator@i@(#1)(#2)(#3){}}%
+}%
+\def\optcirculator@i@(#1)(#2)(#3)#4{%
+ \addafter@par{ref@angle=180}%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#2}
+ \ifx\POE@key@position\@empty
+ \ifx\POE@key@abspos\@empty
+ \POE@positionrefnodes
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempc%
+ \pst@getcoor{#3}\POE@tempb%
+ \pnode(! \POE@dict{%
+ \POE@tempa \tx@UserCoor 2 copy 2 copy
+ \POE@tempc \tx@UserCoor 4 2 roll @ABVect
+ 2 copy 2 copy 10 4 roll
+ \POE@tempb \tx@UserCoor 6 -2 roll @ABVect
+ 4 2 roll tx@EcldDict begin Project end VecAdd
+ 2 copy 6 -2 roll -0.5 VecScale VecAdd
+ }){\oenode@RefA{}}%
+ \pnode(! \POE@dict{4 2 roll 0.5 VecScale VecAdd})%
+ {\oenode@RefB{}}%
+ \fi
+ \fi
+ \fi
+ \POE@drawcomponent[optcirculator]{#4}\optcirculator@ii
+ \ifPOE@backlayer
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut1}[startnode=N]%
+ {\POE@key@compname}{(#2)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=2, fiberalign=center]%
+ {\POE@key@compname}{(#3)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{optcirculator}%
+\def\POE@calcNodes#1#2#3{{%
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pst@getcoor{#3}\POE@tempc%
+ \pnode(! \POE@dict{%
+ \POE@tempa \tx@UserCoor
+ \POE@tempc \tx@UserCoor
+ \POE@tempb \tx@UserCoor
+ calcNodes
+ X@A Y@A}){\oenode@RefA{}}%
+ \pnode(! \POE@dict{X@B Y@B}){\oenode@RefB{}}%
+}\ignorespaces}%
+\def\POE@regNodes#1#2{%
+ \pnode(#1){\oenodeRefA{}}
+ \pnode(#2){\oenodeRefB{}}
+ \POE@Verb{%
+ /@xref \POE@key@extnode@xref\space def
+ /@yref \POE@key@extnode@yref\space def
+ }%
+\ignorespaces}%
+\def\POE@extnodealign{%
+ \ifx\POE@key@extnodealign\POE@str@absolute
+ \POE@Verb{%
+ /N@\oenodeRefA{} @GetCenter /N@\oenodeRefB{} @GetCenter
+ @ABVect exch
+ dup 0 gt 3 1 roll 0 eq exch 0 lt and or
+ { /RefFac -1 def } if
+ }%
+ \fi
+\ignorespaces}%
+\def\POE@pnode@shiftedrot(#1)#2#3#4{%
+ \pst@getcoor{#1}\POE@temp%
+ \pnode(!%
+ \POE@temp /YDiff ED /XDiff ED %
+ /N@#2 load GetCenter /YShifted ED /XShifted ED
+ /rot@angle #4 \POE@key@labelrefangle\space add def
+ /XDiff@Rot rot@angle cos XDiff mul rot@angle sin YDiff mul add def
+ /YDiff@Rot rot@angle cos YDiff mul rot@angle sin XDiff mul sub def
+ XShifted XDiff@Rot add YShifted YDiff@Rot add neg \tx@UserCoor
+ ){#3}%
+ \psset[optexp]{ref@angle=0}
+}%
+\def\POE@nlput{\pst@object{POE@nlput}}
+\def\POE@nlput@i(#1)(#2)#3#4{%
+ \begin@SpecialObj
+ \POE@LDNode(#1)(#2){#3}
+ \pcline[linestyle=none](temp@nlputA)(temp@nlputB)%
+ \ncput[npos=0.5]{#4}%
+ \end@SpecialObj}
+\def\POE@LDNode(#1)(#2)#3{%
+ \pst@getcoor{#1}\pst@tempA%
+ \pst@getcoor{#2}\pst@tempB%
+ \pnode(!
+ \pst@tempA \tx@UserCoor /YA ED /XA ED
+ \pst@tempB \tx@UserCoor /YB ED /XB ED
+ /dx XB XA sub def
+ /dy YB YA sub def
+ /angle dy dx Atan def
+ XA #3 1 sub angle cos mul add
+ YA #3 1 sub angle sin mul add ){temp@nlputA}%
+ \pnode(!
+ \pst@tempA \tx@UserCoor /YA ED /XA ED
+ \pst@tempB \tx@UserCoor /YB ED /XB ED
+ /dx XB XA sub def
+ /dy YB YA sub def
+ /angle dy dx Atan def
+ XA #3 1 add angle cos mul add
+ YA #3 1 add angle sin mul add ){temp@nlputB}%
+}
+\def\POE@putlabelrelative#1{%
+ \nput[labelsep=0]{\POE@key@labelangle}%
+ {\oenodeLabel{}}%
+ {\rput[\POE@key@labelalign](0,0){\POE@key@labelstyle #1}}%
+}%
+\def\POE@putcomp#1{%
+ \rput(! \POE@key@comp@Xshift\space\POE@key@comp@Yshift){%
+ \pnode(! \POE@dict{
+ \POE@key@rotate@xref\space
+ \POE@key@rotate@yref\space
+ DefineExtNode}){\oenodeRotref{}}%
+ \ifdim\POE@key@angle pt=0pt
+ #1%
+ \POE@pnode@shiftedrot(0,\POE@key@labeloffset)%
+ {\oenodeCenter{}}%
+ {\oenodeLabel{}}%
+ {\POE@key@labelangle}%
+ \else
+ \psrotate(\oenodeRotref{}){\POE@key@angle}{%
+ #1%
+ \POE@pnode@shiftedrot(0,\POE@key@labeloffset)%
+ {\oenodeCenter{}}%
+ {\oenodeLabel{}}%
+ {\POE@key@labelangle}%
+ }%
+ \fi%
+ }%
+}%
+\def\POE@putlabel#1{%
+ \def\POE@temp{#1}%
+ \ifx\POE@temp\@empty\else
+ \ifx\POE@key@labelref\POE@str@labelref@global
+ \nput[labelsep=\POE@key@labeloffset]%
+ {\POE@key@labelangle}%
+ {\oenodeCenter{}}%
+ {\pnode(0,0){\oenodeLabel{}}%
+ \rput[\POE@key@labelalign](0,0){\POE@key@labelstyle #1}}%
+ \else\ifx\POE@key@labelref\POE@str@labelref@relgrav
+ \rput[\POE@key@labelalign](\oenodeLabel{}){%
+ \POE@key@labelstyle #1}%
+ \else\ifx\POE@key@labelref\POE@str@relative
+ \begingroup
+ \pst@def{InitNC}< % kindly contributed by Herbert Voss
+ /b ED /a ED
+ /NodeSepTypeB ED /NodeSepTypeA ED
+ /NodeSepB ED /NodeSepA ED
+ /OffsetB ED /OffsetA ED
+ tx@NodeDict a known tx@NodeDict b known and dup {
+ /NodeA a load def /NodeB b load def
+ NodeA GetCenter NodeB GetCenter
+ 4 copy exch 4 -1 roll 2 copy gt
+ { pop pop pop pop /yB ED /xB ED /yA ED /xA ED }
+ { eq 3 1 roll lt and
+ { /yB ED /xB ED /yA ED /xA ED}
+ { /yA ED /xA ED /yB ED /xB ED} ifelse
+ } ifelse
+ } if >%
+ \ncline[linestyle=none,fillstyle=none, npos=]%
+ {\POE@trefnodeA}{\POE@trefnodeB}%
+ \ifx\POE@key@position\@empty
+ \ifx\POE@key@abspos\@empty
+ \ncput[nrot=:U,npos=]{\POE@putlabelrelative{#1}}%
+ \else
+ \POE@nlput[nrot=:U](\POE@trefnodeA)(\POE@trefnodeB)%
+ {\POE@key@abspos}{\POE@putlabelrelative{#1}}%
+ \fi
+ \else
+ \ncput[nrot=:U, npos=\POE@key@position]%
+ {\POE@putlabelrelative{#1}}%
+ \fi
+ \endgroup
+ \fi\fi\fi
+ \fi
+}%
+\newOptexpDipole{lens}{}%
+\newOptexpDipole{pinhole}{}%
+\newOptexpDipole{crystal}{}%
+\newOptexpDipole{polarization}{}%
+\newOptexpDipole{optbox}{}%
+\newOptexpDipole{optplate}{}%
+\newOptexpDipole{optretplate}{}%
+\newOptexpDipole[endbox]{optdetector}{}%
+\newOptexpDipole{optdiode}{allowbeaminside=false}%
+\newOptexpDipole{doveprism}{}%
+\newOptexpTripole{mirror}{}%
+\newOptexpTripole[ref@angle=-135]{beamsplitter}{}%
+\newOptexpTripole{optgrating}{}%
+\def\optgrid{%
+ \PackageWarning{pst-optexp}{%
+ \string\optgrid\space is deprecated,\MessageBreak
+ use \string\optgrating\space instead.}%
+ \optgrating%
+}%
+\newOptexpTripole[ref@angle=-135]{pentaprism}{}%
+\newOptexpTripole[ref@angle=-135]{rightangleprism}{}%
+\newOptexpTripole[ref@angle=-135]{optprism}{}%
+\def\optdipole{\pst@object{optdipole}}
+\def\optdipole@i(#1)(#2)#3#4{%
+ \begin@OptexpObj
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent{#4}{%
+ \ifPOE@backlayer
+ \pnode(0,0){\oenodeCenter{}}%
+ \newOptexpComp{{0 0} {0 1} 0 0 trans {PlainIfc} 1 }%
+ \fi
+ \ifPOE@frontlayer
+ #3
+ \fi
+ }%
+ \ifPOE@backlayer
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpObj
+}%
+\def\opttripole{\pst@object{opttripole}}
+\def\opttripole@i(#1)(#2)(#3)#4#5{%
+ \begin@OptexpTripole
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#3}%
+ \POE@calcNodes{#1}{#2}{#3}%
+ \fi
+ \POE@drawcomponent{#5}{%
+ \pnode(0,0){\oenodeCenter{}}%
+ \newOptexpComp{{0 0} {1 0} 0 0 refl {PlainIfc} 1 }%
+ #4
+ }%
+ \POE@drawInternalConnections
+ \end@OptexpTripole
+}%
+\def\fibercollimator{\pst@object{fibercollimator}}
+\def\fibercollimator@i(#1)(#2){%
+ \def\POE@tempa{#1}%
+ \def\POE@tempb{#2}%
+ \def\POE@tempc{}%
+ \def\POE@tempd{}%
+ \@ifnextchar(%)
+ {\fibercollimator@ii}{\fibercollimator@iv}%
+}%
+\def\fibercollimator@ii(#1){%
+ \def\POE@tempc{#1}%
+ \@ifnextchar(%)
+ {\fibercollimator@iii}{\fibercollimator@iv}%
+}%
+\def\fibercollimator@iii(#1){%
+ \def\POE@tempd{#1}%
+ \fibercollimator@iv
+}%
+\def\fibercollimator@iv{%
+ \@ifnextchar\bgroup{\fibercollimator@v}{\fibercollimator@v{}}%
+}%
+\def\fibercollimator@v#1{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{\POE@tempa}{\POE@tempb}%
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[fibercollimator]{#1}{%
+ \pnode(0,0){\oenodeCenter{}}%
+ \ifPOE@backlayer
+ \fibercollimator@nodes
+ \fi
+ \ifPOE@frontlayer
+ \fibercollimator@comp
+ \fi
+ }%
+ \ifPOE@backlayer
+ \ifPOE@beam
+ \drawbeam{(\oenodeRefA{})}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetout@
+ \ifx\@empty\POE@tempc
+ \drawfiber{\POE@key@compname}{(\oenodeRefB{})}
+ \else\ifx\@empty\POE@tempd
+ \psbezier[style=FiberOut](\oenodeOut{})(\POE@tempb)%
+ (\POE@tempb)(\POE@tempc)%
+ \else
+ \psbezier[style=FiberOut](\oenodeOut{})(\POE@tempb)%
+ (\POE@tempc)(\POE@tempd)%
+ \fi\fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\newOptexpFiberDipole{optfiber}{newOptComp={}}
+\newOptexpFiberDipole{optamp}{}
+\newOptexpFiberDipole{optmzm}{}
+\newOptexpFiberDipole{optfilter}{allowbeaminside=false}
+\newOptexpFiberDipole{polcontrol}{}
+\newOptexpFiberDipole{optisolator}{}
+\newOptexpFiberDipole{optfiberpolarizer}{}
+\newOptexpFiberDipole{optswitch}{}
+\newOptexpFiberDipole{fiberdelayline}{}
+\def\POE@drawcomponent{%
+ \@ifnextchar[%]
+ {\POE@drawcomponent@i}{\POE@drawcomponent@i[]}%
+}%
+\def\POE@drawcomponent@i[#1]#2#3{%
+ \def\@@comp{%
+ #3%
+ \ifx\POE@key@extnode\@empty\else
+ \ifPOE@backlayer
+ \pnode(! \POE@dict{
+ \POE@key@extnode@xref\space
+ \POE@key@extnode@yref\space
+ DefineExtNode}){\oenodeExt{}}%
+ \POE@Verb{%
+ tx@NodeDict begin /N@\oenodeExt{} load
+ \ifnum9<1\POE@key@compname
+ /N@ExtNode
+ \else
+ /N@\POE@key@compname ExtNode
+ \fi
+ ED end
+ }%
+ \fi
+ \fi
+ }%
+ \@ifundefined{#1@ref}{}{\@nameuse{#1@ref}}%
+ \ifPOE@endbox
+ \psset[optexp]{abspos={%
+ \POE@dict{%
+ /N@\POE@refnodeA\space @GetCenter \tx@UserCoor
+ /N@\POE@refnodeB\space @GetCenter \tx@UserCoor
+ @ABDist @@x0 @@x add add
+ }%
+ }}%
+ \else\ifPOE@startbox
+ \psset[optexp]{abspos={\POE@dict{ @@x0 neg @@x sub }}}%
+ \fi\fi
+ \POE@disablepos
+ \ncline[linestyle=none,fillstyle=none,npos=]%
+ {\POE@refnodeA}{\POE@refnodeB}%
+ \begingroup
+ \psset{style=OptComp}%
+ \ifPOE@component@optional
+ \psset{style=OptionalStyle}%
+ \fi
+ \ifx\POE@key@abspos\@empty
+ \ifx\POE@key@position\@empty
+ \ncput[nrot=:U,npos=]{\POE@putcomp{\@@comp}}%
+ \else
+ \ncput[nrot=:U,npos=\POE@key@position]{\POE@putcomp{\@@comp}}%
+ \fi
+ \else
+ \POE@nlput[nrot=:U](\POE@refnodeA)(\POE@refnodeB)%
+ {\POE@key@abspos}{\POE@putcomp{\@@comp}}%
+ \fi
+ \endgroup
+ \ifPOE@backlayer
+ \POE@transformnodes
+ \fi
+ \ifPOE@frontlayer
+ \POE@putlabel{#2}%
+ \fi
+ \ifPOE@debug@showoptdots
+ \ifPOE@frontlayer
+ \psdot[linecolor=red](\oenodeCenter{})
+ \psdot[linecolor=red, dotstyle=x, dotscale=1.5](\oenodeLabel{})
+ \psdot[linecolor=black](\oenodeRefA{})
+ \psdot[linecolor=black](\oenodeRefB{})
+ \psdot[linecolor=black, dotstyle=x,
+ dotscale=1.5](\oenodeTrefA{})
+ \psdot[linecolor=black, dotstyle=x,
+ dotscale=1.5](\oenodeTrefB{})
+ \fi
+ \fi
+ \ifPOE@debug@showifcnodes
+ \ifPOE@frontlayer
+ \POE@ifcnodes[style=IfcNodeStyle]
+ \fi
+ \fi
+\ignorespaces}%
+\let\POE@setref\POE@Verb
+\def\POE@transformnode#1#2{%
+ \pnode(!
+ \POE@dict{%
+ /N@\oenodeRotref{} @GetCenter 2 copy
+ /N@#1 @GetCenter
+ \POE@key@comp@Xshift\space\POE@key@comp@Yshift\space
+ \tx@ScreenCoor VecAdd 4 2 roll @ABVect
+ \POE@key@angle\space matrix rotate dtransform VecAdd
+ \tx@UserCoor
+ }){#2}%
+}%
+\def\POE@ifcnodes{\pst@object{POE@ifcnodes}}
+\def\POE@ifcnodes@i{%
+ \begin@SpecialObj%
+ \solid@star%
+ \addto@pscode{
+ \psk@dotsize
+ \@nameuse{psds@\psk@dotstyle}
+ \POE@dict{[ (\oenode{}{}) false GetInternalBeamNodes %]
+ counttomark 2 idiv { Dot } repeat
+ pop}
+ }%
+ \end@SpecialObj
+}%
+\def\POE@extnodes{\pst@object{POE@extnodes}}
+\def\POE@extnodes@i#1{%
+ \begin@SpecialObj
+ \let\POE@setref\addto@pscode
+ \addto@pscode{\pst@optexpdict InitOptexpComp }
+ \@ifundefined{#1@ref}{}{\@nameuse{#1@ref}}%
+ \solid@star%
+ \addto@pscode{
+ \psk@dotsize
+ \@nameuse{psds@\psk@dotstyle}
+ @@x 0 eq { [0] }{ [ @@x neg 0 @@x ] } ifelse
+ {
+ @@y 0 eq { [0] }{ [@@y neg 0 @@y ] } ifelse
+ {
+ exch dup 3 1 roll
+ @@x0 add exch @@y0 add \tx@ScreenCoor
+ /\oenode{}{} load begin CompMtrx end transform CM itransform
+ Dot
+ } forall
+ pop
+ } forall
+ end
+ }%
+ \end@SpecialObj
+}%
+\def\tripole@nodes{%
+ \newOptexpComp{{0 0} {1 0} @@x neg @@x refl {PlainIfc} 1}%
+ \pnode(! \POE@dict{@@y0 @@x0}){\oenodeCenter{}}
+\ignorespaces}%
+\def\dipole@nodes{%
+ \newOptexpComp{%
+ {@@x0 @@x sub 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ @@x 0 eq not {
+ {@@x0 @@x add 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ } if \POE@key@n }%
+ \pnode(! \POE@dict{@@x0 @@y0}){\oenodeCenter{}}
+\ignorespaces}%
+\def\fiberdipole@nodes{%
+ \newOptexpFiberComp{%
+ {@@x0 @@x sub 0}
+ @@x 0 eq not {
+ {@@x0 @@x add 0}
+ } if }%
+ \pnode(! \POE@dict{@@x0 @@y0}){\oenodeCenter{}}
+\ignorespaces}%
+\def\mirror@ref{%
+ \ifdim\POE@key@mirrorradius pt=0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@piezo
+ \POE@setref{/@@y0 \pst@number\psyunit def}%
+ \bgroup
+ \psset{style=PiezoMirror}
+ \POE@setref{%
+ \pst@number\psyunit @@y0 div
+ \POE@key@mirrorwidth\space 0.5 mul mul 2.5 div /@@y0 ED
+ }%
+ \egroup
+ \else
+ \POE@setref{/@@x \POE@key@mirrorwidth\space 0.5 mul def}%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@plain\else
+ \POE@setref{\POE@key@mirrordepth\space 0.5 mul dup /@@y0 ED /@@y ED}
+ \fi
+ \fi
+ \fi
+}%
+\def\mirror@nodes{%
+ \ifdim\POE@key@mirrorradius pt=0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \newOptexpCompAmb{%
+ {0 0} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {PlainIfc}
+ {0 \POE@key@mirrordepth} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \POE@key@mirrordepth\space -1e-5 lt {
+ 12 6 roll 2
+ } {
+ \POE@key@mirrordepth\space 1e-5 lt {
+ 6 {pop} repeat
+ } if
+ 1
+ } ifelse
+ \POE@key@n }%
+ \else
+ \newOptexpComp{%
+ {0 0} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {PlainIfc} 1 }%
+ \fi
+ \else
+ \newOptexpComp{%
+ {0 0} {0 \POE@key@mirrorradius\space neg}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {CurvedIfc} 1 }%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \PackageWarning{pst-optexp}{%
+ Mirrortype 'semitrans' does not support curved\MessageBreak
+ mirror, falling back to 'plain' type.}%
+ \fi
+ \fi
+}%
+\def\mirror@comp{%
+ \edef\@ht{%
+ \POE@key@mirrorwidth\space\pst@number\psyunit mul 0.5 mul %
+ }%
+ \edef\@dp{\POE@key@mirrordepth\space\pst@number\psxunit mul }%
+ \edef\@r{\POE@key@mirrorradius\space\pst@number\psxunit mul }%
+ \edef\@postcode{%
+ neg 5 -1 roll exch 5 2 roll 90 add exch 90 add exch ArcR %
+ }%
+ \edef\@extpostcode{%
+ neg \@dp add 5 -1 roll exch 5 2 roll 90 add exch 90 add %
+ }%
+ \ifdim\POE@key@mirrorradius pt<0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+ \bgroup
+ \psset{style=ExtendedMirror}
+ \begin@ClosedObj
+ \addto@pscode{%
+ \pst@optexpdict \@ht \@r rightCurvedIfc \@postcode
+ \@ht \@r rightCurvedIfc \@extpostcode arc
+ closepath end}%
+ \end@ClosedObj
+ \egroup
+ \fi
+ \bgroup
+ \psset{linewidth=\POE@key@mirrorlinewidth}
+ \begin@OpenObj
+ \addto@pscode{\POE@dict{ \@ht \@r rightCurvedIfc \@postcode }}%
+ \end@OpenObj
+ \egroup
+ \else\ifdim\POE@key@mirrorradius pt>0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+ \bgroup
+ \psset{style=ExtendedMirror}
+ \begin@ClosedObj
+ \addto@pscode{%
+ \pst@optexpdict \@ht \@r rightCurvedIfc \@postcode
+ \@ht \@r rightCurvedIfc \@extpostcode arcn
+ closepath end}%
+ \end@ClosedObj
+ \egroup
+ \fi
+ \bgroup
+ \psset{linewidth=\POE@key@mirrorlinewidth}
+ \begin@OpenObj
+ \addto@pscode{\POE@dict{ \@ht \@r rightCurvedIfc \@postcode }}%
+ \end@OpenObj
+ \egroup
+ \else
+ \edef\@ht{\POE@key@mirrorwidth\space 0.5 mul }%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@piezo
+ \psframe[style=PiezoMirror,
+ dimen=outer](! \@ht 4 div 0)%
+ (! \@ht -4 div \@ht 2.5 div)
+ \ifx\POE@key@extnode\@empty
+ \psbezier(! 0 \@ht 2.5 div)%
+ (! 0 \@ht 1.5 div)%
+ (! \@ht 2 div \@ht 2 div)%
+ (! \@ht 4 div \@ht)
+ \fi
+ \else\ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+ \psframe[style=ExtendedMirror]%
+ (! \@ht neg \POE@key@mirrordepth\space )%
+ (! \@ht 0)
+ \else\ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \psframe[style=SemitransMirror]%
+ (! \@ht neg \POE@key@mirrordepth\space )%
+ (! \@ht 0)
+ \fi\fi\fi
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \psline[linewidth=\POE@key@mirrorlinewidth]%
+ (! \@ht neg 0)(! \@ht 0)
+ \else
+ \psline[linewidth=\POE@key@mirrorlinewidth]%
+ (! \@ht neg \getCLWH)(! \@ht \getCLWH)
+ \fi
+ \fi\fi
+ \ifPOE@variable
+ \psarc[style=VariableStyle]%
+ (! \POE@key@mirrorwidth\space 0.5 mul 0.4 sub
+ \ifdim\POE@key@mirrorradius pt=0pt
+ 0
+ \else
+ \POE@key@mirrorradius\space dup \POE@dict{sign} neg exch
+ \POE@key@mirrorwidth\space 0.5 mul \POE@dict{capHeight} mul
+ \fi){0.6}{-20}{20}
+ \psarc[style=VariableStyle]%
+ (! 0.4 \POE@key@mirrorwidth\space 0.5 mul sub
+ \ifdim\POE@key@mirrorradius pt=0pt
+ 0
+ \else
+ \POE@key@mirrorradius\space dup \POE@dict{sign} neg exch
+ \POE@key@mirrorwidth\space 0.5 mul \POE@dict{capHeight} mul
+ \fi){0.6}{160}{200}
+ \fi
+}%
+\def\lens@ref{%
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ \edef\@th{0 }%
+ \else
+ \edef\@th{%
+ \ifPOE@thicklens
+ \POE@key@lenswidth\space 0.5 mul
+ \else
+ \ifdim\POE@key@lensradiusleft pt<0pt
+ \POE@key@lensheight\space 0.075 mul
+ \else
+ \POE@key@lensradiusleft
+ \POE@key@lensheight\space 0.5 mul capHeight
+ \fi
+ \fi
+ \space}%
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \edef\@th{%
+ \@th\space
+ \ifPOE@thicklens
+ \POE@key@lenswidth\space 0.5 mul
+ \else
+ \ifdim\POE@key@lensradiusright pt<0pt
+ \POE@key@lensheight\space 0.075 mul
+ \else
+ \POE@key@lensradiusright
+ \POE@key@lensheight\space 0.5 mul capHeight
+ \fi
+ \fi
+ \space add
+ \space}%
+ \fi
+ \POE@setref{%
+ /@@y \POE@key@lensheight\space 0.5 mul def
+ /@@x \@th 0.5 mul def
+ }%
+}%
+\def\lens@nodes{%
+ \newOptexpComp{%
+ {@@x neg 0}
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ {0 1}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \else
+ {\POE@key@lensradiusleft\space 0}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {CurvedIfc}
+ \fi
+ {@@x 0}
+ \ifdim\POE@key@lensradiusright pt=0pt
+ {0 1}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \else
+ {\POE@key@lensradiusright\space neg 0}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {CurvedIfc}
+ \fi
+ \POE@key@n
+ }%
+}%
+\def\lens@comp{%
+ \addbefore@par{linejoin=1}%
+ \begin@ClosedObj
+ \addto@pscode{\pst@optexpdict }%
+ \def\@th{0}%
+ \def\@wd{\POE@key@lenswidth\space\pst@number\psxunit mul 2 div }%
+ \def\@ht{\POE@key@lensheight\space\pst@number\psyunit mul 2 div }%
+ \def\@rL{\POE@key@lensradiusleft\space\pst@number\psrunit mul }%
+ \def\@rR{\POE@key@lensradiusright\space\pst@number\psrunit mul }%
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{ \@ht \@rL leftCurvedIfc }%
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \addto@pscode{ \@ht \@rR rightCurvedIfc }%
+ \fi
+ \def\@@x{@@x \pst@number\psxunit mul }%
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \addto@pscode{%
+ \@@x sub neg 5 1 roll
+ \@@x neg \@ht neg moveto ArcR
+ \@@x neg \@ht lineto
+ }%
+ \fi
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{%
+ \@@x sub 5 1 roll
+ \@@x \@ht moveto ArcL
+ \@@x \@ht neg lineto
+ }%
+ \fi
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{%
+ \@@x dup
+ 7 1 roll sub neg 5 1 roll
+ ArcR sub 5 1 roll ArcL
+ }%
+ \fi
+ \fi
+ \addto@pscode{closepath 1 setlinejoin end }%
+ \end@ClosedObj
+\ignorespaces}%
+\def\pinhole@ref{%
+ \POE@setref{/@@y \POE@key@outerheight\space 0.5 mul def}%
+\ignorespaces}%
+\def\pinhole@nodes{%
+ \newOptexpComp{%
+ {-1e-4 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ {0 0} {0 1} \POE@key@innerheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ {1e-4 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ \POE@key@n }%
+\ignorespaces}%
+\def\pinhole@comp{%
+ \ifdim\POE@key@phwidth pt=0pt
+ \psline[linewidth=\POE@key@phlinewidth]%
+ (! 0 \POE@key@outerheight\space 2 div)%
+ (! 0 \POE@key@innerheight\space 2 div)%
+ \psline[linewidth=\POE@key@phlinewidth]%
+ (! 0 \POE@key@outerheight\space -2 div)%
+ (! 0 \POE@key@innerheight\space -2 div)%
+ \else
+ \pspolygon*[linestyle=none]%
+ (! 0 \POE@key@innerheight\space 2 div)%
+ (! 0 \POE@key@outerheight\space 2 div)%
+ (! \POE@key@phwidth\space\POE@key@outerheight\space 2 div)%
+ (! \POE@key@phwidth\space\POE@key@innerheight\space dup neg
+ \POE@key@outerheight\space add 2 div add 2 div)%
+ \pspolygon*[linestyle=none]%
+ (! 0 \POE@key@innerheight\space -2 div)%
+ (! 0 \POE@key@outerheight\space -2 div)%
+ (! \POE@key@phwidth\space\POE@key@outerheight\space -2 div)%
+ (! \POE@key@phwidth\space\POE@key@innerheight\space dup neg
+ \POE@key@outerheight\space add 2 div add -2 div)%
+ \fi
+\ignorespaces}%
+\def\beamsplitter@ref{%
+ \POE@setref{/@@x \POE@key@bssize\space 0.5 sqrt mul def }%
+}%
+\def\beamsplitter@nodes{%
+ \edef\@bs@wd{\POE@key@bssize\space 0.5 mul }%
+ \ifx\POE@key@bsstyle\POE@str@bsstyle@cube
+ \newOptexpCompAmb{%
+ {\@bs@wd 2 sqrt div neg dup} {-1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div dup neg} {1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {0 0} {1 0} \@bs@wd 2 sqrt mul dup neg exch
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div dup} {-1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div neg dup neg} {1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ 3 \POE@key@n
+ }%
+ \else\ifx\POE@key@bsstyle\POE@str@bsstyle@plate
+ \newOptexpCompAmb{%
+ {0 0} {1 0} \@bs@wd neg \@bs@wd trans {PlainIfc} 1 1 }%
+ \fi\fi
+\ignorespaces}%
+\def\beamsplitter@comp{%
+ \edef\@bs@wd{\POE@key@bssize\space 2.0 div }%
+ \ifx\POE@key@bsstyle\POE@str@bsstyle@cube
+ \psline[arrows=cc-cc](! \@bs@wd neg 2 sqrt mul 0)
+ (! \@bs@wd 2 sqrt mul 0)
+ \rput[c]{45}(0,0){%
+ \psframe(! \@bs@wd neg \@bs@wd neg)(! \@bs@wd \@bs@wd)
+ }
+ \else\ifx\POE@key@bsstyle\POE@str@bsstyle@plate
+ \psline(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
+ \fi\fi
+\ignorespaces}%
+\def\crystal@ref{%
+ \let\POE@key@optboxwidth\POE@key@crystalwidth
+ \let\POE@key@optboxheight\POE@key@crystalheight
+ \optbox@ref
+}%
+\def\crystal@comp{%
+ \edef\@wd{\POE@key@crystalwidth\space 0.5 mul }
+ \edef\@ht{\POE@key@crystalheight\space 0.5 mul }
+ \psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
+ \ifPOE@voltage%
+ \psline(!\@wd 4 div 3 mul neg \@ht)%
+ (! \@wd 4 div 3 mul neg \@ht 0.2 add)
+ \pscircle[fillstyle=solid, fillcolor=white]%
+ (! \@wd 4 div 3 mul neg \@ht 0.2 add){0.04}
+ \psline(! \@wd 4 div 3 mul neg \@ht neg)%
+ (! \@wd 4 div 3 mul neg \@ht neg 0.2 sub)%
+ \psline(! \@wd 4 div 3 mul neg 0.15 sub \@ht neg 0.2 sub)%
+ (! \@wd 4 div 3 mul neg 0.15 add \@ht neg 0.2 sub)%
+ \fi
+ \ifPOE@lamp
+ \rput(! \@wd \@ht){%
+ \psset{style=CrystalLamp}%
+ \rput(0, 0.4){\crystal@lamp}%
+ }%
+ \fi
+ \ifdim\POE@key@caxislength pt=0pt\else
+ \def\@cl{%
+ \POE@key@caxislength\space
+ \ifPOE@caxisinv -1 mul\space\fi
+ }%
+ \psline[style=CrystalCaxis](! 0 \@cl \POE@dict{sign} \@ht mul)%
+ (! 0 \@cl \POE@dict{sign} neg \@ht mul \@cl sub)%
+ \fi
+\ignorespaces}%
+\def\crystal@lamp{%
+ \pscurve[fillstyle=none](-0.015, 0)(-0.03, -0.045)(-0.06, -0.075)%
+ (-0.075, -0.15)(0, -0.21)(0.075, -0.15)(0.06, -0.075)%
+ (0.03, -0.045)(0.015, 0)
+ \multido{\i=-30+40}{7}{%
+ \rput{\i}(0, -0.135){%
+ \psline(-0.105, 0)(-0.18, 0)
+ }%
+ }%
+\ignorespaces}%
+\def\polarization@comp{%
+ \edef\@sz{\POE@key@polsize\space 0.5 mul }%
+ \psset{style=Polarization}%
+ \ifx\POE@key@poltype\POE@str@pol@polparallel
+ \psline[arrows=<->](! 0 \@sz neg)(! 0 \@sz)
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polperp
+ \psdot(0,0)
+ \pscircle[fillstyle=none](0,0){0.12}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polmisc
+ \psline[arrows=<->](! 0 \@sz neg)(! 0 \@sz)
+ \psdot(0,0)
+ \pscircle[fillstyle=none](0,0){0.12}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polrcirc
+ \psellipticarc[arrows=->]%
+ (0,0)(! \@sz 2 div \@sz){20}{-20}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@pollcirc
+ \psellipticarc[arrows=<-]%
+ (0,0)(! \@sz 2 div \@sz){20}{-20}
+ \fi
+\ignorespaces}%
+\def\optgrating@ref{%
+ \POE@setref{/@@x \POE@key@gratingwidth\space 0.5 mul def}%
+}%
+\def\optgrating@comp{%
+ \edef\@cnt{\POE@key@gratingcount\space}%
+ \edef\@wd{\POE@key@gratingwidth\space 0.5 mul }%
+ \ifdim\POE@key@gratingheight pt<\POE@key@gratingdepth pt
+ \edef\@ht{\POE@key@gratingdepth\space}%
+ \else
+ \edef\@ht{\POE@key@gratingheight\space}%
+ \fi
+ \edef\@dp{\POE@key@gratingdepth\space}%
+ \edef\@step{\POE@key@gratingwidth\space\@cnt div }%
+ \ifx\POE@key@gratingtype\POE@str@gratingtype@blazed
+ \pscustom[linewidth=\POE@key@gratinglinewidth, linejoin=1]{%
+ \psline[liftpen=1](! \@wd \@dp)(! \@wd \@ht)%
+ (! \@wd neg \@ht)(! \@wd neg \@dp)%
+ \multido{\i=0+1}{\POE@key@gratingcount}{%
+ \psline[liftpen=1]%
+ (! \@wd neg \i\space \@step mul add \@dp)%
+ (! \@wd neg \i\space
+ \ifPOE@reverse\else 1 add \fi \@step mul add 0)%
+ (! \@wd neg \i\space 1 add \@step mul add \@dp)%
+ }%
+ \closepath
+ }%
+ \else\ifx\POE@key@gratingtype\POE@str@gratingtype@binary
+ \pscustom[linewidth=\POE@key@gratinglinewidth]{%
+ \psline[liftpen=1](! \@wd \@dp)(! \@wd \@ht)%
+ (! \@wd neg \@ht)(! \@wd neg \@dp)%
+ \multido{\i=0+1}{\POE@key@gratingcount}{%
+ \psline[liftpen=1]%
+ (! \@wd neg \i\space \@step mul add \@dp)%
+ (! \@wd neg \i\space \@step mul add 0)%
+ (! \@wd neg \i\space 0.5 add \@step mul add 0)%
+ (! \@wd neg \i\space 0.5 add \@step mul add \@dp)%
+ (! \@wd neg \i\space 1 add \@step mul add \@dp)%
+ }%
+ }%
+ \fi\fi
+ \ifPOE@variable
+ \psarc[style=VariableStyle]%
+ (! \POE@key@gratingwidth\space 0.5 mul 0.4 sub
+ \POE@key@gratingheight\space 0.5 mul){0.6}{-20}{20}
+ \psarc[style=VariableStyle]%
+ (! 0.4 \POE@key@gratingwidth\space 0.5 mul sub
+ \POE@key@gratingheight\space 0.5 mul){0.6}{160}{200}
+ \fi
+\ignorespaces}%
+\def\optbox@ref{%
+ \POE@setref{%
+ /@@x \POE@key@optboxwidth\space 0.5 mul def
+ /@@y \POE@key@optboxheight\space 0.5 mul def
+ }%
+}%
+\def\optbox@comp{%
+ \edef\@wd{\POE@key@optboxwidth\space 0.5 mul }
+ \edef\@ht{\POE@key@optboxheight\space 0.5 mul }
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+\ignorespaces}%
+\def\optplate@ref{%
+ \POE@setref{/@@y \POE@key@plateheight\space 0.5 mul def }%
+}%
+\def\optplate@comp{%
+ \psline[linewidth=\POE@key@platelinewidth]%
+ (! \POE@dict{0 @@y neg})(! \POE@dict{0 @@y})
+\ignorespaces}%
+\def\optdetector@ref{%
+ \ifx\POE@key@detsize\@empty
+ \POE@setref{%
+ /@@y \POE@key@detheight\space 0.5 mul def
+ /@@x \POE@key@detwidth\space 0.5 mul def
+ }%
+ \else
+ \POE@setref{%
+ /@@y \POE@key@detsize\space 0.5 mul def
+ /@@x \POE@key@detsize\space 0.5 mul
+ \ifx\POE@key@dettype\POE@str@dettype@round 0.5 mul\fi
+ \space def
+ }%
+ \fi
+}%
+\def\optdetector@nodes{%
+ \dipole@nodes
+ \ifx\POE@key@dettype\POE@str@dettype@round
+ \pnode(! \POE@dict{@@x0 @@x -0.2 mul add} 0){\oenodeCenter{}}%
+ \fi
+}%
+\def\optdetector@comp{%
+ \ifx\POE@key@dettype\POE@str@dettype@round
+ \psellipticwedge(!\POE@dict{@@x0 @@x sub @@y0})%
+ (!\POE@dict{@@x 2 mul @@y}){-90}{90}%
+ \else\ifx\POE@key@dettype\POE@str@dettype@diode
+ \ifx\POE@key@detsize\@empty
+ \ifdim\POE@key@detwidth pt<\POE@key@detheight pt
+ \def\@sz{\POE@key@detwidth\space 0.5 mul }%
+ \else
+ \def\@sz{\POE@key@detheight\space 0.5 mul }%
+ \fi
+ \else
+ \def\@sz{\POE@key@detsize\space 0.5 mul }%
+ \fi
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})%
+ \bgroup
+ \psset{style=DetectorStyle}
+ \pspolygon(! \@sz -0.2 mul \@sz -0.4 mul)%
+ (! \@sz 0.6 mul \@sz -0.4 mul)%
+ (! \@sz 0.2 mul \@sz 0.4 mul)%
+ \psline(! \@sz -0.2 mul \@sz 0.4 mul \getCLWH add)%
+ (! \@sz 0.6 mul \@sz 0.4 mul \getCLWH add)
+ \psset{arrows=->, arrowinset=0, arrowscale=0.8}%
+ \psline(! \@sz -0.8 mul \@sz 0.3 mul)%
+ (! \@sz -0.3 mul \@sz 0.15 mul)%
+ \psline(! \@sz -0.8 mul 0)(! \@sz -0.3 mul \@sz -0.15 mul)%
+ \egroup
+ \fi\fi
+\ignorespaces}%
+\def\optretplate@ref{%
+ \POE@setref{%
+ /@@y \POE@key@plateheight\space 0.5 mul def
+ /@@x \POE@key@platewidth\space 0.5 mul def
+ }%
+}%
+\def\optretplate@comp{%
+ \edef\@ht{\POE@key@plateheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@platewidth\space 0.5 mul }%
+ \psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline{cc-cc}(! \@wd neg \@ht)(! \@wd \@ht neg)
+\ignorespaces}%
+\def\optdiode@ref{%
+ \POE@setref{%
+ \POE@key@optdiodesize\space 0.5 mul dup /@@y ED /@@x ED
+ }%
+}%
+\def\optdiode@comp{%
+ \edef\@sz{\POE@key@optdiodesize\space}%
+ \psframe[dimen=outer](! \@sz -0.5 mul dup)(!\@sz 0.5 mul dup)
+ \pspolygon(! \@sz -0.2 mul \@sz -0.2 mul)
+ (! \@sz -0.2 mul \@sz 0.2 mul)
+ (! \@sz 0.2 mul 0)
+ \psline(! \@sz 0.2 mul \getCLWH add \@sz 0.2 mul)%
+ (! \@sz 0.2 mul \getCLWH add \@sz -0.2 mul)
+\ignorespaces}%
+\def\doveprism@ref{%
+ \POE@setref{/@@x \POE@key@doveprismwidth\space 0.5 mul def
+ /@@y \POE@key@doveprismheight\space 0.5 mul def}%
+}%
+\def\doveprism@nodes{%
+ \newOptexpComp{%
+ /@htsq @@y 2 sqrt mul def
+ {@@x neg @@y add 0} {1 1}
+ @htsq neg @htsq trans {PlainIfc}
+ {0 @@y neg} {1 0}
+ @@x neg dup neg
+ refl {PlainIfc}
+ {@@x @@y sub 0} {-1 1}
+ @htsq neg @htsq trans {PlainIfc}
+ \POE@key@n true
+ }%
+\ignorespaces}%
+\def\doveprism@comp{%
+ \edef\@ht{\POE@key@doveprismheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@doveprismwidth\space 0.5 mul }%
+ \pspolygon(! \@wd neg \@ht neg)%
+ (! \@wd \@ht neg)%
+ (! \@wd \@ht 2 mul sub \@ht)%
+ (! \@ht 2 mul \@wd sub \@ht)%
+\ignorespaces}%
+\def\pentaprism@nodes{%
+ \edef\@sz{\POE@key@pentaprismsize\space}%
+ \newOptexpComp{%
+ {\@sz 2 sqrt -2 mul div dup } {-1 1}
+ \@sz -0.5 mul dup neg trans {PlainIfc}
+ {\@sz 2 sqrt div 67.5 cos \@sz mul
+ 67.5 sin 2 mul div sub \@sz 2 div}
+ {67.5 cos \@sz mul 67.5 sin div neg \@sz}
+ \@sz 22.5 cos div -0.5 mul dup neg refl {PlainIfc}
+ {\@sz 2 sqrt div neg 67.5 cos \@sz mul
+ 67.5 sin 2 mul div add \@sz 2 div}
+ {67.5 cos \@sz mul 67.5 sin div \@sz}
+ \@sz 22.5 cos div -0.5 mul dup neg refl {PlainIfc}
+ {\@sz 2 sqrt 2 mul div dup neg} {1 1}
+ \@sz -0.5 mul dup neg trans {PlainIfc}
+ \POE@key@n
+ }%
+}%
+\def\pentaprism@comp{%
+ \edef\@sz{\POE@key@pentaprismsize\space}%
+ \pscustom{%
+ \psline(! \@sz 2 sqrt div 0)%
+ (! \@sz 2 sqrt div 67.5 cos \@sz mul
+ 67.5 sin div sub \@sz)%
+ (! 67.5 cos \@sz mul 67.5 sin div \@sz
+ 2 sqrt div sub \@sz)%
+ (! \@sz 2 sqrt div neg 0)%
+ (! 0 \@sz 2 sqrt div neg)%
+ \closepath
+ }%
+}%
+\def\optprism@nodes{%
+ \edef\@sz{\POE@key@prismsize\space}%
+ \edef\@ang{\POE@key@prismangle\space 0.5 mul\space}%
+ \edef\@hshift{%
+ \ifx\POE@key@prismalign\POE@str@auto
+ \@sz 0.6 mul \@ang tan mul \POE@dict{OEangle} 0.5 mul tan div
+ \else
+ 0
+ \fi
+ }%
+ \newOptexpComp{%
+ {\@sz -0.6 mul \@ang tan mul \@hshift neg}
+ {90 \@ang sub dup cos exch sin}
+ \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
+ {\@sz 0.6 mul \@ang tan mul \@hshift neg}
+ {90 \@ang add dup cos exch sin}
+ \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
+ \POE@key@n true }%
+ \pnode(! 0 \@hshift neg){\oenodeCenter{}}
+}%
+\def\optprism@comp{%
+ \edef\@sz{\POE@key@prismsize\space}%
+ \edef\@altan{\POE@key@prismangle\space 0.5 mul tan }%
+ \edef\@hshift{%
+ \ifx\POE@key@prismalign\POE@str@auto
+ \@sz 0.6 mul \@altan mul \POE@dict{OEangle} 0.5 mul tan div
+ \else
+ 0
+ \fi
+ }%
+ \pspolygon(! \@sz neg \@altan mul \@sz -0.4 mul \@hshift sub)
+ (! \@sz \@altan mul \@sz -0.4 mul \@hshift sub)
+ (! 0 \@sz 0.6 mul \@hshift sub)
+}%
+\def\rightangleprism@ref{%
+ \POE@setref{%
+ tx@EcldDict begin
+ OEangle 0.5 mul
+ { x sin modA mul }
+ { OEangle x sub sin modB mul }
+ NewtonSolving pop
+ end
+ /@htA exch def
+ OEangle 0.5 mul exch sub /dOEangle exch def
+ /@OEtrafo {dOEangle matrix rotate dtransform } bind def
+ }%
+}%
+\def\rightangleprism@nodes{%
+ \edef\@sz{\POE@key@raprismsize\space}%
+ \edef\@ht{\POE@dict{OEangle 0.5 mul sin modA mul} }%
+ \newOptexpComp{%
+ {@htA neg @htA \@sz 0.5 mul sub @OEtrafo} {1 0 @OEtrafo}
+ @htA \@sz 0.5 mul sub @htA trans {PlainIfc}
+ {@htA neg 0 @OEtrafo} {1 1 @OEtrafo}
+ @htA 2 sqrt mul dup \@sz 2 sqrt div sub exch refl {PlainIfc}
+ {@htA 0 @OEtrafo} {-1 1 @OEtrafo}
+ @htA 2 sqrt mul dup \@sz 2 sqrt div sub exch refl {PlainIfc}
+ {@htA dup \@sz 0.5 mul sub @OEtrafo} {1 0 @OEtrafo}
+ @htA neg \@sz 0.5 mul @htA sub trans {PlainIfc}
+ \POE@key@n
+ }%
+\ignorespaces}%
+\def\rightangleprism@comp{%
+ \edef\@sz{\POE@key@raprismsize\space 0.5 mul }%
+ \pspolygon(!\POE@dict{\@sz neg @htA \@sz sub @OEtrafo})
+ (!\POE@dict{\@sz @htA \@sz sub @OEtrafo})
+ (! 0 \POE@dict{@htA @OEtrafo})%
+\ignorespaces}%
+\def\optfiber@ref{%
+ \POE@setref{/@@x \POE@key@fiberloopsep\space\POE@key@fiberloops\space
+ 1 sub mul 0.5 mul def }%
+}%
+\def\optfiber@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+\ignorespaces}%
+\def\optfiber@comp{%
+ \edef\@f@cnt{\POE@key@fiberloops\space}%
+ \edef\@f@r{\POE@key@fiberloopradius\space}%
+ \edef\@f@sep{\POE@key@fiberloopsep\space}%
+ \parametricplot[plotpoints=200, style=Fiber]{0}{1}{%
+ t 360 mul \@f@cnt mul sin \@f@r mul \@f@sep
+ \@f@cnt 1 sub mul t 0.5 sub mul add
+ 1 t 360 mul \@f@cnt mul cos sub \@f@r mul
+ }%
+\ignorespaces}%
+\def\optmzm@ref{%
+ \POE@setref{%
+ /@@x \POE@key@optmzmwidth\space 0.5 mul def
+ /@@y \POE@key@optmzmheight\space 0.5 mul def
+ }%
+}%
+\def\optmzm@comp{%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}
+ \fi
+ \psline(! \POE@dict{@@x} neg 0)(! \POE@dict{@@x} -0.7 mul 0)%
+ (! \POE@dict{@@x} -0.4 mul \POE@dict{@@y} 0.6 mul)%
+ (! \POE@dict{@@x 0.4 mul @@y 0.6 mul})%
+ (! \POE@dict{@@x} 0.7 mul 0)(! \POE@dict{@@x} 0)%
+ (! \POE@dict{@@x} 0.7 mul 0)%
+ (! \POE@dict{@@x 0.4 mul @@y -0.6 mul})%
+ (! \POE@dict{@@x -0.4 mul @@y -0.6 mul})%
+ (! \POE@dict{@@x} -0.7 mul 0)%
+ \egroup
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (!\POE@dict{@@x @@y})
+\ignorespaces}%
+\def\optfilter@ref{%
+ \POE@setref{\POE@key@filtersize\space 0.5 mul dup /@@y ED /@@x ED }%
+}%
+\let\optfilter@nodes\dipole@nodes
+\def\optfilter@comp{%
+ \edef\@sz{\POE@key@filtersize\space 0.5 mul }%
+ \def\filter@curve{%
+ \parametricplot[plotstyle=curve,arrows=-]{-1}{1}{%
+ t \@sz mul 0.7 mul t Pi mul RadtoDeg
+ 90 add cos 0.2 \@sz mul mul}%
+ }%
+ \psframe[dimen=outer](! \@sz neg dup)(! \@sz dup)
+ \bgroup
+ \psset{style=FilterStyle}%
+ \ifx\POE@key@filtertype\POE@str@filtertype@bandpass
+ \psline(! -0.3 \@sz mul -0.65 \@sz mul)%
+ (! 0.3 \@sz mul -0.35 \@sz mul)%
+ \psline(! -0.3 \@sz mul 0.35 \@sz mul)%
+ (! 0.3 \@sz mul 0.65 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){\filter@curve}
+ \rput(0, 0){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(! 0 0.5 \@sz mul){\filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@bandstop
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@lowpass
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \psline(! -0.3 \@sz mul 0.35 \@sz mul)%
+ (! 0.3 \@sz mul 0.65 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 0.5 \@sz mul){\filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@highpass
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \psline(! -0.3 \@sz mul -0.65 \@sz mul)%
+ (! 0.3 \@sz mul -0.35 \@sz mul)%
+ \rput(! 0 0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 -0.5 \@sz mul){\filter@curve}
+ \fi\fi\fi\fi
+ \egroup
+\ignorespaces}%
+\def\optamp@ref{%
+ \POE@setref{/@@x \POE@key@optampwidth\space 0.5 mul def
+ /@@y \POE@key@optampheight\space 0.5 mul def
+ }%
+}%
+\def\optamp@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+}%
+\def\optamp@comp{%
+ \def\@wd{\POE@key@optampwidth\space 0.5 mul }%
+ \def\@ht{\POE@key@optampheight\space 0.5 mul }%
+ \pspolygon(! \@wd 0)(! \@wd neg \@ht)(! \@wd neg \@ht neg)
+\ignorespaces}%
+\def\polcontrol@ref{%
+ \ifx\POE@key@polcontroltype\POE@str@polcontroltype@linear
+ \POE@setref{/@@x \POE@key@polcontrolsize\space 2 mul def}%
+ \else
+ \POE@setref{/@@x \POE@key@polcontrolsize\space 1.5 mul def}%
+ \fi
+}%
+\def\polcontrol@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+}%
+\def\polcontrol@comp{%
+ \edef\@sz{\POE@key@polcontrolsize\space}%
+ \ifPOE@optexpenv
+ \psline[style=Fiber, arrows=-, ArrowInside=-](\oenodeIn{})(\oenodeOut{})
+ \fi
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}%
+ \fi
+ \ifx\POE@key@polcontroltype\POE@str@polcontroltype@linear
+ \multips(! -2 \@sz mul \@sz)(! 2 \@sz mul 0){3}{%
+ \pscircle(0,0){\POE@key@polcontrolsize}%
+ }%
+ \else
+ \pscircle(! -1.5 \@sz mul \@sz neg){\POE@key@polcontrolsize}
+ \pscircle(! 0 \@sz){\POE@key@polcontrolsize}%
+ \pscircle(! 1.5 \@sz mul \@sz neg){\POE@key@polcontrolsize}
+ \fi
+ \egroup
+ \ifPOE@optexpenv\else
+ \psline[style=Fiber, arrows=-, ArrowInside=-](\oenodeIn{})(\oenodeOut{})
+ \fi
+\ignorespaces}%
+\def\optisolator@ref{%
+ \POE@setref{%
+ /@@x \POE@key@isolatorwidth\space 0.5 mul def
+ /@@y \POE@key@isolatorheight\space 0.5 mul def
+ }%
+}%
+\def\optisolator@comp{%
+ \edef\@ht{\POE@key@isolatorheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@isolatorwidth\space 0.5 mul }%
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline[style=IsolatorArrow,
+ arrows=->](! \@wd neg 0.6 mul 0)(!\@wd 0.6 mul 0)
+\ignorespaces}%
+\def\optfiberpolarizer@ref{%
+ \POE@setref{%
+ /@@x \POE@key@fiberpolwidth\space 0.5 mul def
+ /@@y \POE@key@fiberpolheight\space 0.5 mul def
+ }%
+}%
+\def\optfiberpolarizer@comp{%
+ \edef\@ht{\POE@key@fiberpolheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@fiberpolwidth\space 0.5 mul }%
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline(! \@wd neg 0.2 mul \@ht neg)(!\@wd 0.2 mul \@ht)
+\ignorespaces}%
+\def\optswitch@ref{%
+ \POE@setref{\POE@key@switchsize\space 0.5 mul dup /@@y ED /@@x ED }%
+}%
+\def\optswitch@comp{%
+ \pstVerb{tx@Dict begin /@lw \getCLW def end}%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}
+ \fi
+ \psline[arrows=-](! \POE@dict{@@x} neg 0)%
+ (! \POE@dict{@@x} -0.6 mul @lw sub 0)%
+ \psline[arrows=-](! \POE@dict{@@x} 0.6 mul 0)(! \POE@dict{@@x} 0)%
+ \egroup
+ \ifx\POE@key@switchstyle\POE@str@closed%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} 0.6 mul 0)%
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} -0.6 mul 0)%
+ \psline[arrows=-, linewidth=1.5\pslinewidth]%
+ (! \POE@dict{@@x} -0.6 mul @lw)(! \POE@dict{@@x} 0.6 mul @lw)%
+ \egroup
+ \else
+ \psline[arrows=-, linewidth=1.5\pslinewidth]%
+ (! \POE@dict{@@x} -0.6 mul @lw add @lw)%
+ (! \POE@dict{@@x 0.6 mul @@y 0.6 mul})%
+ \pscircle(! \POE@dict{@@x} -0.6 mul 0){\pslinewidth}%
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} 0.6 mul 0)%
+ \fi
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})%
+\ignorespaces}%
+\def\fiberdelayline@ref{%
+ \POE@setref{%
+ /@@y \POE@key@fdlheight\space 0.5 mul def
+ /@@x \POE@key@fdlwidth\space 0.5 mul def
+ }%
+}%
+\def\POE@get@yarrowscale#1 #2 #3 #4\@nil{%
+ \def\POE@tempA{#3\space}%
+}%
+\def\fiberdelayline@comp{%
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})
+ \begingroup
+ \psset{style=FdlArrow}
+ \use@par
+ \pst@expandafter\POE@get@yarrowscale{\psk@arrowscale}\@nil
+ \def\@arrowshift{%
+ \psk@arrowlength\space \psk@arrowsize\space
+ \pst@number\pslinewidth\space mul add mul
+ \POE@tempA mul
+ @@y 2.9 mul @@x 0.6 mul atan 2 copy cos mul 3 1 roll sin mul
+ \tx@UserCoor abs exch abs exch\space
+ }%
+ \psline(! \POE@dict{@@x -0.4 mul @@y -1.6 mul})%
+ (! \POE@dict{@@x 0.2 mul @@y 1.3 mul \@arrowshift VecAdd})
+ \endgroup
+\ignorespaces}%
+\def\optcoupler@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \newOptexpFiberComp{%
+ {@@x neg @@y0 \@sep add}
+ {@@x neg @@y0 \@sep sub}
+ {@@x @@y0 \@sep add}
+ {@@x @@y0 \@sep sub} }%
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+\def\POE@coupler@ref{%
+ \POE@setref{%
+ /@@y0
+ \ifx\POE@key@coupleralign\POE@str@top
+ \POE@key@couplersep\space -0.5 mul
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \POE@key@couplersep\space 0.5 mul
+ \else
+ 0
+ \fi\fi
+ def
+ /@@x \POE@key@couplerwidth\space 0.5 mul def
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \POE@key@couplersep
+ \else
+ \POE@key@couplerheight\space 0.5 mul
+ \fi
+ \space /@@y ED
+ }%
+}%
+\let\optcoupler@ref\POE@coupler@ref
+\def\wdmcoupler@ref{%
+ \POE@coupler@ref
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \POE@setref{/@@y 0 def }%
+ \fi
+ \fi
+}%
+\let\wdmsplitter@ref\wdmcoupler@ref
+\def\optcoupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \psline[style=Fiber](\oenode{1}{})(\oenode{3}{})
+ \psline[style=Fiber](\oenode{2}{})(\oenode{N}{})
+ \fi
+ \POE@coupler@comp
+}%
+\def\POE@coupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \else\ifx\POE@key@couplertype\POE@str@couplertype@ellipse
+ \psellipse(! 0 \POE@dict{@@y0})(! \POE@dict{@@x @@y})
+ \else
+ \psframe[dimen=outer](!\POE@dict{@@x neg @@y0 @@y sub})%
+ (!\POE@dict{@@x @@y0 @@y add})%
+ \ifx\POE@key@couplertype\POE@str@couplertype@cross
+ \psline(! \POE@dict{@@x -0.5 mul @@y0 @@y 0.5 mul sub})%
+ (! \POE@dict{@@x 0.5 mul @@y0 @@y 0.5 mul add})%
+ \psline(! \POE@dict{@@x -0.5 mul @@y0 @@y 0.5 mul add})%
+ (! \POE@dict{@@x 0.5 mul @@y0 @@y 0.5 mul sub})%
+ \fi
+ \fi\fi
+ \ifx\POE@key@couplertype\POE@str@couplertype@cross\else
+ \ifPOE@variable
+ \begingroup
+ \psset{style=VariableCoupler}
+ \use@par
+ \pst@expandafter\POE@get@yarrowscale{\psk@arrowscale}\@nil
+ \def\@arrowshift{%
+ \psk@arrowlength\space\psk@arrowsize\space
+ \pst@number\pslinewidth\space mul add mul
+ \POE@tempA mul
+ 1.6 0.8 atan 2 copy cos mul 3 1 roll sin mul
+ \tx@UserCoor abs exch abs exch\space
+ }%
+ \psline(!\POE@dict{@@x -0.4 mul @@y0 @@x sub})%
+ (!\POE@dict{@@x 0.4 mul @@x 0.7 mul @@y0 add
+ \@arrowshift VecAdd})
+ \endgroup
+ \fi
+ \fi
+}%
+\def\wdmcoupler@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \edef\@sep{0 }%
+ \fi
+ \fi
+ \newOptexpFiberComp{%
+ {@@x neg @@y0 \@sep add}
+ {@@x neg @@y0 \@sep sub}
+ {@@x 0}}%
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+\def\wdmcoupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@top
+ \psline[style=Fiber](\oenode{1}{})(\oenodeOut{})
+ \psline[style=Fiber]%
+ (!/N@\oenodeOut{} \POE@dict{@GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{2}{})
+ \else
+ \psline[style=Fiber](\oenode{2}{})(\oenodeOut{})
+ \ifx\POE@key@coupleralign\POE@str@bottom
+ \psline[style=Fiber]%
+ (!/N@\oenodeOut{} \POE@dict{@GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space add)(\oenode{1}{})
+ \fi
+ \fi
+ \fi
+ \POE@coupler@comp
+}%
+\def\wdmsplitter@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \edef\@sep{0 }%
+ \fi
+ \fi
+ \newOptexpFiberComp{%
+ {@@x neg 0}
+ {@@x @@y0 \@sep add}
+ {@@x @@y0 \@sep sub}}
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+\def\wdmsplitter@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@top
+ \psline[style=Fiber](\oenodeIn{})(\oenode{2}{})
+ \psline[style=Fiber](! \POE@dict{/N@\oenodeIn{} @GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{N}{})
+ \else
+ \psline[style=Fiber](\oenodeIn{})(\oenode{N}{})
+ \ifx\POE@key@coupleralign\POE@str@bottom
+ \psline[style=Fiber](! \POE@dict{/N@\oenodeIn{} @GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{2}{})
+ \fi
+ \fi
+ \fi
+ \POE@coupler@comp
+}%
+\def\optcirculator@ref{%
+ \POE@setref{\POE@key@optcircsize\space 0.5 mul dup /@@x ED /@@y ED }%
+}%
+\def\optcirculator@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {0 @@y neg} {@@x 0}}%
+}%
+\def\optcirculator@comp{%
+ \edef\@sz{\POE@key@optcircsize\space 0.5 mul }%
+ \pscircle(0,0){! \@sz}
+ \psarc[style=OptCircArrow](0,0)%
+ {! \POE@key@optcircsize\space 0.5 mul}%
+ {\POE@key@optcircangleA}%
+ {\POE@key@optcircangleB}
+}%
+\def\fibercollimator@ref{%
+ \POE@setref{%
+ /@@x \POE@key@fibercolwidth\space 0.5 mul def
+ /@@y \POE@key@fibercolheight\space 0.5 mul def}%
+}%
+\def\fibercollimator@nodes{%
+ \pnode(!\POE@dict{@@x neg} 0){\oenodeIn{}}
+ \newOptexpComp{{@@x neg 0} {0 1} @@y neg @@y trans {PlainIfc}
+ {@@x 0} {0 1} 0 0 trans {PlainIfc} 1 }%
+}%
+\def\fibercollimator@comp{%
+ \def\@wd{\POE@key@fibercolwidth\space 0.5 mul }%
+ \def\@ht{\POE@key@fibercolheight\space 0.5 mul }%
+ \pspolygon(!\@wd neg \getCLWH add \@ht neg)%
+ (!\@wd 0)(!\@wd neg \getCLWH add \@ht)
+}%
\endinput
+%%
+%% End of file `pst-optexp.sty'.