summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips/pstricks/pst-node.pro
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-01-25 00:33:24 +0000
committerKarl Berry <karl@freefriends.org>2008-01-25 00:33:24 +0000
commit7b47a6fc77ad486993f61d5ecdcd884a64f331da (patch)
tree0c29e5a6adc88fe23713e5e1dfd2fcbe7be0f3e5 /Master/texmf-dist/dvips/pstricks/pst-node.pro
parentfb100c8d5700c5ed13acd4bcf77f59447de8a8f3 (diff)
pstricks 0.36 (23jan08)
git-svn-id: svn://tug.org/texlive/trunk@6393 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips/pstricks/pst-node.pro')
-rw-r--r--Master/texmf-dist/dvips/pstricks/pst-node.pro92
1 files changed, 68 insertions, 24 deletions
diff --git a/Master/texmf-dist/dvips/pstricks/pst-node.pro b/Master/texmf-dist/dvips/pstricks/pst-node.pro
index 5502ecbd202..85c44dde388 100644
--- a/Master/texmf-dist/dvips/pstricks/pst-node.pro
+++ b/Master/texmf-dist/dvips/pstricks/pst-node.pro
@@ -1,17 +1,39 @@
-%!
+% $Id: pst-node.pro 7 2007-12-29 22:21:13Z herbert $
+%
% PostScript prologue for pst-node.tex.
-% Version 97 patch 1, 97/05/09.
+% Version 1.00, 2008/01/01.
% For distribution, see pstricks.tex.
%
/tx@NodeDict 400 dict def tx@NodeDict begin
-tx@Dict begin /T /translate load def end
-/NewNode { gsave /next ED dict dup 3 1 roll def exch { dup 3 1 roll def }
-if begin tx@Dict begin STV CP T exec end /NodeMtrx CM def next end
-grestore } def
-/InitPnode { /Y ED /X ED /NodePos { NodeSep Cos mul NodeSep Sin mul } def
+tx@Dict begin
+ /T /translate load def
+end
+/NewNode { % on stack: { x y } boolean N@name type InitXnode
+ gsave
+ /next ED % { x y } boolean N@name type
+ dict dup % { x y } boolean N@name dict dict
+ 3 1 roll def % { x y } boolean dict N@name dict def
+ exch { dup 3 1 roll def } if % { x y } dict boolean
+ begin % { x y } dict begin
+ tx@Dict begin
+ STV CP T exec % set scaling
+ end
+ /NodeMtrx CM def % save CM
+ next % InitXNode
+ end
+ grestore
+} def
+%
+/InitPnode {
+ /Y ED /X ED
+ /NodePos { NodeSep Cos mul NodeSep Sin mul } def
+} def
+%
+/InitCnode {
+ /r ED /Y ED /X ED
+ /NodePos { NodeSep r add dup Cos mul exch Sin mul } def
} def
-/InitCnode { /r ED /Y ED /X ED /NodePos { NodeSep r add dup Cos mul exch
-Sin mul } def } def
+%
/GetRnodePos { Cos 0 gt { /dx r NodeSep add def } { /dx l NodeSep sub def
} ifelse Sin 0 gt { /dy u NodeSep add def } { /dy d NodeSep sub def }
ifelse dx Sin mul abs dy Cos mul abs gt { dy Cos mul Sin div dy } { dx
@@ -30,13 +52,16 @@ sin def /NodePos { TriNodePos } def } def
/OvalNodePos { /ww w NodeSep add def /hh h NodeSep add def Sin ww mul Cos
hh mul Atan dup cos ww mul exch sin hh mul } def
/GetCenter { begin X Y NodeMtrx transform CM itransform end } def
+%
/XYPos { dup sin exch cos Do /Cos ED /Sin ED /Dist ED Cos 0 gt { Dist
-Dist Sin mul Cos div } { Cos 0 lt { Dist neg Dist Sin mul Cos div neg }
-{ 0 Dist Sin mul } ifelse } ifelse Do } def
+ Dist Sin mul Cos div } { Cos 0 lt { Dist neg Dist Sin mul Cos div neg }
+ { 0 Dist Sin mul } ifelse } ifelse Do
+} def
/GetEdge { dup 0 eq { pop begin 1 0 NodeMtrx dtransform CM idtransform
-exch atan sub dup sin /Sin ED cos /Cos ED /NodeSep ED NodePos NodeMtrx
-dtransform CM idtransform end } { 1 eq {{exch}} {{}} ifelse /Do ED pop
-XYPos } ifelse } def
+ exch atan sub dup sin /Sin ED cos /Cos ED /NodeSep ED NodePos NodeMtrx
+ dtransform CM idtransform end } { 1 eq {{exch}} {{}} ifelse /Do ED pop
+ XYPos } ifelse
+} def
/AddOffset { 1 index 0 eq { pop pop } { 2 copy 5 2 roll cos mul add 4 1
roll sin mul sub exch } ifelse } def
/GetEdgeA { NodeSepA AngleA NodeA NodeSepTypeA GetEdge OffsetA AngleA
@@ -51,10 +76,18 @@ ArmA AngleA XYPos OffsetA AngleA AddOffset yA add /yA2 ED xA add /xA2 ED
AngleB sin mul yB1 add def } { ArmTypeB 1 eq {{exch}} {{}} ifelse /Do ED
ArmB AngleB XYPos OffsetB AngleB AddOffset yB add /yB2 ED xB add /xB2 ED
} ifelse } def
-/InitNC { /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 /yA
-ED /xA ED NodeB GetCenter /yB ED /xB ED } if } def
+/InitNC {
+ /b ED /a ED % second and first node
+ /NodeSepTypeB ED /NodeSepTypeA ED
+ /NodeSepB ED /NodeSepA ED
+ /OffsetB ED /OffsetA ED
+ tx@NodeDict a known tx@NodeDict b known and dup {
+ /NodeA a load def
+ /NodeB b load def
+ NodeA GetCenter /yA ED /xA ED
+ NodeB GetCenter /yB ED /xB ED } if
+} def
+%
/LPutLine { 4 copy 3 -1 roll sub neg 3 1 roll sub Atan /NAngle ED 1 t sub
mul 3 1 roll 1 t sub mul 4 1 roll t mul add /Y ED t mul add /X ED } def
/LPutLines { mark LPutVar counttomark 2 div 1 sub /n ED t floor dup n gt
@@ -107,12 +140,21 @@ begin ArrowB end curveto /LPutVar [ xA1 yA1 xA2 yA2 xB2 yB2 xB1 yB1 ]
cvx def /LPutPos { t LPutVar BezierMidpoint } def /HPutPos { { HPutLines
} HPutCurve } def /VPutPos { { VPutLines } HPutCurve } def } def
%
-/NCAngles { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate
-def xA2 yA2 mtrx transform pop xB2 yB2 mtrx transform exch pop mtrx
-itransform /y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA2
-yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1
-yB1 xB2 yB2 x0 y0 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def
-/HPutPos { HPutLines } def /VPutPos { VPutLines } def } def
+/NCAngles {
+ GetEdgeA GetEdgeB GetArmA GetArmB
+ /mtrx AngleA matrix rotate def
+ xA2 yA2 mtrx transform pop
+ xB2 yB2 mtrx transform exch pop
+ mtrx itransform
+ /y0 ED /x0 ED
+ mark ArmB 0 ne { xB1 yB1 } if
+ xB2 yB2 x0 y0 xA2 yA2
+ ArmA 0 ne { xA1 yA1 } if
+ tx@Dict begin false Line end
+ /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA2 yA2 xA1 yA1 ] cvx def
+ /LPutPos { LPutLines } def
+ /HPutPos { HPutLines } def
+ /VPutPos { VPutLines } def } def
%
/NCAngle { GetEdgeA GetEdgeB GetArmB /mtrx AngleA matrix rotate def xB2
yB2 mtrx itransform pop xA1 yA1 mtrx itransform exch pop mtrx transform
@@ -196,8 +238,10 @@ w sub yB } { xB yB w sub xB yB w add } ifelse xA1 yA1 ] cvx def /LPutPos
{ pop pop pop pop 4 2 roll } ifelse } def /VPutPos { VPutPos@ VPutLine }
def /HPutPos { VPutPos@ HPutLine } def mark LPutVar tx@Dict begin
/ArrowA { moveto } def /ArrowB { } def false Line closepath end } def
+
/LPutCoor { NAngle tx@Dict begin /NAngle ED end gsave CM STV CP Y sub neg
exch X sub neg exch moveto setmatrix CP grestore } def
+
/LPut { tx@NodeDict /LPutPos known { LPutPos } { CP /Y ED /X ED /NAngle 0
def } ifelse LPutCoor } def
/HPutAdjust { Sin Cos mul 0 eq { 0 } { d Cos mul Sin div flag not { neg }