summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex425
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex137
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex408
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex4312
-rw-r--r--Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex34
5 files changed, 2656 insertions, 2660 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex
index e79634a06ea..62b1a260299 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.IEC.code.tex
@@ -13,20 +13,20 @@
%
\pgfdeclareshape{var resistor IEC}
-{
- \inheritsavedanchors[from=rectangle ee]
- \inheritanchor[from=rectangle ee]{center}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
- \inheritanchorborder[from=rectangle ee]
+{%
+ \inheritsavedanchors[from=rectangle ee]%
+ \inheritanchor[from=rectangle ee]{center}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
+ \inheritanchorborder[from=rectangle ee]%
\backgroundpath{
\pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
@@ -54,9 +54,9 @@
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yc}}%
\pgfutil@repeat%
\advance\pgf@xb by-.1pt%
- \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
- }
-}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
+ }%
+}%
@@ -65,7 +65,7 @@
%
\pgfdeclareshape{inductor IEC}
-{
+{%
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -75,7 +75,7 @@
\pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
\pgf@y=\pgf@ya%
\advance\pgf@y by\pgf@yb%
- }
+ }%
\savedanchor\southwest{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -83,19 +83,19 @@
\advance\pgf@x by -.5\pgf@xb%
\pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
\pgf@y=-\pgf@ya%
- }
-
- \anchor{center}{\pgfpointorigin}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
+ }%
+
+ \anchor{center}{\pgfpointorigin}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
\anchorborder{%
\ifdim\pgf@y<0pt%
@@ -112,8 +112,8 @@
\pgf@yc=\pgf@y%
\pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\northeast}}%
\fi%
- }
-
+ }%
+
\backgroundpath{
\pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
\pgf@xa=-\pgf@x \pgf@ya=0pt
@@ -127,12 +127,12 @@
\pgfutil@loop%
\advance\pgf@xa by2\pgf@xc\relax%
\ifdim\pgf@xa<\pgf@xb%
- \pgfpatharc{180}{0}{\pgf@xc}%
+ \pgfpatharc{180}{0}{\pgf@xc}%
\pgfutil@repeat%
\advance\pgf@xb by-.1pt%
- \pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}%
- }
-}
+ \pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}%
+ }%
+}%
@@ -142,20 +142,20 @@
%
\pgfdeclareshape{capacitor IEC}
-{
- \inheritsavedanchors[from=rectangle ee]
- \inheritanchor[from=rectangle ee]{center}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
- \inheritanchorborder[from=rectangle ee]
+{%
+ \inheritsavedanchors[from=rectangle ee]%
+ \inheritanchor[from=rectangle ee]{center}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
+ \inheritanchorborder[from=rectangle ee]%
\backgroundpath{
\pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
@@ -166,8 +166,8 @@
\pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}
\pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
@@ -177,20 +177,20 @@
%
\pgfdeclareshape{ground IEC}
-{
- \inheritsavedanchors[from=rectangle ee]
- \inheritanchor[from=rectangle ee]{center}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
- \inheritanchorborder[from=rectangle ee]
+{%
+ \inheritsavedanchors[from=rectangle ee]%
+ \inheritanchor[from=rectangle ee]{center}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
+ \inheritanchorborder[from=rectangle ee]%
\backgroundpath{
\pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
@@ -213,8 +213,8 @@
\advance\pgf@yb by-\pgf@yc
\pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
@@ -224,20 +224,20 @@
%
\pgfdeclareshape{battery IEC}
-{
- \inheritsavedanchors[from=rectangle ee]
- \inheritanchor[from=rectangle ee]{center}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
- \inheritanchorborder[from=rectangle ee]
+{%
+ \inheritsavedanchors[from=rectangle ee]%
+ \inheritanchor[from=rectangle ee]{center}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
+ \inheritanchorborder[from=rectangle ee]%
\backgroundpath{
\pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
@@ -253,8 +253,8 @@
\advance\pgf@yb by-\pgf@yc
\pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@ya}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
%
@@ -263,20 +263,20 @@
\pgfdeclareshape{breakdown diode IEC}
-{
- \inheritsavedanchors[from=rectangle ee]
- \inheritanchor[from=rectangle ee]{center}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
- \inheritanchorborder[from=rectangle ee]
+{%
+ \inheritsavedanchors[from=rectangle ee]%
+ \inheritanchor[from=rectangle ee]{center}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
+ \inheritanchorborder[from=rectangle ee]%
\backgroundpath{
\pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
@@ -295,9 +295,9 @@
\pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@yc}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
\pgfpathclose
- }
+ }%
+
-
\beforebackgroundpath{
{
\pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
@@ -311,7 +311,7 @@
\pgfusepathqstroke
\pgf@xc=.5\pgf@xa
\advance\pgf@xc by.5\pgf@xb
- \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}
+ \pgftransformshift{\pgfqpoint{\pgf@xc}{\pgf@yc}}
\pgf@yc=.5\pgf@yb
\advance\pgf@yc by-.5\pgf@ya
\pgftransformscale{\pgf@sys@tonumber{\pgf@yc}}
@@ -321,8 +321,8 @@
\pgfpathlineto{\pgfqpoint{.5pt}{1pt}}
\pgfusepathqstroke
}
- }
-}
+ }%
+}%
@@ -339,7 +339,7 @@
\pgfdeclareshape{generic circle IEC}
-{
+{%
% This shape is a generic circle, to which you can add something to
% the before background path using the key
% /pgf/generic circle IEC/before background
@@ -347,31 +347,31 @@
% setup such that the circle's center is at the origin and that the
% position \pgfpoint{1pt}{0pt} lies exactly on the top of the circle
% (and, there, on the middle of the line).
-
- \inheritsavedanchors[from=circle ee]
- \inheritanchorborder[from=circle ee]
- \inheritanchor[from=circle ee]{north}
- \inheritanchor[from=circle ee]{north west}
- \inheritanchor[from=circle ee]{north east}
- \inheritanchor[from=circle ee]{center}
- \inheritanchor[from=circle ee]{west}
- \inheritanchor[from=circle ee]{east}
- \inheritanchor[from=circle ee]{south}
- \inheritanchor[from=circle ee]{south west}
- \inheritanchor[from=circle ee]{south east}
- \inheritanchor[from=circle ee]{input}
- \inheritanchor[from=circle ee]{output}
- \inheritbackgroundpath[from=circle ee]
-
+
+ \inheritsavedanchors[from=circle ee]%
+ \inheritanchorborder[from=circle ee]%
+ \inheritanchor[from=circle ee]{north}%
+ \inheritanchor[from=circle ee]{north west}%
+ \inheritanchor[from=circle ee]{north east}%
+ \inheritanchor[from=circle ee]{center}%
+ \inheritanchor[from=circle ee]{west}%
+ \inheritanchor[from=circle ee]{east}%
+ \inheritanchor[from=circle ee]{south}%
+ \inheritanchor[from=circle ee]{south west}%
+ \inheritanchor[from=circle ee]{south east}%
+ \inheritanchor[from=circle ee]{input}%
+ \inheritanchor[from=circle ee]{output}%
+ \inheritbackgroundpath[from=circle ee]%
+
\beforebackgroundpath{
{
\centerpoint%
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
- \pgftransformshift{}
+ \pgftransformshift{}
\pgfutil@tempdima=\radius%
- \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%
\ifdim\pgf@xb<\pgf@yb%
\advance\pgfutil@tempdima by-\pgf@yb%
\else%
@@ -380,8 +380,8 @@
\pgftransformscale{\pgf@sys@tonumber{\pgfutil@tempdima}}
\pgfkeysvalueof{/pgf/generic circle IEC/before background}
}
- }
-}
+ }%
+}%
@@ -390,28 +390,28 @@
%
\pgfdeclareshape{generic diode IEC}
-{
+{%
% This shape is a generic diode, to which you can add something to
% the before background path using the key
% /pgf/generic diode IEC/before background
% When this key is invoked, the transformation matrix will have been
- % setup such that the center is at the tip of the diode. The
+ % setup such that the center is at the tip of the diode. The
% position \pgfpoint{1pt}{0pt} lies exactly on the top of the
- % (suggested) line before the diode.
-
- \inheritsavedanchors[from=rectangle ee]
- \inheritanchor[from=rectangle ee]{center}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
- \inheritanchorborder[from=rectangle ee]
+ % (suggested) line before the diode.
+
+ \inheritsavedanchors[from=rectangle ee]%
+ \inheritanchor[from=rectangle ee]{center}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
+ \inheritanchorborder[from=rectangle ee]%
\backgroundpath{
\pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
@@ -427,9 +427,9 @@
\advance\pgf@yc by .5\pgf@yb
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}
\pgfpathclose
- }
+ }%
+
-
\beforebackgroundpath{
{
\pgf@process{\pgfpointadd{\southwest}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}
@@ -441,31 +441,31 @@
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@yc}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yc}}
\pgfusepathqstroke
- \pgftransformshift{\pgfqpoint{\pgf@xb}{\pgf@yc}}
+ \pgftransformshift{\pgfqpoint{\pgf@xb}{\pgf@yc}}
\pgf@yc=.5\pgf@yb
\advance\pgf@yc by-.5\pgf@ya
\pgftransformscale{\pgf@sys@tonumber{\pgf@yc}}
\pgfkeysvalueof{/pgf/generic diode IEC/before background}
}
- }
-}
+ }%
+}%
\pgfkeys{
/pgf/generic circle IEC/before background/.initial=,
/pgf/generic diode IEC/before background/.initial=,
-}
+}%
%
-% Concacts
+% Contacts
%
\pgfdeclareshape{make contact IEC}
-{
+{%
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -475,7 +475,7 @@
\pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
\pgf@y=\pgf@ya%
\advance\pgf@y by\pgf@yb%
- }
+ }%
\savedanchor\southwest{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -483,23 +483,23 @@
\advance\pgf@x by -.5\pgf@xb%
\pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
\pgf@y=-\pgf@ya%
- }
-
- \anchor{center}{\pgfpointorigin}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
+ }%
+
+ \anchor{center}{\pgfpointorigin}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
\anchorborder{%
\ifdim\pgf@y<0pt%
- % tricky... simpilfy to the origin...
+ % tricky... simplify to the origin...
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
\pgf@process{\southwest}%
@@ -512,8 +512,8 @@
\pgf@yc=\pgf@y%
\pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\northeast}}%
\fi%
- }
-
+ }%
+
\backgroundpath{
\pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
\pgf@xa=-\pgf@x \pgf@ya=0pt
@@ -521,17 +521,17 @@
% Start point
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
%
-% Concacts
+% Contacts
%
\pgfdeclareshape{var make contact IEC}
-{
+{%
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -541,7 +541,7 @@
\pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
\pgf@y=\pgf@ya%
\advance\pgf@y by\pgf@yb%
- }
+ }%
\savedanchor\southwest{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -551,23 +551,23 @@
\pgf@y=-\pgf@ya%
\pgf@xc=0.083333\pgf@x%
\advance\pgf@y by\pgf@xc%
- }
-
- \anchor{center}{\pgfpointorigin}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
+ }%
+
+ \anchor{center}{\pgfpointorigin}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
\anchorborder{%
\ifdim\pgf@y<0pt%
- % tricky... simpilfy to the origin...
+ % tricky... simplify to the origin...
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
\pgf@process{\southwest}%
@@ -579,8 +579,8 @@
\pgf@yc=\pgf@y%
\pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\northeast}}%
\fi%
- }
-
+ }%
+
\backgroundpath{
\pgf@process{\pgfpointadd{\northeast}{
\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
@@ -600,13 +600,13 @@
\pgfpathmoveto{\pgfpointadd{\pgfqpoint{\pgf@xa}{0pt}}{%
\pgfpointscale{\pgfutil@tempdima}{\pgfqpoint{\pgf@xc}{\pgf@yc}}}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
\pgfdeclareshape{break contact IEC}
-{
+{%
\savedanchor\northeast{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -616,7 +616,7 @@
\pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/minimum height}}%
\pgf@y=\pgf@ya%
\advance\pgf@y by\pgf@yb%
- }
+ }%
\savedanchor\southwest{%
\pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
\pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%
@@ -624,23 +624,23 @@
\advance\pgf@x by -.5\pgf@xb%
\pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
\pgf@y=-\pgf@ya%
- }
-
- \anchor{center}{\pgfpointorigin}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
+ }%
+
+ \anchor{center}{\pgfpointorigin}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
\anchorborder{%
\ifdim\pgf@y<0pt%
- % tricky... simpilfy to the origin...
+ % tricky... simplify to the origin...
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
\pgf@process{\southwest}%
@@ -653,8 +653,8 @@
\pgf@yc=\pgf@y%
\pgf@process{\pgfpointborderrectangle{\pgfqpoint{\pgf@xc}{\the\pgf@yc}}{\northeast}}%
\fi%
- }
-
+ }%
+
\backgroundpath{
\pgf@process{\pgfpointadd{\northeast}{\pgfpointscale{-1}{\pgfpoint{\pgfkeysvalueof{/pgf/outer xsep}}{\pgfkeysvalueof{/pgf/outer ysep}}}}}
\pgf@xa=-\pgf@x \pgf@ya=0pt
@@ -669,12 +669,11 @@
\advance\pgf@xb by-\pgf@xc
\pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@yb}}
- }
-}
+ }%
+}%
\endinput
-
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex
index 30ecbff3c4d..4cfa4eed7d6 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.ee.code.tex
@@ -16,25 +16,25 @@
% and an "output" anchor have been added at the left and right end.
\pgfdeclareshape{rectangle ee}
-{
- \inheritsavedanchors[from=rectangle]
- \inheritanchorborder[from=rectangle]
- \inheritanchor[from=rectangle]{north}
- \inheritanchor[from=rectangle]{north west}
- \inheritanchor[from=rectangle]{north east}
- \inheritanchor[from=rectangle]{center}
- \inheritanchor[from=rectangle]{west}
- \inheritanchor[from=rectangle]{east}
- \inheritanchor[from=rectangle]{mid}
- \inheritanchor[from=rectangle]{mid west}
- \inheritanchor[from=rectangle]{mid east}
- \inheritanchor[from=rectangle]{base}
- \inheritanchor[from=rectangle]{base west}
- \inheritanchor[from=rectangle]{base east}
- \inheritanchor[from=rectangle]{south}
- \inheritanchor[from=rectangle]{south west}
- \inheritanchor[from=rectangle]{south east}
- \inheritbackgroundpath[from=rectangle]
+{%
+ \inheritsavedanchors[from=rectangle]%
+ \inheritanchorborder[from=rectangle]%
+ \inheritanchor[from=rectangle]{north}%
+ \inheritanchor[from=rectangle]{north west}%
+ \inheritanchor[from=rectangle]{north east}%
+ \inheritanchor[from=rectangle]{center}%
+ \inheritanchor[from=rectangle]{west}%
+ \inheritanchor[from=rectangle]{east}%
+ \inheritanchor[from=rectangle]{mid}%
+ \inheritanchor[from=rectangle]{mid west}%
+ \inheritanchor[from=rectangle]{mid east}%
+ \inheritanchor[from=rectangle]{base}%
+ \inheritanchor[from=rectangle]{base west}%
+ \inheritanchor[from=rectangle]{base east}%
+ \inheritanchor[from=rectangle]{south}%
+ \inheritanchor[from=rectangle]{south west}%
+ \inheritanchor[from=rectangle]{south east}%
+ \inheritbackgroundpath[from=rectangle]%
% New:
\anchor{input}{
\pgf@process{\northeast}%
@@ -42,57 +42,57 @@
\pgf@process{\southwest}%
\pgf@y=.5\pgf@y%
\advance\pgf@y by \pgf@ya%
- }
+ }%
\anchor{output}{%
\pgf@process{\southwest}%
\pgf@ya=.5\pgf@y%
\pgf@process{\northeast}%
\pgf@y=.5\pgf@y%
\advance\pgf@y by \pgf@ya%
- }
-}
+ }%
+}%
\pgfdeclareshape{circle ee}
-{
- \inheritsavedanchors[from=circle]
- \inheritanchorborder[from=circle]
- \inheritanchor[from=circle]{north}
- \inheritanchor[from=circle]{north west}
- \inheritanchor[from=circle]{north east}
- \inheritanchor[from=circle]{center}
- \inheritanchor[from=circle]{west}
- \inheritanchor[from=circle]{east}
- \inheritanchor[from=circle]{mid}
- \inheritanchor[from=circle]{mid west}
- \inheritanchor[from=circle]{mid east}
- \inheritanchor[from=circle]{base}
- \inheritanchor[from=circle]{base west}
- \inheritanchor[from=circle]{base east}
- \inheritanchor[from=circle]{south}
- \inheritanchor[from=circle]{south west}
- \inheritanchor[from=circle]{south east}
- \inheritbackgroundpath[from=circle]
+{%
+ \inheritsavedanchors[from=circle]%
+ \inheritanchorborder[from=circle]%
+ \inheritanchor[from=circle]{north}%
+ \inheritanchor[from=circle]{north west}%
+ \inheritanchor[from=circle]{north east}%
+ \inheritanchor[from=circle]{center}%
+ \inheritanchor[from=circle]{west}%
+ \inheritanchor[from=circle]{east}%
+ \inheritanchor[from=circle]{mid}%
+ \inheritanchor[from=circle]{mid west}%
+ \inheritanchor[from=circle]{mid east}%
+ \inheritanchor[from=circle]{base}%
+ \inheritanchor[from=circle]{base west}%
+ \inheritanchor[from=circle]{base east}%
+ \inheritanchor[from=circle]{south}%
+ \inheritanchor[from=circle]{south west}%
+ \inheritanchor[from=circle]{south east}%
+ \inheritbackgroundpath[from=circle]%
% New:
- \anchor{input}{\centerpoint\advance\pgf@x by-\radius}
- \anchor{output}{\centerpoint\advance\pgf@x by\radius}
-}
+ \anchor{input}{\centerpoint\advance\pgf@x by-\radius}%
+ \anchor{output}{\centerpoint\advance\pgf@x by\radius}%
+}%
%
% Current direction indicator. This shape uses the current setting of
% the current direction arrow tip for the arrow. The shape is a
-% rectangle around the arrow tip.
+% rectangle around the arrow tip.
%
\pgfdeclareshape{direction ee}
-{
+{%
\savedanchor\northeast{
\pgf@x=0pt%
% Height is given by minimum height/2
\pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/minimum height}}%
\pgf@y=.5\pgf@y
- }
+ }%
\savedanchor\southwest{
% Left border is given by left extend
\pgfarrowtotallength{\pgfkeysvalueof{/pgf/direction ee arrow}}%
@@ -100,20 +100,20 @@
% Height is given by minimum height/2
\pgfmathsetlength{\pgf@y}{\pgfkeysvalueof{/pgf/minimum height}}%
\pgf@y=-.5\pgf@y
- }
-
- \inheritanchor[from=rectangle ee]{center}
- \inheritanchor[from=rectangle ee]{north}
- \inheritanchor[from=rectangle ee]{south}
- \inheritanchor[from=rectangle ee]{east}
- \inheritanchor[from=rectangle ee]{west}
- \inheritanchor[from=rectangle ee]{north east}
- \inheritanchor[from=rectangle ee]{north west}
- \inheritanchor[from=rectangle ee]{south east}
- \inheritanchor[from=rectangle ee]{south west}
- \inheritanchor[from=rectangle ee]{input}
- \inheritanchor[from=rectangle ee]{output}
- \inheritanchorborder[from=rectangle ee]
+ }%
+
+ \inheritanchor[from=rectangle ee]{center}%
+ \inheritanchor[from=rectangle ee]{north}%
+ \inheritanchor[from=rectangle ee]{south}%
+ \inheritanchor[from=rectangle ee]{east}%
+ \inheritanchor[from=rectangle ee]{west}%
+ \inheritanchor[from=rectangle ee]{north east}%
+ \inheritanchor[from=rectangle ee]{north west}%
+ \inheritanchor[from=rectangle ee]{south east}%
+ \inheritanchor[from=rectangle ee]{south west}%
+ \inheritanchor[from=rectangle ee]{input}%
+ \inheritanchor[from=rectangle ee]{output}%
+ \inheritanchorborder[from=rectangle ee]%
\nodeparts{}% no text
\behindbackgroundpath{
@@ -124,7 +124,7 @@
\pgfpathmoveto{\pgfqpoint{\pgf@xa}{0pt}}
\pgfpathlineto{\pgfqpoint{\pgf@xb}{0pt}}
\pgfusepathqstroke
- }
+ }%
\beforebackgroundpath{
{
@@ -132,19 +132,19 @@
\pgfarrowdraw{\pgfkeysvalueof{/pgf/direction ee arrow}}%
\pgfsys@endscope
}
- }
-}
+ }%
+}%
\pgfkeys{
/pgf/direction ee arrow/.initial=direction ee,
-}
+}%
% Special arrow for ee directions:
\pgfarrowsdeclare{direction ee}{direction ee}
-{
+{%
\pgfmathsetlength\pgfutil@tempdima{\pgfgetarrowoptions{direction ee}}%
\pgfutil@tempdima=.5\pgfutil@tempdima
\pgfarrowsleftextend{+-\pgfutil@tempdima}
@@ -159,13 +159,12 @@
\pgfpathlineto{\pgfqpoint{-0.5\pgfutil@tempdima}{-0.38268343237\pgfutil@tempdima}}
\pgfpathclose
\pgfusepathqfillstroke
-}
+}%
-\pgfsetarrowoptions{direction ee}{4pt}
+\pgfsetarrowoptions{direction ee}{4pt}%
\endinput
-
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
index e137e113cdc..9b964996d70 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.IEC.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{shapes.gates.logic}
+\usepgflibrary{shapes.gates.logic}%
\pgfkeys{/pgf/.cd,
and gate IEC symbol/.initial=$\char`\&$,
@@ -20,14 +20,14 @@
buffer gate IEC symbol/.initial=1,
logic gate IEC symbol align/.initial=top,
logic gate IEC symbol color/.initial=% no value
-}
+}%
\pgfkeys{/pgf/logic gate IEC symbol align/.cd,
top/.code=\pgftransformyshift{\innerhalfheight},
bottom/.code=\pgftransformyshift{-\innerhalfheight},
left/.code=\pgftransformxshift{-\innerhalfwidth},
- right/.code=\pgftransformxshift{\innerhalfwidth}
-}
+ right/.code=\pgftransformxshift{\innerhalfwidth},
+}%
\def\pgf@lib@sh@logicgates@IEC@foregroundpath#1{%
\dimensions%
@@ -45,7 +45,7 @@
\pgfkeysvalueof{/pgf/#1 gate IEC symbol}%
}%
}%
-}
+}%
\def\pgf@lib@sh@logicgates@dimensions@IEC#1{%
@@ -135,13 +135,13 @@
\multiply\pgfutil@tempdima#1\relax%
\advance\pgf@y\halfheight%
\advance\pgf@y-\pgfutil@tempdima%
-}
+}%
% Shape and gate IEC
%
-\pgfdeclareshape{and gate IEC}{
+\pgfdeclareshape{and gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -165,25 +165,25 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{and}%
- }
+ }%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
+ }%
\anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}
+ \anchor{mid}{\midpoint}%
\anchor{mid west}{%
\dimensions%
\midpoint%
@@ -192,7 +192,7 @@
\dimensions%
\midpoint%
\advance\pgf@x\halfwidth}%
- \anchor{base}{\basepoint}
+ \anchor{base}{\basepoint}%
\anchor{base west}{%
\dimensions%
\basepoint%
@@ -209,7 +209,7 @@
\anchor{north west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth\advance\pgf@y\halfheight}%
\anchor{south east}{\dimensions\centerpoint\advance\pgf@x\halfwidth\advance\pgf@y-\halfheight}%
\anchor{south west}{\dimensions\centerpoint\advance\pgf@x-\halfwidth\advance\pgf@y-\halfheight}%
- \anchor{output}{\dimensions\centerpoint\advance\pgf@x\halfwidth}
+ \anchor{output}{\dimensions\centerpoint\advance\pgf@x\halfwidth}%
\backgroundpath{%
\dimensions%
\pgf@xc\halfwidth%
@@ -241,19 +241,19 @@
\advance\pgf@yc-\pgfutil@tempdima%
\expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
{%
- \pgfpathcircle{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\invertedradius}%
+ \pgfpathcircle{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\invertedradius}%
}%
\fi%
\repeatpgfmathloop%
}%
- }
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{and}}
+ }%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{and}}%
\anchorborder{%
\pgfextract@process\externalpoint{}%
\dimensions%
\pgfpointadd{\centerpoint}{\pgfpointborderrectangle{\externalpoint}{\pgfqpoint{\halfwidth}{\halfheight}}}%
- }%
-}
+ }%
+}%
@@ -261,7 +261,7 @@
% Shape nand gate IEC
%
-\pgfdeclareshape{nand gate IEC}{
+\pgfdeclareshape{nand gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -285,43 +285,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{nand}%
- }
+ }%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
\anchor{output}{%
\csname pgf@anchor@and gate IEC@east\endcsname%
\advance\pgf@x\invertedradius%
\advance\pgf@x\outerinvertedradius%
- }
+ }%
\backgroundpath{%
\csname pgf@sh@bg@and gate IEC\endcsname%
\pgfpathcircle{%
@@ -329,10 +329,10 @@
\advance\pgf@x\halfwidth%
\advance\pgf@x\invertedradius%
}{+\invertedradius}%
- }
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nand}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nand}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -340,7 +340,7 @@
% Shape or gate IEC
%
-\pgfdeclareshape{or gate IEC}{
+\pgfdeclareshape{or gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@or gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -364,43 +364,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{or}%
- }
+ }%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=and gate IEC]{output}
- \inheritbackgroundpath[from=and gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{or}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=and gate IEC]{output}%
+ \inheritbackgroundpath[from=and gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{or}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -408,7 +408,7 @@
% Shape nor gate IEC
%
-\pgfdeclareshape{nor gate IEC}{
+\pgfdeclareshape{nor gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nor gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -432,43 +432,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{nor}%
- }
+ }%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=nand gate IEC]{output}%
- \inheritbackgroundpath[from=nand gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nor}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=nand gate IEC]{output}%%
+ \inheritbackgroundpath[from=nand gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{nor}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -476,7 +476,7 @@
% Shape xor gate IEC
%
-\pgfdeclareshape{xor gate IEC}{
+\pgfdeclareshape{xor gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{2}% Maximum 1024 (!) inputs.
%
@@ -500,43 +500,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{xor}%
- }
+ }%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=and gate IEC]{output}
- \inheritbackgroundpath[from=and gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xor}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=and gate IEC]{output}%
+ \inheritbackgroundpath[from=and gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xor}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -544,7 +544,7 @@
% Shape xnor gate IEC
%
-\pgfdeclareshape{xnor gate IEC}{
+\pgfdeclareshape{xnor gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
%
@@ -568,50 +568,50 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{xnor}%
- }
+ }%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=nand gate IEC]{output}
- \inheritbackgroundpath[from=nand gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xnor}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=nand gate IEC]{output}%
+ \inheritbackgroundpath[from=nand gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{xnor}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
% Shape buffer gate IEC
%
-\pgfdeclareshape{buffer gate IEC}{
+\pgfdeclareshape{buffer gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1}% Maximum 1 input.
%
@@ -629,43 +629,43 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{xor}%
- }
+ }%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=and gate IEC]{output}
- \inheritbackgroundpath[from=and gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{buffer}}
- \inheritanchorborder[from=and gate IEC]
-}
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=and gate IEC]{output}%
+ \inheritbackgroundpath[from=and gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{buffer}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
@@ -673,7 +673,7 @@
% Shape not gate IEC
%
-\pgfdeclareshape{not gate IEC}{
+\pgfdeclareshape{not gate IEC}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate IEC\endcsname{%
\pgf@lib@sh@logicgate@parseinputs{1}%
%
@@ -692,42 +692,42 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
+ }%
\savedmacro\dimensions{%
\pgf@lib@sh@logicgates@dimensions@IEC{not}%
- }
+ }%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
- \inheritanchor[from=and gate IEC]{center}
- \inheritanchor[from=and gate IEC]{mid}
- \inheritanchor[from=and gate IEC]{mid west}
- \inheritanchor[from=and gate IEC]{mid east}
- \inheritanchor[from=and gate IEC]{base}
- \inheritanchor[from=and gate IEC]{base west}
- \inheritanchor[from=and gate IEC]{base east}
- \inheritanchor[from=and gate IEC]{north}
- \inheritanchor[from=and gate IEC]{south}
- \inheritanchor[from=and gate IEC]{east}
- \inheritanchor[from=and gate IEC]{west}
- \inheritanchor[from=and gate IEC]{north east}
- \inheritanchor[from=and gate IEC]{north west}
- \inheritanchor[from=and gate IEC]{south east}
- \inheritanchor[from=and gate IEC]{south west}
- \inheritanchor[from=nand gate IEC]{output}
- \inheritbackgroundpath[from=nand gate IEC]
- \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{not}}
- \inheritanchorborder[from=and gate IEC]
-}
-
-\endinput \ No newline at end of file
+ }%
+ \inheritanchor[from=and gate IEC]{center}%
+ \inheritanchor[from=and gate IEC]{mid}%
+ \inheritanchor[from=and gate IEC]{mid west}%
+ \inheritanchor[from=and gate IEC]{mid east}%
+ \inheritanchor[from=and gate IEC]{base}%
+ \inheritanchor[from=and gate IEC]{base west}%
+ \inheritanchor[from=and gate IEC]{base east}%
+ \inheritanchor[from=and gate IEC]{north}%
+ \inheritanchor[from=and gate IEC]{south}%
+ \inheritanchor[from=and gate IEC]{east}%
+ \inheritanchor[from=and gate IEC]{west}%
+ \inheritanchor[from=and gate IEC]{north east}%
+ \inheritanchor[from=and gate IEC]{north west}%
+ \inheritanchor[from=and gate IEC]{south east}%
+ \inheritanchor[from=and gate IEC]{south west}%
+ \inheritanchor[from=nand gate IEC]{output}%
+ \inheritbackgroundpath[from=nand gate IEC]%
+ \foregroundpath{\pgf@lib@sh@logicgates@IEC@foregroundpath{not}}%
+ \inheritanchorborder[from=and gate IEC]%
+}%
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
index f941abd2647..3a496324f81 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.US.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\usepgflibrary{shapes.gates.logic}
+\usepgflibrary{shapes.gates.logic}%
\newif\ifpgfgateanchorsuseboundingrectangle%
@@ -17,160 +17,160 @@
%
\pgfkeys{
/pgf/logic gate anchors use bounding box/.is if=pgfgateanchorsuseboundingrectangle,%
-}
+}%
-% An internal macro for calculating internal dimensions of
+% An internal macro for calculating internal dimensions of
% the US + CDH gates (excluding and gate US and nand gate US).
%
\def\pgf@lib@sh@logicgates@dimensions@orUS{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- %
- % Adjust the height for the number of inputs.
- %
- \c@pgf@counta\pgf@lib@sh@logicgate@numinputs%
- \advance\c@pgf@counta1\relax%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@ya\pgflinewidth%
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate input sep}}%
- \pgf@yb.5\pgf@yb%
- \ifdim\pgf@ya<\pgf@yb%
- \pgf@ya\pgf@yb%
- \fi%
- \multiply\pgf@ya\c@pgf@counta%
- \ifdim\pgf@y<\pgf@ya%
- \pgf@y\pgf@ya%
- \fi%
- %
- \ifdim\pgf@x>\pgf@y%
- \pgf@y\pgf@x%
- \else%
- \pgf@x\pgf@y%
- \fi%
- %
- % Adjust for minimum height and width.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@y<.5\pgf@ya%
- \pgf@y.5\pgf@ya%
- \fi%
- \pgf@xb\pgf@x%
- \advance\pgf@xb1.732051\pgf@y% 2y*cos(30)
- \ifdim\pgf@xb<\pgf@xa%
- \pgf@xb\pgf@xa%
- \pgf@x0.366025\pgf@xb% xb / (1 + 2*cos(30))
- \fi%
- %
- \ifdim\pgf@x>\pgf@y%
- \pgf@y\pgf@x%
- \else%
- \pgf@x\pgf@y%
- \fi%
- \edef\halfside{\the\pgf@x}%
- \addtosavedmacro\halfside%
- %
- % Take into account the outer sep.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
- \edef\outerxsep{\the\pgf@xa}%
- \edef\outerysep{\the\pgf@ya}%
- \addtosavedmacro\outerxsep%
- \addtosavedmacro\outerysep%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- %
- \edef\halfwidth{\the\pgf@x}%
- \edef\halfheight{\the\pgf@y}%
- \addtosavedmacro\halfwidth%
- \addtosavedmacro\halfheight%
- %
- \pgfextract@process\tipanchor{%
- \advance\pgf@x-\pgf@xa%
- \advance\pgf@y-\pgf@ya%
- \pgf@x-.16666\pgf@x%
- \pgf@yb2.0\pgf@y%
- \advance\pgf@x.866025\pgf@yb%
- \advance\pgf@x1.154701\pgf@xa%
- \pgf@y0pt%
- }%
- \addtosavedmacro\tipanchor%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ %
+ % Adjust the height for the number of inputs.
+ %
+ \c@pgf@counta\pgf@lib@sh@logicgate@numinputs%
+ \advance\c@pgf@counta1\relax%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@ya\pgflinewidth%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate input sep}}%
+ \pgf@yb.5\pgf@yb%
+ \ifdim\pgf@ya<\pgf@yb%
+ \pgf@ya\pgf@yb%
+ \fi%
+ \multiply\pgf@ya\c@pgf@counta%
+ \ifdim\pgf@y<\pgf@ya%
+ \pgf@y\pgf@ya%
+ \fi%
+ %
+ \ifdim\pgf@x>\pgf@y%
+ \pgf@y\pgf@x%
+ \else%
+ \pgf@x\pgf@y%
+ \fi%
+ %
+ % Adjust for minimum height and width.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@y<.5\pgf@ya%
+ \pgf@y.5\pgf@ya%
+ \fi%
+ \pgf@xb\pgf@x%
+ \advance\pgf@xb1.732051\pgf@y% 2y*cos(30)
+ \ifdim\pgf@xb<\pgf@xa%
+ \pgf@xb\pgf@xa%
+ \pgf@x0.366025\pgf@xb% xb / (1 + 2*cos(30))
+ \fi%
+ %
+ \ifdim\pgf@x>\pgf@y%
+ \pgf@y\pgf@x%
+ \else%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\halfside{\the\pgf@x}%
+ \addtosavedmacro\halfside%
+ %
+ % Take into account the outer sep.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \edef\outerxsep{\the\pgf@xa}%
+ \edef\outerysep{\the\pgf@ya}%
+ \addtosavedmacro\outerxsep%
+ \addtosavedmacro\outerysep%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ %
+ \edef\halfwidth{\the\pgf@x}%
+ \edef\halfheight{\the\pgf@y}%
+ \addtosavedmacro\halfwidth%
+ \addtosavedmacro\halfheight%
+ %
+ \pgfextract@process\tipanchor{%
+ \advance\pgf@x-\pgf@xa%
+ \advance\pgf@y-\pgf@ya%
+ \pgf@x-.16666\pgf@x%
+ \pgf@yb2.0\pgf@y%
+ \advance\pgf@x.866025\pgf@yb%
+ \advance\pgf@x1.154701\pgf@xa%
+ \pgf@y0pt%
+ }%
+ \addtosavedmacro\tipanchor%
}%
-% An internal macro for calculating internal dimensions of
+% An internal macro for calculating internal dimensions of
% the and gate US and nand gate US.
%
\def\pgf@lib@sh@logicgates@dimensions@andUS{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
- \advance\pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
- \advance\pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y.5\dp\pgfnodeparttextbox%
- %
- % Adjust the height for the number of inputs.
- %
- \c@pgf@counta\pgf@lib@sh@logicgate@numinputs%
- \advance\c@pgf@counta1\relax%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@ya\pgflinewidth%
- \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate input sep}}%
- \pgf@yb.5\pgf@yb%
- \ifdim\pgf@ya<\pgf@yb%
- \pgf@ya\pgf@yb%
- \fi%
- \multiply\pgf@ya\c@pgf@counta%
- \ifdim\pgf@y<\pgf@ya%
- \pgf@y\pgf@ya%
- \fi%
- %
- \ifdim\pgf@x>\pgf@y%
- \pgf@y\pgf@x%
- \else%
- \pgf@x\pgf@y%
- \fi%
- %
- % Adjust for minimum height and width.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
- \ifdim\pgf@y<.5\pgf@ya%
- \pgf@y.5\pgf@ya%
- \fi%
- \pgf@xb2.5\pgf@x%
- \ifdim\pgf@xb<\pgf@xa%
- \pgf@xb\pgf@xa%
- \pgf@x0.4\pgf@xb%
- \fi%
- %
- \ifdim\pgf@x>\pgf@y%
- \pgf@y\pgf@x%
- \else%
- \pgf@x\pgf@y%
- \fi%
- \edef\halfside{\the\pgf@x}%
- \addtosavedmacro\halfside%
- %
- % Take into account the outer sep.
- %
- \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
- \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
- \edef\outerxsep{\the\pgf@xa}%
- \edef\outerysep{\the\pgf@ya}%
- \addtosavedmacro\outerxsep%
- \addtosavedmacro\outerysep%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\pgf@ya%
- %
- \edef\halfwidth{\the\pgf@x}%
- \edef\halfheight{\the\pgf@y}%
- \addtosavedmacro\halfwidth%
- \addtosavedmacro\halfheight%
- %
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/inner xsep}}%
+ \advance\pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{\pgfkeysvalueof{/pgf/inner ysep}}%
+ \advance\pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y.5\dp\pgfnodeparttextbox%
+ %
+ % Adjust the height for the number of inputs.
+ %
+ \c@pgf@counta\pgf@lib@sh@logicgate@numinputs%
+ \advance\c@pgf@counta1\relax%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@ya\pgflinewidth%
+ \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/logic gate input sep}}%
+ \pgf@yb.5\pgf@yb%
+ \ifdim\pgf@ya<\pgf@yb%
+ \pgf@ya\pgf@yb%
+ \fi%
+ \multiply\pgf@ya\c@pgf@counta%
+ \ifdim\pgf@y<\pgf@ya%
+ \pgf@y\pgf@ya%
+ \fi%
+ %
+ \ifdim\pgf@x>\pgf@y%
+ \pgf@y\pgf@x%
+ \else%
+ \pgf@x\pgf@y%
+ \fi%
+ %
+ % Adjust for minimum height and width.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/minimum width}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/minimum height}}%
+ \ifdim\pgf@y<.5\pgf@ya%
+ \pgf@y.5\pgf@ya%
+ \fi%
+ \pgf@xb2.5\pgf@x%
+ \ifdim\pgf@xb<\pgf@xa%
+ \pgf@xb\pgf@xa%
+ \pgf@x0.4\pgf@xb%
+ \fi%
+ %
+ \ifdim\pgf@x>\pgf@y%
+ \pgf@y\pgf@x%
+ \else%
+ \pgf@x\pgf@y%
+ \fi%
+ \edef\halfside{\the\pgf@x}%
+ \addtosavedmacro\halfside%
+ %
+ % Take into account the outer sep.
+ %
+ \pgfmathsetlength\pgf@xa{\pgfkeysvalueof{/pgf/outer xsep}}%
+ \pgfmathsetlength\pgf@ya{\pgfkeysvalueof{/pgf/outer ysep}}%
+ \edef\outerxsep{\the\pgf@xa}%
+ \edef\outerysep{\the\pgf@ya}%
+ \addtosavedmacro\outerxsep%
+ \addtosavedmacro\outerysep%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\pgf@ya%
+ %
+ \edef\halfwidth{\the\pgf@x}%
+ \edef\halfheight{\the\pgf@y}%
+ \addtosavedmacro\halfwidth%
+ \addtosavedmacro\halfheight%
+ %
}%
@@ -178,25 +178,25 @@
% both and gates and nand gates, and also the not gate and buffer.
%
\def\pgf@lib@sh@logicgate@AND@inputanchor#1{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-.166666\pgf@xa%
- \advance\pgf@x-\halfwidth%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
- \advance\pgf@x-\invertedradius%
- \advance\pgf@x-\outerinvertedradius%
- \fi%
- %
- \pgfutil@tempdima\halfside%
- \multiply\pgfutil@tempdima2\relax%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \multiply\pgfutil@tempdima#1\relax%
- \advance\pgf@y\halfside%
- \advance\pgf@y-\pgfutil@tempdima%
-}
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-.166666\pgf@xa%
+ \advance\pgf@x-\halfwidth%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
+ \advance\pgf@x-\invertedradius%
+ \advance\pgf@x-\outerinvertedradius%
+ \fi%
+ %
+ \pgfutil@tempdima\halfside%
+ \multiply\pgfutil@tempdima2\relax%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \multiply\pgfutil@tempdima#1\relax%
+ \advance\pgf@y\halfside%
+ \advance\pgf@y-\pgfutil@tempdima%
+}%
@@ -204,235 +204,235 @@
% Shape and gate US
%
\pgfdeclareshape{and gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@and gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@and gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An and gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@andUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \csname pgf@anchor@and gate US@east\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{mid west}{%
- \csname pgf@anchor@and gate US@west\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \csname pgf@anchor@and gate US@east\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{base west}{%
- \csname pgf@anchor@and gate US@west\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{east}{%
- \dimensions%
- \pgf@xa\halfwidth%
- \pgf@xb\pgf@xa%
- \advance\pgf@xb-\outerxsep%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- \advance\pgf@x\pgf@xa%
- }
- \anchor{output}{\csname pgf@anchor@and gate US@east\endcsname}
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@nand gate US@east\endcsname%
- \advance\pgf@y\halfheight%
- \else
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\pgf@xa%
- \advance\pgf@xb-\outerxsep%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- \advance\pgf@x.707106\pgf@xa%
- \advance\pgf@y.707106\pgf@ya%
- \fi%
- }
- \anchor{south east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@nand gate US@east\endcsname%
- \advance\pgf@y-\halfheight%
- \else
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\pgf@xa%
- \advance\pgf@xb-\outerxsep%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- \advance\pgf@x.707106\pgf@xa%
- \advance\pgf@y-.707106\pgf@ya%
- \fi%
- }
- \anchor{north}{%
- \dimensions%
- \centerpoint%
- \advance\pgf@y\halfheight%
- }
- \anchor{south}{%
- \dimensions%
- \centerpoint%
- \advance\pgf@y-\halfheight%
- }
- \anchor{south west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y-\halfheight%
- }
- \anchor{north west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y\halfheight%
- }
- \anchor{west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- \pgf@xb.333333\pgf@xc%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
- {%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \dimensions%
- \pgf@xb\halfside%
- \pgf@xc1.66666\pgf@xb%
- \advance\pgf@xc\outerxsep%
- \pgf@yc\halfheight%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@and gate US@north west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y\pgf@yc}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- }%
- {0}{90}{+\halfwidth and +\halfheight}%
- \else%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y\pgf@yc}%
- {\centerpoint\advance\pgf@x-\pgf@xc\advance\pgf@y\pgf@yc}%
- \fi%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y-\pgf@yc}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@x.333333\pgf@xb%
- }%
- {270}{360}{+\halfwidth and +\halfheight}%
- \else%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@and gate US@south west\endcsname}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y-\pgf@yc}%
- {\csname pgf@anchor@and gate US@south west\endcsname}%
- \else%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {\csname pgf@anchor@and gate US@north west\endcsname}%
- {\csname pgf@anchor@and gate US@south west\endcsname}%
- \fi%
- \fi%
- \fi%
- }
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@and gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@and gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An and gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@andUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \csname pgf@anchor@and gate US@east\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@and gate US@west\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \csname pgf@anchor@and gate US@east\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base west}{%
+ \csname pgf@anchor@and gate US@west\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{east}{%
+ \dimensions%
+ \pgf@xa\halfwidth%
+ \pgf@xb\pgf@xa%
+ \advance\pgf@xb-\outerxsep%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ \advance\pgf@x\pgf@xa%
+ }%
+ \anchor{output}{\csname pgf@anchor@and gate US@east\endcsname}%
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@nand gate US@east\endcsname%
+ \advance\pgf@y\halfheight%
+ \else
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\pgf@xa%
+ \advance\pgf@xb-\outerxsep%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ \advance\pgf@x.707106\pgf@xa%
+ \advance\pgf@y.707106\pgf@ya%
+ \fi%
+ }%
+ \anchor{south east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@nand gate US@east\endcsname%
+ \advance\pgf@y-\halfheight%
+ \else
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\pgf@xa%
+ \advance\pgf@xb-\outerxsep%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ \advance\pgf@x.707106\pgf@xa%
+ \advance\pgf@y-.707106\pgf@ya%
+ \fi%
+ }%
+ \anchor{north}{%
+ \dimensions%
+ \centerpoint%
+ \advance\pgf@y\halfheight%
+ }%
+ \anchor{south}{%
+ \dimensions%
+ \centerpoint%
+ \advance\pgf@y-\halfheight%
+ }%
+ \anchor{south west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y-\halfheight%
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y\halfheight%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ \pgf@xb.333333\pgf@xc%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
+ {%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \let\externalangle\pgfmathresult%
+ \dimensions%
+ \pgf@xb\halfside%
+ \pgf@xc1.66666\pgf@xb%
+ \advance\pgf@xc\outerxsep%
+ \pgf@yc\halfheight%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@and gate US@north west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y\pgf@yc}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ }%
+ {0}{90}{+\halfwidth and +\halfheight}%
+ \else%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y\pgf@yc}%
+ {\centerpoint\advance\pgf@x-\pgf@xc\advance\pgf@y\pgf@yc}%
+ \fi%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y-\pgf@yc}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@x.333333\pgf@xb%
+ }%
+ {270}{360}{+\halfwidth and +\halfheight}%
+ \else%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@and gate US@south west\endcsname}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {\centerpoint\advance\pgf@x.333333\pgf@xb\advance\pgf@y-\pgf@yc}%
+ {\csname pgf@anchor@and gate US@south west\endcsname}%
+ \else%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {\csname pgf@anchor@and gate US@north west\endcsname}%
+ {\csname pgf@anchor@and gate US@south west\endcsname}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
@@ -441,512 +441,512 @@
% Shape nand gate US
%
\pgfdeclareshape{nand gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@nand gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@nand gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{A nand gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@andUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \inheritanchor[from=and gate US]{mid}
- \inheritanchor[from=and gate US]{mid east}
- \inheritanchor[from=and gate US]{mid west}
- \inheritanchor[from=and gate US]{base}
- \inheritanchor[from=and gate US]{base east}
- \inheritanchor[from=and gate US]{base west}
- \anchor{output}{%
- \dimensions
- \pgfpointadd{\centerpoint}{%
- \pgf@xa\halfside%
- \pgf@x1.33333\pgf@xa%
- \advance\pgf@x\invertedradius%
- \advance\pgf@x\outerinvertedradius%
- \advance\pgf@x\outerxsep%
- \pgf@y0pt%
- }%
- }
- \inheritanchor[from=and gate US]{east}
- \inheritanchor[from=and gate US]{north east}
- \inheritanchor[from=and gate US]{south east}
- \inheritanchor[from=and gate US]{north}
- \inheritanchor[from=and gate US]{south}
- \inheritanchor[from=and gate US]{south west}
- \inheritanchor[from=and gate US]{north west}
- \inheritanchor[from=and gate US]{west}
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- \pgf@xb.333333\pgf@xc%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
- {%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-1.166666\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- %
- % Draw the output inverter.
- %
- {%
- \pgfpathcircle{%
- \pgf@x1.33333\pgf@xc%
- \advance\pgf@x\outerinvertedradius%
- \pgf@y0pt%
- }{+\invertedradius}%
- }%
- }%
- }
- \inheritanchorborder[from=and gate US]
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@nand gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@nand gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{A nand gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@andUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \inheritanchor[from=and gate US]{mid}%
+ \inheritanchor[from=and gate US]{mid east}%
+ \inheritanchor[from=and gate US]{mid west}%
+ \inheritanchor[from=and gate US]{base}%
+ \inheritanchor[from=and gate US]{base east}%
+ \inheritanchor[from=and gate US]{base west}%
+ \anchor{output}{%
+ \dimensions
+ \pgfpointadd{\centerpoint}{%
+ \pgf@xa\halfside%
+ \pgf@x1.33333\pgf@xa%
+ \advance\pgf@x\invertedradius%
+ \advance\pgf@x\outerinvertedradius%
+ \advance\pgf@x\outerxsep%
+ \pgf@y0pt%
+ }%
+ }%
+ \inheritanchor[from=and gate US]{east}%
+ \inheritanchor[from=and gate US]{north east}%
+ \inheritanchor[from=and gate US]{south east}%
+ \inheritanchor[from=and gate US]{north}%
+ \inheritanchor[from=and gate US]{south}%
+ \inheritanchor[from=and gate US]{south west}%
+ \inheritanchor[from=and gate US]{north west}%
+ \inheritanchor[from=and gate US]{west}%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ \pgf@xb.333333\pgf@xc%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yc}}%
+ {%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-1.166666\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ % Draw the output inverter.
+ %
+ {%
+ \pgfpathcircle{%
+ \pgf@x1.33333\pgf@xc%
+ \advance\pgf@x\outerinvertedradius%
+ \pgf@y0pt%
+ }{+\invertedradius}%
+ }%
+ }%
+ }%
+ \inheritanchorborder[from=and gate US]%
+}%
% Internal macro for calculation input anchors. Used by
% or, nor xnor gates (US).
%
\def\pgf@lib@sh@logicgate@OR@inputanchor#1{%
- \dimensions%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- %
- \pgfutil@tempdima\halfside%
- \multiply\pgfutil@tempdima2\relax%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \multiply\pgfutil@tempdima#1\relax%
- \pgf@yc\pgf@ya%
- \advance\pgf@yc-\pgfutil@tempdima%
- %
- \pgf@xb\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@xc-1.166666\pgf@ya%
- \advance\pgf@xc-.866025\pgf@xb%
- \advance\pgf@xc\pgfmathresult\pgf@yb%
- \advance\pgf@xc\halflinewidth%
- \advance\pgf@xc-\outerxsep%
- %
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
- \advance\pgf@xc-\invertedradius%
- \advance\pgf@xc-\outerinvertedradius%
- \fi%
- %
- \centerpoint%
- \advance\pgf@x\pgf@xc%
- \advance\pgf@y\pgf@yc%
-}
+ \dimensions%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ %
+ \pgfutil@tempdima\halfside%
+ \multiply\pgfutil@tempdima2\relax%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \multiply\pgfutil@tempdima#1\relax%
+ \pgf@yc\pgf@ya%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ %
+ \pgf@xb\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@xc-1.166666\pgf@ya%
+ \advance\pgf@xc-.866025\pgf@xb%
+ \advance\pgf@xc\pgfmathresult\pgf@yb%
+ \advance\pgf@xc\halflinewidth%
+ \advance\pgf@xc-\outerxsep%
+ %
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
+ \advance\pgf@xc-\invertedradius%
+ \advance\pgf@xc-\outerinvertedradius%
+ \fi%
+ %
+ \centerpoint%
+ \advance\pgf@x\pgf@xc%
+ \advance\pgf@y\pgf@yc%
+}%
% Shape or gate US
%
\pgfdeclareshape{or gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@or gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@or gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@or gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@OR@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An or gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\halflinewidth{%
- \pgf@x.5\pgflinewidth%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \csname pgf@anchor@or gate US@east\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{mid west}{%
- \csname pgf@anchor@or gate US@north west\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \csname pgf@anchor@or gate US@east\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{base west}{%
- \csname pgf@anchor@or gate US@north west\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{east}{%
- \dimensions%
- \pgfpointadd{\centerpoint}{\tipanchor}%
- }
- \anchor{output}{\csname pgf@anchor@or gate US@east\endcsname}
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\halfheight%
- \else%
- \centerpoint%
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\halfside%
- \advance\pgf@x-.166666\pgf@xb%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@x.5\pgf@xa%
- \advance\pgf@y-\pgf@xb%
- \advance\pgf@ya\pgf@xb%
- \advance\pgf@y.866025\pgf@ya%
- \fi%
- }
- \anchor{south east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y-\halfheight%
- \else
- \centerpoint%
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\halfside%
- \advance\pgf@x-.166666\pgf@xb%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@x.5\pgf@xa%
- \advance\pgf@y\pgf@xb%
- \advance\pgf@ya\pgf@xb%
- \advance\pgf@y-.866025\pgf@ya%
- \fi%
- }
- \anchor{north}{%
- \dimensions%
- \centerpoint%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y\halfheight%
- \else%
- \pgf@ya\halfheight%
- \advance\pgf@y.993043\pgf@ya%
- \fi%
- }
- \anchor{south}{%
- \dimensions%
- \centerpoint%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y-\halfheight%
- \else%
- \pgf@ya\halfheight%
- \advance\pgf@y-.993043\pgf@ya%
- \fi%
- }
- \anchor{south west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \pgf@xa\outerxsep%
- \advance\pgf@x-1.732050\pgf@xa%
- \advance\pgf@y-\halfheight%
- }
- \anchor{north west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \pgf@xa\outerxsep%
- \advance\pgf@x-1.732050\pgf@xa%
- \advance\pgf@y\halfheight%
- }
- \anchor{west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \else%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@x0.267949\pgf@xa%
- \fi%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \pgfpatharc{-30}{0}{+\pgf@yc}%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \pgfpatharc{0}{30}{+\pgf@yc}%
- }%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- \pgf@xa\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \let\sineangle\pgfmathresult%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@x-1.166666\pgf@ya%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x\pgfmathresult\pgf@yb%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \dimensions%
- \pgf@xc\halfside%
- %
- \pgf@xc-.166666\pgf@xc%
- \ifdim\pgf@xa<\pgf@xc%
- \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@or gate US@north west\endcsname}%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@or gate US@north\endcsname%
- }%
- {\csname pgf@anchor@or gate US@north west\endcsname}%
- \else%
- \pgfmathsubtract@{360}{\pgfmathresult}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@or gate US@south\endcsname%
- }%
- {\csname pgf@anchor@or gate US@south west\endcsname}%
- \else%
- \ifdim\pgf@ya>\pgf@yb%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \advance\pgf@yc-\outerxsep%
- \pgfextract@process\point{%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.166666\pgf@xa%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x-\outerxsep%
- }%
- {0}{90}{+\pgf@yc}%
- }%
- \else%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \advance\pgf@yc-\outerxsep%
- \pgfextract@process\point{%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.166666\pgf@xa%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x-\outerxsep%
- }%
- {270}{360}{+\pgf@yc}%
- }%
- \fi%
- \fi%
- \fi%
- \else%
- \ifdim\pgf@y=0pt\relax%
- \csname pgf@anchor@and gate US@east\endcsname%
- \else%
- \pgf@xc\halfwidth%
- \advance\pgf@xc\halfside%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \pgf@xb\halfside%
- \pgf@xb-.166666\pgf@xb%
- \ifdim\pgf@ya<0pt%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {270}{330}{+\pgf@yc}%
- \else%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y-\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {30}{90}{+\pgf@xc and +\pgf@yc}%
- \fi%
- \fi%
- \fi%
- }%
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@or gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@or gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@or gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@OR@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An or gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\halflinewidth{%
+ \pgf@x.5\pgflinewidth%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \csname pgf@anchor@or gate US@east\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@or gate US@north west\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \csname pgf@anchor@or gate US@east\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base west}{%
+ \csname pgf@anchor@or gate US@north west\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{east}{%
+ \dimensions%
+ \pgfpointadd{\centerpoint}{\tipanchor}%
+ }%
+ \anchor{output}{\csname pgf@anchor@or gate US@east\endcsname}%
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\halfheight%
+ \else%
+ \centerpoint%
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\halfside%
+ \advance\pgf@x-.166666\pgf@xb%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@x.5\pgf@xa%
+ \advance\pgf@y-\pgf@xb%
+ \advance\pgf@ya\pgf@xb%
+ \advance\pgf@y.866025\pgf@ya%
+ \fi%
+ }%
+ \anchor{south east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y-\halfheight%
+ \else
+ \centerpoint%
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\halfside%
+ \advance\pgf@x-.166666\pgf@xb%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@x.5\pgf@xa%
+ \advance\pgf@y\pgf@xb%
+ \advance\pgf@ya\pgf@xb%
+ \advance\pgf@y-.866025\pgf@ya%
+ \fi%
+ }%
+ \anchor{north}{%
+ \dimensions%
+ \centerpoint%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y\halfheight%
+ \else%
+ \pgf@ya\halfheight%
+ \advance\pgf@y.993043\pgf@ya%
+ \fi%
+ }%
+ \anchor{south}{%
+ \dimensions%
+ \centerpoint%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y-\halfheight%
+ \else%
+ \pgf@ya\halfheight%
+ \advance\pgf@y-.993043\pgf@ya%
+ \fi%
+ }%
+ \anchor{south west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x-1.732050\pgf@xa%
+ \advance\pgf@y-\halfheight%
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x-1.732050\pgf@xa%
+ \advance\pgf@y\halfheight%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \else%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@x0.267949\pgf@xa%
+ \fi%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \pgfpatharc{-30}{0}{+\pgf@yc}%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \pgfpatharc{0}{30}{+\pgf@yc}%
+ }%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ \pgf@xa\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \let\sineangle\pgfmathresult%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@x-1.166666\pgf@ya%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x\pgfmathresult\pgf@yb%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \let\externalangle\pgfmathresult%
+ \dimensions%
+ \pgf@xc\halfside%
+ %
+ \pgf@xc-.166666\pgf@xc%
+ \ifdim\pgf@xa<\pgf@xc%
+ \pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@or gate US@north west\endcsname}%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@or gate US@north\endcsname%
+ }%
+ {\csname pgf@anchor@or gate US@north west\endcsname}%
+ \else%
+ \pgfmathsubtract@{360}{\pgfmathresult}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@or gate US@south\endcsname%
+ }%
+ {\csname pgf@anchor@or gate US@south west\endcsname}%
+ \else%
+ \ifdim\pgf@ya>\pgf@yb%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \advance\pgf@yc-\outerxsep%
+ \pgfextract@process\point{%
+ \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
+ {%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.166666\pgf@xa%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ }%
+ {0}{90}{+\pgf@yc}%
+ }%
+ \else%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \advance\pgf@yc-\outerxsep%
+ \pgfextract@process\point{%
+ \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
+ {%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.166666\pgf@xa%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ }%
+ {270}{360}{+\pgf@yc}%
+ }%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgf@y=0pt\relax%
+ \csname pgf@anchor@and gate US@east\endcsname%
+ \else%
+ \pgf@xc\halfwidth%
+ \advance\pgf@xc\halfside%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \pgf@xb\halfside%
+ \pgf@xb-.166666\pgf@xb%
+ \ifdim\pgf@ya<0pt%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {270}{330}{+\pgf@yc}%
+ \else%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y-\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {30}{90}{+\pgf@xc and +\pgf@yc}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
@@ -954,154 +954,154 @@
% Shape nor gate US
%
\pgfdeclareshape{nor gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nor gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@nor gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@nor gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@OR@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{A nor gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\halflinewidth{%
- \pgf@x.5\pgflinewidth%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \inheritanchor[from=or gate US]{center}
- \inheritanchor[from=or gate US]{mid}
- \inheritanchor[from=or gate US]{mid east}
- \inheritanchor[from=or gate US]{mid west}
- \inheritanchor[from=or gate US]{base}
- \inheritanchor[from=or gate US]{base east}
- \inheritanchor[from=or gate US]{base west}
- \inheritanchor[from=or gate US]{east}
- \inheritanchor[from=or gate US]{north east}
- \inheritanchor[from=or gate US]{south east}
- \inheritanchor[from=or gate US]{north}
- \inheritanchor[from=or gate US]{south}
- \inheritanchor[from=or gate US]{south west}
- \inheritanchor[from=or gate US]{north west}
- \inheritanchor[from=or gate US]{west}
- \anchor{output}{%
- \dimensions%
- \centerpoint%
- \pgf@xc\halfside%
- \pgf@yc\pgf@xc%
- \advance\pgf@x-.166666\pgf@xc%
- \pgf@yc2.0\pgf@yc%
- \advance\pgf@x.866025\pgf@yc%
- \advance\pgf@x\outerinvertedradius%
- \advance\pgf@x\invertedradius%
- \advance\pgf@x\outerxsep%
- }%
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \pgfpatharc{-30}{0}{+\pgf@yc}%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \pgfpatharc{0}{30}{+\pgf@yc}%
- }%
- \pgfpathclose%
- % Draw the output inverter.
- %
- {%
- \pgfpathcircle{%
- \pgf@x-.166666\pgf@xc%
- \pgf@yc2.0\pgf@yc%
- \advance\pgf@x.866025\pgf@yc%
- \advance\pgf@x\outerinvertedradius%
- \pgf@y0pt%
- }{+\invertedradius}%
- }%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- \pgf@xa\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \let\sineangle\pgfmathresult%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@x-1.166666\pgf@ya%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x\pgfmathresult\pgf@yb%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \inheritanchorborder[from=or gate US]
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nor gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@nor gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@nor gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@OR@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{A nor gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\halflinewidth{%
+ \pgf@x.5\pgflinewidth%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \inheritanchor[from=or gate US]{center}%
+ \inheritanchor[from=or gate US]{mid}%
+ \inheritanchor[from=or gate US]{mid east}%
+ \inheritanchor[from=or gate US]{mid west}%
+ \inheritanchor[from=or gate US]{base}%
+ \inheritanchor[from=or gate US]{base east}%
+ \inheritanchor[from=or gate US]{base west}%
+ \inheritanchor[from=or gate US]{east}%
+ \inheritanchor[from=or gate US]{north east}%
+ \inheritanchor[from=or gate US]{south east}%
+ \inheritanchor[from=or gate US]{north}%
+ \inheritanchor[from=or gate US]{south}%
+ \inheritanchor[from=or gate US]{south west}%
+ \inheritanchor[from=or gate US]{north west}%
+ \inheritanchor[from=or gate US]{west}%
+ \anchor{output}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xc\halfside%
+ \pgf@yc\pgf@xc%
+ \advance\pgf@x-.166666\pgf@xc%
+ \pgf@yc2.0\pgf@yc%
+ \advance\pgf@x.866025\pgf@yc%
+ \advance\pgf@x\outerinvertedradius%
+ \advance\pgf@x\invertedradius%
+ \advance\pgf@x\outerxsep%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \pgfpatharc{-30}{0}{+\pgf@yc}%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \pgfpatharc{0}{30}{+\pgf@yc}%
+ }%
+ \pgfpathclose%
+ % Draw the output inverter.
+ %
+ {%
+ \pgfpathcircle{%
+ \pgf@x-.166666\pgf@xc%
+ \pgf@yc2.0\pgf@yc%
+ \advance\pgf@x.866025\pgf@yc%
+ \advance\pgf@x\outerinvertedradius%
+ \pgf@y0pt%
+ }{+\invertedradius}%
+ }%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ \pgf@xa\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \let\sineangle\pgfmathresult%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@x-1.166666\pgf@ya%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x\pgfmathresult\pgf@yb%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \inheritanchorborder[from=or gate US]%
+}%
@@ -1109,42 +1109,42 @@
% xor and xnor gates (US).
%
\def\pgf@lib@sh@logicgate@XOR@inputanchor#1{%
- \dimensions%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- %
- \pgfutil@tempdima\halfside%
- \multiply\pgfutil@tempdima2\relax%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \multiply\pgfutil@tempdima#1\relax%
- \pgf@yc\pgf@ya%
- \advance\pgf@yc-\pgfutil@tempdima%
- %
- \pgf@xb\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@xc-1.166666\pgf@ya%
- \advance\pgf@xc-.866025\pgf@xb%
- \advance\pgf@xc\pgfmathresult\pgf@yb%
- \advance\pgf@xc\halflinewidth%
- \advance\pgf@xc-\outerxsep%
- %
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
- \advance\pgf@xc-\invertedradius%
- \advance\pgf@xc-\outerinvertedradius%
- \fi%
- %
- \centerpoint%
- \advance\pgf@x\pgf@xc%
- \advance\pgf@y\pgf@yc%
- \pgf@xa\halfside%
- \advance\pgf@x-.333333\pgf@xa%
-}
+ \dimensions%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ %
+ \pgfutil@tempdima\halfside%
+ \multiply\pgfutil@tempdima2\relax%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \multiply\pgfutil@tempdima#1\relax%
+ \pgf@yc\pgf@ya%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ %
+ \pgf@xb\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@xc-1.166666\pgf@ya%
+ \advance\pgf@xc-.866025\pgf@xb%
+ \advance\pgf@xc\pgfmathresult\pgf@yb%
+ \advance\pgf@xc\halflinewidth%
+ \advance\pgf@xc-\outerxsep%
+ %
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-#1\endcsname%
+ \advance\pgf@xc-\invertedradius%
+ \advance\pgf@xc-\outerinvertedradius%
+ \fi%
+ %
+ \centerpoint%
+ \advance\pgf@x\pgf@xc%
+ \advance\pgf@y\pgf@yc%
+ \pgf@xa\halfside%
+ \advance\pgf@x-.333333\pgf@xa%
+}%
@@ -1153,330 +1153,330 @@
% Shape xor gate US
%
\pgfdeclareshape{xor gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{2}%
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@xor gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@xor gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@XOR@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An xor gate must have at two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\halflinewidth{%
- \pgf@x.5\pgflinewidth%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \inheritanchor[from=or gate US]{mid east}
- \anchor{mid west}{%
- \csname pgf@anchor@xor gate US@north west\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{base}{\basepoint}%
- \inheritanchor[from=or gate US]{base east}
- \anchor{base west}{%
- \csname pgf@anchor@xor gate US@north west\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \inheritanchor[from=or gate US]{base}
- \inheritanchor[from=or gate US]{output}
- \inheritanchor[from=or gate US]{east}
- \inheritanchor[from=or gate US]{north east}
- \inheritanchor[from=or gate US]{south east}
- \inheritanchor[from=or gate US]{north}
- \inheritanchor[from=or gate US]{south}
- \anchor{south west}{%
- \dimensions%
- \pgf@xa\halfside%
- \pgf@xa-3.232051\pgf@xa% (7/6 + 2*cos(30) + 1/3) * x
- \pgf@xb\halfside%
- \pgf@xb2.0\pgf@xb%
- \advance\pgf@xb-\halflinewidth%
- \advance\pgf@xa.866025\pgf@xb%
- \pgf@ya.5\pgf@xb%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y-\halfheight%
- \else%
- \advance\pgf@y-\pgf@ya%
- \fi%
- }
- \anchor{north west}{%
- \dimensions%
- \pgf@xa\halfside%
- \pgf@xa-3.232051\pgf@xa% (7/6 + 2*cos(30) + 1/3) * x
- \pgf@xb\halfside%
- \pgf@xb2.0\pgf@xb%
- \advance\pgf@xb-\halflinewidth%
- \advance\pgf@xa.866025\pgf@xb%
- \pgf@ya.5\pgf@xb%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y\halfheight%
- \else%
- \advance\pgf@y\pgf@ya%
- \fi%
- }
- \anchor{west}{%
- \dimensions%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- %
- \pgf@xb\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{0}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@xc-1.166666\pgf@ya%
- \advance\pgf@xc-.866025\pgf@xb%
- \advance\pgf@xc\pgfmathresult\pgf@yb%
- \advance\pgf@xc\halflinewidth%
- \advance\pgf@xc-\outerxsep%
- %
- \centerpoint%
- \advance\pgf@x\pgf@xc%
- \pgf@xa\halfside%
- \advance\pgf@x-.333333\pgf@xa%
- \ifpgfgateanchorsuseboundingrectangle%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-0.133974\pgf@xa%
- \fi%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- {%
- \pgf@yc2.66666\pgf@yc%
- \pgfpatharc{-22}{0}{+1.166666\pgf@yc and +\pgf@yc}%
- }
- {%
- \pgf@yc2.66666\pgf@yc%
- \pgfpatharc{0}{22}{+1.166666\pgf@yc and +\pgf@yc}%
- }%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- \pgf@xa\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@x-1.5\pgf@ya%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x\pgfmathresult\pgf@yb%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- %
- % Now, some fooling around to stop the `tail' being filled.
- % Technically it still is, but it isn't visible.
- %
- \pgf@xc\halfside%
- \pgf@yc\halfside%
- \pgfpathmoveto{\pgfqpoint{-1.5\pgf@xc}{-\pgf@yc}}%
- \pgf@yc2.0\pgf@yc%
- \pgfmathloop%
- \ifnum\pgfmathcounter<61\relax%
- {%
- \pgfextract@process\point{%
- \pgfpointadd{%
- \pgf@x\halfside%
- \pgf@x-3.232051\pgf@x% (7/6 + 2*cos(30) + 1/3) * x
- \pgf@y0pt%
- }{%
- \pgfpointpolar{\pgfmathcounter-30}{+\pgf@yc}%
- }%
- }%
- \pgfpathlineto{\point}%
- \pgfpathmoveto{\point}%
- }
- \repeatpgfmathloop%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@xb\pgf@x%
- \pgf@yb\pgf@y%
- \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
- \let\externalangle\pgfmathresult%
- \dimensions%
- \pgf@xc\halfside%
- %
- \pgf@xc-.166666\pgf@xc%
- \ifdim\pgf@xa<\pgf@xc%
- \pgfmathanglebetweenpoints{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@north west\endcsname%
- }%
- \ifdim\externalangle pt<\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@north\endcsname%
- }%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@north west\endcsname%
- }%
- \else%
- \pgfmathsubtract@{360}{\pgfmathresult}%
- \ifdim\externalangle pt>\pgfmathresult pt\relax%
- \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@south\endcsname%
- }%
- {%
- \pgfgateanchorsuseboundingrectangletrue%
- \csname pgf@anchor@xor gate US@south west\endcsname%
- }%
- \else%
- \ifdim\pgf@ya>\pgf@yb%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \advance\pgf@yc-\outerxsep%
- \pgf@process{%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.166666\pgf@xa%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@x-.166666\pgf@xa%
- }%
- {0}{90}{+\pgf@yc}%
- }%
- \else%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \advance\pgf@yc-\outerxsep%
- \pgf@process{%
- \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
- {%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.166666\pgf@xa%
- \pgf@xa2.0\pgf@xa%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@x-.166666\pgf@xa%
- }%
- {270}{360}{+\pgf@yc}%
- }%
- \fi%
- \fi%
- \fi%
- \else%
- \ifdim\pgf@y=0pt\relax%
- \csname pgf@anchor@and gate US@east\endcsname%
- \else%
- \pgf@xc\halfwidth%
- \advance\pgf@xc\halfside%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \pgf@xb\halfside%
- \pgf@xb-.166666\pgf@xb%
- \ifdim\pgf@ya<0pt%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {270}{330}{+\pgf@yc}%
- \else%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y-\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {30}{90}{+\pgf@xc and +\pgf@yc}%
- \fi%
- \fi%
- \fi%
- }%
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xor gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{2}%
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@xor gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@xor gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@XOR@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An xor gate must have at two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\halflinewidth{%
+ \pgf@x.5\pgflinewidth%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \inheritanchor[from=or gate US]{mid east}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@xor gate US@north west\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base}{\basepoint}%
+ \inheritanchor[from=or gate US]{base east}%
+ \anchor{base west}{%
+ \csname pgf@anchor@xor gate US@north west\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \inheritanchor[from=or gate US]{base}%
+ \inheritanchor[from=or gate US]{output}%
+ \inheritanchor[from=or gate US]{east}%
+ \inheritanchor[from=or gate US]{north east}%
+ \inheritanchor[from=or gate US]{south east}%
+ \inheritanchor[from=or gate US]{north}%
+ \inheritanchor[from=or gate US]{south}%
+ \anchor{south west}{%
+ \dimensions%
+ \pgf@xa\halfside%
+ \pgf@xa-3.232051\pgf@xa% (7/6 + 2*cos(30) + 1/3) * x
+ \pgf@xb\halfside%
+ \pgf@xb2.0\pgf@xb%
+ \advance\pgf@xb-\halflinewidth%
+ \advance\pgf@xa.866025\pgf@xb%
+ \pgf@ya.5\pgf@xb%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y-\halfheight%
+ \else%
+ \advance\pgf@y-\pgf@ya%
+ \fi%
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \pgf@xa\halfside%
+ \pgf@xa-3.232051\pgf@xa% (7/6 + 2*cos(30) + 1/3) * x
+ \pgf@xb\halfside%
+ \pgf@xb2.0\pgf@xb%
+ \advance\pgf@xb-\halflinewidth%
+ \advance\pgf@xa.866025\pgf@xb%
+ \pgf@ya.5\pgf@xb%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y\halfheight%
+ \else%
+ \advance\pgf@y\pgf@ya%
+ \fi%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ %
+ \pgf@xb\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{0}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@xc-1.166666\pgf@ya%
+ \advance\pgf@xc-.866025\pgf@xb%
+ \advance\pgf@xc\pgfmathresult\pgf@yb%
+ \advance\pgf@xc\halflinewidth%
+ \advance\pgf@xc-\outerxsep%
+ %
+ \centerpoint%
+ \advance\pgf@x\pgf@xc%
+ \pgf@xa\halfside%
+ \advance\pgf@x-.333333\pgf@xa%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-0.133974\pgf@xa%
+ \fi%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ {%
+ \pgf@yc2.66666\pgf@yc%
+ \pgfpatharc{-22}{0}{+1.166666\pgf@yc and +\pgf@yc}%
+ }
+ {%
+ \pgf@yc2.66666\pgf@yc%
+ \pgfpatharc{0}{22}{+1.166666\pgf@yc and +\pgf@yc}%
+ }%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ \pgf@xa\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@x-1.5\pgf@ya%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x\pgfmathresult\pgf@yb%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ % Now, some fooling around to stop the `tail' being filled.
+ % Technically it still is, but it isn't visible.
+ %
+ \pgf@xc\halfside%
+ \pgf@yc\halfside%
+ \pgfpathmoveto{\pgfqpoint{-1.5\pgf@xc}{-\pgf@yc}}%
+ \pgf@yc2.0\pgf@yc%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter<61\relax%
+ {%
+ \pgfextract@process\point{%
+ \pgfpointadd{%
+ \pgf@x\halfside%
+ \pgf@x-3.232051\pgf@x% (7/6 + 2*cos(30) + 1/3) * x
+ \pgf@y0pt%
+ }{%
+ \pgfpointpolar{\pgfmathcounter-30}{+\pgf@yc}%
+ }%
+ }%
+ \pgfpathlineto{\point}%
+ \pgfpathmoveto{\point}%
+ }
+ \repeatpgfmathloop%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@xb\pgf@x%
+ \pgf@yb\pgf@y%
+ \pgfmathanglebetweenpoints{\centerpoint}{\externalpoint}%
+ \let\externalangle\pgfmathresult%
+ \dimensions%
+ \pgf@xc\halfside%
+ %
+ \pgf@xc-.166666\pgf@xc%
+ \ifdim\pgf@xa<\pgf@xc%
+ \pgfmathanglebetweenpoints{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@north west\endcsname%
+ }%
+ \ifdim\externalangle pt<\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@north\endcsname%
+ }%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@north west\endcsname%
+ }%
+ \else%
+ \pgfmathsubtract@{360}{\pgfmathresult}%
+ \ifdim\externalangle pt>\pgfmathresult pt\relax%
+ \pgfpointintersectionoflines{\externalpoint}{\centerpoint}%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@south\endcsname%
+ }%
+ {%
+ \pgfgateanchorsuseboundingrectangletrue%
+ \csname pgf@anchor@xor gate US@south west\endcsname%
+ }%
+ \else%
+ \ifdim\pgf@ya>\pgf@yb%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \advance\pgf@yc-\outerxsep%
+ \pgf@process{%
+ \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
+ {%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.166666\pgf@xa%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@x-.166666\pgf@xa%
+ }%
+ {0}{90}{+\pgf@yc}%
+ }%
+ \else%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \advance\pgf@yc-\outerxsep%
+ \pgf@process{%
+ \pgfmathpointintersectionoflineandarc{\centerpoint}{\externalpoint}%
+ {%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.166666\pgf@xa%
+ \pgf@xa2.0\pgf@xa%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@x-.166666\pgf@xa%
+ }%
+ {270}{360}{+\pgf@yc}%
+ }%
+ \fi%
+ \fi%
+ \fi%
+ \else%
+ \ifdim\pgf@y=0pt\relax%
+ \csname pgf@anchor@and gate US@east\endcsname%
+ \else%
+ \pgf@xc\halfwidth%
+ \advance\pgf@xc\halfside%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \pgf@xb\halfside%
+ \pgf@xb-.166666\pgf@xb%
+ \ifdim\pgf@ya<0pt%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {270}{330}{+\pgf@yc}%
+ \else%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y-\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {30}{90}{+\pgf@xc and +\pgf@yc}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
@@ -1484,167 +1484,167 @@
% Shape xnor gate US
%
\pgfdeclareshape{xnor gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{2}%
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@xnor gate US@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@xnor gate US@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@XOR@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An xnor gate must have two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\halflinewidth{%
- \pgf@x.5\pgflinewidth%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \inheritanchor[from=xor gate US]{mid east}
- \inheritanchor[from=xor gate US]{mid west}
- \anchor{base}{\basepoint}%
- \inheritanchor[from=xor gate US]{base east}
- \inheritanchor[from=xor gate US]{base west}
- \inheritanchor[from=xor gate US]{base}
- \inheritanchor[from=nor gate US]{output}
- \inheritanchor[from=xor gate US]{east}
- \inheritanchor[from=xor gate US]{north east}
- \inheritanchor[from=xor gate US]{south east}
- \inheritanchor[from=xor gate US]{north}
- \inheritanchor[from=xor gate US]{south}
- \inheritanchor[from=xor gate US]{south west}
- \inheritanchor[from=xor gate US]{north west}
- \inheritanchor[from=xor gate US]{west}
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- {%
- \pgf@yc2.66666\pgf@yc%
- \pgfpatharc{-22}{0}{+1.166666\pgf@yc and +\pgf@yc}%
- }
- {%
- \pgf@yc2.66666\pgf@yc%
- \pgfpatharc{0}{22}{+1.166666\pgf@yc and +\pgf@yc}%
- }%
- \pgfpathclose%
- %
- % Draw the output inverter.
- %
- {%
- \pgfpathcircle{%
- \pgf@x-.166666\pgf@xc%
- \pgf@yc2.0\pgf@yc%
- \advance\pgf@x.866025\pgf@yc%
- \advance\pgf@x\outerinvertedradius%
- \pgf@y0pt%
- }{+\invertedradius}%
- }%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@ya\halfside%
- \pgf@yb2.0\pgf@ya%
- \pgf@xa\pgf@yb%
- \advance\pgf@yb-\halflinewidth%
- \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
- \pgfmathasin@{\pgfmathresult}%
- \pgfmathcos@{\pgfmathresult}%
- %
- \pgf@x-1.5\pgf@ya%
- \advance\pgf@x-.866025\pgf@xa%
- \advance\pgf@x\pgfmathresult\pgf@yb%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- %
- % Now, some fooling around to stop the `tail' being filled.
- %
- \pgf@xc\halfside%
- \pgf@yc\halfside%
- \pgfpathmoveto{\pgfqpoint{-1.5\pgf@xc}{-\pgf@yc}}%
- \pgf@yc2.0\pgf@yc%
- \pgfmathloop%
- \ifnum\pgfmathcounter<61\relax%
- {%
- \pgfextract@process\point{%
- \pgfpointadd{%
- \pgf@x\halfside%
- \pgf@x-3.232051\pgf@x% (7/6 + 2*cos(30) + 1/3) * x
- \pgf@y0pt%
- }{%
- \pgfpointpolar{\pgfmathcounter-30}{+\pgf@yc}%
- }%
- }%
- \pgfpathlineto{\point}%
- \pgfpathmoveto{\point}%
- }
- \repeatpgfmathloop%
- }%
- }%
- \inheritanchorborder[from=xor gate US]
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@xnor gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{2}%
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@xnor gate US@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@xnor gate US@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@XOR@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An xnor gate must have two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\halflinewidth{%
+ \pgf@x.5\pgflinewidth%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \inheritanchor[from=xor gate US]{mid east}%
+ \inheritanchor[from=xor gate US]{mid west}%
+ \anchor{base}{\basepoint}%%
+ \inheritanchor[from=xor gate US]{base east}%
+ \inheritanchor[from=xor gate US]{base west}%
+ \inheritanchor[from=xor gate US]{base}%
+ \inheritanchor[from=nor gate US]{output}%
+ \inheritanchor[from=xor gate US]{east}%
+ \inheritanchor[from=xor gate US]{north east}%
+ \inheritanchor[from=xor gate US]{south east}%
+ \inheritanchor[from=xor gate US]{north}%
+ \inheritanchor[from=xor gate US]{south}%
+ \inheritanchor[from=xor gate US]{south west}%
+ \inheritanchor[from=xor gate US]{north west}%
+ \inheritanchor[from=xor gate US]{west}%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ {%
+ \pgf@yc2.66666\pgf@yc%
+ \pgfpatharc{-22}{0}{+1.166666\pgf@yc and +\pgf@yc}%
+ }
+ {%
+ \pgf@yc2.66666\pgf@yc%
+ \pgfpatharc{0}{22}{+1.166666\pgf@yc and +\pgf@yc}%
+ }%
+ \pgfpathclose%
+ %
+ % Draw the output inverter.
+ %
+ {%
+ \pgfpathcircle{%
+ \pgf@x-.166666\pgf@xc%
+ \pgf@yc2.0\pgf@yc%
+ \advance\pgf@x.866025\pgf@yc%
+ \advance\pgf@x\outerinvertedradius%
+ \pgf@y0pt%
+ }{+\invertedradius}%
+ }%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@ya\halfside%
+ \pgf@yb2.0\pgf@ya%
+ \pgf@xa\pgf@yb%
+ \advance\pgf@yb-\halflinewidth%
+ \pgfmathdivide@{\pgfmath@tonumber{\pgf@yc}}{\pgfmath@tonumber{\pgf@yb}}%
+ \pgfmathasin@{\pgfmathresult}%
+ \pgfmathcos@{\pgfmathresult}%
+ %
+ \pgf@x-1.5\pgf@ya%
+ \advance\pgf@x-.866025\pgf@xa%
+ \advance\pgf@x\pgfmathresult\pgf@yb%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ %
+ % Now, some fooling around to stop the `tail' being filled.
+ %
+ \pgf@xc\halfside%
+ \pgf@yc\halfside%
+ \pgfpathmoveto{\pgfqpoint{-1.5\pgf@xc}{-\pgf@yc}}%
+ \pgf@yc2.0\pgf@yc%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter<61\relax%
+ {%
+ \pgfextract@process\point{%
+ \pgfpointadd{%
+ \pgf@x\halfside%
+ \pgf@x-3.232051\pgf@x% (7/6 + 2*cos(30) + 1/3) * x
+ \pgf@y0pt%
+ }{%
+ \pgfpointpolar{\pgfmathcounter-30}{+\pgf@yc}%
+ }%
+ }%
+ \pgfpathlineto{\point}%
+ \pgfpathmoveto{\point}%
+ }
+ \repeatpgfmathloop%
+ }%
+ }%
+ \inheritanchorborder[from=xor gate US]%
+}%
@@ -1655,7 +1655,7 @@
%
\pgfdeclareshape{not gate US}{%
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@not gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1}%
+ \pgf@lib@sh@logicgate@parseinputs{1}%
\ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
\pgferror{A not gate must have one input}%
\fi%
@@ -1670,21 +1670,21 @@
\saveddimen\outerinvertedradius{%
\pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
\advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}%
\savedanchor\centerpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y.5\ht\pgfnodeparttextbox%
\advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
+ }%
\savedanchor\midpoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgfmathsetlength\pgf@y{+0.5ex}%
- }
+ }%
\savedanchor\basepoint{%
\pgf@x.5\wd\pgfnodeparttextbox%
\pgf@y0pt%
- }
+ }%
\anchor{center}{\centerpoint}%
\anchor{mid}{\midpoint}%
\anchor{mid east}{%
@@ -1692,14 +1692,14 @@
\pgfutil@tempdima\pgf@y%
\csname pgf@anchor@not gate US@east\endcsname%
\pgf@y\pgfutil@tempdima%
- }
+ }%
\anchor{mid west}{%
\dimensions%
\pgf@xc\halfside%
\pgf@xc-.833333\pgf@xc%
\advance\pgf@xc-\outerxsep%
\midpoint%
- \advance\pgf@x\pgf@xc%
+ \advance\pgf@x\pgf@xc%
}%
\anchor{base}{\basepoint}%
\anchor{base east}{%
@@ -1707,16 +1707,16 @@
\pgfutil@tempdima\pgf@y%
\csname pgf@anchor@not gate US@east\endcsname%
\pgf@y\pgfutil@tempdima%
- }
+ }%
\anchor{base west}{%
\dimensions%
\pgf@xc\halfside%
\pgf@xc-.833333\pgf@xc%
\advance\pgf@xc-\outerxsep%
\basepoint%
- \advance\pgf@x\pgf@xc%
+ \advance\pgf@x\pgf@xc%
}%
- \inheritanchor[from=and gate US]{base}
+ \inheritanchor[from=and gate US]{base}%
\anchor{output}{%
\dimensions%
\pgf@xc\halfside%
@@ -1727,7 +1727,7 @@
\advance\pgf@x\invertedradius%
\advance\pgf@x\outerinvertedradius%
\advance\pgf@x\outerxsep%
- }
+ }%
\anchor{east}{%
\dimensions%
\tipanchor%
@@ -1749,11 +1749,11 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\fi%
- }
+ }%
\anchor{south}{%
\dimensions%
\ifpgfgateanchorsuseboundingrectangle%
@@ -1768,17 +1768,17 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\fi%
- }
+ }%
\anchor{south east}{%
\dimensions%
\ifpgfgateanchorsuseboundingrectangle%
\csname pgf@anchor@not gate US@south west\endcsname%
\pgf@ya\pgf@y%
- \pgf@process{%
+ \pgf@process{%
\dimensions%
\tipanchor%
\pgf@xa\pgf@x%
@@ -1793,17 +1793,17 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\fi%
- }
+ }%
\anchor{north east}{%
\dimensions%
\ifpgfgateanchorsuseboundingrectangle%
\csname pgf@anchor@not gate US@north west\endcsname%
\pgf@ya\pgf@y%
- \pgf@process{%
+ \pgf@process{%
\dimensions%
\tipanchor%
\pgf@xa\pgf@x%
@@ -1818,11 +1818,11 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\fi%
- }
+ }%
\anchor{south west}{%
\dimensions%
\pgf@xa\halfside%
@@ -1831,7 +1831,7 @@
\advance\pgf@x-\outerxsep%
\advance\pgf@y-1.166666\pgf@xa%
\pgf@ya\outerysep%
- \advance\pgf@y-1.565\pgf@ya% Selected by trial and error.
+ \advance\pgf@y-1.565\pgf@ya% Selected by trial and error.
}%
\anchor{north west}{%
\dimensions%
@@ -1841,7 +1841,7 @@
\advance\pgf@x-\outerxsep%
\advance\pgf@y1.166666\pgf@xa%
\pgf@ya\outerysep%
- \advance\pgf@y1.565\pgf@ya% Selected by trial and error.
+ \advance\pgf@y1.565\pgf@ya% Selected by trial and error.
}%
\anchor{input}{%
\dimensions%
@@ -1856,7 +1856,7 @@
\advance\pgf@xc-\outerxsep%
\centerpoint%
\advance\pgf@x\pgf@xc%
- }
+ }%
\backgroundpath{%
\dimensions%
\pgf@xc\halfwidth%
@@ -1869,9 +1869,9 @@
\pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{1.166666\pgf@yc}}%
\pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{-1.166666\pgf@yc}}%
\pgfpathlineto{\tipanchor}%
- %
+ %
% Draw the output inverter.
- %
+ %
{%
\pgfpathcircle{%
\pgf@x-.166666\pgf@xc%
@@ -1879,11 +1879,11 @@
\advance\pgf@x.866025\pgf@yc%
\advance\pgf@x\outerinvertedradius%
\pgf@y0pt%
- }{+\invertedradius}%
+ }{+\invertedradius}%
}%
- %
+ %
% Draw the input.
- %
+ %
\expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-1\endcsname%
{%
\pgfpathcircle{%
@@ -1892,15 +1892,15 @@
\advance\pgf@x-.5\pgflinewidth%
\advance\pgf@x-\invertedradius%
\pgf@y0pt%
- }{+\invertedradius}%
+ }{+\invertedradius}%
}%
- \fi%
+ \fi%
}%
}%
\anchorborder{%
\pgf@lib@gates@not@buffer@border{not gate US}
- }
-}
+ }%
+}%
\def\pgf@lib@gates@not@buffer@border#1{
\pgfextract@process\externalpoint{}%
@@ -1922,9 +1922,9 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\else%
\pgfmathanglebetweenpoints{\centerpoint}{\csname pgf@anchor@not gate US@south west\endcsname}%
\ifdim\externalangle pt<\pgfmathresult pt%
@@ -1938,9 +1938,9 @@
\pgfpointadd{\centerpoint}{%
\tipanchor%
\pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
+ \advance\pgf@x2.350943\pgf@xa%
}%
- }%
+ }%
\fi%
\fi%
\fi%
@@ -1948,8 +1948,8 @@
}%
-\def\pgf@lib@zero@text{0.0}
-\def\pgf@lib@onehundredeighty@text{180.0}
+\def\pgf@lib@zero@text{0.0}%
+\def\pgf@lib@onehundredeighty@text{180.0}%
@@ -1957,569 +1957,569 @@
% Shape buffer gate US.
%
\pgfdeclareshape{buffer gate US}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate US\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1}%
- \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
- \pgferror{A buffer gate must have one input}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\halflinewidth{%
- \pgf@x.5\pgflinewidth%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \midpoint%
- \pgfutil@tempdima\pgf@y%
- \csname pgf@anchor@buffer gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- }
- \anchor{mid west}{%
- \dimensions%
- \pgf@xc\halfside%
- \pgf@xc-.833333\pgf@xc%
- \advance\pgf@xc-\outerxsep%
- \midpoint%
- \advance\pgf@x\pgf@xc%
- }%
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \basepoint%
- \pgfutil@tempdima\pgf@y%
- \csname pgf@anchor@buffer gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- }
- \inheritanchor[from=not gate US]{base west}
- \inheritanchor[from=and gate US]{base}
- \anchor{output}{\csname pgf@anchor@buffer gate US@east\endcsname}
- \anchor{east}{%
- \dimensions%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \anchor{north}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@north west\endcsname%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@y\pgf@ya%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@y1pt}%
- {\csname pgf@anchor@buffer gate US@north west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- }
- \anchor{south}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@south west\endcsname%
- \pgf@ya\pgf@y%
- \centerpoint%
- \pgf@y\pgf@ya%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@y-1pt}%
- {\csname pgf@anchor@not gate US@south west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- }
- \anchor{south east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@south west\endcsname%
- \pgfutil@tempdima\pgf@y%
- \csname pgf@anchor@buffer gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y-1pt}%
- {\csname pgf@anchor@buffer gate US@south west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xc\outerxsep%
- \advance\pgf@x2.350943\pgf@xc%
- }%
- }%
- \fi%
- }
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \csname pgf@anchor@not gate US@north west\endcsname%
- \pgfutil@tempdima\pgf@y%
- \csname pgf@anchor@buffer gate US@east\endcsname%
- \pgf@y\pgfutil@tempdima%
- \else%
- \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y1pt}%
- {\csname pgf@anchor@buffer gate US@north west\endcsname}%
- {%
- \pgfpointadd{\centerpoint}{%
- \tipanchor%
- \pgf@xa\outerxsep%
- \advance\pgf@x2.350943\pgf@xa%
- }%
- }%
- \fi%
- }
- \inheritanchor[from=not gate US]{south west}
- \inheritanchor[from=not gate US]{north west}
- \inheritanchor[from=not gate US]{input}
- \inheritanchor[from=not gate US]{west}
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\tipanchor}%
- \pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{1.166666\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{-1.166666\pgf@yc}}%
- \pgfpathclose%
- %
- % Draw the input.
- %
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-1\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-.833333\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y0pt%
- }{+\invertedradius}%
- }%
- \fi%
- }%
- }%
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@buffer gate US\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1}%
+ \ifnum\pgf@lib@sh@logicgate@numinputs=0\relax%
+ \pgferror{A buffer gate must have one input}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\halflinewidth{%
+ \pgf@x.5\pgflinewidth%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \midpoint%
+ \pgfutil@tempdima\pgf@y%
+ \csname pgf@anchor@buffer gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ }%
+ \anchor{mid west}{%
+ \dimensions%
+ \pgf@xc\halfside%
+ \pgf@xc-.833333\pgf@xc%
+ \advance\pgf@xc-\outerxsep%
+ \midpoint%
+ \advance\pgf@x\pgf@xc%
+ }%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \basepoint%
+ \pgfutil@tempdima\pgf@y%
+ \csname pgf@anchor@buffer gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ }%
+ \inheritanchor[from=not gate US]{base west}%
+ \inheritanchor[from=and gate US]{base}%
+ \anchor{output}{\csname pgf@anchor@buffer gate US@east\endcsname}%
+ \anchor{east}{%
+ \dimensions%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \anchor{north}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@north west\endcsname%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@y\pgf@ya%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@y1pt}%
+ {\csname pgf@anchor@buffer gate US@north west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ }%
+ \anchor{south}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@south west\endcsname%
+ \pgf@ya\pgf@y%
+ \centerpoint%
+ \pgf@y\pgf@ya%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@y-1pt}%
+ {\csname pgf@anchor@not gate US@south west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ }%
+ \anchor{south east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@south west\endcsname%
+ \pgfutil@tempdima\pgf@y%
+ \csname pgf@anchor@buffer gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y-1pt}%
+ {\csname pgf@anchor@buffer gate US@south west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xc\outerxsep%
+ \advance\pgf@x2.350943\pgf@xc%
+ }%
+ }%
+ \fi%
+ }%
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \csname pgf@anchor@not gate US@north west\endcsname%
+ \pgfutil@tempdima\pgf@y%
+ \csname pgf@anchor@buffer gate US@east\endcsname%
+ \pgf@y\pgfutil@tempdima%
+ \else%
+ \pgfpointintersectionoflines{\centerpoint}{\centerpoint\advance\pgf@x1pt\advance\pgf@y1pt}%
+ {\csname pgf@anchor@buffer gate US@north west\endcsname}%
+ {%
+ \pgfpointadd{\centerpoint}{%
+ \tipanchor%
+ \pgf@xa\outerxsep%
+ \advance\pgf@x2.350943\pgf@xa%
+ }%
+ }%
+ \fi%
+ }%
+ \inheritanchor[from=not gate US]{south west}%
+ \inheritanchor[from=not gate US]{north west}%
+ \inheritanchor[from=not gate US]{input}%
+ \inheritanchor[from=not gate US]{west}%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\tipanchor}%
+ \pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{1.166666\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-.833333\pgf@xc}{-1.166666\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % Draw the input.
+ %
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-1\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-.833333\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y0pt%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ }%
+ }%
\anchorborder{%
\pgf@lib@gates@not@buffer@border{buffer gate US}
- }
-}
+ }%
+}%
\pgfdeclareshape{and gate CDH}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate CDH\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@and gate CDH@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@and gate CDH@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{An and gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \anchor{mid east}{%
- \csname pgf@anchor@and gate CDH@east\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{mid west}{%
- \csname pgf@anchor@and gate CDH@west\endcsname%
- \pgf@xa\pgf@x%
- \midpoint%
- \pgf@x\pgf@xa}
- \anchor{base}{\basepoint}%
- \anchor{base east}{%
- \csname pgf@anchor@and gate CDH@east\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{base west}{%
- \csname pgf@anchor@and gate CDH@west\endcsname%
- \pgf@xa\pgf@x%
- \basepoint%
- \pgf@x\pgf@xa}
- \anchor{east}{%
- \dimensions%
- \pgfpointadd{\centerpoint}{\tipanchor}%
- }
- \anchor{output}{\csname pgf@anchor@and gate CDH@east\endcsname}
- \anchor{north east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y\halfheight%
- \else%
- \centerpoint%
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\halfside%
- \advance\pgf@x-.166666\pgf@xb%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@x.5\pgf@xa%
- \advance\pgf@y-\pgf@xb%
- \advance\pgf@ya\pgf@xb%
- \advance\pgf@y.866025\pgf@ya%
- \fi%
- }
- \anchor{south east}{%
- \dimensions%
- \ifpgfgateanchorsuseboundingrectangle%
- \tipanchor%
- \pgf@xa\pgf@x%
- \centerpoint%
- \advance\pgf@x\pgf@xa%
- \advance\pgf@y-\halfheight%
- \else
- \centerpoint%
- \pgf@xa\halfwidth%
- \pgf@ya\halfheight%
- \pgf@xb\halfside%
- \advance\pgf@x-.166666\pgf@xb%
- \advance\pgf@xa\pgf@xb%
- \advance\pgf@x.5\pgf@xa%
- \advance\pgf@y\pgf@xb%
- \advance\pgf@ya\pgf@xb%
- \advance\pgf@y-.866025\pgf@ya%
- \fi%
- }
- \anchor{north}{%
- \dimensions%
- \centerpoint%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y\halfheight%
- \else%
- \pgf@ya\halfheight%
- \advance\pgf@y.993043\pgf@ya%
- \fi%
- }
- \anchor{south}{%
- \dimensions%
- \centerpoint%
- \ifpgfgateanchorsuseboundingrectangle%
- \advance\pgf@y-\halfheight%
- \else%
- \pgf@ya\halfheight%
- \advance\pgf@y-.993043\pgf@ya%
- \fi%
- }
- \anchor{south west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y-\halfheight%
- }
- \anchor{north west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- \advance\pgf@y\halfheight%
- }
- \anchor{west}{%
- \dimensions%
- \centerpoint%
- \pgf@xa\halfside%
- \advance\pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-\outerxsep%
- }
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
- \pgfpathclose%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \anchorborder{%
- \pgfextract@process\externalpoint{}%
- \pgf@xa\pgf@x%
- \pgf@ya\pgf@y%
- \dimensions%
- \pgf@xb\halfside%
- %
- \pgf@xb-.166666\pgf@xb%
- \ifdim\pgf@xa<\pgf@xb%
- \pgfpointadd{\centerpoint}{%
- \pgfpointborderrectangle{\externalpoint}{%
- \pgf@xc\halfside%
- \pgf@xc.166666\pgf@xc%
- \advance\pgf@xc\halfwidth%
- \pgfqpoint{\pgf@xc}{\halfheight}%
- }%
- }%
- \else%
- \ifdim\pgf@y=0pt\relax%
- \csname pgf@anchor@and gate CDH@east\endcsname%
- \else%
- \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
- \pgf@xc\halfwidth%
- \advance\pgf@xc\halfside%
- \pgf@yc\halfheight%
- \advance\pgf@yc\halfside%
- \ifdim\pgf@ya<0pt%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {270}{330}{+\pgf@yc}%
- \else%
- \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
- {%
- \centerpoint%
- \advance\pgf@y-\halfside%
- \advance\pgf@x\pgf@xb%
- }%
- {30}{90}{+\pgf@xc and +\pgf@yc}%
- \fi%
- \fi%
- \fi%
- }
-}
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@and gate CDH\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@and gate CDH@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@and gate CDH@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{An and gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \anchor{mid east}{%
+ \csname pgf@anchor@and gate CDH@east\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{mid west}{%
+ \csname pgf@anchor@and gate CDH@west\endcsname%
+ \pgf@xa\pgf@x%
+ \midpoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base}{\basepoint}%
+ \anchor{base east}{%
+ \csname pgf@anchor@and gate CDH@east\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{base west}{%
+ \csname pgf@anchor@and gate CDH@west\endcsname%
+ \pgf@xa\pgf@x%
+ \basepoint%
+ \pgf@x\pgf@xa}%
+ \anchor{east}{%
+ \dimensions%
+ \pgfpointadd{\centerpoint}{\tipanchor}%
+ }%
+ \anchor{output}{\csname pgf@anchor@and gate CDH@east\endcsname}%
+ \anchor{north east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y\halfheight%
+ \else%
+ \centerpoint%
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\halfside%
+ \advance\pgf@x-.166666\pgf@xb%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@x.5\pgf@xa%
+ \advance\pgf@y-\pgf@xb%
+ \advance\pgf@ya\pgf@xb%
+ \advance\pgf@y.866025\pgf@ya%
+ \fi%
+ }%
+ \anchor{south east}{%
+ \dimensions%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \tipanchor%
+ \pgf@xa\pgf@x%
+ \centerpoint%
+ \advance\pgf@x\pgf@xa%
+ \advance\pgf@y-\halfheight%
+ \else
+ \centerpoint%
+ \pgf@xa\halfwidth%
+ \pgf@ya\halfheight%
+ \pgf@xb\halfside%
+ \advance\pgf@x-.166666\pgf@xb%
+ \advance\pgf@xa\pgf@xb%
+ \advance\pgf@x.5\pgf@xa%
+ \advance\pgf@y\pgf@xb%
+ \advance\pgf@ya\pgf@xb%
+ \advance\pgf@y-.866025\pgf@ya%
+ \fi%
+ }%
+ \anchor{north}{%
+ \dimensions%
+ \centerpoint%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y\halfheight%
+ \else%
+ \pgf@ya\halfheight%
+ \advance\pgf@y.993043\pgf@ya%
+ \fi%
+ }%
+ \anchor{south}{%
+ \dimensions%
+ \centerpoint%
+ \ifpgfgateanchorsuseboundingrectangle%
+ \advance\pgf@y-\halfheight%
+ \else%
+ \pgf@ya\halfheight%
+ \advance\pgf@y-.993043\pgf@ya%
+ \fi%
+ }%
+ \anchor{south west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y-\halfheight%
+ }%
+ \anchor{north west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ \advance\pgf@y\halfheight%
+ }%
+ \anchor{west}{%
+ \dimensions%
+ \centerpoint%
+ \pgf@xa\halfside%
+ \advance\pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-\outerxsep%
+ }%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \anchorborder{%
+ \pgfextract@process\externalpoint{}%
+ \pgf@xa\pgf@x%
+ \pgf@ya\pgf@y%
+ \dimensions%
+ \pgf@xb\halfside%
+ %
+ \pgf@xb-.166666\pgf@xb%
+ \ifdim\pgf@xa<\pgf@xb%
+ \pgfpointadd{\centerpoint}{%
+ \pgfpointborderrectangle{\externalpoint}{%
+ \pgf@xc\halfside%
+ \pgf@xc.166666\pgf@xc%
+ \advance\pgf@xc\halfwidth%
+ \pgfqpoint{\pgf@xc}{\halfheight}%
+ }%
+ }%
+ \else%
+ \ifdim\pgf@y=0pt\relax%
+ \csname pgf@anchor@and gate CDH@east\endcsname%
+ \else%
+ \pgfextract@process\externalpoint{\pgfpointadd{\centerpoint}{\externalpoint}}%
+ \pgf@xc\halfwidth%
+ \advance\pgf@xc\halfside%
+ \pgf@yc\halfheight%
+ \advance\pgf@yc\halfside%
+ \ifdim\pgf@ya<0pt%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {270}{330}{+\pgf@yc}%
+ \else%
+ \pgfmathpointintersectionoflineandarc{\externalpoint}{\centerpoint}%
+ {%
+ \centerpoint%
+ \advance\pgf@y-\halfside%
+ \advance\pgf@x\pgf@xb%
+ }%
+ {30}{90}{+\pgf@xc and +\pgf@yc}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}%
\pgfdeclareshape{nand gate CDH}{%
- \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate CDH\endcsname{%
- \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
- %
- \pgfmathloop%
- \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
- \else%
- \pgfutil@ifundefined{pgf@anchor@nand gate CDH@input \pgfmathcounter}{%
- \expandafter\xdef\csname pgf@anchor@nand gate CDH@input \pgfmathcounter\endcsname{%
- \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
- }%
- }{}%
- \repeatpgfmathloop%
- \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
- \pgferror{A nand gate must have at least two inputs}%
- \fi%
- }%
- \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
- \saveddimen\invertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- }%
- \saveddimen\outerinvertedradius{%
- \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
- \advance\pgf@x.5\pgflinewidth%
- }
- \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}
- \savedanchor\centerpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y.5\ht\pgfnodeparttextbox%
- \advance\pgf@y-.5\dp\pgfnodeparttextbox%
- }
- \savedanchor\midpoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgfmathsetlength\pgf@y{+0.5ex}%
- }
- \savedanchor\basepoint{%
- \pgf@x.5\wd\pgfnodeparttextbox%
- \pgf@y0pt%
- }
- \anchor{center}{\centerpoint}%
- \anchor{mid}{\midpoint}%
- \inheritanchor[from=and gate CDH]{mid east}
- \inheritanchor[from=and gate CDH]{mid west}
- \anchor{base}{\basepoint}%
- \inheritanchor[from=and gate CDH]{base east}
- \inheritanchor[from=and gate CDH]{base west}
- \anchor{output}{%
- \dimensions
- \pgfpointadd{\centerpoint}{%
- \pgf@xa\halfside%
- \pgf@x-.166666\pgf@xa%
- \pgf@xb2.0\pgf@xa%
- \advance\pgf@x.866025\pgf@xb%
- \advance\pgf@x\invertedradius%
- \advance\pgf@x\outerinvertedradius%
- \advance\pgf@x\outerxsep%
- \pgf@y0pt%
- }%
- }
- \inheritanchor[from=and gate CDH]{east}
- \inheritanchor[from=and gate CDH]{north east}
- \inheritanchor[from=and gate CDH]{south east}
- \inheritanchor[from=and gate CDH]{north}
- \inheritanchor[from=and gate CDH]{south}
- \inheritanchor[from=and gate CDH]{south west}
- \inheritanchor[from=and gate CDH]{north west}
- \inheritanchor[from=and gate CDH]{west}
- \backgroundpath{%
- \dimensions%
- \pgf@xc\halfwidth%
- \pgf@yc\halfheight%
- \advance\pgf@xc-\outerxsep%
- \advance\pgf@yc-\outerysep%
- {%
- \pgftransformshift{\centerpoint}%
- \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- {%
- \pgf@yc2.0\pgf@yc%
- \edef\pgf@marshal{%
- \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
- }%
- \pgf@marshal%
- }
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
- \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
- \pgfpathclose%
- %
- % Draw the output inverter.
- %
- {%
- \pgfpathcircle{%
- \pgf@x-.166666\pgf@xc%
- \pgf@yc2.0\pgf@yc%
- \advance\pgf@x.866025\pgf@yc%
- \advance\pgf@x\outerinvertedradius%
- \pgf@y0pt%
- }{+\invertedradius}%
- }%
- %
- % Draw the inputs.
- %
- \pgfutil@tempdima2.0\pgf@yc%
- \c@pgf@counta\numinputs%
- \advance\c@pgf@counta1\relax%
- \divide\pgfutil@tempdima\c@pgf@counta%
- \pgfmathloop%
- \ifnum\pgfmathcounter>\numinputs%
- \else%
- \advance\pgf@yc-\pgfutil@tempdima%
- \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
- {%
- \pgfpathcircle{%
- \pgf@xa\halfside%
- \pgf@x-1.16666\pgf@xa%
- \advance\pgf@x-.5\pgflinewidth%
- \advance\pgf@x-\invertedradius%
- \pgf@y\pgf@yc%
- }{+\invertedradius}%
- }%
- \fi%
- \repeatpgfmathloop%
- }%
- }%
- \inheritanchorborder[from=and gate CDH]
-} \ No newline at end of file
+ \expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@nand gate CDH\endcsname{%
+ \pgf@lib@sh@logicgate@parseinputs{1024}% Maximum 1024 (!) inputs.
+ %
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf@lib@sh@logicgate@numinputs%
+ \else%
+ \pgfutil@ifundefined{pgf@anchor@nand gate CDH@input \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf@anchor@nand gate CDH@input \pgfmathcounter\endcsname{%
+ \noexpand\pgf@lib@sh@logicgate@AND@inputanchor{\pgfmathcounter}%
+ }%
+ }{}%
+ \repeatpgfmathloop%
+ \ifnum\pgf@lib@sh@logicgate@numinputs<2\relax%
+ \pgferror{A nand gate must have at least two inputs}%
+ \fi%
+ }%
+ \savedmacro\numinputs{\let\numinputs\pgf@lib@sh@logicgate@numinputs}%
+ \saveddimen\invertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ }%
+ \saveddimen\outerinvertedradius{%
+ \pgfmathsetlength\pgf@x{\pgfkeysvalueof{/pgf/logic gate inverted radius}}%
+ \advance\pgf@x.5\pgflinewidth%
+ }%
+ \savedmacro\dimensions{\pgf@lib@sh@logicgates@dimensions@orUS}%
+ \savedanchor\centerpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y.5\ht\pgfnodeparttextbox%
+ \advance\pgf@y-.5\dp\pgfnodeparttextbox%
+ }%
+ \savedanchor\midpoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgfmathsetlength\pgf@y{+0.5ex}%
+ }%
+ \savedanchor\basepoint{%
+ \pgf@x.5\wd\pgfnodeparttextbox%
+ \pgf@y0pt%
+ }%
+ \anchor{center}{\centerpoint}%
+ \anchor{mid}{\midpoint}%
+ \inheritanchor[from=and gate CDH]{mid east}%
+ \inheritanchor[from=and gate CDH]{mid west}%
+ \anchor{base}{\basepoint}%%
+ \inheritanchor[from=and gate CDH]{base east}%
+ \inheritanchor[from=and gate CDH]{base west}%
+ \anchor{output}{%
+ \dimensions
+ \pgfpointadd{\centerpoint}{%
+ \pgf@xa\halfside%
+ \pgf@x-.166666\pgf@xa%
+ \pgf@xb2.0\pgf@xa%
+ \advance\pgf@x.866025\pgf@xb%
+ \advance\pgf@x\invertedradius%
+ \advance\pgf@x\outerinvertedradius%
+ \advance\pgf@x\outerxsep%
+ \pgf@y0pt%
+ }%
+ }%
+ \inheritanchor[from=and gate CDH]{east}%
+ \inheritanchor[from=and gate CDH]{north east}%
+ \inheritanchor[from=and gate CDH]{south east}%
+ \inheritanchor[from=and gate CDH]{north}%
+ \inheritanchor[from=and gate CDH]{south}%
+ \inheritanchor[from=and gate CDH]{south west}%
+ \inheritanchor[from=and gate CDH]{north west}%
+ \inheritanchor[from=and gate CDH]{west}%
+ \backgroundpath{%
+ \dimensions%
+ \pgf@xc\halfwidth%
+ \pgf@yc\halfheight%
+ \advance\pgf@xc-\outerxsep%
+ \advance\pgf@yc-\outerysep%
+ {%
+ \pgftransformshift{\centerpoint}%
+ \pgfpathmoveto{\pgfqpoint{-.16666\pgf@xc}{\pgf@yc}}%
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{90}{30}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ {%
+ \pgf@yc2.0\pgf@yc%
+ \edef\pgf@marshal{%
+ \noexpand\pgfpatharc{-30}{-90}{\the\pgf@yc}%
+ }%
+ \pgf@marshal%
+ }
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{-\pgf@yc}}%
+ \pgfpathlineto{\pgfqpoint{-1.16666\pgf@xc}{\pgf@yc}}%
+ \pgfpathclose%
+ %
+ % Draw the output inverter.
+ %
+ {%
+ \pgfpathcircle{%
+ \pgf@x-.166666\pgf@xc%
+ \pgf@yc2.0\pgf@yc%
+ \advance\pgf@x.866025\pgf@yc%
+ \advance\pgf@x\outerinvertedradius%
+ \pgf@y0pt%
+ }{+\invertedradius}%
+ }%
+ %
+ % Draw the inputs.
+ %
+ \pgfutil@tempdima2.0\pgf@yc%
+ \c@pgf@counta\numinputs%
+ \advance\c@pgf@counta1\relax%
+ \divide\pgfutil@tempdima\c@pgf@counta%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\numinputs%
+ \else%
+ \advance\pgf@yc-\pgfutil@tempdima%
+ \expandafter\ifx\expandafter\pgf@lib@sh@itext\csname input-\pgfmathcounter\endcsname%
+ {%
+ \pgfpathcircle{%
+ \pgf@xa\halfside%
+ \pgf@x-1.16666\pgf@xa%
+ \advance\pgf@x-.5\pgflinewidth%
+ \advance\pgf@x-\invertedradius%
+ \pgf@y\pgf@yc%
+ }{+\invertedradius}%
+ }%
+ \fi%
+ \repeatpgfmathloop%
+ }%
+ }%
+ \inheritanchorborder[from=and gate CDH]%
+}%
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex
index 72d6a6d22ba..68005a61478 100644
--- a/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/libraries/shapes/circuits/pgflibraryshapes.gates.logic.code.tex
@@ -13,8 +13,8 @@
\pgfkeys{/pgf/.cd,%
logic gate input sep/.initial=0.125cm,
logic gate inputs/.initial={normal,normal},%
- logic gate inverted radius/.initial=2pt
-}
+ logic gate inverted radius/.initial=2pt,
+}%
% Internal macro for parsing inputs.
@@ -31,19 +31,19 @@
\let\pgf@lib@sh@next\pgf@lib@sh@logicgate@parseinputs@short%
\fi%
\pgf@lib@sh@next%
-}
-\def\pgf@lib@sh@itext{i}
-\def\pgf@lib@sh@invertedtext{inverted}
-\def\pgf@lib@sh@atchar{@}
-\def\pgf@lib@sh@gobbletilat#1@{}
-\def\pgf@lib@sh@gobbletilatcomma#1@,{}
+}%
+\def\pgf@lib@sh@itext{i}%
+\def\pgf@lib@sh@invertedtext{inverted}%
+\def\pgf@lib@sh@atchar{@}%
+\def\pgf@lib@sh@gobbletilat#1@{}%
+\def\pgf@lib@sh@gobbletilatcomma#1@,{}%
%
-% The `short' version for input specifcation is an extension of
+% The `short' version for input specification is an extension of
% ideas due to Juergen Werber and Christoph Bartoschek.
%
\def\pgf@lib@sh@logicgate@parseinputs@short{%
\expandafter\pgf@lib@sh@logicgate@parseinputs@@short\pgf@lib@sh@temp @%
-}
+}%
\def\pgf@lib@sh@logicgate@parseinputs@@short#1{%
\def\pgf@lib@sh@tmp{#1}%
\ifx\pgf@lib@sh@tmp\pgf@lib@sh@atchar%
@@ -61,17 +61,17 @@
\else%
\expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
\expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
- \fi%
+ \fi%
\let\pgf@lib@sh@next=\pgf@lib@sh@logicgate@parseinputs@@short%
\fi%
\fi%
\pgf@lib@sh@next%
-}
+}%
\def\pgf@lib@sh@logicgate@parseinputs@long{%
\expandafter\pgf@lib@sh@logicgate@parseinputs@@long\pgf@lib@sh@temp,@,%
-}
+}%
\def\pgf@lib@sh@logicgate@parseinputs@@long#1,{%
\def\pgf@lib@sh@tmp{#1}%
\ifx\pgf@lib@sh@tmp\pgf@lib@sh@atchar%
@@ -90,16 +90,14 @@
\else%
\expandafter\pgf@sh@resavedmacro\expandafter{\csname input-\the\c@pgf@countb\endcsname}{%
\expandafter\def\csname input-\the\c@pgf@countb\endcsname{n}}%
- \fi%
+ \fi%
\let\pgf@lib@sh@next=\pgf@lib@sh@logicgate@parseinputs@@@long%
\fi%
\fi%
\pgf@lib@sh@next%
-}
+}%
\def\pgf@lib@sh@logicgate@parseinputs@@@long{%
\pgfutil@ifnextchar x{\pgf@lib@sh@logicgate@parseinputs@@long}%
{\pgf@lib@sh@logicgate@parseinputs@@long}%
-}
+}%
\fi%
-
-