| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
\csname PSTricksAddLoaded\endcsname |
|---|
| 22 |
\let\PSTricksAddLoaded\endinput |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
\ifx\PSTricksLoaded\endinput\else\input pstricks \fi |
|---|
| 26 |
\ifx\PSTplotLoaded\endinput\else \input pst-plot \fi |
|---|
| 27 |
\ifx\PSTnodesLoaded\endinput\else\input pst-node \fi |
|---|
| 28 |
\ifx\PSTthreeDLoaded\endinput\else\input pst-3d \fi |
|---|
| 29 |
\ifx\MultidoLoaded\endinput\else \input multido \fi |
|---|
| 30 |
\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi |
|---|
| 31 |
|
|---|
| 32 |
\def\fileversion{3.00} |
|---|
| 33 |
\def\filedate{2008/01/01} |
|---|
| 34 |
\message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} |
|---|
| 35 |
|
|---|
| 36 |
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax |
|---|
| 37 |
\SpecialCoor |
|---|
| 38 |
\pst@addfams{pstricks-add} |
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
\pstheader{pstricks-add.pro} |
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
\newdimen\pst@dimm |
|---|
| 48 |
\newdimen\pst@dimn |
|---|
| 49 |
\newdimen\pst@dimo |
|---|
| 50 |
\newdimen\pst@dimp |
|---|
| 51 |
\newcount\pst@cntm |
|---|
| 52 |
\newcount\pst@cntn |
|---|
| 53 |
\newcount\pst@cnto |
|---|
| 54 |
\newcount\pst@cntp |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
\newcount\@zero\@zero=0\relax |
|---|
| 58 |
\chardef\f@ur=4 |
|---|
| 59 |
|
|---|
| 60 |
\def\psPiFour{12.566371} |
|---|
| 61 |
\def\psPiTwo{6.283185} |
|---|
| 62 |
\def\psPi{3.14159265} |
|---|
| 63 |
\def\psPiH{1.570796327} |
|---|
| 64 |
\newdimen\pstRadUnit |
|---|
| 65 |
\newdimen\pstRadUnitInv |
|---|
| 66 |
\pstRadUnit=1.047198cm |
|---|
| 67 |
\pstRadUnitInv=0.95493cm |
|---|
| 68 |
|
|---|
| 69 |
\def\pst@getdimdim#1 #2 #3\@nil{ |
|---|
| 70 |
\def\pst@tempA{#2} |
|---|
| 71 |
\ifx\pst@tempA\@empty |
|---|
| 72 |
\pssetlength\pst@dimn{#1} |
|---|
| 73 |
\pst@dimm=\z@ |
|---|
| 74 |
\else |
|---|
| 75 |
\pssetlength\pst@dimm{#1} |
|---|
| 76 |
\pssetlength\pst@dimn{#2} |
|---|
| 77 |
\fi |
|---|
| 78 |
} |
|---|
| 79 |
\def\pst@getxdimdim#1 #2 #3\@nil{ |
|---|
| 80 |
\def\pst@tempA{#2} |
|---|
| 81 |
\ifx\pst@tempA\@empty |
|---|
| 82 |
\pssetxlength\pst@dimn{#1} |
|---|
| 83 |
\pst@dimm=\z@ |
|---|
| 84 |
\else |
|---|
| 85 |
\pssetxlength\pst@dimm{#1} |
|---|
| 86 |
\pssetxlength\pst@dimn{#2} |
|---|
| 87 |
\fi |
|---|
| 88 |
} |
|---|
| 89 |
\def\pst@getydimdim#1 #2 #3\@nil{ |
|---|
| 90 |
\def\pst@tempA{#2} |
|---|
| 91 |
\ifx\pst@tempA\@empty |
|---|
| 92 |
\pssetylength\pst@dimn{#1} |
|---|
| 93 |
\pst@dimm=\z@ |
|---|
| 94 |
\else |
|---|
| 95 |
\pssetylength\pst@dimm{#1} |
|---|
| 96 |
\pssetylength\pst@dimn{#2} |
|---|
| 97 |
\fi |
|---|
| 98 |
} |
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
\def\@fornoop#1\@@#2#3{} |
|---|
| 103 |
\long\def\@for#1:=#2\do#3{ |
|---|
| 104 |
\expandafter\def\expandafter\@fortmp\expandafter{#2} |
|---|
| 105 |
\ifx\@fortmp\@empty \else |
|---|
| 106 |
\expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi} |
|---|
| 107 |
\long\def\@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else |
|---|
| 108 |
#5\def#4{#2}\ifx #4\@nnil \else#5\@iforloop #3\@@#4{#5}\fi\fi} |
|---|
| 109 |
\long\def\@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil |
|---|
| 110 |
\expandafter\@fornoop \else |
|---|
| 111 |
#4\relax\expandafter\@iforloop\fi#2\@@#3{#4}} |
|---|
| 112 |
\def\psforeach#1#2#3{ |
|---|
| 113 |
\begingroup |
|---|
| 114 |
\edef\reserved@a{#2} |
|---|
| 115 |
\@for#1:=\reserved@a\do{#3} |
|---|
| 116 |
\endgroup |
|---|
| 117 |
} |
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
\def\pst@mod#1#2#3{ |
|---|
| 123 |
\begingroup |
|---|
| 124 |
\pst@cntm=#1\pst@cntn=#2\relax |
|---|
| 125 |
\pst@cnto=\pst@cntm |
|---|
| 126 |
\divide\pst@cntm by \pst@cntn |
|---|
| 127 |
\multiply\pst@cntn by \pst@cntm |
|---|
| 128 |
\advance\pst@cnto by -\pst@cntn |
|---|
| 129 |
\edef\value{\endgroup\def\noexpand#3{\number\pst@cnto}}\value |
|---|
| 130 |
} |
|---|
| 131 |
\def\pst@max#1#2#3{ |
|---|
| 132 |
\begingroup |
|---|
| 133 |
\pst@cntm=#1\pst@cntn=#2\relax |
|---|
| 134 |
\ifnum\pst@cntm<\pst@cntn\pst@cntm=\pst@cntn\fi |
|---|
| 135 |
\global#3=\the\pst@cntm |
|---|
| 136 |
\endgroup |
|---|
| 137 |
} |
|---|
| 138 |
\def\pst@maxdim#1#2#3{ |
|---|
| 139 |
\begingroup |
|---|
| 140 |
\pst@dimm=#1\pst@dimn=#2\relax |
|---|
| 141 |
\ifdim\pst@dimm<\pst@dimn\pst@dimm=\pst@dimn\fi |
|---|
| 142 |
\global#3=\the\pst@dimm |
|---|
| 143 |
\endgroup |
|---|
| 144 |
} |
|---|
| 145 |
\def\pst@abs#1#2{ |
|---|
| 146 |
\begingroup |
|---|
| 147 |
\pst@cntm=#1\relax |
|---|
| 148 |
\ifnum\pst@cntm<\z@\pst@cntm=-\pst@cntm\fi |
|---|
| 149 |
\global#2=\the\pst@cntm |
|---|
| 150 |
\endgroup |
|---|
| 151 |
} |
|---|
| 152 |
\def\pst@absdim#1#2{ |
|---|
| 153 |
\begingroup |
|---|
| 154 |
\pst@dimm=#1\relax |
|---|
| 155 |
\ifdim\pst@dimm<\z@\pst@dimm=-\pst@dimm\fi |
|---|
| 156 |
\global#2=\the\pst@dimm |
|---|
| 157 |
\endgroup |
|---|
| 158 |
} |
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
\define@boolkey[psset]{pstricks-add}[Pst@]{CMYK}[true]{} |
|---|
| 162 |
\psset[pstricks-add]{CMYK=true} |
|---|
| 163 |
|
|---|
| 164 |
\def\defineTColor{\@ifnextchar[{\defineTColor@i}{\defineTColor@i[]}} |
|---|
| 165 |
\def\defineTColor@i[#1]#2#3{ |
|---|
| 166 |
\def\pst@tempA{#1} |
|---|
| 167 |
\newpsstyle{#2}{ |
|---|
| 168 |
fillstyle=vlines,hatchwidth=0.1\pslinewidth, |
|---|
| 169 |
hatchsep=1\pslinewidth,hatchcolor=#3} |
|---|
| 170 |
\ifx\pst@tempA\@empty\else\psset{#1}\fi |
|---|
| 171 |
} |
|---|
| 172 |
\defineTColor{TRed}{red} |
|---|
| 173 |
\defineTColor{TGreen}{green} |
|---|
| 174 |
\defineTColor{TBlue}{blue} |
|---|
| 175 |
|
|---|
| 176 |
\define@key[psset]{pstricks-add}{fsAngle}{\pst@getangle{#1}\pst@fsAngle } |
|---|
| 177 |
\define@key[psset]{pstricks-add}{fsOrigin}{ |
|---|
| 178 |
\pst@@getcoor{#1}\edef\pst@fsOrigin{\pst@coor T }} |
|---|
| 179 |
\psset[pstricks-add]{fsOrigin={0,0},fsAngle=137.50775} |
|---|
| 180 |
|
|---|
| 181 |
\def\psfs@spiral{\pst@fill{\pst@fsOrigin \pst@usecolor\psfillcolor clip newpath |
|---|
| 182 |
0 .1 500 { dup dup sqrt 4 div 0 360 arc fill \pst@fsAngle rotate } for }} |
|---|
| 183 |
|
|---|
| 184 |
\def\rmultiput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\rmultiput@i}{\rmultiput@i[]}}} |
|---|
| 185 |
\def\rmultiput@i[#1]{\begingroup\psset{#1}\rmultiput@ii} |
|---|
| 186 |
\def\rmultiput@ii#1{\def\@rmultiputArg{#1} |
|---|
| 187 |
\@ifnextchar({\rmultiput@iii}{\rmultiput@iii(\z@,\z@)}} |
|---|
| 188 |
\def\rmultiput@iii(#1){ |
|---|
| 189 |
\pst@killglue |
|---|
| 190 |
\if@star\rput*(#1){\@rmultiputArg} |
|---|
| 191 |
\else\rput(#1){\@rmultiputArg}\fi |
|---|
| 192 |
\@ifnextchar({\rmultiput@iii}{\endgroup} |
|---|
| 193 |
} |
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
\def\psrotate{\pst@object{psrotate}} |
|---|
| 197 |
\def\psrotate@i(#1)#2{ |
|---|
| 198 |
\pst@killglue |
|---|
| 199 |
\begingroup |
|---|
| 200 |
\use@par\pst@makebox{\psrotate@ii(#1){#2}}} |
|---|
| 201 |
\def\psrotate@ii(#1)#2{ |
|---|
| 202 |
\pst@getcoor{#1}\pst@tempA |
|---|
| 203 |
\pst@getangle{#2}\pst@tempB |
|---|
| 204 |
\leavevmode |
|---|
| 205 |
\pst@Verb{ |
|---|
| 206 |
{ \pst@tempA /yRot ED /xRot ED |
|---|
| 207 |
\pst@tempB dup cos /cosA ED sin /sinA ED |
|---|
| 208 |
/ax cosA def |
|---|
| 209 |
/by sinA def |
|---|
| 210 |
/cx sinA neg def |
|---|
| 211 |
/dy cosA def |
|---|
| 212 |
/ex xRot cosA mul neg xRot add yRot sinA mul add def |
|---|
| 213 |
/fy xRot sinA mul neg yRot add yRot cosA mul sub def |
|---|
| 214 |
[ax by cx dy ex fy] concat } \tx@TMChange } |
|---|
| 215 |
\box\pst@hbox |
|---|
| 216 |
\pst@Verb{ \tx@TMRestore }\endgroup} |
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
\def\psHomothetie{\pst@object{psHomothetie}} |
|---|
| 220 |
\def\psHomothetie@i(#1)#2{ |
|---|
| 221 |
\begin@SpecialObj |
|---|
| 222 |
\pst@getcoor{#1}\pst@tempA |
|---|
| 223 |
\pst@makebox{\psHomothetie@ii{#2}}} |
|---|
| 224 |
\def\psHomothetie@ii#1{ |
|---|
| 225 |
\pst@Verb{ |
|---|
| 226 |
{ \pst@tempA /yH ED /xH ED |
|---|
| 227 |
[#1 0 0 #1 #1 xH mul neg xH add #1 yH mul neg yH add] concat } |
|---|
| 228 |
\tx@TMChange } |
|---|
| 229 |
\box\pst@hbox |
|---|
| 230 |
\pst@Verb{\tx@TMRestore} |
|---|
| 231 |
\end@SpecialObj} |
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 |
|
|---|
| 235 |
\define@key[psset]{}{dash}{ |
|---|
| 236 |
\pst@expandafter\psset@@dash{#1}\@nil |
|---|
| 237 |
} |
|---|
| 238 |
\define@key[psset]{pstricks-add}{maxdashes}{\def\psk@maxdashes{#1}} |
|---|
| 239 |
|
|---|
| 240 |
\def\psset@@dash#1\@nil{ |
|---|
| 241 |
\def\psk@dash{} |
|---|
| 242 |
|
|---|
| 243 |
\pst@cntm0 |
|---|
| 244 |
\def\next##1 ##2\relax{ |
|---|
| 245 |
\expandafter\ifnum\psk@maxdashes>\pst@cntm\relax |
|---|
| 246 |
\edef\@tempa{##1} |
|---|
| 247 |
\ifx\@tempa\@empty\else |
|---|
| 248 |
\pssetlength\pst@dimc{##1} |
|---|
| 249 |
\advance\pst@cntm by 1 |
|---|
| 250 |
\edef\psk@dash{\psk@dash\space\pst@number\pst@dimc} |
|---|
| 251 |
\fi |
|---|
| 252 |
\edef\@tempa{##2} |
|---|
| 253 |
\ifx\@tempa\@empty\else |
|---|
| 254 |
\ifx\@tempa\space\else |
|---|
| 255 |
\next##2\relax |
|---|
| 256 |
\fi\fi |
|---|
| 257 |
\else |
|---|
| 258 |
\@pstrickserr{Number of dashes > \psk@maxdashes. Increasing |
|---|
| 259 |
'maxdashes' might work.}\@ehpa |
|---|
| 260 |
\fi |
|---|
| 261 |
} |
|---|
| 262 |
\expandafter\next#1 \relax} |
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 |
|
|---|
| 269 |
\def\psls@dashed{ |
|---|
| 270 |
\ifpsdashadjust |
|---|
| 271 |
[ \psk@dash ] \pst@linetype\space \tx@DashLine |
|---|
| 272 |
\else |
|---|
| 273 |
[ \psk@dash ] 0 setdash stroke |
|---|
| 274 |
\fi} |
|---|
| 275 |
|
|---|
| 276 |
|
|---|
| 277 |
|
|---|
| 278 |
\pst@def{DashLine}< |
|---|
| 279 |
dup 0 gt |
|---|
| 280 |
{ /a .5 def PathLength exch div } |
|---|
| 281 |
{ pop /a 1 def PathLength } ifelse |
|---|
| 282 |
/b ED |
|---|
| 283 |
dup /X ED |
|---|
| 284 |
0 get /y ED |
|---|
| 285 |
/z 0 X {add} forall def |
|---|
| 286 |
|
|---|
| 287 |
b a .5 sub 2 mul y mul sub z Div round |
|---|
| 288 |
z mul a .5 sub 2 mul y mul add b exch Div |
|---|
| 289 |
|
|---|
| 290 |
/z ED |
|---|
| 291 |
false |
|---|
| 292 |
X { z mul } forall X astore |
|---|
| 293 |
|
|---|
| 294 |
{0 gt or} forall |
|---|
| 295 |
{ X 1 a sub y mul } |
|---|
| 296 |
{ [ 1 0 ] 0 } |
|---|
| 297 |
ifelse |
|---|
| 298 |
setdash stroke > |
|---|
| 299 |
|
|---|
| 300 |
|
|---|
| 301 |
|
|---|
| 302 |
\define@key[psset]{pstricks-add}{intSeparator}{\def\psk@intSeparator{#1}} |
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 |
\def\psFormatInt{\def\pst@par{}\pst@object{psFormatInt}} |
|---|
| 306 |
\def\psFormatInt@i#1{{ |
|---|
| 307 |
\pst@killglue |
|---|
| 308 |
\use@par |
|---|
| 309 |
\count1=#1\count2=\count1 |
|---|
| 310 |
\ifnum\count1=0 0\else |
|---|
| 311 |
\ifnum\count1>999999 |
|---|
| 312 |
\count3=\count1 |
|---|
| 313 |
\divide\count3 by 1000000 |
|---|
| 314 |
\the\count3\psk@intSeparator\relax |
|---|
| 315 |
\multiply\count3 by 1000000 |
|---|
| 316 |
\advance\count1 by -\count3 |
|---|
| 317 |
\fi |
|---|
| 318 |
\ifnum\count2>999 |
|---|
| 319 |
\count3=\count1 |
|---|
| 320 |
\divide\count3 by 1000 |
|---|
| 321 |
\ifnum\count2>99999 |
|---|
| 322 |
\ifnum\count3<100 0\fi |
|---|
| 323 |
\ifnum\count3<10 0\fi |
|---|
| 324 |
\fi |
|---|
| 325 |
\the\count3\psk@intSeparator\relax |
|---|
| 326 |
\multiply\count3 by 1000 |
|---|
| 327 |
\advance\count1 by -\count3 |
|---|
| 328 |
\fi |
|---|
| 329 |
\ifnum\count2>999 |
|---|
| 330 |
\ifnum\count1<100 0\fi |
|---|
| 331 |
\ifnum\count1<10 0\fi |
|---|
| 332 |
\fi |
|---|
| 333 |
\the\count1 |
|---|
| 334 |
\fi |
|---|
| 335 |
}\ignorespaces} |
|---|
| 336 |
|
|---|
| 337 |
\define@key[psset]{pstricks-add}{braceWidth}{\pst@getlength{#1}\psk@braceWidth} |
|---|
| 338 |
\define@key[psset]{pstricks-add}{bracePos}{\pst@checknum{#1}\psk@bracePos} |
|---|
| 339 |
\define@key[psset]{pstricks-add}{braceWidthInner}{\pst@getlength{#1}\psk@braceWidthInner} |
|---|
| 340 |
\define@key[psset]{pstricks-add}{braceWidthOuter}{\pst@getlength{#1}\psk@braceWidthOuter} |
|---|
| 341 |
|
|---|
| 342 |
\def\psbrace{\pst@object{psbrace}} |
|---|
| 343 |
\def\psbrace@i(#1)(#2)#3{ |
|---|
| 344 |
\addbefore@par{ref=lb,linewidth=0.01pt,fillstyle=solid,fillcolor=black} |
|---|
| 345 |
\begin@SpecialObj |
|---|
| 346 |
\if@star\def\pst@tempC{true }\else\def\pst@tempC{false }\fi |
|---|
| 347 |
\ifx\psk@rot\empty\def\psk@@rot{0}\else\let\psk@@rot\psk@rot\fi |
|---|
| 348 |
\def\psk@rot{Alpha \psk@@rot\space add 90 sub} |
|---|
| 349 |
\pst@getcoor{#1}\pst@tempA |
|---|
| 350 |
\pst@getcoor{#2}\pst@tempB |
|---|
| 351 |
\rput(! |
|---|
| 352 |
/ifStar \pst@tempC def |
|---|
| 353 |
/radius1 \psk@braceWidthOuter def |
|---|
| 354 |
/radius2 \psk@braceWidthInner def |
|---|
| 355 |
/Alpha \pst@tempA \pst@tempB 3 -1 roll sub 3 1 roll exch sub atan def |
|---|
| 356 |
/Length \pst@tempA \pst@tempB Pyth2 def |
|---|
| 357 |
/Left { Length \psk@bracePos\space mul } bind def |
|---|
| 358 |
/Right { Length Left sub } bind def |
|---|
| 359 |
/Width \psk@braceWidth def |
|---|
| 360 |
/pop4 { pop pop pop pop } def |
|---|
| 361 |
gsave |
|---|
| 362 |
[ Alpha cos Alpha sin Alpha sin neg Alpha cos \pst@tempA ] concat |
|---|
| 363 |
0 0 moveto |
|---|
| 364 |
0 radius2 neg radius2 radius2 neg radius2 arcto pop4 |
|---|
| 365 |
Left radius2 sub radius1 sub 0 rlineto |
|---|
| 366 |
Left radius2 neg Left radius2 radius1 add neg radius1 arcto pop4 |
|---|
| 367 |
currentpoint /y@Label ED /x@Label ED |
|---|
| 368 |
Left radius2 neg Left radius1 add radius2 neg radius1 arcto pop4 |
|---|
| 369 |
Right radius2 sub radius1 sub 0 rlineto |
|---|
| 370 |
Length radius2 neg Length 0 radius2 arcto pop4 |
|---|
| 371 |
|
|---|
| 372 |
Length radius2 Width add neg Length radius2 sub radius2 Width add neg radius2 arcto pop4 |
|---|
| 373 |
Right radius2 sub radius1 sub neg 0 rlineto |
|---|
| 374 |
Left radius1 add Width radius1 add radius2 add neg radius1 90 180 arc |
|---|
| 375 |
Left radius1 sub Width radius1 add radius2 add neg radius1 0 90 arc |
|---|
| 376 |
Left radius2 sub radius1 sub neg 0 rlineto |
|---|
| 377 |
radius2 Width neg radius2 270 180 arcn |
|---|
| 378 |
0 0 lineto |
|---|
| 379 |
gsave |
|---|
| 380 |
ifStar { \pst@usecolor\pslinecolor }{ \pst@usecolor\psfillcolor } ifelse fill |
|---|
| 381 |
grestore |
|---|
| 382 |
0.01 setlinewidth \pst@usecolor\pslinecolor stroke |
|---|
| 383 |
0 0 moveto |
|---|
| 384 |
grestore |
|---|
| 385 |
|
|---|
| 386 |
/Dh radius1 radius2 add Width add def |
|---|
| 387 |
\pst@tempA \pst@tempB 3 -1 roll sub 3 1 roll exch sub |
|---|
| 388 |
\psk@bracePos\space mul exch \psk@bracePos\space mul |
|---|
| 389 |
\pst@tempA 3 -1 roll add Dh Alpha cos mul sub |
|---|
| 390 |
\psk@nodesepB sub |
|---|
| 391 |
3 1 roll add Dh Alpha sin mul add \psk@nodesepA add |
|---|
| 392 |
exch \tx@UserCoor ){#3} |
|---|
| 393 |
\end@SpecialObj} |
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
|
|---|
| 398 |
|
|---|
| 399 |
|
|---|
| 400 |
|
|---|
| 401 |
|
|---|
| 402 |
|
|---|
| 403 |
\edef\pst@arrowtable{\pst@arrowtable,v-v,V-V,f-f,F-F,t-t,T-T} |
|---|
| 404 |
|
|---|
| 405 |
|
|---|
| 406 |
\define@key[psset]{pstricks-add}{veearrowlength}{\pst@getlength{#1}\psk@veearrowlength} |
|---|
| 407 |
\psset[pstricks-add]{veearrowlength=3mm} |
|---|
| 408 |
\define@key[psset]{pstricks-add}{veearrowangle}{\pst@getangle{#1}\psk@veearrowangle} |
|---|
| 409 |
\psset[pstricks-add]{veearrowangle=30} |
|---|
| 410 |
\define@key[psset]{pstricks-add}{veearrowlinewidth}{\pst@getlength{#1}\psk@veearrowlinewidth} |
|---|
| 411 |
\psset[pstricks-add]{veearrowlinewidth=.35mm} |
|---|
| 412 |
|
|---|
| 413 |
|
|---|
| 414 |
\define@key[psset]{pstricks-add}{filledveearrowlength}{\pst@getlength{#1}\psk@filledveearrowlength} |
|---|
| 415 |
\psset[pstricks-add]{filledveearrowlength=3mm} |
|---|
| 416 |
\define@key[psset]{pstricks-add}{filledveearrowangle}{\pst@getangle{#1}\psk@filledveearrowangle} |
|---|
| 417 |
\psset[pstricks-add]{filledveearrowangle=15} |
|---|
| 418 |
\define@key[psset]{pstricks-add}{filledveearrowlinewidth}{\pst@getlength{#1}\psk@filledveearrowlinewidth} |
|---|
| 419 |
\psset[pstricks-add]{filledveearrowlinewidth=.35mm} |
|---|
| 420 |
\define@key[psset]{pstricks-add}{arrowLW}{\pst@getlength{#1}\psk@arrowLW} |
|---|
| 421 |
|
|---|
| 422 |
|
|---|
| 423 |
\def\psas@o{\psk@arrowLW\space dup 0 eq { pop }{ SLW } ifelse |
|---|
| 424 |
{\pst@usecolor\psfillcolor true} false \psk@dotsize \tx@EndDot } |
|---|
| 425 |
\@namedef{psas@*}{\psk@arrowLW\space dup 0 eq { pop }{ SLW } ifelse |
|---|
| 426 |
{\pst@usecolor\psfillcolor false} false \psk@dotsize \tx@EndDot} |
|---|
| 427 |
|
|---|
| 428 |
\pst@def{VeeArrow}< |
|---|
| 429 |
1 setlinecap |
|---|
| 430 |
1 setlinejoin |
|---|
| 431 |
setlinewidth |
|---|
| 432 |
/y ED |
|---|
| 433 |
2 div /a ED |
|---|
| 434 |
/t ED |
|---|
| 435 |
a sin a cos div y mul /x ED |
|---|
| 436 |
t { 1 -1 scale } if |
|---|
| 437 |
x neg y moveto |
|---|
| 438 |
0 0 L |
|---|
| 439 |
x y L |
|---|
| 440 |
{closepath gsave fill grestore} if |
|---|
| 441 |
stroke |
|---|
| 442 |
0 t {y 2 mul} {0} ifelse moveto> |
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 |
|
|---|
| 446 |
\@namedef{psas@v}{ |
|---|
| 447 |
false false \psk@veearrowangle \psk@veearrowlength \psk@veearrowlinewidth \tx@VeeArrow} |
|---|
| 448 |
\@namedef{psas@V}{ |
|---|
| 449 |
false true \psk@veearrowangle \psk@veearrowlength \psk@veearrowlinewidth \tx@VeeArrow} |
|---|
| 450 |
\@namedef{psas@f}{ |
|---|
| 451 |
true false \psk@filledveearrowangle \psk@filledveearrowlength \psk@filledveearrowlinewidth \tx@VeeArrow} |
|---|
| 452 |
\@namedef{psas@F}{ |
|---|
| 453 |
true true \psk@filledveearrowangle \psk@filledveearrowlength \psk@filledveearrowlinewidth \tx@VeeArrow} |
|---|
| 454 |
|
|---|
| 455 |
|
|---|
| 456 |
|
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 |
\define@key[psset]{pstricks-add}{tickarrowlength}{\pst@getlength{#1}\psk@tickarrowlength} |
|---|
| 460 |
\psset[pstricks-add]{tickarrowlength=1.5mm} |
|---|
| 461 |
\define@key[psset]{pstricks-add}{tickarrowlinewidth}{\pst@getlength{#1}\psk@tickarrowlinewidth} |
|---|
| 462 |
\psset[pstricks-add]{tickarrowlinewidth=.35mm} |
|---|
| 463 |
|
|---|
| 464 |
\pst@def{TickArrow}< |
|---|
| 465 |
1 setlinecap |
|---|
| 466 |
1 setlinejoin |
|---|
| 467 |
setlinewidth |
|---|
| 468 |
/y ED |
|---|
| 469 |
/t ED |
|---|
| 470 |
t { 1 -1 scale } if |
|---|
| 471 |
y neg y moveto |
|---|
| 472 |
y y neg L |
|---|
| 473 |
stroke |
|---|
| 474 |
0 0 moveto> |
|---|
| 475 |
|
|---|
| 476 |
\@namedef{psas@t}{ false \psk@tickarrowlength \psk@tickarrowlinewidth \tx@TickArrow } |
|---|
| 477 |
\@namedef{psas@T}{ true \psk@tickarrowlength \psk@tickarrowlinewidth \tx@TickArrow } |
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 |
\newdimen\pshooklength |
|---|
| 481 |
\newdimen\pshookwidth |
|---|
| 482 |
\define@key[psset]{pstricks-add}{hooklength}{\pssetlength\pshooklength{#1}} |
|---|
| 483 |
\define@key[psset]{pstricks-add}{hookwidth}{\pssetlength\pshookwidth{#1}} |
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 |
\edef\pst@arrowtable{\pst@arrowtable,H-H,h-h} |
|---|
| 487 |
\def\tx@RHook{RHook } |
|---|
| 488 |
\def\tx@Rhook{Rhook } |
|---|
| 489 |
\@namedef{psas@H}{ |
|---|
| 490 |
/RHook { |
|---|
| 491 |
/x ED |
|---|
| 492 |
/y ED |
|---|
| 493 |
/z CLW 2 div def |
|---|
| 494 |
x y moveto |
|---|
| 495 |
x 0 0 0 0 y |
|---|
| 496 |
curveto |
|---|
| 497 |
stroke |
|---|
| 498 |
0 y moveto |
|---|
| 499 |
} def |
|---|
| 500 |
\pst@number\pshooklength |
|---|
| 501 |
\pst@number\pshookwidth |
|---|
| 502 |
\tx@RHook |
|---|
| 503 |
} |
|---|
| 504 |
\@namedef{psas@h}{ |
|---|
| 505 |
/Rhook { |
|---|
| 506 |
CLW mul |
|---|
| 507 |
add dup |
|---|
| 508 |
2 div /w ED |
|---|
| 509 |
mul dup /h ED mul |
|---|
| 510 |
/a ED |
|---|
| 511 |
w neg h abs moveto 0 0 L |
|---|
| 512 |
gsave |
|---|
| 513 |
stroke grestore |
|---|
| 514 |
} def |
|---|
| 515 |
0 \psk@arrowlength \psk@arrowsize \tx@Rhook |
|---|
| 516 |
} |
|---|
| 517 |
|
|---|
| 518 |
\define@boolkey[psset]{pstricks-add}[ps]{ArrowFill}[true]{} |
|---|
| 519 |
|
|---|
| 520 |
|
|---|
| 521 |
|
|---|
| 522 |
\pst@def{Arrow}<{ |
|---|
| 523 |
CLW mul add dup 2 div |
|---|
| 524 |
/w ED mul dup |
|---|
| 525 |
/h ED mul |
|---|
| 526 |
/a ED { 0 h T 1 -1 scale } if |
|---|
| 527 |
gsave |
|---|
| 528 |
\ifpsArrowFill\else\pst@number\pslinewidth \pst@arrowscale\space div SLW \fi |
|---|
| 529 |
w neg h moveto |
|---|
| 530 |
0 0 L w h L w neg a neg rlineto |
|---|
| 531 |
\ifpsArrowFill gsave fill grestore \else gsave closepath stroke grestore \fi |
|---|
| 532 |
grestore |
|---|
| 533 |
0 h a sub moveto |
|---|
| 534 |
}> |
|---|
| 535 |
|
|---|
| 536 |
\define@key[psset]{pstricks-add}{nArrowsA}{\def\psk@nArrowsA{#1}} |
|---|
| 537 |
\define@key[psset]{pstricks-add}{nArrowsB}{\def\psk@nArrowsB{#1}} |
|---|
| 538 |
\define@key[psset]{pstricks-add}{nArrows}{\def\psk@nArrowsA{#1}\def\psk@nArrowsB{#1}} |
|---|
| 539 |
|
|---|
| 540 |
|
|---|
| 541 |
\@namedef{psas@>>}{ |
|---|
| 542 |
\psk@nArrowsA\space 1 sub { |
|---|
| 543 |
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow |
|---|
| 544 |
0 h a sub T |
|---|
| 545 |
} repeat |
|---|
| 546 |
gsave |
|---|
| 547 |
newpath |
|---|
| 548 |
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow |
|---|
| 549 |
CP |
|---|
| 550 |
grestore |
|---|
| 551 |
moveto |
|---|
| 552 |
} |
|---|
| 553 |
|
|---|
| 554 |
\@namedef{psas@<<}{ |
|---|
| 555 |
true \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow |
|---|
| 556 |
0 h neg a add T |
|---|
| 557 |
\psk@nArrowsB\space 2 sub { |
|---|
| 558 |
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow |
|---|
| 559 |
0 h neg a add T |
|---|
| 560 |
} repeat |
|---|
| 561 |
false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@Arrow |
|---|
| 562 |
0 h a 5 mul 2 div sub moveto |
|---|
| 563 |
} |
|---|
| 564 |
|
|---|
| 565 |
|
|---|
| 566 |
|
|---|
| 567 |
\define@key[psset]{pstricks-add}{ArrowInside}{ |
|---|
| 568 |
\def\pst@tempArrow{#1} |
|---|
| 569 |
\ifx\pst@tempArrow\@empty \def\psk@ArrowInside{} |
|---|
| 570 |
\else |
|---|
| 571 |
\begingroup |
|---|
| 572 |
\pst@activearrows |
|---|
| 573 |
\xdef\pst@tempg{<#1} |
|---|
| 574 |
\endgroup |
|---|
| 575 |
\expandafter\psset@@ArrowInside\pst@tempg\@empty-\@empty\@nil |
|---|
| 576 |
\if@pst\else\@pstrickserr{Bad intermediate arrow specification: #1}\@ehpa\fi |
|---|
| 577 |
\fi |
|---|
| 578 |
} |
|---|
| 579 |
|
|---|
| 580 |
\def\psset@@ArrowInside#1-#2\@empty#3\@nil{ |
|---|
| 581 |
\@psttrue |
|---|
| 582 |
\def\next##1,#1-##2,##3\@nil{\def\pst@tempg{##2}} |
|---|
| 583 |
\expandafter\next\pst@arrowtable,#1-#1,\@nil |
|---|
| 584 |
\@ifundefined{psas@#2} |
|---|
| 585 |
{\@pstfalse\def\psk@ArrowInside{}} |
|---|
| 586 |
{\def\psk@ArrowInside{#2}} |
|---|
| 587 |
} |
|---|
| 588 |
|
|---|
| 589 |
\psset{ArrowInside={}} |
|---|
| 590 |
|
|---|
| 591 |
\def\pst@addarrowdef{ |
|---|
| 592 |
\addto@pscode{ |
|---|
| 593 |
/ArrowA { |
|---|
| 594 |
\ifx\psk@arrowA\@empty |
|---|
| 595 |
\pst@oplineto |
|---|
| 596 |
\else |
|---|
| 597 |
\pst@arrowdef{A} |
|---|
| 598 |
moveto |
|---|
| 599 |
\fi |
|---|
| 600 |
} def |
|---|
| 601 |
/ArrowB { |
|---|
| 602 |
\ifx\psk@arrowB\@empty \else \pst@arrowdef{B} \fi |
|---|
| 603 |
} def |
|---|
| 604 |
|
|---|
| 605 |
/ArrowInside { |
|---|
| 606 |
\ifx\psk@ArrowInside\@empty \else \pst@arrowdefA{Inside} \fi |
|---|
| 607 |
} def |
|---|
| 608 |
} |
|---|
| 609 |
} |
|---|
| 610 |
|
|---|
| 611 |
\def\pst@arrowdefA#1{ |
|---|
| 612 |
\ifnum\pst@repeatarrowsflag>\z@ |
|---|
| 613 |
/Arrow#1c [ 6 2 roll ] cvx def Arrow#1c |
|---|
| 614 |
\fi |
|---|
| 615 |
\tx@BeginArrow |
|---|
| 616 |
\psk@arrowscale |
|---|
| 617 |
\@nameuse{psas@\@nameuse{psk@Arrow#1}} |
|---|
| 618 |
\tx@EndArrow |
|---|
| 619 |
} |
|---|
| 620 |
|
|---|
| 621 |
\define@key[psset]{pstricks-add}{ArrowInsidePos}{\pst@checknum{#1}\psk@ArrowInsidePos} |
|---|
| 622 |
|
|---|
| 623 |
|
|---|
| 624 |
|
|---|
| 625 |
\def\begin@ClosedObj{ |
|---|
| 626 |
\leavevmode |
|---|
| 627 |
\pst@killglue |
|---|
| 628 |
\begingroup |
|---|
| 629 |
\use@par |
|---|
| 630 |
\solid@star |
|---|
| 631 |
\ifpsdoubleline\pst@setdoublesep\fi |
|---|
| 632 |
\pst@addarrowdef |
|---|
| 633 |
\init@pscode} |
|---|
| 634 |
|
|---|
| 635 |
|---|