summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-04-23 03:00:42 +0000
committerNorbert Preining <norbert@preining.info>2022-04-23 03:00:42 +0000
commit4acee1a3ab0aae587d4f0a4327141056ee7e6081 (patch)
tree1cde72d1e942ae756d750c665cd346533074171b /graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
parentc65c806536b3d6b228d5d71f0e0c835968a3733a (diff)
CTAN sync 202204230300
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex997
1 files changed, 168 insertions, 829 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
index aa481caaf9..44816fafc4 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
@@ -184,16 +184,16 @@
\northwest
\pgf@x=0pt
}
- #3
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ #3%
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
\pgf@circ@res@right = -\pgf@x
\pgf@circ@res@left = \pgf@x
- #2
+ #2%
}
}
}
@@ -457,10 +457,16 @@
% Option "boxed" for nodes and twoports
\newif\ifpgf@circuit@boxed
-\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
-\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
-\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
-\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
+\newif\ifpgf@circuit@boxedcircled\pgf@circuit@boxedcircledtrue
+\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledtrue}}
+\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledtrue}}
+\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledtrue}}
+\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledtrue}}
+% boxed, no circle
+\pgfkeys{/tikz/boxed only/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledfalse}}
+\ctikzset{boxed only/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledfalse}}
+\pgfkeys{/tikz/box only/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledfalse}}
+\ctikzset{box only/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledfalse}}
% Option "dashed" for nodes and twoports
\newif\ifpgf@circuit@dashed
@@ -480,14 +486,23 @@
%% Node shapes definition for path-style block diagrams%<<<
%% Draw the two-port fillable box
-\def\pgf@circ@twoportbox{
+\def\pgf@circ@twoportbox{%
\pgfscope
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}%
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}%
\pgf@circ@draworfill
\endpgfscope
}
-
+\def\pgf@circ@inputarrow{%
+ \ifpgf@circuit@inputarrow
+ {%
+ % Remove this: the line will overrun the tip, resulting in bad look. See issue #613, thanks to Laurenz Preindl
+ % \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}%
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}%
+ }%
+ \fi
+}
%% Generic two port box
\pgfcircdeclarebipolescaled{blocks}
{}
@@ -507,14 +522,7 @@
\fi
% draw outer box
\pgf@circ@twoportbox
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -528,6 +536,7 @@
\fi\fi
% draw inner symbol
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
}
@@ -553,15 +562,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
%get texts
\def\pgfcirc@tin{\ctikzvalof{bipoles/twoport/text in}}
\def\pgfcirc@tout{\ctikzvalof{bipoles/twoport/text out}}
@@ -594,6 +595,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\texti}
\pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textii}
}
@@ -675,15 +677,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -749,15 +743,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -820,15 +806,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -894,15 +872,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -958,15 +928,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1032,15 +994,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1096,15 +1050,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1164,15 +1110,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\texti{A}
\def\textii{D}
@@ -1201,6 +1139,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
\pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
}
@@ -1226,15 +1165,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\texti{D}
\def\textii{A}
@@ -1263,6 +1194,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
\pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
}
@@ -1288,15 +1220,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1310,6 +1234,7 @@
\fi\fi
% draw inner symbol
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\textsf{DSP}}
}
@@ -1334,15 +1259,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1356,6 +1273,7 @@
\fi\fi
% draw inner symbol
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\textsf{FFT}}
}
@@ -1425,6 +1343,7 @@
\pgf@circ@draworfill
% draw inner text
+ \pgf@circ@text@strokecolor
\pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
}
@@ -1494,8 +1413,6 @@
\pgfpathclose
\pgf@circ@draworfill
- % draw inner text
- \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
% draw arrow
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -1503,6 +1420,9 @@
\pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
\pgfusepath{draw}
+ % draw inner text
+ \pgf@circ@text@strokecolor
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
}
%% pi attenuator
@@ -1526,15 +1446,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1580,15 +1492,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1639,15 +1543,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1690,15 +1586,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1746,15 +1634,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1768,6 +1648,7 @@
\fi\fi
% inner symbol
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\Large$\varphi$}
}
@@ -1792,15 +1673,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1813,15 +1686,16 @@
\pgftransformrotate{90}
\fi\fi
- % inner symbol
- \pgftext[center,x=0,y=0]{\Large$\varphi$}
-
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
\pgfsetarrowsend{latex}
\pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
\pgfusepath{draw}
+ % inner symbol
+ \pgf@circ@text@strokecolor
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
}
%% detector
@@ -1845,15 +1719,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetarrows{-} %never draw arrows
@@ -1904,15 +1770,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1983,15 +1841,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -2062,15 +1912,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -2154,15 +1996,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -2260,15 +2094,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -2354,12 +2180,10 @@
\pgfcirc@activate@bipole@simple{l}{tdcac}
% %>>>
-%% Node shapes for Block elements%<<<
-
-\pgfdeclareshape{mixer}
-{
- \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
- \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+%% Node shapes for Block elements %<<<
+%
+% utility macro for the anchors
+\def\pgf@circ@circular@rf@anchors#1{%
\savedanchor\northwest{
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
\ifpgf@circuit@boxed
@@ -2368,165 +2192,75 @@
\pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
\pgf@x=.5\pgf@x
\else
- \pgf@y=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+ \pgf@y=\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
\pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
\pgf@x=.5\pgf@x
\fi
}
- \anchor{center}{
- \pgfpointorigin
- }
- \anchor{left}{%
- \northwest
- \pgf@y=0pt
- }
- \anchor{right}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{3}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{4}{
- \northwest
- \pgf@y=\pgf@y
- \pgf@x=0pt
- }
- \anchor{in 1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in 2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{in2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{out}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{center}{
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{north}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{e}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{w}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{s}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{n}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{down}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{up}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{south west}{
- \northwest
- \pgf@y=-\pgf@y
- }
- \anchor{north east}{
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{north west}{
- \northwest
- }
- \anchor{south east}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
- }
+ % border anchors
\anchorborder{
\pgf@circ@res@left=\pgf@x
\pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{\ctikzvalof{tripoles/mixer/width}*\scaledRlen/2}{\ctikzvalof{tripoles/mixer/width}*\scaledRlen/2}}
+ \ifnum\componentisboxed=0
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{\ctikzvalof{tripoles/#1/width}*\scaledRlen/2}{\ctikzvalof{tripoles/#1/width}*\scaledRlen/2}}
+ \else
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{\ctikzvalof{tripoles/#1/width}*\scaledRlen/2}{\ctikzvalof{tripoles/#1/width}*\scaledRlen/2}}
+ \fi
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgfcirc@northwest@symmetric@geoanchors
+ \anchor{geocenter}{\pgfpointorigin}
+ \anchor{up}{\northwest\pgf@x=0pt}
+ \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ % Deprecated number anchors
+ \anchor{1}{\northwest\pgf@y=0pt}
+ \anchor{2}{\northwest\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{3}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{4}{\northwest\pgf@y=\pgf@y\pgf@x=0pt}
+ % input output anchors (also quite bad)
+ \anchor{in 1}{\northwest\pgf@y=0pt}
+ \anchor{in1}{\northwest\pgf@y=0pt}
+ \anchor{in}{\northwest\pgf@y=0pt}
+ \anchor{in 2}{\northwest\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{in2}{\northwest\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{out}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+}
+% draw the body rectangle and circle if and when needed
+\def\pgf@circ@circular@rf@box@circle{%
+ \pgfstartlinewidth=\pgflinewidth
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \ifpgf@circuit@boxedcircled
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \fi
+ \pgf@circ@draworfill
+}
+%
+\pgfdeclareshape{mixer}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}}
+ % build the anchor set
+ \anchor{center}{\pgfpointorigin}
+ \pgf@circ@circular@rf@anchors{mixer}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
-
\pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
-
\pgfscope
- \pgfstartlinewidth=\pgflinewidth
-
- % draw outer box
- \ifpgf@circuit@boxed
- \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
- \fi
-
- % draw outer circle
- \ifpgf@circuit@boxed
- \pgf@circ@res@step=.7\pgf@circ@res@step
- \pgfsetdash{}{0pt} % draw solid circle if boxed
- \else
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \fi
- \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgf@circ@draworfill
-
+ \pgf@circ@circular@rf@box@circle
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -2537,7 +2271,6 @@
\pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
\pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
\pgfusepath{draw}
-
\endpgfscope
}
}
@@ -2546,177 +2279,19 @@
{
\savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
- \savedanchor\northwest{
- \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
- \ifpgf@circuit@boxed
- \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@x=.5\pgf@x
- \else
- \pgf@y=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
- \pgf@x=.5\pgf@x
- \fi
- }
- \anchor{center}{
- \pgfpointorigin
- }
- \anchor{left}{%
- \northwest
- \pgf@y=0pt
- }
- \anchor{right}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{3}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{4}{
- \northwest
- \pgf@y=\pgf@y
- \pgf@x=0pt
- }
- \anchor{in 1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in 2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{in2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{out}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{center}{
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{north}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{e}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{w}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{s}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{n}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{down}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{up}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{south west}{
- \northwest
- \pgf@y=-\pgf@y
- }
- \anchor{north east}{
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{north west}{
- \northwest
- }
- \anchor{south east}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchorborder{
- \pgf@circ@res@left=\pgf@x
- \pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{\ctikzvalof{tripoles/adder/width}*\scaledRlen/2}{\ctikzvalof{tripoles/adder/width}*\scaledRlen/2}}
- }
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}}
+ % build the anchor set
+ \anchor{center}{\pgfpointorigin}
+ \pgf@circ@circular@rf@anchors{adder}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
-
\pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
-
\pgfscope
- \pgfstartlinewidth=\pgflinewidth
-
- % draw outer box
- \ifpgf@circuit@boxed
- \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
- \fi
-
- % draw outer circle
- \ifpgf@circuit@boxed
- \pgf@circ@res@step=.7\pgf@circ@res@step{}
- \pgfsetdash{}{0pt} % draw solid circle if boxed
- \else
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \fi
- \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgf@circ@draworfill
-
+ \pgf@circ@circular@rf@box@circle
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
-
\pgfpathmoveto{\pgfpointorigin}
\pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
\pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
@@ -2725,7 +2300,6 @@
\pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
\pgfusepath{draw}
-
\endpgfscope
}
}
@@ -2734,126 +2308,22 @@
{
\savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
- \savedanchor\northwest{
- \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
- \ifpgf@circuit@boxed
- \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \else
- \pgf@y=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
- \fi
- }
- \anchor{center}{
- \pgfpointorigin
- }
- \anchor{north}{
- \northwest
- \pgf@x=.5\pgf@x
- }
- \anchor{south}{
- \northwest
- \pgf@x=.5\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{up}{
- \northwest
- \pgf@x=.5\pgf@x
- }
- \anchor{down}{
- \northwest
- \pgf@x=.5\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{n}{
- \northwest
- \pgf@x=.5\pgf@x
- }
- \anchor{s}{
- \northwest
- \pgf@x=.5\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{e}{
- \northwest
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{w}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{up}{
- \northwest
- \pgf@x=.5\pgf@x
- }
- \anchor{down}{
- \northwest
- \pgf@x=.5\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{right}{
- \northwest
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{left}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
- \anchor{north east}{ \northwest \pgf@x=0pt\relax}
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}}
+ % build the anchor set --- the center of an oscillator is on the right
+ \anchor{center}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \pgf@circ@circular@rf@anchors{oscillator}
+ % border anchors
\anchor{text}{
\pgf@x=-2\pgf@x
\advance \pgf@x by -.5\wd\pgfnodeparttextbox
\advance \pgf@y by -1.5\ht\pgfnodeparttextbox
}
- \anchorborder{
- \pgf@circ@res@left=\pgf@x
- \pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{\ctikzvalof{tripoles/oscillator/width}*\scaledRlen/2}{\ctikzvalof{tripoles/oscillator/width}*\scaledRlen/2}}
- \pgfmathsetlength{\pgf@x}{\pgf@x-\ctikzvalof{tripoles/oscillator/width}*\scaledRlen/2}
- }
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
-
\pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen{}
-
\pgfscope
- \pgfstartlinewidth=\pgflinewidth
-
- \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
-
- % draw outer box
- \ifpgf@circuit@boxed{}
- \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
- \fi
-
- % draw outer circle
- \ifpgf@circuit@boxed
- \pgf@circ@res@step=.7\pgf@circ@res@step{}
- \pgfsetdash{}{0pt} % draw solid circle if boxed
- \else
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \fi
- \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgf@circ@draworfill
-
+ \pgf@circ@circular@rf@box@circle
% draw inner sine waves
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -2863,9 +2333,7 @@
\pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
\pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
\pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
-
\pgfusepath{draw}
-
\endpgfscope
}
}
@@ -2874,147 +2342,24 @@
{
\savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
- \savedanchor\northwest{
- \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
- \ifpgf@circuit@boxed
- \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@x=.5\pgf@x
- \else
- \pgf@y=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
- \pgf@x=.5\pgf@x
- \fi
- }
- \anchor{center}{
- \pgfpointorigin
- }
- \anchor{left}{%
- \northwest
- \pgf@y=0pt
- }
- \anchor{right}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{2}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{3}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{north}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{e}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{w}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{s}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{n}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{down}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{up}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{south west}{
- \northwest
- \pgf@y=-\pgf@y
- }
- \anchor{north east}{
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{north west}{
- \northwest
- }
- \anchor{south east}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchorborder{
- \pgf@circ@res@left=\pgf@x
- \pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{\ctikzvalof{tripoles/circulator/width}*\scaledRlen/2}{\ctikzvalof{tripoles/circulator/width}*\scaledRlen/2}}
- }
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}}
+ % build the anchor set
+ \anchor{center}{\pgfpointorigin}
+ \pgf@circ@circular@rf@anchors{circulator}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
-
\pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
-
\pgfscope
- \pgfstartlinewidth=\pgflinewidth
-
- % draw outer box
- \ifpgf@circuit@boxed
- \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
- \fi
-
- % draw outer circle
- \ifpgf@circuit@boxed{}
- \pgf@circ@res@step=.7\pgf@circ@res@step{}
- \pgfsetdash{}{0pt} % draw solid circle if boxed
- \else
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \fi
- \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgf@circ@draworfill
-
+ \pgf@circ@circular@rf@box@circle
% inner arrow
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
-
\pgfsetarrowsend{latex}
\pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
\pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
\pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
\pgfusepath{draw}
-
\endpgfscope
}
}
@@ -3093,8 +2438,8 @@
\advance \pgf@x by -.5\wd\pgfnodeparttextbox
\advance \pgf@y by -1.5\ht\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{quadpoles/gridnode/width}\pgf@circ@scaled@Rlen
@@ -3118,15 +2463,7 @@
% draw outer box
\pgf@circ@twoportbox
-
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
+ \pgf@circ@inputarrow
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetarrows{-} %never draw arrows
@@ -3226,8 +2563,8 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\northwest
@@ -3240,6 +2577,8 @@
% draw outer box
\pgf@circ@twoportbox
+ \pgf@circ@inputarrow
+
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
@@ -3353,8 +2692,8 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\northwest
@@ -3367,7 +2706,7 @@
% draw outer box
\pgf@circ@twoportbox
-
+ \pgf@circ@inputarrow
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetarrows{-} %never draw arrows
@@ -3530,8 +2869,8 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -3546,11 +2885,10 @@
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@draworfill
-
% draw inner stuff
- #2
-
+ #2%
% draw inner text
+ \pgf@circ@text@strokecolor
\pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
}
}
@@ -3682,8 +3020,8 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\northwest
@@ -3696,6 +3034,7 @@
% draw outer box
\pgf@circ@twoportbox
+ \pgf@circ@inputarrow
% draw inner stuff
% rotate inner symbol