| 1 |
% Copyright 2019 by Till Tantau |
| 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 Public License. |
| 7 |
% |
| 8 |
% See the file doc/generic/pgf/licenses/LICENSE for more details. |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
% Guard against reading twice |
| 13 |
\ifx\pgfsysanimationsloaded\pgfutil@undefined |
| 14 |
\let\pgfsysanimationsloaded=\relax |
| 15 |
\else |
| 16 |
\expandafter\endinput |
| 17 |
\fi |
| 18 |
|
| 19 |
|
| 20 |
% We need some support: |
| 21 |
\usepgfmodule{decorations} |
| 22 |
|
| 23 |
|
| 24 |
% Animation abstraction layer |
| 25 |
% |
| 26 |
% This layer provides an abstraction of the |
| 27 |
% \pgfsys@anim... commands. The idea is to provide an interface that |
| 28 |
% can map animation commands either to "real" animations (for instance |
| 29 |
% in the sense of SVG) or to "snapshots" of animations, which are |
| 30 |
% especially useful for printing. For these snapshots, instead of |
| 31 |
% adding an animation property to a scope, the property is actually |
| 32 |
% set to a certain value computed by \TeX. |
| 33 |
% |
| 34 |
% For each \pgfsys@animation@... command there is a corresponding |
| 35 |
% \pgfsysanim command. |
| 36 |
|
| 37 |
|
| 38 |
% Set the current time to a snapshot time |
| 39 |
% |
| 40 |
% #1 = a global snapshot time (a dimensionless number, measured in |
| 41 |
% seconds). |
| 42 |
% |
| 43 |
% Description: |
| 44 |
% |
| 45 |
% When this command is used in a scope, instead of creating an |
| 46 |
% animation, pgf will insert appropriate commands that show the state |
| 47 |
% of the animation at the given time. |
| 48 |
% |
| 49 |
% The value #1 can be thought of as the "global time", which can be |
| 50 |
% thought of as the time that elapsed since the "onload" event. |
| 51 |
% |
| 52 |
% The command \pgfsysanimsnapshotafter works the same way as |
| 53 |
% pgfsysanimsnapshot, only the time #1 is interpreted as "global time |
| 54 |
% #1 + epsilon". This means that when two or more values are specified |
| 55 |
% for time #1, the last of them is used rather than the |
| 56 |
% first. Likewise, when a non-freezing timeline ends at time #1, |
| 57 |
% \pgfsysanimsnapshot will set the value to the last value in the |
| 58 |
% timeline, while \pgfsysanimsnapshotafter removes the animation. |
| 59 |
% |
| 60 |
% The following commands and effect for animations are ignored / not |
| 61 |
% implemented for snapshots (meaning that even if the "real" animation |
| 62 |
% would look in a certain way because of one of the following commands |
| 63 |
% or effects, the snapshot will not reflect this): |
| 64 |
% |
| 65 |
% - Events and restarts are ignored. For the snapshot, all animations |
| 66 |
% start at global time 0, except if the command |
| 67 |
% \pgfsysanimkeysnapshotstart is used to specify a different |
| 68 |
% start for a specific animation. |
| 69 |
% - The "current value" as starting value (pgf has no real chance of |
| 70 |
% determining the correct value of this). Using this with a snapshot |
| 71 |
% will raise an error. |
| 72 |
% |
| 73 |
% Example: |
| 74 |
% |
| 75 |
% { |
| 76 |
% \pgfsyssnapshot{2}% |
| 77 |
% \pgfsysanimkeytime{0}{1}{1}{0}{0} |
| 78 |
% \pgfsysanimvalscalar{1} |
| 79 |
% \pgfsysanimkeytime{5}{1}{1}{0}{0} |
| 80 |
% \pgfsysanimvalscalar{0} |
| 81 |
% \pgfsysanimkeywhom{\someid}{} |
| 82 |
% \pgfsysanimate{fillopacity}% |
| 83 |
% % Will set the opacity of \someid to 0.6 |
| 84 |
% } |
| 85 |
|
| 86 |
\def\pgfsysanimsnapshot#1{% |
| 87 |
\def\pgfsysanim@snaptime{#1}% |
| 88 |
\pgfsysanim@snap@firsttrue% |
| 89 |
\pgfsysanim@is@snaptrue% |
| 90 |
} |
| 91 |
\def\pgfsysanimsnapshotafter#1{% |
| 92 |
\def\pgfsysanim@snaptime{#1}% |
| 93 |
\pgfsysanim@snap@firstfalse% |
| 94 |
\pgfsysanim@is@snaptrue% |
| 95 |
} |
| 96 |
\newif\ifpgfsysanim@is@snap |
| 97 |
\newif\ifpgfsysanim@snap@first |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
% Companion for \pgfsys@animate |
| 102 |
% |
| 103 |
% #1 = attribute |
| 104 |
% |
| 105 |
% Description: |
| 106 |
% |
| 107 |
% If not snapshot is set, \pgfsys@animate is simply called. Otherwise, |
| 108 |
% appropriate code is generated that sets the specified attribute of |
| 109 |
% the whom object to the value it would have during the animation at |
| 110 |
% the moment of the snapshot. |
| 111 |
|
| 112 |
\def\pgfsysanimate#1{% |
| 113 |
\csname pgfsysanim@checks@#1\endcsname% |
| 114 |
\ifpgfsysanim@is@snap% |
| 115 |
\pgfsysanim@do@snap{#1}% |
| 116 |
\else% |
| 117 |
\pgfsys@animate{#1}% |
| 118 |
\fi% |
| 119 |
} |
| 120 |
|
| 121 |
\def\pgfsysanim@do@snap#1{% |
| 122 |
{% |
| 123 |
\expandafter\ifx\csname pgfsysanim@prep@attr@#1\endcsname\pgfutil@undefined% |
| 124 |
\else% |
| 125 |
% First, compute time frame: |
| 126 |
\pgfsysanim@compute@interval% |
| 127 |
% Second, compute code: |
| 128 |
\let\pgfsysanim@code@begin\relax% |
| 129 |
\let\pgfsysanim@code@end\pgfutil@empty% |
| 130 |
\csname pgfsysanim@prep@attr@#1\endcsname% |
| 131 |
\ifx\pgfsysanim@code@begin\relax% |
| 132 |
\else% |
| 133 |
% Attach to object: |
| 134 |
\expandafter\expandafter\expandafter\pgfsysanim@call@attacher% |
| 135 |
\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@code@begin\expandafter}\expandafter{\pgfsysanim@code@end}{}% |
| 136 |
\fi% |
| 137 |
\fi% |
| 138 |
}% |
| 139 |
} |
| 140 |
\def\pgfsysanim@call@attacher{\pgfsys@attach@to@id{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}} |
| 141 |
|
| 142 |
|
| 143 |
% Do some checks: |
| 144 |
\def\pgfsysanim@checks@path{% |
| 145 |
\expandafter\global\expandafter\let\csname pgfsysanim@path@is@animated@\pgfsysanim@whom@id @\pgfsysanim@whom@type\endcsname\pgfutil@empty% |
| 146 |
} |
| 147 |
|
| 148 |
|
| 149 |
% Companions for \pgfsys@animation@restart@... |
| 150 |
% |
| 151 |
% Description: |
| 152 |
% |
| 153 |
% These commands just call \pgfsys@animation@restart@... and they are |
| 154 |
% *ignored* when it comes to snapshots. |
| 155 |
|
| 156 |
\def\pgfsysanimkeyrestartalways{\pgfsys@animation@restart@always} |
| 157 |
\def\pgfsysanimkeyrestartnever{\pgfsys@animation@restart@never} |
| 158 |
\def\pgfsysanimkeyrestartwhennotactive{\pgfsys@animation@restart@whennotactive} |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
% Companions for \pgfsys@animation@repeat... |
| 163 |
% |
| 164 |
% Description: |
| 165 |
% |
| 166 |
% These commands call \pgfsys@animation@repeat... and, if there is a |
| 167 |
% snapshot installed, the passed values are taken into consideration. |
| 168 |
|
| 169 |
\def\pgfsysanimkeyrepeat#1{% |
| 170 |
\pgfsys@animation@repeat{#1}% |
| 171 |
% Snapshot |
| 172 |
\let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@normal% |
| 173 |
{% |
| 174 |
\pgf@x#1pt\relax% |
| 175 |
\expandafter}% |
| 176 |
\expandafter\def\expandafter\pgfsysanim@snap@repeat@arg\expandafter{\the\pgf@x}% |
| 177 |
} |
| 178 |
\def\pgfsysanimkeyrepeatindefinite{% |
| 179 |
\pgfsys@animation@repeat@indefinite% |
| 180 |
% Snapshot |
| 181 |
\let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@indefinite% |
| 182 |
\let\pgfsysanim@snap@repeat@arg\pgfutil@empty% |
| 183 |
} |
| 184 |
\def\pgfsysanimkeyrepeatdur#1{% |
| 185 |
\pgfsys@animation@repeat@dur{#1}% |
| 186 |
% Snapshot |
| 187 |
\let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@dur% |
| 188 |
{% |
| 189 |
\pgf@x#1pt\relax% |
| 190 |
\expandafter}% |
| 191 |
\expandafter\def\expandafter\pgfsysanim@snap@repeat@arg\expandafter{\the\pgf@x}% |
| 192 |
} |
| 193 |
\def\pgfsysanim@snap@repeat@none{n}% |
| 194 |
\def\pgfsysanim@snap@repeat@normal{m}% |
| 195 |
\def\pgfsysanim@snap@repeat@indefinite{i}% |
| 196 |
\def\pgfsysanim@snap@repeat@dur{d}% |
| 197 |
\let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@none |
| 198 |
\let\pgfsysanim@snap@repeat@arg\pgfutil@empty |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
% Companions for \pgfsys@animation@freezeatend and |
| 203 |
% \pgfsys@animation@removeatend |
| 204 |
% |
| 205 |
% Description: |
| 206 |
% |
| 207 |
% These commands call the two system commands and, if there is a |
| 208 |
% snapshot installed, the settings are taken into consideration. |
| 209 |
|
| 210 |
\def\pgfsysanimkeyfreezeatend{\pgfsys@animation@freezeatend\pgfsysanim@freezeatendtrue} |
| 211 |
\def\pgfsysanimkeyremoveatend{\pgfsys@animation@removeatend\pgfsysanim@freezeatendfalse} |
| 212 |
\newif\ifpgfsysanim@freezeatend |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
% Companion for \pgfsys@animation@time |
| 217 |
% |
| 218 |
% #1 to #5 = as in \pgfsys@animation@time |
| 219 |
% |
| 220 |
% Description: |
| 221 |
% |
| 222 |
% Calls \pgfsys@animation@time. Furthermore, the specified times are |
| 223 |
% recorded so that they can later be analysed for the computation |
| 224 |
% needed for a snapshot. |
| 225 |
|
| 226 |
\def\pgfsysanimkeytime#1#2#3#4#5{% |
| 227 |
% Setup animation |
| 228 |
\pgfsys@animation@time{#1}{#2}{#3}{#4}{#5}% |
| 229 |
% and remember for snapshots |
| 230 |
\def\pgfsysanim@time{{#1}{#2}{#3}{#4}{#5}}% |
| 231 |
} |
| 232 |
|
| 233 |
|
| 234 |
% Sets the base value |
| 235 |
% |
| 236 |
% Description: |
| 237 |
% |
| 238 |
% This will set the "base" value for an animation, which is installed |
| 239 |
% prior to any animation of the attribute. |
| 240 |
|
| 241 |
\def\pgfsysanimkeybase{% |
| 242 |
\pgfsys@animation@base% |
| 243 |
\let\pgfsysanim@time\pgfsysanim@base@text% |
| 244 |
} |
| 245 |
\def\pgfsysanim@base@text{base}% |
| 246 |
|
| 247 |
% Sets the beginning of the timeline for snapshots |
| 248 |
% |
| 249 |
% #1 = a time (a scalar) |
| 250 |
% |
| 251 |
% Description: |
| 252 |
% |
| 253 |
% Sets the start of current animation to #1 for snapshots. For |
| 254 |
% instance, if #1 is 5 (=five seconds), and you say |
| 255 |
% \pgfsysanimsnapshot{6}, the attribute will be set to whatever the |
| 256 |
% animation specifies after one second. |
| 257 |
|
| 258 |
\def\pgfsysanimkeysnapshotstart#1{% |
| 259 |
\def\pgfsysanim@snapshotstart{#1}% |
| 260 |
} |
| 261 |
\def\pgfsysanim@snapshotstart{0} |
| 262 |
|
| 263 |
|
| 264 |
% Companion for \pgfsys@animation@offset |
| 265 |
% |
| 266 |
% #1, #2 = as in \pgfsys@animation@offset |
| 267 |
% |
| 268 |
% Description: |
| 269 |
% |
| 270 |
% Calls \pgfsys@animation@offset. |
| 271 |
|
| 272 |
\def\pgfsysanimkeyoffset#1#2{% |
| 273 |
\pgfsys@animation@offset{#1}{#2}% |
| 274 |
} |
| 275 |
|
| 276 |
|
| 277 |
% Companion for \pgfsys@animation@sync(begin|end) |
| 278 |
% |
| 279 |
% #1 to #4 = as in \pgfsys@animation@sync(begin|end) |
| 280 |
% |
| 281 |
% Description: |
| 282 |
% |
| 283 |
% Calls \pgfsys@animation@sync(begin|end). |
| 284 |
|
| 285 |
\def\pgfsysanimkeysyncbegin#1#2#3#4{% |
| 286 |
\pgfsys@animation@syncbegin{#1}{#2}{#3}{#4}% |
| 287 |
} |
| 288 |
|
| 289 |
\def\pgfsysanimkeysyncend#1#2#3#4{% |
| 290 |
\pgfsys@animation@syncend{#1}{#2}{#3}{#4}% |
| 291 |
} |
| 292 |
|
| 293 |
|
| 294 |
% Companion for \pgfsys@animation@event |
| 295 |
% |
| 296 |
% #1 to #5 = as in \pgfsys@animation@event |
| 297 |
% |
| 298 |
% Description: |
| 299 |
% |
| 300 |
% Calls \pgfsys@animation@event. |
| 301 |
|
| 302 |
\def\pgfsysanimkeyevent#1#2#3#4#5{% |
| 303 |
\pgfsys@animation@event{#1}{#2}{#3}{#4}{#5}% |
| 304 |
} |
| 305 |
|
| 306 |
|
| 307 |
% Companion for \pgfsys@animation@repeat@event |
| 308 |
% |
| 309 |
% #1 to #5 = as in \pgfsys@animation@repeat@event |
| 310 |
% |
| 311 |
% Description: |
| 312 |
% |
| 313 |
% Calls \pgfsys@animation@repeat@event. |
| 314 |
|
| 315 |
\def\pgfsysanimkeyrepeatevent#1#2#3#4#5{% |
| 316 |
\pgfsys@animation@repeat@event{#1}{#2}{#3}{#4}{#5}% |
| 317 |
} |
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
% Companion for \pgfsys@animation@accesskey |
| 322 |
% |
| 323 |
% #1 to #3 = as in \pgfsys@animation@accesskey |
| 324 |
% |
| 325 |
% Description: |
| 326 |
% |
| 327 |
% Calls \pgfsys@animation@accesskey. |
| 328 |
|
| 329 |
\def\pgfsysanimkeyaccesskey#1#2#3{% |
| 330 |
\pgfsys@animation@accesskey{#1}{#2}{#3}% |
| 331 |
} |
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
% Companions for \pgfsys@animation@(no)accumulate |
| 337 |
% |
| 338 |
% Description: |
| 339 |
% |
| 340 |
% Calls \pgfsys@animation@(no)accumulate and records the setting for |
| 341 |
% snapshots. |
| 342 |
|
| 343 |
\def\pgfsysanimkeyaccumulate{\pgfsys@animation@accumulate\pgfsysanim@accumulatetrue} |
| 344 |
\def\pgfsysanimkeynoaccumulate{\pgfsys@animation@noaccumulate\pgfsysanim@accumulatefalse} |
| 345 |
\newif\ifpgfsysanim@accumulate |
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
% Companion for \pgfsys@animation@whom |
| 351 |
% |
| 352 |
% #1 and #2 = as for \pgfsys@animation@whom |
| 353 |
% |
| 354 |
% Description: |
| 355 |
% |
| 356 |
% Calls \pgfsys@animation@whom and records the setting for snapshots. |
| 357 |
|
| 358 |
\def\pgfsysanimkeywhom#1#2{% |
| 359 |
\pgfsys@register@type{#2}% |
| 360 |
\pgfsys@animation@whom{#1}{#2}% |
| 361 |
% Snapshots |
| 362 |
\def\pgfsysanim@whom@id{#1}% |
| 363 |
\def\pgfsysanim@whom@type{#2}% |
| 364 |
} |
| 365 |
|
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
% Companions for \pgfsys@animation@rotatealong and |
| 371 |
% \pgfsys@animation@norotatealong |
| 372 |
% |
| 373 |
% Description: |
| 374 |
% |
| 375 |
% Calls the system layer command and records the setting for |
| 376 |
% snapshots. |
| 377 |
|
| 378 |
\def\pgfsysanimkeyrotatealong{\pgfsys@animation@rotatealong\pgfsysanim@rotatealongtrue} |
| 379 |
\def\pgfsysanimkeynorotatealong{\pgfsys@animation@norotatealong\pgfsysanim@rotatealongfalse} |
| 380 |
\newif\ifpgfsysanim@rotatealong |
| 381 |
|
| 382 |
|
| 383 |
% Companion for \pgfsys@animation@movealong |
| 384 |
% |
| 385 |
% #1 = the path |
| 386 |
% |
| 387 |
% Description: |
| 388 |
% |
| 389 |
% Calls the system layer command and records the setting for |
| 390 |
% snapshots. |
| 391 |
|
| 392 |
\def\pgfsysanimkeymovealong#1{% |
| 393 |
\pgfsys@animation@movealong{#1}% |
| 394 |
% Snapshot |
| 395 |
\def\pgfsysanim@snap@movealong{#1}% |
| 396 |
} |
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
% Companion for \pgfsys@animation@tip@markers |
| 402 |
% |
| 403 |
% #1, #2 = the markers |
| 404 |
% |
| 405 |
% Description: |
| 406 |
% |
| 407 |
% Calls the system layer command and records the setting for |
| 408 |
% snapshots. |
| 409 |
|
| 410 |
\def\pgfsysanimkeytipmarkers#1#2{% |
| 411 |
\pgfsys@animation@tip@markers{#1}{#2}% |
| 412 |
% Snapshot |
| 413 |
\def\pgfsysanim@snap@tip@start{#1}% |
| 414 |
\def\pgfsysanim@snap@tip@end{#2}% |
| 415 |
} |
| 416 |
\let\pgfsysanim@snap@tip@start\pgfutil@empty% |
| 417 |
\let\pgfsysanim@snap@tip@end\pgfutil@empty% |
| 418 |
|
| 419 |
|
| 420 |
% Companion for \pgfsys@animation@canvas@transform |
| 421 |
% |
| 422 |
% Description: |
| 423 |
% |
| 424 |
% Calls the system layer command and records the setting for |
| 425 |
% snapshots. |
| 426 |
|
| 427 |
\def\pgfsysanimkeycanvastransform#1#2{% |
| 428 |
\pgfsys@animation@canvas@transform{#1}{#2}% |
| 429 |
% Snapshot |
| 430 |
\def\pgfsysanim@snap@canvas@transform@pre{#1}% |
| 431 |
\def\pgfsysanim@snap@canvas@transform@post{#2}% |
| 432 |
} |
| 433 |
\let\pgfsysanim@snap@canvas@transform@pre\relax |
| 434 |
\let\pgfsysanim@snap@canvas@transform@post\relax |
| 435 |
|
| 436 |
|
| 437 |
|
| 438 |
% Companion for \pgfsys@animation@val@current |
| 439 |
% |
| 440 |
% Description: |
| 441 |
% |
| 442 |
% Calls the system layer command. If a snapshot is currently active, |
| 443 |
% an error results. |
| 444 |
|
| 445 |
\def\pgfsysanimvalcurrent{% |
| 446 |
\pgfsys@animation@val@current% |
| 447 |
\ifpgfsysanim@is@snap% |
| 448 |
\pgferror{You may not use "current value" with an animation snapshot}% |
| 449 |
\fi% |
| 450 |
} |
| 451 |
|
| 452 |
|
| 453 |
% Suppresses the animation value |
| 454 |
% |
| 455 |
% Description: |
| 456 |
% |
| 457 |
% The animation value is simply ignored. |
| 458 |
|
| 459 |
\def\pgfsysanimvalnone{% |
| 460 |
} |
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
% Companion for \pgfsys@animation@val@text |
| 465 |
% |
| 466 |
% #1 = as for \pgfsys@animation@val@text |
| 467 |
% |
| 468 |
% Description: |
| 469 |
% |
| 470 |
% Calls the system layer command. If a snapshot is currently active, |
| 471 |
% the value is recorded in the timeline. |
| 472 |
|
| 473 |
\def\pgfsysanimvaltext#1{% |
| 474 |
\pgfsys@animation@val@text{#1}% |
| 475 |
\ifpgfsysanim@is@snap% |
| 476 |
\pgfsysanim@esnap@record{#1}% |
| 477 |
\fi% |
| 478 |
} |
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
% Companion for \pgfsys@animation@val@scalar |
| 484 |
% |
| 485 |
% #1 = as for \pgfsys@animation@val@scalar |
| 486 |
% |
| 487 |
% Description: |
| 488 |
% |
| 489 |
% Calls the system layer command. If a snapshot is currently active, |
| 490 |
% the value is recorded in the timeline. |
| 491 |
|
| 492 |
\def\pgfsysanimvalscalar#1{% |
| 493 |
\pgfsys@animation@val@scalar{#1}% |
| 494 |
\ifpgfsysanim@is@snap% |
| 495 |
\pgfsysanim@esnap@record{#1}% |
| 496 |
\fi% |
| 497 |
} |
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
% Companion for \pgfsys@animation@val@dimension |
| 502 |
% |
| 503 |
% #1 = as for \pgfsys@animation@val@dimension |
| 504 |
% |
| 505 |
% Description: |
| 506 |
% |
| 507 |
% Calls the system layer command. If a snapshot is currently active, |
| 508 |
% the value is recorded in the timeline. |
| 509 |
|
| 510 |
\def\pgfsysanimvaldimension#1{% |
| 511 |
\pgfsys@animation@val@dimension{#1}% |
| 512 |
\ifpgfsysanim@is@snap% |
| 513 |
\pgfsysanim@esnap@record{#1}% |
| 514 |
\fi% |
| 515 |
} |
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
% Dispatcher for different color values |
| 520 |
% |
| 521 |
% #1 = a color value (like "red" or "black!20") |
| 522 |
% |
| 523 |
% Description: |
| 524 |
% |
| 525 |
% This macro transforms #1 into its correct color model and, then, |
| 526 |
% calls the correct \pgfsysanimcolor... macro. |
| 527 |
|
| 528 |
\def\pgfsysanimvalcolor#1{% |
| 529 |
\pgfutil@colorlet{pgf@anim@temp}{#1}% |
| 530 |
\pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@anim@temp}}% |
| 531 |
\expandafter\let\expandafter\pgf@sys@temp\csname\string\color@pgf@anim@temp\endcsname |
| 532 |
\expandafter\pgfanim@parse@type@color@\pgf@sys@temp% |
| 533 |
} |
| 534 |
\def\pgfanim@parse@type@color@#1#2#3#4#5{% |
| 535 |
\expandafter\ifx\csname pgfsysanimvalcolor#4\endcsname\relax% |
| 536 |
\pgferror{Unsupported color model `#4'}% |
| 537 |
\else% |
| 538 |
\edef\pgf@sys@colmarshal{\expandafter\noexpand\csname pgfsysanimvalcolor#4\endcsname}% |
| 539 |
\pgf@sys@uncomma#5,,% |
| 540 |
\pgf@sys@colmarshal% |
| 541 |
\fi% |
| 542 |
} |
| 543 |
|
| 544 |
\def\pgf@sys@uncomma#1,{% |
| 545 |
\def\pgf@sys@coltest{#1}% |
| 546 |
\ifx\pgf@sys@coltest\pgfutil@empty% |
| 547 |
\else% |
| 548 |
\expandafter\def\expandafter\pgf@sys@colmarshal\expandafter{\pgf@sys@colmarshal{#1}}% |
| 549 |
\expandafter\pgf@sys@uncomma% |
| 550 |
\fi% |
| 551 |
} |
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
% Companion for \pgfsys@animation@val@color@rgb |
| 557 |
% |
| 558 |
% #1, #2, #3 = as for \pgfsys@animation@val@color@rgb |
| 559 |
% |
| 560 |
% Description: |
| 561 |
% |
| 562 |
% Calls the system layer command. If a snapshot is currently active, |
| 563 |
% the value is recorded in the timeline. |
| 564 |
|
| 565 |
\def\pgfsysanimvalcolorrgb#1#2#3{% |
| 566 |
\pgfsys@animation@val@color@rgb{#1}{#2}{#3}% |
| 567 |
\ifpgfsysanim@is@snap% |
| 568 |
\pgfsysanim@esnap@record{{#1}{#2}{#3}}% |
| 569 |
\fi% |
| 570 |
} |
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
% Companion for \pgfsys@animation@val@color@cmyk |
| 575 |
% |
| 576 |
% #1, #2, #3, #4 = as for \pgfsys@animation@val@color@cmyk |
| 577 |
% |
| 578 |
% Description: |
| 579 |
% |
| 580 |
% Calls the system layer command. If a snapshot is currently active, |
| 581 |
% the value is recorded in the timeline. |
| 582 |
|
| 583 |
\def\pgfsysanimvalcolorcmyk#1#2#3#4{% |
| 584 |
\pgfsys@animation@val@color@cmyk{#1}{#2}{#3}{#4}% |
| 585 |
\ifpgfsysanim@is@snap% |
| 586 |
{% |
| 587 |
\pgf@xa=1pt% |
| 588 |
\advance\pgf@xa by-#1pt% |
| 589 |
\advance\pgf@xa by-#4pt\relax% |
| 590 |
\ifdim\pgf@xa<0pt\pgf@xa0pt\fi% |
| 591 |
\pgf@xb=1pt% |
| 592 |
\advance\pgf@xb by-#1pt% |
| 593 |
\advance\pgf@xb by-#4pt\relax% |
| 594 |
\ifdim\pgf@xb<0pt\pgf@xb0pt\fi% |
| 595 |
\pgf@xc=1pt% |
| 596 |
\advance\pgf@xc by-#1pt% |
| 597 |
\advance\pgf@xc by-#4pt\relax% |
| 598 |
\ifdim\pgf@xc<0pt\pgf@xc0pt\fi% |
| 599 |
\edef\pgfsys@temp{{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@xc}}% |
| 600 |
\expandafter}% |
| 601 |
\expandafter\pgfsysanim@esnap@record\expandafter{\pgfsys@temp}% |
| 602 |
\fi% |
| 603 |
} |
| 604 |
|
| 605 |
|
| 606 |
% Companion for \pgfsys@animation@val@color@cmy |
| 607 |
% |
| 608 |
% #1, #2, #3 = as for \pgfsys@animation@val@color@cmy |
| 609 |
% |
| 610 |
% Description: |
| 611 |
% |
| 612 |
% Calls the system layer command. If a snapshot is currently active, |
| 613 |
% the value is recorded in the timeline. |
| 614 |
|
| 615 |
\def\pgfsysanimvalcolorcmy#1#2#3{% |
| 616 |
\pgfsys@animation@val@color@cmy{#1}{#2}{#3}% |
| 617 |
\ifpgfsysanim@is@snap% |
| 618 |
{% |
| 619 |
\pgf@xa=1pt% |
| 620 |
\advance\pgf@xa by-#1pt% |
| 621 |
\pgf@xb=1pt% |
| 622 |
\advance\pgf@xb by-#1pt% |
| 623 |
\pgf@xc=1pt% |
| 624 |
\advance\pgf@xc by-#1pt% |
| 625 |
\edef\pgfsys@temp{{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@xc}}% |
| 626 |
\expandafter}% |
| 627 |
\expandafter\pgfsysanim@esnap@record\expandafter{\pgfsys@temp}% |
| 628 |
\fi% |
| 629 |
} |
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
% Companion for \pgfsys@animation@val@color@gray |
| 634 |
% |
| 635 |
% #1 = as for \pgfsys@animation@val@color@gray |
| 636 |
% |
| 637 |
% Description: |
| 638 |
% |
| 639 |
% Calls the system layer command. If a snapshot is currently active, |
| 640 |
% the value is recorded in the timeline. |
| 641 |
|
| 642 |
\def\pgfsysanimvalcolorgray#1{% |
| 643 |
\pgfsys@animation@val@color@gray{#1}% |
| 644 |
\ifpgfsysanim@is@snap% |
| 645 |
\pgfsysanim@esnap@record{{#1}{#1}{#1}}% |
| 646 |
\fi% |
| 647 |
} |
| 648 |
|
| 649 |
|
| 650 |
|
| 651 |
% Special companion for \pgfsys@animation@val@path |
| 652 |
% |
| 653 |
% #1 = as for \pgfsys@animation@val@path |
| 654 |
% |
| 655 |
% Description: |
| 656 |
% |
| 657 |
% Calls the system layer command. If a snapshot is currently active, |
| 658 |
% the value is recorded in the timeline. |
| 659 |
|
| 660 |
\def\pgfsysanimvalpath#1{% |
| 661 |
\pgfsys@animation@val@path{#1}% |
| 662 |
\ifpgfsysanim@is@snap% |
| 663 |
\pgfsysanim@snap@record{#1}% |
| 664 |
\fi% |
| 665 |
} |
| 666 |
|
| 667 |
|
| 668 |
% Companion for \pgfsys@animation@val@translate |
| 669 |
% |
| 670 |
% #1, #2 = as for \pgfsys@animation@val@translate |
| 671 |
% |
| 672 |
% Description: |
| 673 |
% |
| 674 |
% Calls the system layer command. If a snapshot is currently active, |
| 675 |
% the value is recorded in the timeline. |
| 676 |
|
| 677 |
\def\pgfsysanimvaltranslate#1#2{% |
| 678 |
\pgfsys@animation@val@translate{#1}{#2}% |
| 679 |
\ifpgfsysanim@is@snap% |
| 680 |
\pgfsysanim@esnap@record{{#1}{#2}}% |
| 681 |
\fi% |
| 682 |
} |
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
% Companion for \pgfsys@animation@val@scale |
| 687 |
% |
| 688 |
% #1, #2 = as for \pgfsys@animation@val@scale |
| 689 |
% |
| 690 |
% Description: |
| 691 |
% |
| 692 |
% Calls the system layer command. If a snapshot is currently active, |
| 693 |
% the value is recorded in the timeline. |
| 694 |
|
| 695 |
\def\pgfsysanimvalscale#1#2{% |
| 696 |
\pgfsys@animation@val@scale{#1}{#2}% |
| 697 |
\ifpgfsysanim@is@snap% |
| 698 |
\pgfsysanim@esnap@record{{#1}{#2}}% |
| 699 |
\fi% |
| 700 |
} |
| 701 |
|
| 702 |
|
| 703 |
|
| 704 |
% Companion for \pgfsys@animation@val@viewbox |
| 705 |
% |
| 706 |
% #1, #2, #3, #4 = as for \pgfsys@animation@val@viewbox |
| 707 |
% |
| 708 |
% Description: |
| 709 |
% |
| 710 |
% Calls the system layer command. If a snapshot is currently active, |
| 711 |
% the value is recorded in the timeline. |
| 712 |
|
| 713 |
\def\pgfsysanimvalviewbox#1#2#3#4{% |
| 714 |
\pgfsys@animation@val@viewbox{#1}{#2}{#3}{#4}% |
| 715 |
\ifpgfsysanim@is@snap% |
| 716 |
\pgfsysanim@esnap@record{{#1}{#2}{#3}{#4}}% |
| 717 |
\fi% |
| 718 |
} |
| 719 |
|
| 720 |
|
| 721 |
|
| 722 |
|
| 723 |
% Companion for \pgfsys@animation@val@dash |
| 724 |
% |
| 725 |
% #1, #2 = as for \pgfsys@animation@val@dash |
| 726 |
% |
| 727 |
% Description: |
| 728 |
% |
| 729 |
% Calls the system layer command. If a snapshot is currently active, |
| 730 |
% the value is recorded in the timeline. |
| 731 |
|
| 732 |
\def\pgfsysanimvaldash#1#2{% |
| 733 |
\pgfsys@animation@val@dash{#1}{#2}% |
| 734 |
\ifpgfsysanim@is@snap% |
| 735 |
\pgfsysanim@esnap@record{{#1}{#2}}% |
| 736 |
\fi% |
| 737 |
} |
| 738 |
|
| 739 |
|
| 740 |
|
| 741 |
|
| 742 |
|
| 743 |
% |
| 744 |
% Recording mechanism: We record entries in an array. |
| 745 |
% |
| 746 |
|
| 747 |
\def\pgfsysanim@esnap@record#1{% records a new entry for the timeline |
| 748 |
\edef\pgfsysanim@temp{#1}% |
| 749 |
\expandafter\pgfsysanim@snap@record\expandafter{\pgfsysanim@temp}% |
| 750 |
} |
| 751 |
\def\pgfsysanim@snap@record#1{% records a new entry for the timeline |
| 752 |
\ifx\pgfsysanim@time\pgfsysanim@base@text% |
| 753 |
\def\pgfsysanim@base@value{#1}% |
| 754 |
\else% |
| 755 |
\advance\pgfsysanim@snap@count by1\relax% |
| 756 |
\expandafter\def\expandafter\pgfsysanim@temp\expandafter{\pgfsysanim@time{#1}}% |
| 757 |
\expandafter\let\csname pgfsysanim@snap@\the\pgfsysanim@snap@count\endcsname\pgfsysanim@temp% |
| 758 |
\fi% |
| 759 |
} |
| 760 |
\newcount\pgfsysanim@snap@count |
| 761 |
\let\pgfsysanim@base@value\pgfutil@empty% |
| 762 |
|
| 763 |
|
| 764 |
% Compute the time-value interval of the snapshot: Based on the value of \pgfsysanim@snaptime, |
| 765 |
% computes the interval containing the specified time. This interval |
| 766 |
% will start at \pgfsysanim@prev@time and end at |
| 767 |
% \pgfsysanim@next@time. The values will be \pgfsysanim@prev@val and |
| 768 |
% \pgfsysanim@next@val. |
| 769 |
% |
| 770 |
\def\pgfsysanim@compute@interval{% |
| 771 |
\let\pgfsysanim@prev@val\relax% |
| 772 |
\let\pgfsysanim@prev@time\relax% |
| 773 |
\let\pgfsysanim@prev@spline\pgfsysanim@default@spline% |
| 774 |
\let\pgfsysanim@next@val\relax% |
| 775 |
\let\pgfsysanim@next@time\relax% |
| 776 |
\let\pgfsysanim@next@spline\pgfsysanim@default@spline% |
| 777 |
\let\pgfsysanim@first@time\relax% |
| 778 |
\let\pgfsysanim@last@time\relax% |
| 779 |
\let\pgfsysanim@last@val\relax% |
| 780 |
\ifnum\pgfsysanim@snap@count>0\relax% |
| 781 |
\pgf@xc\pgfsysanim@snaptime pt\relax% |
| 782 |
\pgf@x\pgfsysanim@snapshotstart pt\relax% |
| 783 |
\advance\pgf@xc-\pgf@x\relax% |
| 784 |
% Compute the start and end times: |
| 785 |
\pgfsysanim@compute@start@end% |
| 786 |
\pgfsysanim@compute@value% |
| 787 |
\fi% |
| 788 |
% Test whether a valid interval has been found: |
| 789 |
\pgfsysanim@valid@snapshot@timefalse% |
| 790 |
\ifx\pgfsysanim@prev@time\relax% |
| 791 |
\else\ifx\pgfsysanim@next@time\relax% |
| 792 |
\else\pgfsysanim@valid@snapshot@timetrue% |
| 793 |
\fi\fi% |
| 794 |
\ifpgfsysanim@valid@snapshot@time% |
| 795 |
% ok, computed later |
| 796 |
\else% |
| 797 |
\ifx\pgfsysanim@base@value\pgfutil@empty% |
| 798 |
\else% |
| 799 |
% Ah, use base value! |
| 800 |
\let\pgfsysanim@prev@val\pgfsysanim@base@value% |
| 801 |
\def\pgfsysanim@prev@time{0}% |
| 802 |
\let\pgfsysanim@prev@spline\pgfsysanim@default@spline% |
| 803 |
\let\pgfsysanim@next@val\pgfsysanim@base@value% |
| 804 |
\let\pgfsysanim@next@time\pgfsysanim@prev@time% |
| 805 |
\let\pgfsysanim@next@spline\pgfsysanim@default@spline% |
| 806 |
\def\pgfsysanim@first@time{-16382}% |
| 807 |
\let\pgfsysanim@last@time\pgfsysanim@prev@time% |
| 808 |
\let\pgfsysanim@last@val\pgfsysanim@base@value% |
| 809 |
\def\pgfsysanim@frac@a{1}% |
| 810 |
\def\pgfsysanim@frac@b{0}% |
| 811 |
\pgfsysanim@valid@snapshot@timetrue% counts as valid! |
| 812 |
\fi% |
| 813 |
\fi% |
| 814 |
} |
| 815 |
\newif\ifpgfsysanim@cont% |
| 816 |
\newif\ifpgfsysanim@valid@snapshot@time |
| 817 |
\def\pgfsysanim@default@spline{{0}{0}{1}{1}} |
| 818 |
|
| 819 |
\def\pgfsysanim@compute@start@end{% |
| 820 |
\expandafter\expandafter\expandafter\pgfsysanim@compute@start\csname pgfsysanim@snap@1\endcsname% |
| 821 |
\expandafter\expandafter\expandafter\pgfsysanim@compute@end\csname pgfsysanim@snap@\the\pgfsysanim@snap@count\endcsname% |
| 822 |
} |
| 823 |
\def\pgfsysanim@compute@start#1#2#3#4#5#6{% |
| 824 |
\def\pgfsysanim@first@time{#1}% |
| 825 |
} |
| 826 |
\def\pgfsysanim@compute@end#1#2#3#4#5#6{% |
| 827 |
\def\pgfsysanim@last@time{#1}% |
| 828 |
\def\pgfsysanim@last@val{#6}% |
| 829 |
} |
| 830 |
|
| 831 |
|
| 832 |
\def\pgfsysanim@compute@value{% |
| 833 |
% First, are we before start? |
| 834 |
\ifdim\pgf@xc<\pgfsysanim@first@time pt\relax% |
| 835 |
% snapshot time (xc) is before start of animation. So, nothing happens: |
| 836 |
\else% |
| 837 |
\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@none% |
| 838 |
\pgfsysanim@handle@repeat@none% |
| 839 |
\else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@normal% |
| 840 |
\pgfsysanim@handle@repeat@normal% |
| 841 |
\else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@indefinite% |
| 842 |
\pgfsysanim@handle@repeat@indefinite% |
| 843 |
\else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@dur% |
| 844 |
\pgfsysanim@handle@repeat@dur% |
| 845 |
\fi\fi\fi\fi% |
| 846 |
\fi% |
| 847 |
} |
| 848 |
|
| 849 |
\def\pgfsysanim@handle@repeat@none{% |
| 850 |
\ifdim\pgf@xc<\pgfsysanim@last@time pt\relax% |
| 851 |
\pgfsysanim@compute@time% |
| 852 |
\else% |
| 853 |
\ifdim\pgf@xc=\pgfsysanim@last@time pt\relax% |
| 854 |
% A bit tricky: |
| 855 |
\ifpgfsysanim@snap@first% |
| 856 |
\pgfsysanim@compute@time% |
| 857 |
\else% |
| 858 |
\ifpgfsysanim@freezeatend% |
| 859 |
\let\pgfsysanim@prev@val\pgfsysanim@last@val% |
| 860 |
\let\pgfsysanim@prev@time\pgfsysanim@last@time% |
| 861 |
\let\pgfsysanim@next@val\pgfsysanim@last@val% |
| 862 |
\let\pgfsysanim@next@time\pgfsysanim@last@time% |
| 863 |
\fi% |
| 864 |
\fi% |
| 865 |
\else% |
| 866 |
% Called when we are past the end. |
| 867 |
\ifpgfsysanim@freezeatend% |
| 868 |
\let\pgfsysanim@prev@val\pgfsysanim@last@val% |
| 869 |
\let\pgfsysanim@prev@time\pgfsysanim@last@time% |
| 870 |
\let\pgfsysanim@next@val\pgfsysanim@last@val% |
| 871 |
\let\pgfsysanim@next@time\pgfsysanim@last@time% |
| 872 |
\fi% |
| 873 |
\fi% |
| 874 |
\fi% |
| 875 |
} |
| 876 |
|
| 877 |
|
| 878 |
\def\pgfsysanim@handle@repeat@indefinite{% |
| 879 |
\ifdim\pgf@xc<\pgfsysanim@last@time pt\relax% |
| 880 |
\pgfsysanim@compute@time% |
| 881 |
\else% |
| 882 |
% Compute interval length |
| 883 |
\pgf@xa=\pgfsysanim@last@time pt% |
| 884 |
\pgf@xb=\pgfsysanim@first@time pt% |
| 885 |
\advance\pgf@xa by-\pgf@xb% |
| 886 |
% Compute repeat count and fraction: |
| 887 |
\pgf@ya\pgf@xc% |
| 888 |
\advance\pgf@ya by-\pgf@xb% |
| 889 |
\ifdim\pgf@xa<0.01pt\relax% |
| 890 |
% Interval too small: Goto end of interval |
| 891 |
\def\pgfmathresult{1.0}% |
| 892 |
\else% |
| 893 |
\pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}% |
| 894 |
\fi% |
| 895 |
\pgf@x\pgfmathresult pt\relax% |
| 896 |
\expandafter\pgfsysanim@splitter\the\pgf@x% |
| 897 |
\pgf@xc=\pgfsysanim@repeat@frac\pgf@xa% |
| 898 |
\advance\pgf@xc by\pgf@xb% |
| 899 |
\pgfsysanim@compute@time% |
| 900 |
\fi% |
| 901 |
} |
| 902 |
{\catcode`\p=12\catcode`\t=12\gdef\Pgfsysanim@sPliTTer#1.#2pt{\Pgfsysanim@seTTer{#1}{#2}}} |
| 903 |
\let\pgfsysanim@splitter\Pgfsysanim@sPliTTer |
| 904 |
\def\Pgfsysanim@seTTer#1#2{% |
| 905 |
\def\pgfsysanim@repeat@decimal{#1}% |
| 906 |
\def\pgfsysanim@repeat@frac{.#2}% |
| 907 |
\ifdim\pgfsysanim@repeat@frac pt=0pt% goto one before: |
| 908 |
\c@pgf@counta\pgfsysanim@repeat@decimal% |
| 909 |
\advance\c@pgf@counta by-1\relax% |
| 910 |
\edef\pgfsysanim@repeat@decimal{\the\c@pgf@counta}% |
| 911 |
\def\pgfsysanim@repeat@frac{1}% |
| 912 |
\fi% |
| 913 |
} |
| 914 |
\def\pgfsysanim@repeat@decimal{0}% |
| 915 |
|
| 916 |
|
| 917 |
\def\pgfsysanim@handle@repeat@normal{% |
| 918 |
% Compute interval length |
| 919 |
\pgf@xa=\pgfsysanim@last@time pt% |
| 920 |
\pgf@xb=\pgfsysanim@first@time pt% |
| 921 |
\advance\pgf@xa by-\pgf@xb% |
| 922 |
% Compute repeat count and fraction: |
| 923 |
\pgf@ya\pgf@xc% |
| 924 |
\advance\pgf@ya by-\pgf@xb% |
| 925 |
\ifdim\pgf@xa<0.01pt\relax% |
| 926 |
% Interval too small: Goto end of interval |
| 927 |
\def\pgfmathresult{1.0}% |
| 928 |
\else% |
| 929 |
\pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}% |
| 930 |
\fi% |
| 931 |
\pgf@x\pgfmathresult pt\relax% |
| 932 |
\expandafter\pgfsysanim@splitter\the\pgf@x% |
| 933 |
% Cases: |
| 934 |
\ifdim\pgfmathresult pt<\pgfsysanim@snap@repeat@arg\relax% |
| 935 |
% Ok! Compute! |
| 936 |
\pgf@xc=\pgfsysanim@repeat@frac\pgf@xa% |
| 937 |
\advance\pgf@xc by\pgf@xb% |
| 938 |
\pgfsysanim@compute@time% |
| 939 |
\else% |
| 940 |
% Hmm. Freeze? |
| 941 |
\ifpgfsysanim@freezeatend% |
| 942 |
\expandafter\pgfsysanim@splitter\pgfsysanim@snap@repeat@arg% |
| 943 |
\pgf@xc=\pgfsysanim@repeat@frac\pgf@xa% |
| 944 |
\advance\pgf@xc by\pgf@xb% |
| 945 |
\pgfsysanim@compute@time% |
| 946 |
\else% |
| 947 |
\ifdim\pgfmathresult pt=\pgfsysanim@snap@repeat@arg\relax% |
| 948 |
\ifpgfsysanim@snap@first% |
| 949 |
\expandafter\pgfsysanim@splitter\pgfsysanim@snap@repeat@arg% |
| 950 |
\pgf@xc=\pgfsysanim@repeat@frac\pgf@xa% |
| 951 |
\advance\pgf@xc by\pgf@xb% |
| 952 |
\pgfsysanim@compute@time% |
| 953 |
\fi% |
| 954 |
% else: nothing! |
| 955 |
\fi% |
| 956 |
\fi% |
| 957 |
\fi% |
| 958 |
} |
| 959 |
|
| 960 |
\def\pgfsysanim@handle@repeat@dur{% |
| 961 |
\pgf@yb=\pgfsysanim@first@time pt% |
| 962 |
\advance\pgf@yb by\pgfsysanim@snap@repeat@arg\relax% |
| 963 |
\ifdim\pgf@xc<\pgf@yb% inside interval |
| 964 |
\pgf@xa=\pgfsysanim@last@time pt% |
| 965 |
\pgf@xb=\pgfsysanim@first@time pt% |
| 966 |
\advance\pgf@xa by-\pgf@xb% |
| 967 |
% Compute repeat count and fraction: |
| 968 |
\pgf@ya\pgf@xc% |
| 969 |
\advance\pgf@ya by-\pgf@xb% |
| 970 |
\ifdim\pgf@xa<0.01pt\relax% |
| 971 |
% Interval too small: Goto end of interval |
| 972 |
\def\pgfmathresult{1.0}% |
| 973 |
\else% |
| 974 |
\pgfmathdivide@{\pgf@sys@tonumber\pgf@ya}{\pgf@sys@tonumber\pgf@xa}% |
| 975 |
\fi% |
| 976 |
\pgf@x\pgfmathresult pt\relax% |
| 977 |
\expandafter\pgfsysanim@splitter\the\pgf@x% |
| 978 |
% |
| 979 |
\pgf@xc=\pgfsysanim@repeat@frac\pgf@xa% |
| 980 |
\advance\pgf@xc by\pgf@xb% |
| 981 |
\pgfsysanim@compute@time% |
| 982 |
\else% |
| 983 |
\ifpgfsysanim@freezeatend% |
| 984 |
\pgfsysanim@handle@repeat@dur@freeze% |
| 985 |
\else% |
| 986 |
\ifdim\pgf@xc=\pgf@yb% |
| 987 |
\ifpgfsysanim@snap@first% |
| 988 |
\pgfsysanim@handle@repeat@dur@freeze% |
| 989 |
\fi% |
| 990 |
\fi% |
| 991 |
\fi% |
| 992 |
\fi% |
| 993 |
} |
| 994 |
|
| 995 |
\def\pgfsysanim@handle@repeat@dur@freeze{% |
| 996 |
\pgf@xa=\pgfsysanim@last@time pt% |
| 997 |
\pgf@xb=\pgfsysanim@first@time pt% |
| 998 |
\advance\pgf@xa by-\pgf@xb% |
| 999 |
% Compute repeat count and fraction: |
| 1000 |
\ifdim\pgf@xa<0.01pt\relax% |
| 1001 |
% Interval too small: Goto end of interval |
| 1002 |
\def\pgfmathresult{1.0}% |
| 1003 |
\else% |
| 1004 |
% `\pgfsysanim@snap@repeat@arg` is a macro storing a dimen value, eg "4.0pt" |
| 1005 |
\pgfmathdivide@{\pgf@sys@tonumber\dimexpr\pgfsysanim@snap@repeat@arg}{\pgf@sys@tonumber\pgf@xa}% |
| 1006 |
\fi% |
| 1007 |
\pgf@x\pgfmathresult pt\relax% |
| 1008 |
\expandafter\pgfsysanim@splitter\the\pgf@x% |
| 1009 |
% |
| 1010 |
\pgf@xc=\pgfsysanim@repeat@frac\pgf@xa% |
| 1011 |
\advance\pgf@xc by\pgf@xb% |
| 1012 |
\pgfsysanim@compute@time% |
| 1013 |
} |
| 1014 |
|
| 1015 |
|
| 1016 |
|
| 1017 |
|
| 1018 |
|
| 1019 |
\def\pgfsysanim@compute@time{% |
| 1020 |
% Ok, let us iterate over all points of time. |
| 1021 |
\pgfutil@tempcnta=1\relax% |
| 1022 |
\pgfsysanim@conttrue% |
| 1023 |
\pgfutil@loop% |
| 1024 |
\ifnum\pgfutil@tempcnta>\pgfsysanim@snap@count% |
| 1025 |
\pgfsysanim@contfalse% |
| 1026 |
\else% |
| 1027 |
\expandafter\let\expandafter\pgfsys@temp\csname pgfsysanim@snap@\the\pgfutil@tempcnta\endcsname% |
| 1028 |
\expandafter\pgfsysanim@test@time\pgfsys@temp% |
| 1029 |
\fi% |
| 1030 |
\ifpgfsysanim@cont% |
| 1031 |
\advance\pgfutil@tempcnta by1\relax% |
| 1032 |
\pgfutil@repeat% |
| 1033 |
} |
| 1034 |
|
| 1035 |
|
| 1036 |
\def\pgfsysanim@test@time#1#2#3#4#5#6{% |
| 1037 |
% #1 = time in seconds |
| 1038 |
% #2 to #5 = spline controls |
| 1039 |
% #6 = value |
| 1040 |
\ifdim#1pt<\pgf@xc% |
| 1041 |
% snap time not yet reached. Update previous: |
| 1042 |
\def\pgfsysanim@prev@val{#6}% |
| 1043 |
\def\pgfsysanim@prev@time{#1}% |
| 1044 |
\def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}% |
| 1045 |
\else% |
| 1046 |
\ifdim#1pt=\pgf@xc% |
| 1047 |
\ifpgfsysanim@snap@first% |
| 1048 |
\ifx\pgfsysanim@next@val\relax% |
| 1049 |
% first? Save! |
| 1050 |
\def\pgfsysanim@prev@val{#6}% |
| 1051 |
\def\pgfsysanim@prev@time{#1}% |
| 1052 |
\def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}% |
| 1053 |
\let\pgfsysanim@next@val\pgfsysanim@prev@val% |
| 1054 |
\let\pgfsysanim@next@time\pgfsysanim@prev@time% |
| 1055 |
\let\pgfsysanim@next@spline\pgfsysanim@prev@spline% |
| 1056 |
\pgfsysanim@contfalse% |
| 1057 |
% else, do nothing |
| 1058 |
\fi |
| 1059 |
\else% |
| 1060 |
% always overwrite: |
| 1061 |
\def\pgfsysanim@prev@val{#6}% |
| 1062 |
\def\pgfsysanim@prev@time{#1}% |
| 1063 |
\def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}% |
| 1064 |
\let\pgfsysanim@next@val\pgfsysanim@prev@val% |
| 1065 |
\let\pgfsysanim@next@time\pgfsysanim@prev@time% |
| 1066 |
\let\pgfsysanim@next@spline\pgfsysanim@prev@spline% |
| 1067 |
\fi% |
| 1068 |
\else% |
| 1069 |
% we passed the time! |
| 1070 |
\ifx\pgfsysanim@next@val\relax% |
| 1071 |
% first? Then save! |
| 1072 |
\def\pgfsysanim@next@val{#6}% |
| 1073 |
\def\pgfsysanim@next@time{#1}% |
| 1074 |
\def\pgfsysanim@next@spline{{#2}{#3}{#4}{#5}}% |
| 1075 |
\else% |
| 1076 |
% ignore later times! |
| 1077 |
\pgfsysanim@contfalse% |
| 1078 |
\fi% |
| 1079 |
\fi% |
| 1080 |
\fi% |
| 1081 |
} |
| 1082 |
|
| 1083 |
\let\pgfsysanim@prev@val\relax% |
| 1084 |
\let\pgfsysanim@prev@time\relax% |
| 1085 |
\let\pgfsysanim@next@val\relax% |
| 1086 |
\let\pgfsysanim@next@time\relax% |
| 1087 |
|
| 1088 |
% Help function |
| 1089 |
\def\pgfsysanim@attach#1#2#3{% |
| 1090 |
\expandafter\pgfsysanim@prep@beg\expandafter{\pgfsysanim@first@time}{#2}{#3}% |
| 1091 |
\expandafter\def\expandafter\pgfsysanim@code@main\expandafter{\csname pgfsysanim@main@of@\pgfsysanim@whom@id @\pgfsysanim@whom@type @#1\endcsname}% |
| 1092 |
\expandafter\ifx\pgfsysanim@code@main\relax% |
| 1093 |
\edef\pgfsysanim@code@begin{% |
| 1094 |
\let\noexpand\pgfsysanim@c@begin\noexpand\pgfutil@empty% |
| 1095 |
\let\noexpand\pgfsysanim@c@end\noexpand\pgfutil@empty% |
| 1096 |
\pgfsysanim@lasttime-16383pt\relax% |
| 1097 |
\expandafter\noexpand\pgfsysanim@code@main% |
| 1098 |
\global\let\expandafter\noexpand\pgfsysanim@code@main\relax% |
| 1099 |
\noexpand\pgfsysanim@c@begin% |
| 1100 |
}% |
| 1101 |
\let\pgfsysanim@code@end\pgfsysanim@code@closer% |
| 1102 |
\expandafter\global\expandafter\let\pgfsysanim@code@main\pgfutil@empty% |
| 1103 |
\else% |
| 1104 |
\let\pgfsysanim@code@begin\relax% |
| 1105 |
\let\pgfsysanim@code@end\relax% |
| 1106 |
\fi% |
| 1107 |
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\def% |
| 1108 |
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgfsysanim@new@main% |
| 1109 |
\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@code@main\pgfsysanim@add@main} |
| 1110 |
\expandafter\global\expandafter\let\pgfsysanim@code@main\pgfsysanim@new@main% |
| 1111 |
} |
| 1112 |
\def\pgfsysanim@code@closer{\pgfsysanim@c@end} |
| 1113 |
|
| 1114 |
\def\pgfsysanim@prep@beg#1#2#3{% |
| 1115 |
\edef\pgfsysanim@add@main{% |
| 1116 |
\noexpand\ifdim\pgfsysanim@lasttime>#1pt% |
| 1117 |
% ignore! |
| 1118 |
\noexpand\else% |
| 1119 |
\pgfsysanim@lasttime#1pt% |
| 1120 |
\def\noexpand\pgfsysanim@c@begin{#2}% |
| 1121 |
\def\noexpand\pgfsysanim@c@end{#3}% |
| 1122 |
\noexpand\fi% |
| 1123 |
} |
| 1124 |
} |
| 1125 |
|
| 1126 |
\def\pgfsysanim@prep@beg@special#1#2{% |
| 1127 |
\def\pgfsysanim@add@main{% |
| 1128 |
\ifdim\pgfsysanim@lasttime>#1pt% |
| 1129 |
% ignore! |
| 1130 |
\else% |
| 1131 |
\pgfsysanim@lasttime#1pt% |
| 1132 |
\def\pgfsysanim@c@begin{#2}% |
| 1133 |
\fi% |
| 1134 |
} |
| 1135 |
} |
| 1136 |
|
| 1137 |
|
| 1138 |
|
| 1139 |
\def\pgfsysanim@attach@special#1#2{% |
| 1140 |
\expandafter\expandafter\expandafter\pgfsysanim@prep@beg@special\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@first@time\expandafter}\expandafter{#2}% |
| 1141 |
\ifx#1\relax% |
| 1142 |
\def#1{% |
| 1143 |
\pgfsysanim@lasttime-16383pt\relax% |
| 1144 |
\let\pgfsysanim@c@begin\pgfutil@empty% |
| 1145 |
}% |
| 1146 |
\fi% |
| 1147 |
\expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter#1\expandafter\expandafter\expandafter{\expandafter#1\pgfsysanim@add@main}% |
| 1148 |
} |
| 1149 |
|
| 1150 |
|
| 1151 |
|
| 1152 |
\newdimen\pgfsysanim@lasttime |
| 1153 |
|
| 1154 |
|
| 1155 |
\def\pgfsysanim@add@trans{% |
| 1156 |
\ifx\pgfsysanim@snap@canvas@transform@pre\relax% |
| 1157 |
\else% |
| 1158 |
\ifx\pgfsysanim@code@begin\relax% |
| 1159 |
\let\pgfsysanim@code@begin\pgfutil@empty% |
| 1160 |
\fi% |
| 1161 |
\pgfsysanim@add@trans@% |
| 1162 |
\fi% |
| 1163 |
} |
| 1164 |
\def\pgfsysanim@add@trans@{% |
| 1165 |
\toks0\expandafter{\pgfsysanim@snap@canvas@transform@pre}% |
| 1166 |
\toks1\expandafter{\pgfsysanim@code@begin}% |
| 1167 |
\toks2\expandafter{\pgfsysanim@snap@canvas@transform@post}% |
| 1168 |
\edef\pgfsysanim@code@begin{{\the\toks0 \the\toks1 \the\toks2}}% |
| 1169 |
} |
| 1170 |
|
| 1171 |
% The code for the different attributes |
| 1172 |
|
| 1173 |
\def\pgfsysanim@prep@attr@opacity{% |
| 1174 |
\ifpgfsysanim@valid@snapshot@time% |
| 1175 |
\pgfsysanim@comp@scalar% |
| 1176 |
\pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}% |
| 1177 |
\pgfsysanim@attach{opacity}{\noexpand\pgfsys@opacity{\pgfsysanim@x@val}}{}% |
| 1178 |
\fi% |
| 1179 |
} |
| 1180 |
|
| 1181 |
\def\pgfsysanim@prep@attr@fillopacity{% |
| 1182 |
\ifpgfsysanim@valid@snapshot@time% |
| 1183 |
\pgfsysanim@comp@scalar% |
| 1184 |
\pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}% |
| 1185 |
\pgfsysanim@attach{fillopacity}{\noexpand\pgfsys@fill@opacity{\pgfsysanim@x@val}}{}% |
| 1186 |
\fi% |
| 1187 |
} |
| 1188 |
|
| 1189 |
\def\pgfsysanim@prep@attr@strokeopacity{% |
| 1190 |
\ifpgfsysanim@valid@snapshot@time% |
| 1191 |
\pgfsysanim@comp@scalar% |
| 1192 |
\pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}% |
| 1193 |
\pgfsysanim@attach{strokeopacity}{\noexpand\pgfsys@stroke@opacity{\pgfsysanim@x@val}}{}% |
| 1194 |
\fi% |
| 1195 |
} |
| 1196 |
|
| 1197 |
\def\pgfsysanim@prep@attr@visibility{% |
| 1198 |
\ifpgfsysanim@valid@snapshot@time% |
| 1199 |
\pgfsysanim@comp@text% |
| 1200 |
\ifx\pgfsysanim@text@val\pgf@hidden@text% |
| 1201 |
\pgfsysanim@attach{visibility}{\noexpand\pgfsys@begininvisiblescope}{\noexpand\pgfsys@endinvisiblescope}% |
| 1202 |
\else% |
| 1203 |
\pgfsysanim@attach{visibility}{}{}% |
| 1204 |
\fi% |
| 1205 |
\fi% |
| 1206 |
} |
| 1207 |
\def\pgf@hidden@text{hidden} |
| 1208 |
|
| 1209 |
\def\pgfsysanim@prep@attr@linewidth{% |
| 1210 |
\ifpgfsysanim@valid@snapshot@time% |
| 1211 |
\pgfsysanim@comp@dimension% |
| 1212 |
\pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{16382}% |
| 1213 |
\pgfsysanim@attach{linewidth}{\noexpand\pgfsys@setlinewidth{\pgfsysanim@x@val pt}}{}% |
| 1214 |
\fi% |
| 1215 |
} |
| 1216 |
|
| 1217 |
\def\pgfsysanim@prep@attr@dash{% |
| 1218 |
\ifpgfsysanim@valid@snapshot@time% |
| 1219 |
\pgfsysanim@comp@dash% |
| 1220 |
\pgfsysanim@attach{dash}{\noexpand\pgfsys@setdash{\pgfsysanim@dash@vals}{\pgfsysanim@x@val pt}}{}% |
| 1221 |
\fi% |
| 1222 |
} |
| 1223 |
|
| 1224 |
\def\pgfsysanim@prep@attr@translate{% |
| 1225 |
\ifpgfsysanim@valid@snapshot@time% |
| 1226 |
\pgfsysanim@comp@translate% |
| 1227 |
\edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformshift{\pgfsysanim@x@val pt}{\pgfsysanim@y@val pt}}% |
| 1228 |
\fi% |
| 1229 |
\pgfsysanim@add@trans% |
| 1230 |
} |
| 1231 |
|
| 1232 |
|
| 1233 |
\def\pgfsysanim@prep@attr@scale{% |
| 1234 |
\ifpgfsysanim@valid@snapshot@time% |
| 1235 |
\pgfsysanim@comp@scale% |
| 1236 |
\edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformxyscale{\pgfsysanim@x@val}{\pgfsysanim@y@val}}% |
| 1237 |
\fi% |
| 1238 |
\pgfsysanim@add@trans% |
| 1239 |
} |
| 1240 |
|
| 1241 |
\def\pgfsysanim@prep@attr@rotate{% |
| 1242 |
\ifpgfsysanim@valid@snapshot@time% |
| 1243 |
\pgfsysanim@comp@scalar% |
| 1244 |
{% |
| 1245 |
\pgfmathsin@{\pgfsysanim@x@val}% |
| 1246 |
\let\pgftransform@sin=\pgfmathresult% |
| 1247 |
\pgfmathcos@{\pgfsysanim@x@val}% |
| 1248 |
\let\pgftransform@cos=\pgfmathresult% |
| 1249 |
\pgf@x=\pgftransform@sin pt% |
| 1250 |
\pgf@xa=-\pgf@x% |
| 1251 |
\edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{\pgftransform@cos}{\pgftransform@sin}{\pgf@sys@tonumber{\pgf@xa}}{\pgftransform@cos}{0pt}{0pt}}% |
| 1252 |
\expandafter}% |
| 1253 |
\expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}% |
| 1254 |
\fi% |
| 1255 |
\pgfsysanim@add@trans% |
| 1256 |
} |
| 1257 |
|
| 1258 |
\def\pgfsysanim@prep@attr@skewx{% |
| 1259 |
\ifpgfsysanim@valid@snapshot@time% |
| 1260 |
\pgfsysanim@comp@scalar% |
| 1261 |
{% |
| 1262 |
\pgfmathtan@{\pgfsysanim@x@val}% |
| 1263 |
\edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{1}{0}{\pgfmathresult}{1}{0pt}{0pt}}% |
| 1264 |
\expandafter}% |
| 1265 |
\expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}% |
| 1266 |
\fi% |
| 1267 |
\pgfsysanim@add@trans% |
| 1268 |
} |
| 1269 |
|
| 1270 |
\def\pgfsysanim@prep@attr@skewy{% |
| 1271 |
\ifpgfsysanim@valid@snapshot@time% |
| 1272 |
\pgfsysanim@comp@scalar% |
| 1273 |
{% |
| 1274 |
\pgfmathtan@{\pgfsysanim@x@val}% |
| 1275 |
\edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{1}{\pgfmathresult}{0}{1}{0pt}{0pt}}% |
| 1276 |
\expandafter}% |
| 1277 |
\expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}% |
| 1278 |
\fi% |
| 1279 |
\pgfsysanim@add@trans% |
| 1280 |
} |
| 1281 |
|
| 1282 |
\def\pgfsysanim@prep@attr@motion{% |
| 1283 |
\ifx\pgfsysanim@base@value\pgfutil@empty% |
| 1284 |
\else% |
| 1285 |
\pgferror{You may not provide a base value for a motion}% |
| 1286 |
\let\pgfsysanim@base@value\pgfutil@empty% |
| 1287 |
\fi% |
| 1288 |
\ifpgfsysanim@valid@snapshot@time% |
| 1289 |
\pgfsysanim@comp@motion% |
| 1290 |
\expandafter\pgfsysanim@prep@attr@motion@\pgfsysanim@motion@trans% |
| 1291 |
\fi% |
| 1292 |
\pgfsysanim@add@trans% |
| 1293 |
} |
| 1294 |
\def\pgfsysanim@prep@attr@motion@#1#2#3#4#5#6{% |
| 1295 |
\ifpgfsysanim@rotatealong% |
| 1296 |
\def\pgfsysanim@code@begin{\pgfsys@transformcm{#1}{#2}{#3}{#4}{#5}{#6}}% |
| 1297 |
\else% |
| 1298 |
\def\pgfsysanim@code@begin{\pgfsys@transformshift{#5}{#6}}% |
| 1299 |
\fi% |
| 1300 |
} |
| 1301 |
|
| 1302 |
|
| 1303 |
\def\pgfsysanim@prep@attr@strokecolor{% |
| 1304 |
\ifpgfsysanim@valid@snapshot@time% |
| 1305 |
\pgfsysanim@comp@color% |
| 1306 |
\pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}% |
| 1307 |
\pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}% |
| 1308 |
\pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}% |
| 1309 |
\pgfsysanim@attach{strokecolor}{\noexpand\pgfsys@color@rgb@stroke{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}% |
| 1310 |
\fi% |
| 1311 |
} |
| 1312 |
|
| 1313 |
\def\pgfsysanim@prep@attr@fillcolor{% |
| 1314 |
\ifpgfsysanim@valid@snapshot@time% |
| 1315 |
\pgfsysanim@comp@color% |
| 1316 |
\pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}% |
| 1317 |
\pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}% |
| 1318 |
\pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}% |
| 1319 |
\pgfsysanim@attach{fillcolor}{\noexpand\pgfsys@color@rgb@fill{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}% |
| 1320 |
\fi% |
| 1321 |
} |
| 1322 |
|
| 1323 |
\def\pgfsysanim@prep@attr@color{% |
| 1324 |
\ifpgfsysanim@valid@snapshot@time% |
| 1325 |
\pgfsysanim@comp@color% |
| 1326 |
\pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}% |
| 1327 |
\pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}% |
| 1328 |
\pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}% |
| 1329 |
\pgfsysanim@attach{color}{\noexpand\pgfsys@color@rgb{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}% |
| 1330 |
\fi% |
| 1331 |
} |
| 1332 |
|
| 1333 |
\newif\ifpgfsys@animation@view@hooked |
| 1334 |
|
| 1335 |
\def\pgfsysanim@prep@attr@viewbox{% |
| 1336 |
\ifpgfsysanim@valid@snapshot@time% |
| 1337 |
\pgfsysanim@comp@viewbox% |
| 1338 |
\pgfsys@attach@to@id{\pgfsysanim@whom@id}{}{% |
| 1339 |
\ifpgfsys@animation@view@hooked% |
| 1340 |
\else% |
| 1341 |
% Hook into viewbox systems layer commands |
| 1342 |
\let\pgfsys@viewboxmeet@orig\pgfsys@viewboxmeet% |
| 1343 |
\let\pgfsys@viewboxmeet\pgfsysanim@hooked@viewboxmeet% |
| 1344 |
\let\pgfsys@viewboxslice@orig\pgfsys@viewboxslice% |
| 1345 |
\let\pgfsys@viewboxslice\pgfsysanim@hooked@viewboxslice% |
| 1346 |
\pgfsys@animation@view@hookedtrue% |
| 1347 |
\fi% |
| 1348 |
}{}{}% |
| 1349 |
\edef\pgfsysanim@temp{{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}{\pgfsysanim@w@val}}% |
| 1350 |
\expandafter\pgfsysanim@attach@special\csname pgfsysanim@hook@for@\pgfsys@id@ref{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}\endcsname\pgfsysanim@temp% |
| 1351 |
\fi% |
| 1352 |
} |
| 1353 |
\def\pgfsysanim@hooked@viewboxmeet#1#2#3#4#5#6#7#8{% |
| 1354 |
\expandafter\ifx\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax% |
| 1355 |
\pgfsys@viewboxmeet@orig{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% |
| 1356 |
\else% |
| 1357 |
\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname% |
| 1358 |
\ifx\pgfsysanim@c@begin\pgfutil@empty% |
| 1359 |
% should not happen, but, then, ignore |
| 1360 |
\else% |
| 1361 |
\expandafter\pgfsysanim@hooked@viewboxmeet@\pgfsysanim@c@begin{#1}{#2}{#3}{#4}% |
| 1362 |
\fi% |
| 1363 |
\expandafter\global\expandafter\let\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax% |
| 1364 |
\fi% |
| 1365 |
} |
| 1366 |
\def\pgfsysanim@hooked@viewboxmeet@#1#2#3#4#5#6#7#8{% |
| 1367 |
\pgfsys@viewboxmeet@orig{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}% |
| 1368 |
} |
| 1369 |
\def\pgfsysanim@hooked@viewboxslice#1#2#3#4#5#6#7#8{% |
| 1370 |
\expandafter\ifx\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax% |
| 1371 |
\pgfsys@viewboxslice@orig{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% |
| 1372 |
\else% |
| 1373 |
\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname% |
| 1374 |
\expandafter\pgfsysanim@hooked@viewboxslice@\pgfsysanim@c@begin{#1}{#2}{#3}{#4}% |
| 1375 |
\expandafter\global\expandafter\let\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax% |
| 1376 |
\fi% |
| 1377 |
} |
| 1378 |
\def\pgfsysanim@hooked@viewboxslice@#1#2#3#4#5#6#7#8{% |
| 1379 |
\pgfsys@viewboxslice@orig{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}% |
| 1380 |
} |
| 1381 |
|
| 1382 |
|
| 1383 |
\newif\ifpgfsys@animation@path@hooked |
| 1384 |
|
| 1385 |
\def\pgfsysanim@prep@attr@path{% |
| 1386 |
\ifpgfsysanim@valid@snapshot@time% |
| 1387 |
\pgfsysanim@comp@path% |
| 1388 |
\pgfsys@attach@to@id{\pgfsysanim@whom@id}{}{% |
| 1389 |
\ifpgfsys@animation@path@hooked% |
| 1390 |
\else% |
| 1391 |
% Hook into path systems layer commands |
| 1392 |
\let\pgfsys@discardpath@orig\pgfsys@discardpath% |
| 1393 |
\let\pgfsys@stroke@orig\pgfsys@stroke% |
| 1394 |
\let\pgfsys@fill@orig\pgfsys@fill% |
| 1395 |
\let\pgfsys@fillstroke@orig\pgfsys@fillstroke% |
| 1396 |
\let\pgfsys@closestroke@orig\pgfsys@closestroke% |
| 1397 |
\let\pgfsys@discardpath\pgfsys@discardpath@hook% |
| 1398 |
\let\pgfsys@stroke\pgfsys@stroke@hook% |
| 1399 |
\let\pgfsys@fill\pgfsys@fill@hook% |
| 1400 |
\let\pgfsys@fillstroke\pgfsys@fillstroke@hook% |
| 1401 |
\let\pgfsys@closestroke\pgfsys@closestroke@hook% |
| 1402 |
\pgfsys@animation@path@hookedtrue% |
| 1403 |
\fi% |
| 1404 |
}{}{}% |
| 1405 |
\expandafter\pgfsysanim@attach@special\csname pgfsysanim@phook@for@\pgfsys@id@ref{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}\endcsname\pgfsysanim@path@all% |
| 1406 |
\fi% |
| 1407 |
} |
| 1408 |
\def\pgfsys@stroke@hook{\pgfsysanim@with@tipstrue\pgfsysanim@path@hooks\pgfsys@stroke@orig} |
| 1409 |
\def\pgfsys@fill@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@fill@orig} |
| 1410 |
\def\pgfsys@fillstroke@hook{\pgfsysanim@with@tipstrue\pgfsysanim@path@hooks\pgfsys@fillstroke@orig} |
| 1411 |
\def\pgfsys@closestroke@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@closestroke@orig} |
| 1412 |
\def\pgfsys@discardpath@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@discardpath@orig} |
| 1413 |
|
| 1414 |
\newif\ifpgfsysanim@with@tips |
| 1415 |
|
| 1416 |
\def\pgfsysanim@path@hooks#1{% |
| 1417 |
{% |
| 1418 |
\expandafter\ifx\csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname\relax% |
| 1419 |
#1% |
| 1420 |
\else% |
| 1421 |
\pgfsys@discardpath@orig% |
| 1422 |
\csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname% |
| 1423 |
\pgfsysanim@c@begin% |
| 1424 |
\pgfsysanim@path@val% |
| 1425 |
#1% |
| 1426 |
\ifpgfsysanim@with@tips% |
| 1427 |
\ifx\pgfsysanim@path@val\pgfutil@empty\else% |
| 1428 |
\pgfsysanim@prepare@end@of@path% |
| 1429 |
\begingroup% |
| 1430 |
\pgfsysanim@prepare@start@of@path% |
| 1431 |
\pgfsysanim@add@marker@at@start% |
| 1432 |
\endgroup% |
| 1433 |
\pgfsysanim@add@marker@at@end% |
| 1434 |
\fi% |
| 1435 |
\fi% |
| 1436 |
\expandafter\global\expandafter\let\csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname\relax% |
| 1437 |
\fi% |
| 1438 |
}% |
| 1439 |
} |
| 1440 |
|
| 1441 |
|
| 1442 |
\def\pgfsysanim@prepare@start@of@path{% |
| 1443 |
\ifx\pgfsysanim@snap@tip@start\pgfutil@empty\else |
| 1444 |
% |
| 1445 |
% Step 1: Split |
| 1446 |
% |
| 1447 |
\ifx\pgfprocessresultpathsuffix\relax% |
| 1448 |
% Ok, still need to compute the split: |
| 1449 |
\pgfprocesssplitpath{\pgf@arrowpath}% |
| 1450 |
\fi% |
| 1451 |
% |
| 1452 |
% Step 2: extract |
| 1453 |
% |
| 1454 |
\expandafter\pgf@parse@start\pgfprocessresultpathsuffix\pgf@stop\pgf@stop\pgf@stop% |
| 1455 |
% |
| 1456 |
% Step 3: prep |
| 1457 |
% |
| 1458 |
\pgf@prep@start% |
| 1459 |
\fi% |
| 1460 |
} |
| 1461 |
\def\pgfsysanim@add@marker@at@start{% |
| 1462 |
\ifx\pgfsysanim@snap@tip@start\pgfutil@empty\else |
| 1463 |
% |
| 1464 |
% Step 4: draw |
| 1465 |
% |
| 1466 |
{% |
| 1467 |
\pgftransformreset% |
| 1468 |
\pgftransformarrow{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}% |
| 1469 |
\pgfsys@beginscope% |
| 1470 |
\pgflowlevelsynccm% |
| 1471 |
\pgfsys@marker@use{\pgfsysanim@snap@tip@start}% |
| 1472 |
\pgfsys@endscope% |
| 1473 |
}% |
| 1474 |
\fi% |
| 1475 |
} |
| 1476 |
|
| 1477 |
|
| 1478 |
\def\pgfsysanim@prepare@end@of@path{% |
| 1479 |
\let\pgfprocessresultpathsuffix\relax% flag that nothing has happened... |
| 1480 |
\let\pgfprocessresultsubpathsuffix\relax% |
| 1481 |
\pgf@precise@shorteningfalse% |
| 1482 |
\edef\pgf@path@shortening@distance{0pt}% |
| 1483 |
\ifx\pgfsysanim@snap@tip@end\pgfutil@empty\else |
| 1484 |
% |
| 1485 |
% Step 1: Split |
| 1486 |
% |
| 1487 |
\pgfprocesssplitpath{\pgfsysanim@path@val}% |
| 1488 |
\pgfprocesssplitsubpath{\pgfprocessresultpathsuffix}% |
| 1489 |
% |
| 1490 |
% Step 2: extract |
| 1491 |
% |
| 1492 |
\expandafter\pgf@parse@end\pgfprocessresultsubpathsuffix\pgf@stop\pgf@stop\pgf@stop% |
| 1493 |
% |
| 1494 |
% Step 3: prep |
| 1495 |
% |
| 1496 |
\pgf@prep@end% |
| 1497 |
\fi% |
| 1498 |
} |
| 1499 |
\def\pgfsysanim@add@marker@at@end{% |
| 1500 |
\ifx\pgfsysanim@snap@tip@end\pgfutil@empty\else |
| 1501 |
% |
| 1502 |
% Step 4: draw |
| 1503 |
% |
| 1504 |
{% |
| 1505 |
\pgftransformreset% |
| 1506 |
\pgftransformarrow{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}% |
| 1507 |
\pgfsys@beginscope% |
| 1508 |
\pgflowlevelsynccm% |
| 1509 |
\pgfsys@marker@use{\pgfsysanim@snap@tip@end}% |
| 1510 |
\pgfsys@endscope% |
| 1511 |
}% |
| 1512 |
\fi% |
| 1513 |
} |
| 1514 |
|
| 1515 |
|
| 1516 |
|
| 1517 |
% |
| 1518 |
% Interpolation functions |
| 1519 |
% |
| 1520 |
|
| 1521 |
% Scalar interpolation |
| 1522 |
|
| 1523 |
\def\pgfsysanim@comp@scalar{% |
| 1524 |
\pgfsysanim@compute@fractions% |
| 1525 |
\pgfsysanim@mix@scalar% |
| 1526 |
\ifpgfsysanim@accumulate% |
| 1527 |
\ifnum\pgfsysanim@repeat@decimal=0\else% |
| 1528 |
\let\pgfsysanim@frac@b\pgfsysanim@one% |
| 1529 |
\let\pgfsysanim@prev@val\pgfsysanim@x@val% |
| 1530 |
\let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal% |
| 1531 |
\let\pgfsysanim@next@val\pgfsysanim@last@val% |
| 1532 |
\pgfsysanim@mix@scalar% |
| 1533 |
\fi% |
| 1534 |
\fi% |
| 1535 |
} |
| 1536 |
\def\pgfsysanim@one{1} |
| 1537 |
|
| 1538 |
\def\pgfsysanim@mix@scalar{% |
| 1539 |
\pgf@x\pgfsysanim@prev@val pt% |
| 1540 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1541 |
\pgf@y\pgfsysanim@next@val pt% |
| 1542 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1543 |
\edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}% |
| 1544 |
} |
| 1545 |
\def\pgfsysanim@cap@scalar#1#2#3{% |
| 1546 |
\ifdim#1 pt<#2 pt% |
| 1547 |
\def#1{#2}% |
| 1548 |
\else\ifdim#1 pt>#3 pt% |
| 1549 |
\def#1{#3}% |
| 1550 |
\fi\fi% |
| 1551 |
} |
| 1552 |
|
| 1553 |
|
| 1554 |
% Scale interpolation |
| 1555 |
|
| 1556 |
\def\pgfsysanim@comp@scale{% |
| 1557 |
\pgfsysanim@compute@fractions% |
| 1558 |
\expandafter\expandafter\expandafter\pgfsysanim@mix@scale\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val% |
| 1559 |
\ifpgfsysanim@accumulate% |
| 1560 |
\ifnum\pgfsysanim@repeat@decimal=0\else% |
| 1561 |
\let\pgfsysanim@frac@b\pgfsysanim@one% |
| 1562 |
\let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal% |
| 1563 |
\expandafter\pgfsysanim@mix@scale\expandafter\pgfsysanim@x@val\expandafter\pgfsysanim@y@val\pgfsysanim@last@val% |
| 1564 |
\fi% |
| 1565 |
\fi% |
| 1566 |
} |
| 1567 |
\def\pgfsysanim@mix@scale#1#2#3#4{% |
| 1568 |
\pgf@x#1pt% |
| 1569 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1570 |
\pgf@y#3pt% |
| 1571 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1572 |
\edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}% |
| 1573 |
\pgf@x#2pt% |
| 1574 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1575 |
\pgf@y#4pt% |
| 1576 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1577 |
\edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}% |
| 1578 |
} |
| 1579 |
|
| 1580 |
|
| 1581 |
% Dimension interpolation |
| 1582 |
|
| 1583 |
\def\pgfsysanim@comp@dimension{% |
| 1584 |
\pgfsysanim@compute@fractions% |
| 1585 |
\pgfsysanim@mix@dimension% |
| 1586 |
\ifpgfsysanim@accumulate% |
| 1587 |
\ifnum\pgfsysanim@repeat@decimal=0\else% |
| 1588 |
\let\pgfsysanim@frac@b\pgfsysanim@one% |
| 1589 |
\def\pgfsysanim@prev@val{\pgfsysanim@x@val pt}% |
| 1590 |
\let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal% |
| 1591 |
\let\pgfsysanim@next@val\pgfsysanim@last@val% |
| 1592 |
\pgfsysanim@mix@dimension% |
| 1593 |
\fi% |
| 1594 |
\fi% |
| 1595 |
} |
| 1596 |
\def\pgfsysanim@mix@dimension{% |
| 1597 |
\pgf@x\pgfsysanim@prev@val% |
| 1598 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1599 |
\pgf@y\pgfsysanim@next@val% |
| 1600 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1601 |
\edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}% |
| 1602 |
} |
| 1603 |
|
| 1604 |
|
| 1605 |
|
| 1606 |
% Translate interpolation |
| 1607 |
|
| 1608 |
\def\pgfsysanim@comp@translate{% |
| 1609 |
\pgfsysanim@compute@fractions% |
| 1610 |
\expandafter\expandafter\expandafter\pgfsysanim@mix@translate\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val% |
| 1611 |
\ifpgfsysanim@accumulate% |
| 1612 |
\ifnum\pgfsysanim@repeat@decimal=0\else% |
| 1613 |
\let\pgfsysanim@frac@b\pgfsysanim@one% |
| 1614 |
\let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal% |
| 1615 |
\edef\pgfsysanim@prev@val{{\pgfsysanim@x@val pt}{\pgfsysanim@y@val pt}} |
| 1616 |
\expandafter\expandafter\expandafter\pgfsysanim@mix@translate\expandafter\pgfsysanim@prev@val\pgfsysanim@last@val% |
| 1617 |
\fi% |
| 1618 |
\fi% |
| 1619 |
} |
| 1620 |
\def\pgfsysanim@mix@translate#1#2#3#4{% |
| 1621 |
\pgf@x#1% |
| 1622 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1623 |
\pgf@y#3% |
| 1624 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1625 |
\edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}% |
| 1626 |
\pgf@x#2% |
| 1627 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1628 |
\pgf@y#4% |
| 1629 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1630 |
\edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}% |
| 1631 |
} |
| 1632 |
|
| 1633 |
|
| 1634 |
|
| 1635 |
% Color interpolation |
| 1636 |
|
| 1637 |
\def\pgfsysanim@comp@color{% |
| 1638 |
\pgfsysanim@compute@fractions% |
| 1639 |
\expandafter\expandafter\expandafter\pgfsysanim@mix@color\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val% |
| 1640 |
\ifpgfsysanim@accumulate% |
| 1641 |
\ifnum\pgfsysanim@repeat@decimal=0\else% |
| 1642 |
\let\pgfsysanim@frac@b\pgfsysanim@one% |
| 1643 |
\let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal% |
| 1644 |
\expandafter\pgfsysanim@mix@color\expandafter\pgfsysanim@x@val\expandafter\pgfsysanim@y@val\expandafter\pgfsysanim@z@val\pgfsysanim@last@val% |
| 1645 |
\fi% |
| 1646 |
\fi% |
| 1647 |
} |
| 1648 |
\def\pgfsysanim@mix@color#1#2#3#4#5#6{% |
| 1649 |
\pgf@x#1pt% |
| 1650 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1651 |
\pgf@y#4pt% |
| 1652 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1653 |
\edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}% |
| 1654 |
\pgf@x#2pt% |
| 1655 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1656 |
\pgf@y#5pt% |
| 1657 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1658 |
\edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}% |
| 1659 |
\pgf@x#3pt% |
| 1660 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1661 |
\pgf@y#6pt% |
| 1662 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1663 |
\edef\pgfsysanim@z@val{\pgf@sys@tonumber\pgf@x}% |
| 1664 |
} |
| 1665 |
|
| 1666 |
|
| 1667 |
% Text interpolation |
| 1668 |
|
| 1669 |
\def\pgfsysanim@comp@text{% |
| 1670 |
\let\pgfsysanim@text@val\pgfsysanim@prev@val% |
| 1671 |
} |
| 1672 |
|
| 1673 |
|
| 1674 |
|
| 1675 |
% Dash interpolation |
| 1676 |
|
| 1677 |
\def\pgfsysanim@comp@dash{% |
| 1678 |
\pgfsysanim@compute@fractions% |
| 1679 |
\expandafter\expandafter\expandafter\pgfsysanim@mix@dash\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val% |
| 1680 |
\ifpgfsysanim@accumulate% |
| 1681 |
\ifnum\pgfsysanim@repeat@decimal=0\else% |
| 1682 |
\let\pgfsysanim@frac@b\pgfsysanim@one% |
| 1683 |
\let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal% |
| 1684 |
\edef\pgfsysanim@prev@val{{\pgfsysanim@dash@vals}{\pgfsysanim@x@val pt}}% |
| 1685 |
\expandafter\expandafter\expandafter\pgfsysanim@mix@dash\expandafter\pgfsysanim@prev@val\pgfsysanim@last@val% |
| 1686 |
\fi% |
| 1687 |
\fi% |
| 1688 |
} |
| 1689 |
\def\pgfsysanim@mix@dash#1#2#3#4{% |
| 1690 |
\pgf@x#2\relax% |
| 1691 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1692 |
\pgf@y#4\relax% |
| 1693 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1694 |
\edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}% |
| 1695 |
\let\pgfsysanim@dash@vals\pgfutil@empty% |
| 1696 |
\pgfsysanim@parse@dash#1,\pgf@stop#3,\pgf@stop% |
| 1697 |
} |
| 1698 |
\def\pgfsysanim@parse@dash{\pgfutil@ifnextchar\pgf@stop\pgfsysanim@parse@dash@done\pgfsysanim@parse@dash@first} |
| 1699 |
\def\pgfsysanim@parse@dash@done\pgf@stop\pgf@stop{}% |
| 1700 |
\def\pgfsysanim@parse@dash@first#1,#2\pgf@stop#3\pgf@stop{% |
| 1701 |
\pgf@x#1\relax% |
| 1702 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1703 |
\pgfsysanim@parse@dash@second#3\pgf@stop{#2}% |
| 1704 |
} |
| 1705 |
\def\pgfsysanim@parse@dash@second#1,#2\pgf@stop#3{% |
| 1706 |
\pgf@y#1\relax% |
| 1707 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1708 |
\def\pgfsys@temp{#2}% |
| 1709 |
\edef\pgfsysanim@dash@vals{\pgfsysanim@dash@vals\the\pgf@x\ifx\pgfsys@temp\pgfutil@empty\else,\fi}% |
| 1710 |
\pgfsysanim@parse@dash#3\pgf@stop#2\pgf@stop% |
| 1711 |
} |
| 1712 |
|
| 1713 |
|
| 1714 |
|
| 1715 |
|
| 1716 |
% Viewbox interpolation |
| 1717 |
|
| 1718 |
\def\pgfsysanim@comp@viewbox{% |
| 1719 |
\pgfsysanim@compute@fractions% |
| 1720 |
\expandafter\expandafter\expandafter\pgfsysanim@mix@viewbox\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val% |
| 1721 |
\ifpgfsysanim@accumulate% |
| 1722 |
\pgferror{viewbox animations cannot accumulate / add}% |
| 1723 |
\fi% |
| 1724 |
} |
| 1725 |
\def\pgfsysanim@mix@viewbox#1#2#3#4#5#6#7#8{% |
| 1726 |
\pgf@x#1% |
| 1727 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1728 |
\pgf@y#5% |
| 1729 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1730 |
\edef\pgfsysanim@x@val{\the\pgf@x}% |
| 1731 |
\pgf@x#2% |
| 1732 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1733 |
\pgf@y#6% |
| 1734 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1735 |
\edef\pgfsysanim@y@val{\the\pgf@x}% |
| 1736 |
\pgf@x#3% |
| 1737 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1738 |
\pgf@y#7% |
| 1739 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1740 |
\edef\pgfsysanim@z@val{\the\pgf@x}% |
| 1741 |
\pgf@x#4% |
| 1742 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1743 |
\pgf@y#8% |
| 1744 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1745 |
\edef\pgfsysanim@w@val{\the\pgf@x}% |
| 1746 |
} |
| 1747 |
|
| 1748 |
|
| 1749 |
|
| 1750 |
|
| 1751 |
% Path interpolation |
| 1752 |
|
| 1753 |
\def\pgfsysanim@comp@path{% |
| 1754 |
\pgfsysanim@compute@fractions% |
| 1755 |
\edef\pgfsysanim@path@tips{% |
| 1756 |
\def\noexpand\pgfsysanim@snap@tip@start{\pgfsysanim@snap@tip@start}% |
| 1757 |
\def\noexpand\pgfsysanim@snap@tip@end{\pgfsysanim@snap@tip@end}% |
| 1758 |
}% |
| 1759 |
\let\pgfsysanim@path@val\pgfutil@empty% |
| 1760 |
\expandafter\expandafter\expandafter\pgfsysanim@parse@path\expandafter\pgfsysanim@prev@val\expandafter\pgf@stop\expandafter\relax\pgfsysanim@next@val\pgf@stop\relax% |
| 1761 |
\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@all\expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@val\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@path@val\expandafter}\pgfsysanim@path@tips}% |
| 1762 |
\ifpgfsysanim@accumulate% |
| 1763 |
\pgferror{path animations cannot accumulate / add}% |
| 1764 |
\fi% |
| 1765 |
} |
| 1766 |
\def\pgfsysanim@parse@path{\pgfutil@ifnextchar\pgf@stop\pgfsysanim@parse@path@done\pgfsysanim@parse@path@first} |
| 1767 |
\def\pgfsysanim@parse@path@done\pgf@stop\relax\pgf@stop\relax{}% |
| 1768 |
\def\pgfsysanim@parse@path@first{\pgfutil@ifnextchar\bgroup\pgfsysanim@parse@path@first@num\pgfsysanim@parse@path@token} |
| 1769 |
\def\pgfsysanim@parse@path@token#1#2\relax#3#4\relax{% |
| 1770 |
\expandafter\def\expandafter\pgfsysanim@path@val\expandafter{\pgfsysanim@path@val#1}% |
| 1771 |
\pgfsysanim@parse@path#2\relax#4\relax% |
| 1772 |
} |
| 1773 |
\def\pgfsysanim@parse@path@first@num#1#2\relax#3#4\relax{% |
| 1774 |
\pgf@x#1% |
| 1775 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1776 |
\pgf@y#3% |
| 1777 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1778 |
\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@val\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@path@val\expandafter{\the\pgf@x}}% |
| 1779 |
\pgfsysanim@parse@path#2\relax#4\relax% |
| 1780 |
} |
| 1781 |
|
| 1782 |
|
| 1783 |
|
| 1784 |
% Motion interpolation |
| 1785 |
|
| 1786 |
\def\pgfsysanim@comp@motion{% |
| 1787 |
\pgfsysanim@compute@fractions% |
| 1788 |
\pgf@x\pgfsysanim@prev@val pt% |
| 1789 |
\pgf@x\pgfsysanim@frac@b\pgf@x% |
| 1790 |
\pgf@y\pgfsysanim@next@val pt% |
| 1791 |
\advance\pgf@x by\pgfsysanim@frac@a\pgf@y% |
| 1792 |
\edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}% |
| 1793 |
\ifdim\pgfsysanim@x@val pt=1pt% |
| 1794 |
\def\pgfsysanim@x@val{0.9999}% because of rounding problems in decorations |
| 1795 |
\fi% |
| 1796 |
\pgf@relevantforpicturesizefalse% |
| 1797 |
\pgfdecoratepath{pgfsysanim@motion}{% |
| 1798 |
\pgfsyssoftpath@setcurrentpath\pgfsysanim@snap@movealong% |
| 1799 |
}% |
| 1800 |
\ifpgfsysanim@accumulate% |
| 1801 |
\pgferror{motion animations cannot accumulate / add}% |
| 1802 |
\fi% |
| 1803 |
} |
| 1804 |
\pgfdeclaredecoration{pgfsysanim@motion}{s}{% |
| 1805 |
\state{s}[width=\pgfsysanim@x@val\pgfdecoratedremainingdistance,next state=final]{}% |
| 1806 |
\state{final}{\pgfgettransform\pgfsysanim@motion@trans\global\let\pgfsysanim@motion@trans\pgfsysanim@motion@trans}% |
| 1807 |
} |
| 1808 |
|
| 1809 |
|
| 1810 |
|
| 1811 |
|
| 1812 |
|
| 1813 |
|
| 1814 |
% Compute fractions and splines: |
| 1815 |
|
| 1816 |
\def\pgfsysanim@compute@fractions{% |
| 1817 |
\ifdim\pgf@xc=\pgfsysanim@prev@time pt% |
| 1818 |
\def\pgfsysanim@frac@a{0}% |
| 1819 |
\def\pgfsysanim@frac@b{1}% |
| 1820 |
\else% |
| 1821 |
\pgfmathsubtract@{\pgfsysanim@next@time}{\pgfsysanim@prev@time}% |
| 1822 |
\ifdim\pgfmathresult pt<0.01pt% |
| 1823 |
\def\pgfsysanim@frac@a{0}% |
| 1824 |
\def\pgfsysanim@frac@b{1}% |
| 1825 |
\else% |
| 1826 |
\let\pgfsysanim@divby\pgfmathresult% |
| 1827 |
\pgfmathsubtract@{\pgf@sys@tonumber\pgf@xc}{\pgfsysanim@prev@time}% |
| 1828 |
\pgfmathdivide@{\pgfmathresult}{\pgfsysanim@divby}% |
| 1829 |
\ifdim\pgfmathresult pt<0pt\def\pgfmathresult{0}\fi% |
| 1830 |
\ifdim\pgfmathresult pt>1pt\def\pgfmathresult{1}\fi% |
| 1831 |
\let\pgfsysanim@frac@a\pgfmathresult% |
| 1832 |
\pgfmathsubtract@{1}{\pgfmathresult}% |
| 1833 |
\let\pgfsysanim@frac@b\pgfmathresult% |
| 1834 |
\fi% |
| 1835 |
\fi% |
| 1836 |
\ifdim\pgfsysanim@frac@a pt=0pt% |
| 1837 |
\else\ifdim\pgfsysanim@frac@b pt=0pt% |
| 1838 |
\else% |
| 1839 |
\expandafter\expandafter\expandafter\pgfsysanim@apply@spline\expandafter\pgfsysanim@prev@spline\pgfsysanim@next@spline% |
| 1840 |
\fi\fi% |
| 1841 |
} |
| 1842 |
|
| 1843 |
|
| 1844 |
\def\pgfsysanim@apply@spline#1#2#3#4#5#6#7#8{% |
| 1845 |
\edef\pgfsys@temp{#3,#5,#4,#6}% |
| 1846 |
\ifx\pgfsys@temp\pgfsysanim@id@spline% |
| 1847 |
\else% |
| 1848 |
\def\pgfsysanim@prev@out@time{{#3}{#4}}% |
| 1849 |
\def\pgfsysanim@next@in@time{{#5}{#6}}% |
| 1850 |
\ifx\pgfsysanim@prev@out@time\pgfsys@stay@text% |
| 1851 |
\pgfsysanim@jump@splines% |
| 1852 |
\else\ifx\pgfsysanim@next@in@time\pgfsys@jump@text% |
| 1853 |
\pgfsysanim@jump@splines% |
| 1854 |
\else% |
| 1855 |
\pgf@xa#3pt% |
| 1856 |
\pgf@xb#5pt% |
| 1857 |
% #4 is val support a |
| 1858 |
% #6 is val support b |
| 1859 |
% our first approximation |
| 1860 |
\let\pgfsysanim@t\pgfsysanim@frac@a% |
| 1861 |
\let\pgfsysanim@s\pgfsysanim@frac@b% |
| 1862 |
\pgfsysanim@eval@spline% |
| 1863 |
\edef\pgfsysanim@ft{\the\pgf@x}% |
| 1864 |
\pgf@x\pgfsysanim@t pt% |
| 1865 |
\advance\pgf@x by256sp% |
| 1866 |
\pgf@y1pt% |
| 1867 |
\advance\pgf@y by-\pgf@x% |
| 1868 |
\edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}% |
| 1869 |
\edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}% |
| 1870 |
\pgfsysanim@eval@spline% |
| 1871 |
% Ok, now do Newton one step |
| 1872 |
\advance\pgf@x by-\pgfsysanim@ft% |
| 1873 |
\pgf@x256\pgf@x% |
| 1874 |
% \pgf@x is f'(t) |
| 1875 |
% must compute t - (f(t)-frac@a)/f'(t) |
| 1876 |
\pgf@ya\pgfsysanim@ft% |
| 1877 |
\advance\pgf@ya by-\pgfsysanim@frac@a pt% |
| 1878 |
\pgf@yb\pgf@x |
| 1879 |
\pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}% |
| 1880 |
\ifdim\pgfmathresult pt>2.5pt% |
| 1881 |
\def\pgfmathresult{2.5}% |
| 1882 |
\fi% |
| 1883 |
\ifdim\pgfmathresult pt<-2.5pt% |
| 1884 |
\def\pgfmathresult{-2.5}% |
| 1885 |
\fi% |
| 1886 |
\pgf@x\pgfsysanim@t pt% |
| 1887 |
\advance\pgf@x by-\pgfmathresult\pgf@ya% |
| 1888 |
% \pgf@x is new t: |
| 1889 |
\pgf@y1pt% |
| 1890 |
\advance\pgf@y by-\pgf@x% |
| 1891 |
\edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}% |
| 1892 |
\edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}% |
| 1893 |
\pgfsysanim@eval@spline% |
| 1894 |
\edef\pgfsysanim@ft{\the\pgf@x}% |
| 1895 |
\pgf@x\pgfsysanim@t pt% |
| 1896 |
\advance\pgf@x by256sp% |
| 1897 |
\pgf@y1pt% |
| 1898 |
\advance\pgf@y by-\pgf@x% |
| 1899 |
\edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}% |
| 1900 |
\edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}% |
| 1901 |
\pgfsysanim@eval@spline% |
| 1902 |
% Ok, now do Newton one step2 |
| 1903 |
\advance\pgf@x by-\pgfsysanim@ft% |
| 1904 |
\pgf@x256\pgf@x% |
| 1905 |
% \pgf@x is f'(t) |
| 1906 |
% must compute t - (f(t)-frac@a)/f'(t) |
| 1907 |
\pgf@ya\pgfsysanim@ft% |
| 1908 |
\advance\pgf@ya by-\pgfsysanim@frac@a pt% |
| 1909 |
\pgf@yb\pgf@x |
| 1910 |
\pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}% |
| 1911 |
\ifdim\pgfmathresult pt>2.5pt% |
| 1912 |
\def\pgfmathresult{2.5}% |
| 1913 |
\fi% |
| 1914 |
\ifdim\pgfmathresult pt<-2.5pt% |
| 1915 |
\def\pgfmathresult{-2.5}% |
| 1916 |
\fi% |
| 1917 |
\pgf@x\pgfsysanim@t pt% |
| 1918 |
\advance\pgf@x by-\pgfmathresult\pgf@ya% |
| 1919 |
% \pgf@x is new t: |
| 1920 |
\pgf@y1pt% |
| 1921 |
\advance\pgf@y by-\pgf@x% |
| 1922 |
\edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}% |
| 1923 |
\edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}% |
| 1924 |
% Third Newton: |
| 1925 |
\pgfsysanim@eval@spline% |
| 1926 |
\edef\pgfsysanim@ft{\the\pgf@x}% |
| 1927 |
\pgf@x\pgfsysanim@t pt% |
| 1928 |
\advance\pgf@x by256sp% |
| 1929 |
\pgf@y1pt% |
| 1930 |
\advance\pgf@y by-\pgf@x% |
| 1931 |
\edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}% |
| 1932 |
\edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}% |
| 1933 |
\pgfsysanim@eval@spline% |
| 1934 |
% Ok, now do Newton one step2 |
| 1935 |
\advance\pgf@x by-\pgfsysanim@ft% |
| 1936 |
\pgf@x256\pgf@x% |
| 1937 |
% \pgf@x is f'(t) |
| 1938 |
% must compute t - (f(t)-frac@a)/f'(t) |
| 1939 |
\pgf@ya\pgfsysanim@ft% |
| 1940 |
\advance\pgf@ya by-\pgfsysanim@frac@a pt% |
| 1941 |
\pgf@yb\pgf@x |
| 1942 |
\pgfmathreciprocal@{\pgf@sys@tonumber\pgf@yb}% |
| 1943 |
\ifdim\pgfmathresult pt>2.5pt% |
| 1944 |
\def\pgfmathresult{2.5}% |
| 1945 |
\fi% |
| 1946 |
\ifdim\pgfmathresult pt<-2.5pt% |
| 1947 |
\def\pgfmathresult{-2.5}% |
| 1948 |
\fi% |
| 1949 |
\pgf@x\pgfsysanim@t pt% |
| 1950 |
\advance\pgf@x by-\pgfmathresult\pgf@ya% |
| 1951 |
% \pgf@x is new t: |
| 1952 |
\pgf@y1pt% |
| 1953 |
\advance\pgf@y by-\pgf@x% |
| 1954 |
\edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}% |
| 1955 |
\edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}% |
| 1956 |
% now, evaluate target: |
| 1957 |
\pgf@xa#4pt% |
| 1958 |
\pgf@xb#6pt% |
| 1959 |
\pgfsysanim@eval@spline% |
| 1960 |
% \pgf@x is result: |
| 1961 |
\pgf@y1pt% |
| 1962 |
\advance\pgf@y by-\pgf@x% |
| 1963 |
\edef\pgfsysanim@frac@a{\pgf@sys@tonumber\pgf@x}% |
| 1964 |
\edef\pgfsysanim@frac@b{\pgf@sys@tonumber\pgf@y}% |
| 1965 |
\fi\fi% |
| 1966 |
\fi% |
| 1967 |
} |
| 1968 |
\def\pgfsysanim@id@spline{0,1,0,1} |
| 1969 |
|
| 1970 |
\def\pgfsysanim@eval@spline{% |
| 1971 |
% Iteration one: (0,#1,#2,1) reduced to (ya,yb,yc) |
| 1972 |
\pgf@ya\pgfsysanim@t\pgf@xa% |
| 1973 |
\pgf@yb\pgfsysanim@t\pgf@xb% |
| 1974 |
\advance\pgf@yb by\pgfsysanim@s\pgf@xa% |
| 1975 |
\pgf@yc\pgfsysanim@t pt% |
| 1976 |
\advance\pgf@yc by\pgfsysanim@s\pgf@xb% |
| 1977 |
% Iteration two: (ya,yb,yc) reduced to (y,xc) |
| 1978 |
\pgf@y\pgfsysanim@t\pgf@yb% |
| 1979 |
\advance\pgf@y by\pgfsysanim@s\pgf@ya% |
| 1980 |
\pgf@xc\pgfsysanim@t\pgf@yc% |
| 1981 |
\advance\pgf@xc by\pgfsysanim@s\pgf@yb% |
| 1982 |
% Iteration three: (y,xc) reduced to (x) |
| 1983 |
\pgf@x\pgfsysanim@t\pgf@xc% |
| 1984 |
\advance\pgf@x by\pgfsysanim@s\pgf@y% |
| 1985 |
} |
| 1986 |
|
| 1987 |
\def\pgfsysanim@jump@splines{% |
| 1988 |
\ifx\pgfsysanim@prev@out@time\pgfsys@stay@text% |
| 1989 |
\ifx\pgfsysanim@next@in@time\pgfsys@jump@text% |
| 1990 |
\ifdim\pgfsysanim@frac@a pt<0.5pt% |
| 1991 |
\def\pgfsysanim@frac@a{0}% |
| 1992 |
\def\pgfsysanim@frac@b{1}% |
| 1993 |
\else% |
| 1994 |
\def\pgfsysanim@frac@a{1}% |
| 1995 |
\def\pgfsysanim@frac@b{0}% |
| 1996 |
\fi% |
| 1997 |
\else% |
| 1998 |
% Only stay, so go to begin |
| 1999 |
\def\pgfsysanim@frac@a{0}% |
| 2000 |
\def\pgfsysanim@frac@b{1}% |
| 2001 |
\fi% |
| 2002 |
\else |
| 2003 |
% Only jump, so go to end |
| 2004 |
\def\pgfsysanim@frac@a{1}% |
| 2005 |
\def\pgfsysanim@frac@b{0}% |
| 2006 |
\fi% |
| 2007 |
} |
| 2008 |
|
| 2009 |
|
| 2010 |
\endinput |