diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-11 00:23:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-11 00:23:38 +0000 |
commit | 098bf061faf05059dd90a3b9ee89bb5d85abebda (patch) | |
tree | 376bc695a21802678e76ef4afafd299929681376 /Master/texmf-dist/tex/latex/pst-optexp | |
parent | c353e13397245a2ace91c7d3ce5eed2e590447d0 (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/latex/pst-optexp')
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty | 4114 |
1 files changed, 4106 insertions, 8 deletions
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'. |