summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pst-optexp
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-optexp')
-rw-r--r--Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty140
1 files changed, 111 insertions, 29 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 3228e22060e..224af6e0280 100644
--- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
+++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Project: pst-optexp
-%% Version: 3.1 (2012/07/17)
+%% Version: 3.2 (2012/07/26)
%%
%% Copyright (C) 2007-2012 by Christoph Bersch <usenet@bersch.net>
%%
@@ -31,8 +31,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{pst-optexp}
- [2012/07/17 v3.1 Optical experimental setups with PSTricks]
-
+ [2012/07/26 v3.2 Optical experimental setups with PSTricks]
\RequirePackage{pstricks}
\RequirePackage{pst-xkey}
\RequirePackage{pst-node}
@@ -280,9 +279,18 @@
\define@key[psset]{optexp}{labelalign}{%
\def\POE@key@labelalign{#1}%
}
-\define@key[psset]{optexp}{labelref}{%
- \edef\POE@key@labelref{#1}%
-}
+\define@choicekey+[psset]{optexp}{labelref}%
+ [\val\nr]{absolute,relative,relgrav,global}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@labelref\POE@str@labelref@global
+ \else
+ \def\POE@key@labelref{#1}%
+ \fi
+ }{%
+ \PackageError{pst-optexp}%
+ {Unknown value '\POE@key@labelref' for labelref}%
+}%
\define@choicekey*+[psset]{optexp}{innerlabel}%
[\val\nr]{true}[true]%
{\ifcase\nr\relax
@@ -663,6 +671,29 @@
\fi
}%
\psset[optexp]{doveprismsize=0.6}%
+\define@key[psset]{optexp}{glanthompsongap}{%
+ \pst@checknum{#1}\POE@key@glanthompsongap
+}%
+\define@key[psset]{optexp}{glanthompsonwidth}{%
+ \pst@checknum{#1}\POE@key@glanthompsonwidth
+}%
+\define@key[psset]{optexp}{glanthompsonheight}{%
+ \pst@checknum{#1}\POE@key@glanthompsonheight
+}%
+\define@key[psset]{optexp}{glanthompsonsize}{%
+ \pst@expandafter\POE@psset@@glanthompsonsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@glanthompsonsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'glanthompsonsize' requires two numbers}%
+ \fi
+ \psset[optexp]{glanthompsonwidth=#1, glanthompsonheight=#2}%
+}%
+\psset[optexp]{%
+ glanthompsongap=0,
+ glanthompsonsize=1 0.5
+}%
\define@key[psset]{optexp}{bssize}{%
\pst@checknum{#1}\POE@key@bssize
}
@@ -1163,7 +1194,7 @@
,beaminsidefirst=false
,beaminsidelast=false
,loadbeam=false
- ,savebeam=false
+ ,savebeam=true
,loadbeampoints=false
,savebeampoints=true
,beamangle=0
@@ -1418,11 +1449,11 @@
\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}
+ \POE@dict{GetIfcOrNodeCoord} \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}
+ \POE@dict{GetIfcOrNodeCoord} \tx@UserCoor}{@@B}
\fi
\ifx\POE@key@startnode\POE@str@auto
\ifx\POE@key@stopnode\POE@str@auto
@@ -1599,13 +1630,15 @@
/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
+ /prevVec\POE@key@savebeampoints\space
+ currentdict /prevVecTmp known { prevVecTmp }{ 0 0 } ifelse
+ /lastVec\POE@key@savebeampoints\space lastVecTmp 7 -1 roll
} if
}%
\fi
\end@BeamObj
\POE@Verb{%
- { tx@OptexpDict begin ToVec def end } if
+ { tx@OptexpDict begin ToVec def ToVec def end } if
{ \tx@NodeScale @NewNode } if
}%
}%
@@ -1711,14 +1744,20 @@
savebeam and
currentdict /lastVecTmpLow known and
currentdict /lastVecTmpUp known and dup {
+ /prevVecLow\POE@key@savebeampoints\space /prevVecUp\POE@key@savebeampoints\space
+ currentdict /prevVecLow known currentdict /prevVecUp known and {
+ prevVecLow 3 -1 roll prevVecUp
+ } {
+ 0 0 3 -1 roll 0 0
+ } ifelse
/lastVecLow\POE@key@savebeampoints\space lastVecTmpLow
/lastVecUp\POE@key@savebeampoints\space lastVecTmpUp
- 7 -1 roll
+ 13 -1 roll
} if
}%
\end@BeamObj
\POE@Verb{%
- { tx@OptexpDict begin ToVec def ToVec def end } if
+ { tx@OptexpDict begin 4 { ToVec def } repeat end } if
{ \tx@NodeScale @NewNode @NewNode } if
}%
}%
@@ -2215,6 +2254,15 @@
\POE@str@basicname@prefix\POE@str@basicname@default BeamLow%
\ifx\\#1\\1\else#1\fi
}%
+\def\oe@BeamVec#1#2{%
+ \POE@dict{%
+ /prevVec#1\ifx\\#2\\1\else#2\fi\space dup
+ currentdict exch known { load exec }{ pop 0 0 } ifelse
+ }%
+}%
+\def\oeBeamVec#1{\oe@BeamVec{}{#1}}%
+\def\oeBeamVecUp#1{\oe@BeamVec{Up}{#1}}%
+\def\oeBeamVecLow#1{\oe@BeamVec{Low}{#1}}%
\def\newOptexpComp@#1#2{%
\POE@Verb{%
\tx@NodeScale
@@ -2739,20 +2787,18 @@
\POE@dict{VecAdd 0.5 VecScale}
\tx@UserCoor){\oenodeRefB{}}
\POE@Verb{%
+ gsave
+ STV CP T
/N@\oenodeRefA{} @GetCenter
/N@\oenodeRefB{} @GetCenter @ABVect NormalizeVec
90 matrix rotate dtransform 2 copy
- \pst@nodedict
- /GetCenterOrig /GetCenter load def
- /GetCenter { begin X Y end } def
- \POE@tempa \POE@tempb @ABVect
- \tx@UserCoor DotProd abs 3 1 roll
- \POE@tempc \POE@tempd @ABVect
- \tx@UserCoor DotProd abs
- /GetCenter /GetCenterOrig load def
- end
- /@@outht ED /@@inht ED
- }%
+ \POE@tempa \POE@tempb @ABVect
+ \tx@UserCoor DotProd abs 3 1 roll
+ \POE@tempc \POE@tempd @ABVect
+ \tx@UserCoor DotProd abs
+ grestore
+ /@@outht ED /@@inht ED
+ }%
\fi
\fi
\POE@drawcomponent[fiberbox]{#5}\fiberbox@ii
@@ -2840,7 +2886,7 @@
\def\POE@nlput@i(#1)(#2)#3#4{%
\begin@SpecialObj
\POE@LDNode(#1)(#2){#3}
- \pcline[linestyle=none](temp@nlputA)(temp@nlputB)%
+ \pcline[linestyle=none,fillstyle=none, arrows=-, ArrowInside=-](temp@nlputA)(temp@nlputB)%
\ncput[npos=0.5]{#4}%
\end@SpecialObj}
\def\POE@LDNode(#1)(#2)#3{%
@@ -2893,7 +2939,14 @@
}%
\def\POE@putlabel#1{%
\def\POE@temp{#1}%
- \ifx\POE@temp\@empty\else
+ \ifx\POE@temp\@empty
+ \ifx\POE@key@labelref\POE@str@labelref@global
+ \nput[labelsep=\POE@key@labeloffset]%
+ {\POE@key@labelangle}%
+ {\oenodeCenter{}}%
+ {\pnode(0,0){\oenodeLabel{}}}%
+ \fi
+ \else
\ifx\POE@key@labelref\POE@str@labelref@global
\nput[labelsep=\POE@key@labeloffset]%
{\POE@key@labelangle}%
@@ -2920,7 +2973,7 @@
{ /yA ED /xA ED /yB ED /xB ED} ifelse
} ifelse
} if >%
- \ncline[linestyle=none,fillstyle=none, npos=]%
+ \ncline[linestyle=none,fillstyle=none, npos=, arrows=-, ArrowInside=-]%
{\POE@trefnodeA}{\POE@trefnodeB}%
\ifx\POE@key@position\@empty
\ifx\POE@key@abspos\@empty
@@ -2947,6 +3000,7 @@
\newOptexpDipole[endbox]{optdetector}{}%
\newOptexpDipole{optdiode}{allowbeaminside=false}%
\newOptexpDipole{doveprism}{}%
+\newOptexpDipole{glanthompson}{}%
\newOptexpTripole{mirror}{}%
\newOptexpTripole[ref@angle=-135]{beamsplitter}{}%
\newOptexpTripole{optgrating}{}%
@@ -3099,7 +3153,7 @@
\psset[optexp]{abspos={\POE@dict{ @@x0 neg @@x sub }}}%
\fi\fi
\POE@disablepos
- \ncline[linestyle=none,fillstyle=none,npos=]%
+ \ncline[linestyle=none,fillstyle=none,npos=,arrows=-,ArrowInside=-]%
{\POE@refnodeA}{\POE@refnodeB}%
\begingroup
\psset{style=OptComp}%
@@ -3779,6 +3833,34 @@
(! \@wd \@ht 2 mul sub \@ht)%
(! \@ht 2 mul \@wd sub \@ht)%
\ignorespaces}%
+\def\glanthompson@ref{%
+ \POE@setref{/@@x \POE@key@glanthompsonwidth\space 0.5 mul def
+ /@@y \POE@key@glanthompsonheight\space 0.5 mul def
+ }%
+}%
+\def\glanthompson@nodes{%
+ \newOptexpCompAmb{%
+ {@@x neg 0} {0 1} @@x neg @@x trans {PlainIfc}
+ {@@x 0} {0 1} @@x neg @@x trans {PlainIfc}
+ {\POE@key@glanthompsongap\space -0.5 mul 0} {@@x neg @@y} 0 0 trans {PlainIfc}
+ {0 @@y neg} {1 0} @@y neg @@y trans {PlainIfc}
+ {0 @@y} {1 0} @@y neg @@y trans {PlainIfc}
+ 3 \POE@key@n
+ }
+}%
+\def\glanthompson@comp{%
+ \ifdim\POE@key@glanthompsongap pt>0pt
+ \pspolygon(!\POE@dict{@@x neg @@y})%
+ (!\POE@dict{@@x neg @@y neg})%
+ (!\POE@dict{@@x \POE@key@glanthompsongap\space sub @@y neg})
+ \pspolygon(!\POE@dict{@@x neg \POE@key@glanthompsongap\space add @@y})%
+ (!\POE@dict{@@x @@y})%
+ (!\POE@dict{@@x @@y neg})%
+ \else
+ \psframe(!\POE@dict{@@x neg @@y neg})(!\POE@dict{@@x @@y})
+ \psline[arrows=cc-cc](!\POE@dict{@@x neg @@y})(!\POE@dict{@@x @@y neg})
+ \fi
+}%
\def\pentaprism@nodes{%
\edef\@sz{\POE@key@pentaprismsize\space}%
\newOptexpComp{%
@@ -4286,7 +4368,7 @@
\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}{})
+ \tx@UserCoor \POE@key@couplersep\space add)(\oenode{2}{})
\fi
\fi
\fi