| 1 |
% Copyright 2022 by Qrrbrbirlbel |
| 2 |
% |
| 3 |
% This file may be distributed and/or modified |
| 4 |
% |
| 5 |
% 1. under the LaTeX Project Public License and/or |
| 6 |
% 2. under the GNU Free Documentation License. |
| 7 |
% |
| 8 |
\unless\ifcsname tikzextset\endcsname |
| 9 |
\input tikzext-util.tex |
| 10 |
\fi |
| 11 |
|
| 12 |
\newcount\tikzext@nodesonpath |
| 13 |
\tikzextset{ |
| 14 |
pic/.is if=tikz@node@is@pic, |
| 15 |
/tikz-ext/nodes/node on line/.style 2 args={ |
| 16 |
/tikz/to path={ |
| 17 |
\pgfextra{% |
| 18 |
\edef\tikz@temp{% rescuing nodes and target for edge |
| 19 |
edge[ |
| 20 |
line to,% -- |
| 21 |
path only,% no draw, no fill, … |
| 22 |
every edge quotes/.append style={auto=false},% node *on* the line |
| 23 |
nodes={alias=tikzext-node on line}] |
| 24 |
coordinate(tikzext-node on line)% fallback coordinate |
| 25 |
\pgfutil@unexpanded\expandafter{\tikz@tonodes}(\tikztotarget) |
| 26 |
}\expandafter |
| 27 |
}\tikz@temp |
| 28 |
-- (tikzext-node on line#1) |
| 29 |
(tikzext-node on line#2) |
| 30 |
-- (\tikztotarget) |
| 31 |
} |
| 32 |
}, |
| 33 |
/tikz-ext/nodes/@node on line/.style args={#1 and #2}{ |
| 34 |
/tikz-ext/nodes/node on line={.#1}{.#2} |
| 35 |
}, |
| 36 |
node on line/.default=, |
| 37 |
node on line/.code={% |
| 38 |
\pgfutil@ifempty{#1}{% |
| 39 |
\pgfkeys{/tikz-ext/nodes/node on line={}{}}% |
| 40 |
}{% |
| 41 |
\pgfutil@in@{ and }{#1}% |
| 42 |
\ifpgfutil@in@ |
| 43 |
\pgfkeys{/tikz-ext/nodes/@node on line={#1}}% |
| 44 |
\else |
| 45 |
\pgfkeys{/tikz-ext/nodes/@node on line={#1 and #1}}% |
| 46 |
\fi |
| 47 |
}% |
| 48 |
}, |
| 49 |
nodes on line/.style={ |
| 50 |
/tikz/to path={ |
| 51 |
\pgfextra{% |
| 52 |
\tikzext@nodesonpath=0 |
| 53 |
\edef\tikz@temp{% rescuing nodes and target for edge |
| 54 |
edge[ |
| 55 |
line to,% -- |
| 56 |
path only,% no draw, no fill, … |
| 57 |
every edge quotes/.append style={auto=false},% node *on* the line |
| 58 |
nodes={ |
| 59 |
/utils/exec=\global\noexpand\advance\tikzext@nodesonpath by 1, |
| 60 |
alias=tikzext-node on line-\noexpand\the\tikzext@nodesonpath |
| 61 |
}] |
| 62 |
\pgfutil@unexpanded\expandafter{\tikz@tonodes}(\tikztotarget) |
| 63 |
}\expandafter |
| 64 |
}\tikz@temp |
| 65 |
\ifnum\tikzext@nodesonpath=0 |
| 66 |
-- (\tikztotarget) |
| 67 |
\else |
| 68 |
-- (tikzext-node on line-1) |
| 69 |
\unless\ifnum\tikzext@nodesonpath=1 |
| 70 |
foreach[expand list] \tikzext@counter in {2, ..., \the\tikzext@nodesonpath}{ |
| 71 |
(tikzext-node on line-\pgfinteval{\tikzext@counter-1}) |
| 72 |
-- (tikzext-node on line-\tikzext@counter) |
| 73 |
} |
| 74 |
\fi |
| 75 |
(tikzext-node on line-\the\tikzext@nodesonpath) -- (\tikztotarget) |
| 76 |
\fi |
| 77 |
} |
| 78 |
}, |
| 79 |
%%% nodes on curve, needs spath3 |
| 80 |
/tikz-ext/spath/split multiple at intersections/.style n args={3}{ |
| 81 |
/utils/temp/.style={ |
| 82 |
/tikz/spath/split at intersections with={#1}{#2##1} |
| 83 |
}, |
| 84 |
/utils/temp/.list={#3} |
| 85 |
}, |
| 86 |
nodes on curve/.default=line to, |
| 87 |
nodes on curve'/.default=line to, |
| 88 |
nodes on curve/.style={% normal path |
| 89 |
/tikz-ext/nodes/nodes on curve={#1}{/tikz/spath/append}{} |
| 90 |
}, |
| 91 |
nodes on curve'/.style={% for edges and tos |
| 92 |
/tikz-ext/nodes/nodes on curve={#1}{/tikz/spath/use}{% |
| 93 |
\ifx\tikz@to@or@edge@function\tikz@do@to(\tikztotarget)\fi |
| 94 |
} |
| 95 |
}, |
| 96 |
% spath/prefix/tikzext-nodes/.style={ |
| 97 |
% set prefix=tikzext-node on curve |
| 98 |
% }, |
| 99 |
% spath/suffix/tikzext-nodes/.style={ |
| 100 |
% set suffix= |
| 101 |
% }, |
| 102 |
/tikz-ext/nodes/nodes on curve/.code n args={3}{% |
| 103 |
\pgfutil@IfUndefined{tikz@library@spath3@loaded}{% |
| 104 |
\pgfutil@packagerror{tikz-ext}{% |
| 105 |
You need to say \string\usetikzlibrary{spath3} to use nodes on curve.}{}% |
| 106 |
}{% |
| 107 |
\tikzset{to path={% |
| 108 |
% \def\tikz@to@path{% to path = |
| 109 |
\pgfextra{% |
| 110 |
\tikzext@nodesonpath=0 |
| 111 |
\edef\tikz@temp{% rescuing nodes and target for edge |
| 112 |
edge[% |
| 113 |
#1, path only,% path only = no draw, no fill, … |
| 114 |
every edge quotes/.append style={auto=false},% node *on* the line |
| 115 |
nodes={ |
| 116 |
/utils/exec=\global\noexpand\advance\tikzext@nodesonpath by 1, |
| 117 |
% spath/set name=tikzext-nodes, |
| 118 |
spath/save global=tikzext-node on curve-\noexpand\the\tikzext@nodesonpath, |
| 119 |
}, |
| 120 |
% spath/set name=tikzext-nodes, |
| 121 |
spath/save global=tikzext-node on curve-curve |
| 122 |
] |
| 123 |
\pgfutil@unexpanded\expandafter{\tikz@tonodes}(\tikztotarget) |
| 124 |
}\expandafter |
| 125 |
}\tikz@temp |
| 126 |
[% |
| 127 |
/tikz-ext/spath/split multiple at intersections/.expanded=% |
| 128 |
{tikzext-node on curve-curve}% |
| 129 |
{tikzext-node on curve-}% |
| 130 |
{1\ifnum\tikzext@nodesonpath>1 ,...,\the\tikzext@nodesonpath\fi}, |
| 131 |
spath/remove components/.expanded={tikzext-node on curve-curve}{% |
| 132 |
2% |
| 133 |
\ifnum\tikzext@nodesonpath>1 |
| 134 |
,4,...,\pgfinteval{2*\the\tikzext@nodesonpath}% |
| 135 |
\fi |
| 136 |
}, |
| 137 |
#2=tikzext-node on curve-curve% |
| 138 |
]% |
| 139 |
#3% |
| 140 |
}}% |
| 141 |
}% |
| 142 |
}% |
| 143 |
} |
| 144 |
% auto extensions |
| 145 |
\newif\iftikzext@auto@offset |
| 146 |
\newif\iftikzext@auto@precise |
| 147 |
\pgfkeysdef{/tikz/auto/}{\let\tikz@do@auto@anchor\tikz@auto@anchor@on} |
| 148 |
\tikzset{ |
| 149 |
swap/.style={% overwriting |
| 150 |
/tikz/swap/\tikz@auto@anchor@direction |
| 151 |
}, |
| 152 |
auto/.is choice, % overwriting |
| 153 |
auto/.default=, |
| 154 |
auto/false/.code=\let\tikz@do@auto@anchor\relax, |
| 155 |
/tikz/ext/nodes/install auto/.style 2 args={ |
| 156 |
/tikz/swap/#1/.code=\def\tikz@auto@anchor@direction{#2\iftikzext@auto@precise @precise\fi}, |
| 157 |
/tikz/auto/#1/.code=\let\tikz@do@auto@anchor\tikz@auto@anchor@on\def\tikz@auto@anchor@direction{#1\iftikzext@auto@precise @precise\fi}% |
| 158 |
}, |
| 159 |
/tikz/ext/nodes/install auto={left}{right}, |
| 160 |
/tikz/ext/nodes/install auto={right}{left}, |
| 161 |
/tikz/ext/nodes/install auto={ext/left}{ext/light}, |
| 162 |
/tikz/ext/nodes/install auto={ext/right}{ext/left}, |
| 163 |
/tikz/ext/nodes/install auto={ext/above}{ext/below}, |
| 164 |
/tikz/ext/nodes/install auto={ext/below}{ext/above}, |
| 165 |
/tikz/ext/nodes/install auto={ext/north}{ext/south}, |
| 166 |
/tikz/ext/nodes/install auto={ext/south}{ext/north}, |
| 167 |
/tikz/ext/nodes/install auto={ext/west}{ext/east}, |
| 168 |
/tikz/ext/nodes/install auto={ext/east}{ext/west}, |
| 169 |
sloped/.default=true, |
| 170 |
sloped/.is choice, % overwriting |
| 171 |
sloped/true/.code=\pgfslopedattimetrue\tikzext@auto@precisefalse, |
| 172 |
sloped/false/.code=\pgfslopedattimefalse |
| 173 |
} |
| 174 |
\tikzextset{ |
| 175 |
precise auto angle/.default=true, |
| 176 |
precise auto angle/.is choice, |
| 177 |
precise auto angle/true/.code=\tikzext@auto@precisetrue\pgfslopedattimefalse, |
| 178 |
precise auto angle/false/.code=\tikzext@auto@precisefalse, |
| 179 |
auto offset/.initial=1cm, |
| 180 |
auto with offset/.is if=tikzext@auto@offset, |
| 181 |
% next four keys needs decorations |
| 182 |
nodes/install auto offset for brace decoration/.default=0pt, |
| 183 |
nodes/install auto offset for brace decoration/.style={% |
| 184 |
/pgf/decoration/raise/.append code=\pgfkeyssetvalue{/pgf/decoration/raise}{##1}, |
| 185 |
/pgf/decoration/raise={#1}, |
| 186 |
/tikz/ext/auto offset for brace decoration/.style={ |
| 187 |
/tikz/ext/auto offset=\pgfdecorationsegmentamplitude+(\pgfkeysvalueof{/pgf/decoration/raise})% |
| 188 |
}, |
| 189 |
/tikz/ext/every brace node/.style={ |
| 190 |
/tikz/auto=% Ugh? |
| 191 |
\ifx\tikz@dec@mirror\relax |
| 192 |
\ifpgf@decorate@inputsegmentobjects@reverse right\else left\fi |
| 193 |
\else |
| 194 |
\ifpgf@decorate@inputsegmentobjects@reverse left\else right\fi |
| 195 |
\fi, |
| 196 |
/tikz/ext/auto with offset=true, |
| 197 |
/tikz/ext/auto offset for brace decoration, |
| 198 |
/tikz/pos=\ifpgf@decorate@inputsegmentobjects@reverse1-\fi(\pgfdecorationsegmentaspect) |
| 199 |
}, |
| 200 |
/tikz/ext/nodes/install auto offset for brace decoration/.code=% don't apply twice |
| 201 |
}, |
| 202 |
} |
| 203 |
\def\tikzext@auto@pre{% |
| 204 |
\begingroup |
| 205 |
\let\iftikzext@slopedattime\ifpgfslopedattime |
| 206 |
\let\iftikzext@allowupsidedownattime\ifpgfallowupsidedownattime |
| 207 |
\begingroup |
| 208 |
\pgfresetnontranslationattimefalse |
| 209 |
\pgfslopedattimetrue |
| 210 |
\pgfallowupsidedownattimetrue |
| 211 |
\tikz@timer |
| 212 |
\pgf@x=\pgf@pt@aa pt% |
| 213 |
\pgf@y=\pgf@pt@ab pt% |
| 214 |
\pgfpointnormalised{}% |
| 215 |
\endgroup |
| 216 |
\edef\tikzext@unslopedx{\the\pgf@x}% |
| 217 |
\edef\tikzext@unslopedy{\the\pgf@y}% |
| 218 |
\pgfresetnontranslationattimefalse |
| 219 |
\ifpgfslopedattime |
| 220 |
\pgfslopedattimefalse% |
| 221 |
\else |
| 222 |
\pgfslopedattimetrue% |
| 223 |
\fi |
| 224 |
\pgfallowupsidedownattimetrue% |
| 225 |
\tikz@timer% |
| 226 |
\pgf@x=\pgf@pt@aa pt% |
| 227 |
\pgf@y=\pgf@pt@ab pt% |
| 228 |
\pgfpointnormalised{}% |
| 229 |
} |
| 230 |
\def\tikzext@auto@post{% |
| 231 |
\edef\tikz@temp{% |
| 232 |
\def\noexpand\tikz@anchor{\tikz@anchor}% |
| 233 |
\def\noexpand\tikzext@autooffset@angle{\tikzext@autooffset@angle}}% |
| 234 |
\expandafter\endgroup\tikz@temp |
| 235 |
} |
| 236 |
\def\tikzext@auto@offset@A#1{% |
| 237 |
\iftikzext@auto@offset |
| 238 |
\xdef\tikz@marshal{% |
| 239 |
\pgf@process{% |
| 240 |
\noexpand\pgftransformreset |
| 241 |
\noexpand\pgftransformrotate{#1}% |
| 242 |
\noexpand\pgfpointtransformed{% |
| 243 |
\noexpand\pgfpointscale{\noexpand\pgfkeysvalueof{/tikz/ext/auto offset}} |
| 244 |
{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}}}% |
| 245 |
\advance\pgf@pt@x\pgf@x |
| 246 |
\advance\pgf@pt@y\pgf@y |
| 247 |
}% |
| 248 |
\fi |
| 249 |
} |
| 250 |
\def\tikzext@auto@offset@B#1{% |
| 251 |
\iftikzext@auto@offset |
| 252 |
\ifpgfslopedattime |
| 253 |
\pgf@xb=\pgf@x |
| 254 |
\pgf@yb=\pgf@y |
| 255 |
\pgf@process{% |
| 256 |
\pgftransformreset |
| 257 |
\pgftransformrotate{#1}% |
| 258 |
\pgfpointtransformed{% |
| 259 |
\pgf@process{% |
| 260 |
\tikz@timer% |
| 261 |
\pgf@x=\pgf@pt@aa pt |
| 262 |
\pgf@y=\pgf@pt@ab pt |
| 263 |
\pgfpointnormalised{}% |
| 264 |
\pgfpointscale{\pgfkeysvalueof{/tikz/ext/auto offset}}{}}}}% |
| 265 |
\advance\pgf@pt@x\pgf@x |
| 266 |
\advance\pgf@pt@y\pgf@y |
| 267 |
\pgf@x=\pgf@xb |
| 268 |
\pgf@y=\pgf@yb |
| 269 |
\else |
| 270 |
\tikz@marshal |
| 271 |
\fi |
| 272 |
\fi |
| 273 |
} |
| 274 |
\def\tikzext@auto@offset@B@precise{% |
| 275 |
\iftikzext@auto@offset |
| 276 |
\ifpgfslopedattime |
| 277 |
\else |
| 278 |
\tikz@marshal |
| 279 |
\fi |
| 280 |
\fi |
| 281 |
} |
| 282 |
|
| 283 |
% direction: left |
| 284 |
\def\tikz@auto@anchor@left{% overwriting |
| 285 |
\tikz@auto@pre |
| 286 |
\tikz@auto@anchor |
| 287 |
\tikzext@auto@offset@A{90}% |
| 288 |
\tikz@auto@post |
| 289 |
\tikzext@auto@offset@B{90}% |
| 290 |
} |
| 291 |
\def\tikz@auto@anchor@left@precise{% |
| 292 |
\tikz@auto@pre |
| 293 |
\edef\tikz@temp{% |
| 294 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 295 |
\tikz@temp |
| 296 |
\pgfmathadd@{\pgfmathresult}{-90}% |
| 297 |
\let\tikz@anchor\pgfmathresult |
| 298 |
\tikzext@auto@offset@A{90}% |
| 299 |
\tikz@auto@post |
| 300 |
\tikzext@auto@offset@B@precise |
| 301 |
} |
| 302 |
|
| 303 |
% direction: right |
| 304 |
\def\tikz@auto@anchor@right{% overwriting |
| 305 |
\tikz@auto@pre |
| 306 |
\tikz@auto@anchor@prime |
| 307 |
\tikzext@auto@offset@A{-90}% |
| 308 |
\tikz@auto@post |
| 309 |
\tikzext@auto@offset@B{-90}% |
| 310 |
} |
| 311 |
\def\tikz@auto@anchor@right@precise{% |
| 312 |
\tikz@auto@pre |
| 313 |
\edef\tikz@temp{% |
| 314 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 315 |
\tikz@temp |
| 316 |
\pgfmathadd@{\pgfmathresult}{90}% |
| 317 |
\let\tikz@anchor\pgfmathresult |
| 318 |
\tikzext@auto@offset@A{-90}% |
| 319 |
\tikz@auto@post |
| 320 |
\tikzext@auto@offset@B@precise |
| 321 |
} |
| 322 |
|
| 323 |
% direction: Left |
| 324 |
\pgfutil@namedef{tikz@auto@anchor@ext/left}{% |
| 325 |
\tikzext@auto@pre |
| 326 |
\def\tikzext@autooffset@angle{90}% |
| 327 |
\iftikzext@allowupsidedownattime |
| 328 |
\tikz@auto@anchor |
| 329 |
\else |
| 330 |
\iftikzext@slopedattime |
| 331 |
\ifdim\tikzext@unslopedx<0pt |
| 332 |
\def\tikz@anchor{north}% |
| 333 |
\def\tikzext@autooffset@angle{-90}% |
| 334 |
\else |
| 335 |
\def\tikz@anchor{south}% |
| 336 |
\fi |
| 337 |
\else |
| 338 |
\tikz@auto@anchor |
| 339 |
\fi |
| 340 |
\fi |
| 341 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 342 |
\tikzext@auto@post |
| 343 |
\tikzext@auto@offset@B{\tikzext@autooffset@angle}% |
| 344 |
} |
| 345 |
\pgfutil@namedef{tikz@auto@anchor@ext/left@precise}{% |
| 346 |
\tikz@auto@pre |
| 347 |
\edef\tikz@temp{% |
| 348 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 349 |
\tikz@temp |
| 350 |
\pgfmathadd@{\pgfmathresult}{-90}% |
| 351 |
\let\tikz@anchor\pgfmathresult |
| 352 |
\tikzext@auto@offset@A{90}% |
| 353 |
\tikz@auto@post |
| 354 |
\tikzext@auto@offset@B@precise |
| 355 |
} |
| 356 |
|
| 357 |
% direction: Right |
| 358 |
\pgfutil@namedef{tikz@auto@anchor@ext/right}{% |
| 359 |
\tikzext@auto@pre |
| 360 |
\def\tikzext@autooffset@angle{-90}% |
| 361 |
\iftikzext@allowupsidedownattime |
| 362 |
\tikz@auto@anchor@prime |
| 363 |
\else |
| 364 |
\iftikzext@slopedattime |
| 365 |
\ifdim\tikzext@unslopedx<0pt |
| 366 |
\def\tikz@anchor{south}% |
| 367 |
\def\tikzext@autooffset@angle{90}% |
| 368 |
\else |
| 369 |
\def\tikz@anchor{north}% |
| 370 |
\fi |
| 371 |
\else |
| 372 |
\tikz@auto@anchor@prime |
| 373 |
\fi |
| 374 |
\fi |
| 375 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 376 |
\tikzext@auto@post |
| 377 |
\tikzext@auto@offset@B{\tikzext@autooffset@angle}% |
| 378 |
} |
| 379 |
\pgfutil@namedef{tikz@auto@anchor@ext/right@precise}{% |
| 380 |
\tikz@auto@pre |
| 381 |
\edef\tikz@temp{% |
| 382 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 383 |
\tikz@temp |
| 384 |
\pgfmathadd@{\pgfmathresult}{90}% |
| 385 |
\let\tikz@anchor\pgfmathresult |
| 386 |
\tikzext@auto@offset@A{-90}% |
| 387 |
\tikz@auto@post |
| 388 |
\tikzext@auto@offset@B@precise |
| 389 |
} |
| 390 |
|
| 391 |
% direction: North (always above the line) |
| 392 |
\pgfutil@namedef{tikz@auto@anchor@ext/north}{% |
| 393 |
\tikzext@auto@pre |
| 394 |
\def\tikz@anchor{south}% |
| 395 |
\def\tikzext@autooffset@angle{90}% |
| 396 |
\iftikzext@allowupsidedownattime |
| 397 |
\ifdim\tikzext@unslopedx<0pt |
| 398 |
\def\tikzext@autooffset@angle{-90}% |
| 399 |
\def\tikz@anchor{north}% |
| 400 |
\fi |
| 401 |
\else |
| 402 |
\ifdim\pgf@x>0.05pt |
| 403 |
\ifdim\pgf@y>0.05pt |
| 404 |
\def\tikz@anchor{south east}% |
| 405 |
\else\ifdim\pgf@y<-0.05pt |
| 406 |
\def\tikz@anchor{south west}% |
| 407 |
\fi\fi |
| 408 |
\else\ifdim\pgf@x<-0.05pt |
| 409 |
\def\tikzext@autooffset@angle{-90}% |
| 410 |
\ifdim\pgf@y>0.05pt |
| 411 |
\def\tikz@anchor{south west}% |
| 412 |
\else\ifdim\pgf@y<-0.05pt |
| 413 |
\def\tikz@anchor{south east}% |
| 414 |
\fi\fi |
| 415 |
\else |
| 416 |
\ifdim\pgf@y>0pt |
| 417 |
\def\tikz@anchor{east}% |
| 418 |
\else |
| 419 |
\def\tikz@anchor{west}% |
| 420 |
\fi |
| 421 |
\fi\fi |
| 422 |
\fi |
| 423 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 424 |
\tikzext@auto@post |
| 425 |
\tikzext@auto@offset@B{\tikzext@autooffset@angle}% |
| 426 |
} |
| 427 |
\pgfutil@namedef{tikz@auto@anchor@ext/north@precise}{% |
| 428 |
\tikz@auto@pre |
| 429 |
\edef\tikz@temp{% |
| 430 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 431 |
\tikz@temp |
| 432 |
\ifdim\pgf@x<0pt |
| 433 |
\pgfmathadd@{\pgfmathresult}{90}% |
| 434 |
\def\tikzext@autooffset@angle{-90}% |
| 435 |
\else |
| 436 |
\pgfmathadd@{\pgfmathresult}{-90}% |
| 437 |
\def\tikzext@autooffset@angle{90}% |
| 438 |
\fi |
| 439 |
\let\tikz@anchor\pgfmathresult |
| 440 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 441 |
\tikz@auto@post |
| 442 |
\tikzext@auto@offset@B@precise |
| 443 |
} |
| 444 |
|
| 445 |
% auto: South (always below the line) |
| 446 |
\pgfutil@namedef{tikz@auto@anchor@ext/south}{% |
| 447 |
\tikzext@auto@pre |
| 448 |
\def\tikz@anchor{north}% |
| 449 |
\def\tikzext@autooffset@angle{-90}% |
| 450 |
\iftikzext@allowupsidedownattime |
| 451 |
\ifdim\tikzext@unslopedx<0pt |
| 452 |
\def\tikzext@autooffset@angle{90}% |
| 453 |
\def\tikz@anchor{south}% |
| 454 |
\fi |
| 455 |
\else |
| 456 |
\ifdim\pgf@x>0.05pt |
| 457 |
\ifdim\pgf@y>0.05pt |
| 458 |
\def\tikz@anchor{north west}% |
| 459 |
\else\ifdim\pgf@y<-0.05pt |
| 460 |
\def\tikz@anchor{north east}% |
| 461 |
\fi\fi |
| 462 |
\else\ifdim\pgf@x<-0.05pt |
| 463 |
\def\tikzext@autooffset@angle{90}% |
| 464 |
\ifdim\pgf@y>0.05pt |
| 465 |
\def\tikz@anchor{north east}% |
| 466 |
\else\ifdim\pgf@y<-0.05pt |
| 467 |
\def\tikz@anchor{north west}% |
| 468 |
\fi\fi |
| 469 |
\else |
| 470 |
\ifdim\pgf@y>0pt |
| 471 |
\def\tikz@anchor{west}% |
| 472 |
\else |
| 473 |
\def\tikz@anchor{east}% |
| 474 |
\fi |
| 475 |
\fi\fi |
| 476 |
\fi |
| 477 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 478 |
\tikzext@auto@post |
| 479 |
\tikzext@auto@offset@B{\tikzext@autooffset@angle}% |
| 480 |
} |
| 481 |
\pgfutil@namedef{tikz@auto@anchor@ext/south@precise}{% |
| 482 |
\tikz@auto@pre |
| 483 |
\edef\tikz@temp{% |
| 484 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 485 |
\tikz@temp |
| 486 |
\ifdim\pgf@x<0pt |
| 487 |
\pgfmathadd@{\pgfmathresult}{-90}% |
| 488 |
\def\tikzext@autooffset@angle{90}% |
| 489 |
\else |
| 490 |
\pgfmathadd@{\pgfmathresult}{90}% |
| 491 |
\def\tikzext@autooffset@angle{-90}% |
| 492 |
\fi |
| 493 |
\let\tikz@anchor\pgfmathresult |
| 494 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 495 |
\tikz@auto@post |
| 496 |
\tikzext@auto@offset@B@precise |
| 497 |
} |
| 498 |
|
| 499 |
% auto: West (always to the left of the line) |
| 500 |
\pgfutil@namedef{tikz@auto@anchor@ext/west}{% |
| 501 |
\tikzext@auto@pre |
| 502 |
\def\tikz@anchor{east}% |
| 503 |
\def\tikzext@autooffset@angle{90}% |
| 504 |
\iftikzext@slopedattime |
| 505 |
\def\tikz@anchor{south}% |
| 506 |
\iftikzext@allowupsidedownattime |
| 507 |
\ifdim\tikzext@unslopedy<-0.05pt |
| 508 |
\def\tikz@anchor{north}% |
| 509 |
\def\tikzext@autooffset@angle{-90}% |
| 510 |
\fi |
| 511 |
\else |
| 512 |
\ifdim\tikzext@unslopedy>0.05pt |
| 513 |
\ifdim\tikzext@unslopedx<-0.05pt |
| 514 |
\def\tikz@anchor{north}% |
| 515 |
\def\tikzext@autooffset@angle{-90}% |
| 516 |
\fi |
| 517 |
\else |
| 518 |
\ifdim\tikzext@unslopedy<-0.05pt |
| 519 |
\ifdim\tikzext@unslopedx<-0.05pt |
| 520 |
\else |
| 521 |
\def\tikz@anchor{north}% |
| 522 |
\def\tikzext@autooffset@angle{-90}% |
| 523 |
\fi |
| 524 |
\else |
| 525 |
\ifdim\tikzext@unslopedx>0pt |
| 526 |
\else |
| 527 |
\def\tikz@anchor{north}% |
| 528 |
\def\tikzext@autooffset@angle{-90}% |
| 529 |
\fi |
| 530 |
\fi |
| 531 |
\fi |
| 532 |
\fi |
| 533 |
\else |
| 534 |
\ifdim\pgf@y>0.05pt |
| 535 |
\ifdim\pgf@x>0.05pt |
| 536 |
\def\tikz@anchor{south east}% |
| 537 |
\else\ifdim\pgf@x<-0.05pt |
| 538 |
\def\tikz@anchor{north east}% |
| 539 |
\fi\fi |
| 540 |
\else |
| 541 |
\ifdim\pgf@y<-0.05pt |
| 542 |
\def\tikzext@autooffset@angle{-90}% |
| 543 |
\ifdim\pgf@x>0.05pt |
| 544 |
\def\tikz@anchor{north east}% |
| 545 |
\else\ifdim\pgf@x<-0.05pt |
| 546 |
\def\tikz@anchor{south east}% |
| 547 |
\fi\fi |
| 548 |
\else |
| 549 |
\ifdim\pgf@x>0pt |
| 550 |
\def\tikz@anchor{south}% |
| 551 |
\else |
| 552 |
\def\tikz@anchor{north}% |
| 553 |
\fi |
| 554 |
\fi |
| 555 |
\fi |
| 556 |
\fi |
| 557 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 558 |
\tikzext@auto@post |
| 559 |
\tikzext@auto@offset@B{\tikzext@autooffset@angle}% |
| 560 |
} |
| 561 |
|
| 562 |
\pgfutil@namedef{tikz@auto@anchor@ext/west@precise}{% |
| 563 |
\tikz@auto@pre |
| 564 |
\edef\tikz@temp{% |
| 565 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 566 |
\tikz@temp |
| 567 |
\ifdim\pgf@y<0pt |
| 568 |
\pgfmathadd@{\pgfmathresult}{90}% |
| 569 |
\def\tikzext@autooffset@angle{-90}% |
| 570 |
\else |
| 571 |
\pgfmathadd@{\pgfmathresult}{-90}% |
| 572 |
\def\tikzext@autooffset@angle{90}% |
| 573 |
\fi |
| 574 |
\let\tikz@anchor\pgfmathresult |
| 575 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 576 |
\tikz@auto@post |
| 577 |
\tikzext@auto@offset@B@precise |
| 578 |
} |
| 579 |
|
| 580 |
% auto: East (always to the right of the line) |
| 581 |
\pgfutil@namedef{tikz@auto@anchor@ext/east}{% |
| 582 |
\tikzext@auto@pre |
| 583 |
\def\tikz@anchor{west}% |
| 584 |
\def\tikzext@autooffset@angle{-90}% |
| 585 |
\iftikzext@slopedattime |
| 586 |
\def\tikz@anchor{north}% |
| 587 |
\iftikzext@allowupsidedownattime |
| 588 |
\ifdim\tikzext@unslopedy<-0.05pt |
| 589 |
\def\tikz@anchor{south}% |
| 590 |
\def\tikzext@autooffset@angle{90}% |
| 591 |
\fi |
| 592 |
\else |
| 593 |
\ifdim\tikzext@unslopedy>0.05pt |
| 594 |
\ifdim\tikzext@unslopedx<-0.05pt |
| 595 |
\def\tikz@anchor{south}% |
| 596 |
\def\tikzext@autooffset@angle{90}% |
| 597 |
\fi |
| 598 |
\else |
| 599 |
\ifdim\tikzext@unslopedy<-0.05pt |
| 600 |
\ifdim\tikzext@unslopedx<-0.05pt |
| 601 |
\else |
| 602 |
\def\tikz@anchor{south}% |
| 603 |
\def\tikzext@autooffset@angle{90}% |
| 604 |
\fi |
| 605 |
\else |
| 606 |
\ifdim\tikzext@unslopedx>0pt |
| 607 |
\else |
| 608 |
\def\tikz@anchor{south}% |
| 609 |
\def\tikzext@autooffset@angle{90}% |
| 610 |
\fi |
| 611 |
\fi |
| 612 |
\fi |
| 613 |
\fi |
| 614 |
\else |
| 615 |
\ifdim\pgf@y>0.05pt |
| 616 |
\ifdim\pgf@x>0.05pt |
| 617 |
\def\tikz@anchor{north west}% |
| 618 |
\else\ifdim\pgf@x<-0.05pt |
| 619 |
\def\tikz@anchor{south west}% |
| 620 |
\fi\fi |
| 621 |
\else |
| 622 |
\ifdim\pgf@y<-0.05pt |
| 623 |
\ifdim\pgf@x>0.05pt |
| 624 |
\def\tikz@anchor{south west}% |
| 625 |
\else\ifdim\pgf@x<-0.05pt |
| 626 |
\def\tikz@anchor{north west}% |
| 627 |
\fi\fi |
| 628 |
\else |
| 629 |
\ifdim\pgf@x>0pt |
| 630 |
\def\tikz@anchor{north}% |
| 631 |
\else |
| 632 |
\def\tikz@anchor{south}% |
| 633 |
\fi |
| 634 |
\fi |
| 635 |
\fi |
| 636 |
\fi |
| 637 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 638 |
\tikzext@auto@post |
| 639 |
\tikzext@auto@offset@B{\tikzext@autooffset@angle}% |
| 640 |
} |
| 641 |
\pgfutil@namedef{tikz@auto@anchor@ext/east@precise}{% |
| 642 |
\tikz@auto@pre |
| 643 |
\edef\tikz@temp{% |
| 644 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 645 |
\tikz@temp |
| 646 |
\ifdim\pgf@y<0pt |
| 647 |
\pgfmathadd@{\pgfmathresult}{-90}% |
| 648 |
\def\tikzext@autooffset@angle{90}% |
| 649 |
\else |
| 650 |
\pgfmathadd@{\pgfmathresult}{90}% |
| 651 |
\def\tikzext@autooffset@angle{-90}% |
| 652 |
\fi |
| 653 |
\let\tikz@anchor\pgfmathresult |
| 654 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 655 |
\tikz@auto@post |
| 656 |
\tikzext@auto@offset@B@precise |
| 657 |
} |
| 658 |
|
| 659 |
% auto: above (always towards end of line) |
| 660 |
\pgfutil@namedef{tikz@auto@anchor@ext/above}{% |
| 661 |
\tikzext@auto@pre |
| 662 |
\def\tikzext@autooffset@angle{0}% |
| 663 |
\ifdim\pgf@y>0.05pt |
| 664 |
\def\tikz@anchor{south}% |
| 665 |
\ifdim\pgf@x>0.05pt |
| 666 |
\def\tikz@anchor{south west}% |
| 667 |
\else\ifdim\pgf@x<-0.05pt |
| 668 |
\def\tikz@anchor{south east}% |
| 669 |
\fi\fi |
| 670 |
\else |
| 671 |
\ifdim\pgf@y<-0.05pt |
| 672 |
\def\tikz@anchor{north}% |
| 673 |
\ifdim\pgf@x>0.05pt |
| 674 |
\def\tikz@anchor{north west}% |
| 675 |
\else\ifdim\pgf@x<-0.05pt |
| 676 |
\def\tikz@anchor{north east}% |
| 677 |
\fi\fi |
| 678 |
\else |
| 679 |
\ifdim\pgf@x>0pt |
| 680 |
\def\tikz@anchor{west}% |
| 681 |
\else |
| 682 |
\def\tikz@anchor{east}% |
| 683 |
\fi |
| 684 |
\fi |
| 685 |
\fi |
| 686 |
\iftikzext@allowupsidedownattime |
| 687 |
\else |
| 688 |
\iftikzext@slopedattime |
| 689 |
\ifdim\tikzext@unslopedx<-0.05pt |
| 690 |
\def\tikz@anchor{east}% |
| 691 |
\def\tikzext@autooffset@angle{180}% |
| 692 |
\fi |
| 693 |
\fi |
| 694 |
\fi |
| 695 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 696 |
\tikzext@auto@post |
| 697 |
\tikzext@auto@offset@B{\tikzext@autooffset@angle}% |
| 698 |
} |
| 699 |
\pgfutil@namedef{tikz@auto@anchor@ext/above@precise}{% |
| 700 |
\tikz@auto@pre |
| 701 |
\edef\tikz@temp{% |
| 702 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 703 |
\tikz@temp |
| 704 |
\pgfmathadd@{\pgfmathresult}{180}% |
| 705 |
\let\tikz@anchor\pgfmathresult |
| 706 |
\tikzext@auto@offset@A{0}% |
| 707 |
\tikz@auto@post |
| 708 |
\tikzext@auto@offset@B@precise |
| 709 |
} |
| 710 |
|
| 711 |
% auto: below (always towards the start of the line) |
| 712 |
\pgfutil@namedef{tikz@auto@anchor@ext/below}{% |
| 713 |
\tikzext@auto@pre |
| 714 |
\def\tikzext@autooffset@angle{180}% |
| 715 |
\ifdim\pgf@y>0.05pt |
| 716 |
\def\tikz@anchor{north}% |
| 717 |
\ifdim\pgf@x>0.05pt |
| 718 |
\def\tikz@anchor{north east}% |
| 719 |
\else\ifdim\pgf@x<-0.05pt |
| 720 |
\def\tikz@anchor{north west}% |
| 721 |
\fi\fi |
| 722 |
\else |
| 723 |
\ifdim\pgf@y<-0.05pt |
| 724 |
\def\tikz@anchor{south}% |
| 725 |
\ifdim\pgf@x>0.05pt |
| 726 |
\def\tikz@anchor{south east}% |
| 727 |
\else\ifdim\pgf@x<-0.05pt |
| 728 |
\def\tikz@anchor{south west}% |
| 729 |
\fi\fi |
| 730 |
\else |
| 731 |
\ifdim\pgf@x>0pt |
| 732 |
\def\tikz@anchor{east}% |
| 733 |
\else |
| 734 |
\def\tikz@anchor{west}% |
| 735 |
\fi |
| 736 |
\fi |
| 737 |
\fi |
| 738 |
\iftikzext@allowupsidedownattime |
| 739 |
\else |
| 740 |
\iftikzext@slopedattime |
| 741 |
\ifdim\tikzext@unslopedx<-0.05pt |
| 742 |
\def\tikz@anchor{west}% |
| 743 |
\def\tikzext@autooffset@angle{0}% |
| 744 |
\fi |
| 745 |
\fi |
| 746 |
\fi |
| 747 |
\tikzext@auto@offset@A{\tikzext@autooffset@angle}% |
| 748 |
\tikzext@auto@post |
| 749 |
\tikzext@auto@offset@B{\tikzext@autooffset@angle}% |
| 750 |
} |
| 751 |
\pgfutil@namedef{tikz@auto@anchor@ext/below@precise}{% |
| 752 |
\tikz@auto@pre |
| 753 |
\edef\tikz@temp{% |
| 754 |
\noexpand\pgfmathatantwo@{\pgf@sys@tonumber\pgf@y}{\pgf@sys@tonumber\pgf@x}}% |
| 755 |
\tikz@temp |
| 756 |
\let\tikz@anchor\pgfmathresult |
| 757 |
\tikzext@auto@offset@A{180}% |
| 758 |
\tikz@auto@post |
| 759 |
\tikzext@auto@offset@B@precise |
| 760 |
} |
| 761 |
|
| 762 |
%%% Compatibility |
| 763 |
\tikzextset{ |
| 764 |
/tikz-ext/compat/add library={nodes}{pre 0.6}, |
| 765 |
compat/nodes/warn/.append code=% |
| 766 |
% \pgfkeyssetvalue{/tikz/ext/compat/nodes@}{3}% |
| 767 |
\tikzextutil@compatwarning@key{nodes}{pre 0.6}{/tikz/pic} [true]{/tikz/ext/pic}% |
| 768 |
\tikzextutil@compatwarning@key{nodes}{pre 0.6}{/tikz/node on line} [] {/tikz/ext/node on line}% |
| 769 |
\tikzextutil@compatwarning@key{nodes}{pre 0.6}{/tikz/nodes on line} {/tikz/ext/nodes on line}% |
| 770 |
\tikzextutil@compatwarning@key{nodes}{pre 0.6}{/tikz/nodes on curve} [] {/tikz/ext/nodes on curve}% |
| 771 |
\tikzextutil@compatwarning@key{nodes}{pre 0.6}{/tikz/nodes on curve'}[] {/tikz/ext/nodes on curve'}, |
| 772 |
compat/nodes/pre 0.6/.append code=% |
| 773 |
% \pgfkeyssetvalue{/tikz/ext/compat/nodes@}{2}% |
| 774 |
\pgfkeysdef{/tikz/pic} {\pgfkeysvalueof{/tikz/ext/pic/.@cmd}##1\pgfeov}% |
| 775 |
\pgfkeysdef{/tikz/node on line} {\pgfkeysvalueof{/tikz/ext/node on line/.@cmd}##1\pgfeov}% |
| 776 |
\pgfkeysdef{/tikz/nodes on line} {\pgfkeysvalueof{/tikz/ext/nodes on line/.@cmd}##1\pgfeov}% |
| 777 |
\pgfkeysdef{/tikz/nodes on curve} {\pgfkeysvalueof{/tikz/ext/nodes on curve/.@cmd}##1\pgfeov}% |
| 778 |
\pgfkeysdef{/tikz/nodes on curve'}{\pgfkeysvalueof{/tikz/ext/nodes on curve'/.@cmd}##1\pgfeov}% |
| 779 |
\pgfkeyssetvalue{/tikz/pic/.@def}{true}% |
| 780 |
\pgfkeyssetvalue{/tikz/node on line/.@def}{}% |
| 781 |
\pgfkeyssetvalue{/tikz/nodes on curve/.@def}{}% |
| 782 |
\pgfkeyssetvalue{/tikz/nodes on curve'/.@def}{}, |
| 783 |
% compat/nodes/0.6/.append code=\pgfkeyssetvalue{/tikz/ext/compat/nodes@}{1}, |
| 784 |
% compat/nodes/newest/.append code=\pgfkeyssetvalue{/tikz/ext/compat/nodes@}{0}, |
| 785 |
compat/nodes/\pgfkeysvalueof{/tikz/ext/compat/nodes}% |
| 786 |
} |
| 787 |
\endinput |