| 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 pgfextset\endcsname |
| 9 |
\input tikzext-util.tex |
| 10 |
\fi |
| 11 |
\pgfextset{ |
| 12 |
circle arrow start angle/.initial=, |
| 13 |
circle arrow end angle/.initial=, |
| 14 |
circle arrow delta angle/.initial=, |
| 15 |
circle arrow arrows/.initial=-, |
| 16 |
circle arrow/@turn left/.style={/pgf/ext/circle arrow arrows=->,/pgf/ext/circle arrow delta angle=340}, |
| 17 |
circle arrow/@turn right/.style={/pgf/ext/circle arrow arrows=<-,/pgf/ext/circle arrow delta angle=340}, |
| 18 |
circle arrow turn left north/.style = {/pgf/ext/circle arrow/@turn left, /pgf/ext/circle arrow start angle=100}, |
| 19 |
circle arrow turn left east/.style = {/pgf/ext/circle arrow/@turn left, /pgf/ext/circle arrow start angle=10}, |
| 20 |
circle arrow turn left south/.style = {/pgf/ext/circle arrow/@turn left, /pgf/ext/circle arrow start angle=280}, |
| 21 |
circle arrow turn left west/.style = {/pgf/ext/circle arrow/@turn left, /pgf/ext/circle arrow start angle=190}, |
| 22 |
circle arrow turn right north/.style = {/pgf/ext/circle arrow/@turn right, /pgf/ext/circle arrow start angle=100}, |
| 23 |
circle arrow turn right east/.style = {/pgf/ext/circle arrow/@turn right, /pgf/ext/circle arrow start angle=10}, |
| 24 |
circle arrow turn right south/.style = {/pgf/ext/circle arrow/@turn right, /pgf/ext/circle arrow start angle=280}, |
| 25 |
circle arrow turn right west/.style = {/pgf/ext/circle arrow/@turn right, /pgf/ext/circle arrow start angle=190}, |
| 26 |
} |
| 27 |
\pgfdeclareshape{ext_circle arrow}{ |
| 28 |
\inheritsavedanchors[from=circle] |
| 29 |
\inheritanchorborder[from=circle] |
| 30 |
\inheritanchor[from=circle]{north} |
| 31 |
\inheritanchor[from=circle]{north west} |
| 32 |
\inheritanchor[from=circle]{north east} |
| 33 |
\inheritanchor[from=circle]{center} |
| 34 |
\inheritanchor[from=circle]{west} |
| 35 |
\inheritanchor[from=circle]{east} |
| 36 |
\inheritanchor[from=circle]{mid} |
| 37 |
\inheritanchor[from=circle]{mid west} |
| 38 |
\inheritanchor[from=circle]{mid east} |
| 39 |
\inheritanchor[from=circle]{base} |
| 40 |
\inheritanchor[from=circle]{base west} |
| 41 |
\inheritanchor[from=circle]{base east} |
| 42 |
\inheritanchor[from=circle]{south} |
| 43 |
\inheritanchor[from=circle]{south west} |
| 44 |
\inheritanchor[from=circle]{south east} |
| 45 |
\backgroundpath{ |
| 46 |
\pgfkeysgetvalue{/pgf/ext/circle arrow start angle}\pgf@sh@circlearrow@s |
| 47 |
\pgfkeysgetvalue{/pgf/ext/circle arrow end angle}\pgf@sh@circlearrow@e |
| 48 |
\pgfkeysgetvalue{/pgf/ext/circle arrow delta angle}\pgf@sh@circlearrow@d |
| 49 |
\ifx\pgf@sh@circlearrow@s\pgfutil@empty% |
| 50 |
\pgfmathsetmacro\pgf@sh@circlearrow@s{\pgf@sh@circlearrow@e-\pgf@sh@circlearrow@d}% |
| 51 |
\else |
| 52 |
\ifx\pgf@sh@circlearrow@e\pgfutil@empty% |
| 53 |
\pgfmathsetmacro\pgf@sh@circlearrow@e{\pgf@sh@circlearrow@s+\pgf@sh@circlearrow@d}% |
| 54 |
\fi% |
| 55 |
\fi |
| 56 |
\pgfutil@tempdima=\radius |
| 57 |
\pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}% |
| 58 |
\pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}% |
| 59 |
\ifdim\pgf@xb<\pgf@yb |
| 60 |
\advance\pgfutil@tempdima by-\pgf@yb |
| 61 |
\else |
| 62 |
\advance\pgfutil@tempdima by-\pgf@xb |
| 63 |
\fi |
| 64 |
\pgfpathmoveto{\pgfpointadd{\centerpoint}{\pgfpointpolar{\pgf@sh@circlearrow@s}{\pgfutil@tempdima}}}% |
| 65 |
\pgfpatharc{\pgf@sh@circlearrow@s}{\pgf@sh@circlearrow@e}{\pgfutil@tempdima}% |
| 66 |
\pgfkeysgetvalue{/pgf/ext/circle arrow arrows}\pgf@temp |
| 67 |
\expandafter\pgfsetarrows\expandafter{\pgf@temp}% |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
%%% Compatibility |
| 72 |
\pgfkeysifdefined{/tikz/ext/compat/shapes/.@cmd}{}{\pgfextset{/tikz-ext/compat/add library={shapes}{pre 0.6}}} |
| 73 |
\tikzextset{ |
| 74 |
compat/shapes/warn/.append style=/tikz/ext/compat/shapes.circlearrow/warn, |
| 75 |
compat/shapes/pre 0.6/.append style=/tikz/ext/compat/shapes.circlearrow/pre 0.6, |
| 76 |
compat/shapes.circlearrow/warn/.code={% |
| 77 |
\tikzextutil@compatwarning@key{shapes}{pre 0.6}{/pgf/circle arrow turn left north}{/pgf/ext/circle arrow turn left north}% |
| 78 |
\tikzextutil@compatwarning@key{shapes}{pre 0.6}{/pgf/circle arrow turn left east}{/pgf/ext/circle arrow turn left east}% |
| 79 |
\tikzextutil@compatwarning@key{shapes}{pre 0.6}{/pgf/circle arrow turn left west}{/pgf/ext/circle arrow turn left west}% |
| 80 |
\tikzextutil@compatwarning@key{shapes}{pre 0.6}{/pgf/circle arrow turn left south}{/pgf/ext/circle arrow turn left south}% |
| 81 |
\tikzextutil@compatwarning@key{shapes}{pre 0.6}{/pgf/circle arrow turn right north}{/pgf/ext/circle arrow turn right north}% |
| 82 |
\tikzextutil@compatwarning@key{shapes}{pre 0.6}{/pgf/circle arrow turn right east}{/pgf/ext/circle arrow turn right east}% |
| 83 |
\tikzextutil@compatwarning@key{shapes}{pre 0.6}{/pgf/circle arrow turn right west}{/pgf/ext/circle arrow turn right west}% |
| 84 |
\tikzextutil@compatwarning@key{shapes}{pre 0.6}{/pgf/circle arrow turn right south}{/pgf/ext/circle arrow turn right south}% |
| 85 |
\tikzextutil@compatwarning@valuekey{shapes}{pre 0.6}{/pgf/circle arrow start angle}{/pgf/ext/circle arrow start angle}% |
| 86 |
\tikzextutil@compatwarning@valuekey{shapes}{pre 0.6}{/pgf/circle arrow delta angle}{/pgf/ext/circle arrow delta angle}% |
| 87 |
\tikzextutil@compatwarning@valuekey{shapes}{pre 0.6}{/pgf/circle arrow end angle}{/pgf/ext/circle arrow end angle}% |
| 88 |
\tikzextutil@compatwarning@valuekey{shapes}{pre 0.6}{/pgf/circle arrow arrows} {/pgf/ext/circle arrow arrows}% |
| 89 |
\tikzextutil@compat@cloneshape{circle arrow}{text,north,north west,north east,center,west,east,mid,mid west,mid east,base,base west,base east,south,south west,south east,center}% |
| 90 |
\def\tikzext@temp{\tikzextutil@compatmaybewarning{shape 'circle arrow'}{'ext_circle arrow'}{shapes = pre 0.6}}% |
| 91 |
\expandafter\tikzextutil@prefix@macrotomacro\csname pgf@sh@s@circle arrow\endcsname\tikzext@temp |
| 92 |
}, |
| 93 |
compat/shapes.circlearrow/pre 0.6/.code={% |
| 94 |
\pgfkeysdef{/pgf/circle arrow turn left north}{\pgfkeysvalueof{/pgf/ext/circle arrow turn left north/.@cmd}##1\pgfeov}% |
| 95 |
\pgfkeysdef{/pgf/circle arrow turn left east}{\pgfkeysvalueof{/pgf/ext/circle arrow turn left east/.@cmd}##1\pgfeov}% |
| 96 |
\pgfkeysdef{/pgf/circle arrow turn left west}{\pgfkeysvalueof{/pgf/ext/circle arrow turn left west/.@cmd}##1\pgfeov}% |
| 97 |
\pgfkeysdef{/pgf/circle arrow turn left south}{\pgfkeysvalueof{/pgf/ext/circle arrow turn left south/.@cmd}##1\pgfeov}% |
| 98 |
\pgfkeysdef{/pgf/circle arrow turn right north}{\pgfkeysvalueof{/pgf/ext/circle arrow turn right north/.@cmd}##1\pgfeov}% |
| 99 |
\pgfkeysdef{/pgf/circle arrow turn right east}{\pgfkeysvalueof{/pgf/ext/circle arrow turn right east/.@cmd}##1\pgfeov}% |
| 100 |
\pgfkeysdef{/pgf/circle arrow turn right west}{\pgfkeysvalueof{/pgf/ext/circle arrow turn right west/.@cmd}##1\pgfeov}% |
| 101 |
\pgfkeysdef{/pgf/circle arrow turn right south}{\pgfkeysvalueof{/pgf/ext/circle arrow turn right south/.@cmd}##1\pgfeov}% |
| 102 |
\pgfkeysdef{/pgf/circle arrow start angle}{\pgfkeyssetvalue{/pgf/ext/circle arrow start angle}{##1}}% |
| 103 |
\pgfkeysdef{/pgf/circle arrow delta angle}{\pgfkeyssetvalue{/pgf/ext/circle arrow delta angle}{##1}}% |
| 104 |
\pgfkeysdef{/pgf/circle arrow end angle}{\pgfkeyssetvalue{/pgf/ext/circle arrow end angle}{##1}}% |
| 105 |
\pgfkeysdef{/pgf/circle arrow arrows} {\pgfkeyssetvalue{/pgf/ext/circle arrow arrows}{##1}}% |
| 106 |
\pgfkeyssetvalue{/pgf/circle arrow start angle}{\pgfkeysvalueof{/pgf/ext/circle arrow start angle}}% |
| 107 |
\pgfkeyssetvalue{/pgf/circle arrow delta angle}{\pgfkeysvalueof{/pgf/ext/circle arrow delta angle}}% |
| 108 |
\pgfkeyssetvalue{/pgf/circle arrow end angle}{\pgfkeysvalueof{/pgf/ext/circle arrow end angle}}% |
| 109 |
\pgfkeyssetvalue{/pgf/circle arrow arrows} {\pgfkeysvalueof{/pgf/ext/circle arrow arrows}}% |
| 110 |
\tikzextutil@compat@cloneshape{circle arrow}{text,north,north west,north east,center,west,east,mid,mid west,mid east,base,base west,base east,south,south west,south east,center}% |
| 111 |
}, |
| 112 |
compat/shapes.circlearrow/\pgfkeysvalueof{/tikz/ext/compat/shapes}% |
| 113 |
} |