summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex242
1 files changed, 182 insertions, 60 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
index 739373f2eb..9b1fd385c3 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
@@ -449,7 +449,7 @@
\pgfextracty{\pgf@circ@res@temp}{\step}%
\pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
\pgf@circ@res@count = \inputs\relax
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\loop\ifnum\pgf@circ@res@count>0
\advance\pgf@circ@res@temp by -\pgf@circ@res@step
@@ -461,11 +461,11 @@
\repeat
\fi
% output lead
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint
- {\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@right}
- {0pt}}
- \pgfusepath{draw}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/american and port/port width}\pgf@circ@res@right} {0pt}}
+ \pgfusepath{draw}
+ \fi
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
@@ -482,7 +482,7 @@
\pgfextracty{\pgf@circ@res@temp}{\step}%
\pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
\pgf@circ@res@count = \inputs\relax
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\loop\ifnum\pgf@circ@res@count>0
\advance\pgf@circ@res@temp by -\pgf@circ@res@step
@@ -494,11 +494,12 @@
\repeat
\fi
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint
- {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
-
- \pgfusepath{draw}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right} {0pt}}
+ \pgfusepath{draw}
+ \fi
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
\pgf@circ@res@step = \ctikzvalof{tripoles/american nand port/circle width}\pgf@circ@res@right
\pgf@circ@res@other = \ctikzvalof{tripoles/american nand port/port width}\pgf@circ@res@right
@@ -528,7 +529,7 @@
\pgfextracty{\pgf@circ@res@temp}{\step}%
\pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
\pgf@circ@res@count = \inputs\relax
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\loop\ifnum\pgf@circ@res@count>0
\advance\pgf@circ@res@temp by -\pgf@circ@res@step
@@ -541,10 +542,11 @@
\fi
\pgf@circ@res@other=\ctikzvalof{tripoles/american nor port/port width}\pgf@circ@res@right
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
-
- \pgfusepath{draw}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \fi
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
@@ -589,7 +591,7 @@
\pgfextracty{\pgf@circ@res@temp}{\step}%
\pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
\pgf@circ@res@count = \inputs\relax
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\loop\ifnum\pgf@circ@res@count>0
\advance\pgf@circ@res@temp by -\pgf@circ@res@step
@@ -602,10 +604,11 @@
\fi
\pgf@circ@res@other=\ctikzvalof{tripoles/american or port/port width}\pgf@circ@res@right
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
-
- \pgfusepath{draw}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \fi
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
@@ -646,7 +649,7 @@
\pgfextracty{\pgf@circ@res@temp}{\step}%
\pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
\pgf@circ@res@count = \inputs\relax
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\loop\ifnum\pgf@circ@res@count>0
\advance\pgf@circ@res@temp by -\pgf@circ@res@step
@@ -660,10 +663,11 @@
\fi
\pgf@circ@res@other=\ctikzvalof{tripoles/american xor port/port width}\pgf@circ@res@right
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
-
- \pgfusepath{draw}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \fi
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
@@ -710,7 +714,7 @@
\pgfextracty{\pgf@circ@res@temp}{\step}%
\pgf@circ@res@step = \dimexpr 2\pgf@circ@res@temp -2\pgf@circ@res@up\relax
\pgf@circ@res@count = \inputs\relax
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\loop\ifnum\pgf@circ@res@count>0
\advance\pgf@circ@res@temp by -\pgf@circ@res@step
@@ -724,10 +728,11 @@
\fi
\pgf@circ@res@other=\ctikzvalof{tripoles/american xnor port/port width}\pgf@circ@res@right
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
-
- \pgfusepath{draw}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ \fi
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
@@ -788,8 +793,14 @@
\northwest
\pgf@y=0pt
}
+ \anchor{left}{
+ \northwest
+ \pgf@x=0.7\pgf@x
+ \pgf@y=0pt
+ }
\anchor{bin}{
\northwest
+ \pgf@x=0.7\pgf@x
\pgf@y=0pt
}
\anchor{bin 1}{
@@ -802,6 +813,11 @@
\pgf@y=0pt
\pgf@x=-\pgf@x
}
+ \anchor{right}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
\anchor{bout}{
\northwest
\pgf@y=0pt
@@ -844,6 +860,19 @@
\pgf@x=-\pgf@x
\pgf@y=-\pgf@y
}
+ \anchorborder{% this is used when the node is used as a path element
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfpointborderrectangle{\pgfpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ }
+ \anchor{text}{%
+ % centered and a bit to the left (it's a triangle)!
+ \pgf@x=\dimexpr -.6\wd\pgfnodeparttextbox\relax
+ \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
\backgroundpath{
\pgfsetcolor{\ctikzvalof{color}}
@@ -874,14 +903,16 @@
\pgf@circ@draworfill
\endpgfscope
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
\fi
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \fi
\pgfusepath{draw}
}
@@ -906,8 +937,14 @@
\northwest
\pgf@y=0pt
}
+ \anchor{left}{
+ \northwest
+ \pgf@x=0.7\pgf@x
+ \pgf@y=0pt
+ }
\anchor{bin}{
\northwest
+ \pgf@x=0.7\pgf@x
\pgf@y=0pt
}
\anchor{bin 1}{
@@ -920,6 +957,11 @@
\pgf@y=0pt
\pgf@x=-\pgf@x
}
+ \anchor{right}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
\anchor{bout}{
\northwest
\pgf@y=0pt
@@ -962,6 +1004,19 @@
\pgf@x=-\pgf@x
\pgf@y=-\pgf@y
}
+ \anchorborder{% this is used when the node is used as a path element
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfpointborderrectangle{\pgfpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ }
+ \anchor{text}{%
+ % centered and a bit to the left (it's a triangle)!
+ \pgf@x=\dimexpr -.6\wd\pgfnodeparttextbox\relax
+ \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
\backgroundpath{
\pgfsetcolor{\ctikzvalof{color}}
@@ -985,14 +1040,16 @@
\pgf@circ@draworfill
\endpgfscope
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
\fi
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \fi
\pgfusepath{draw}
}
@@ -1016,6 +1073,11 @@
\northwest
\pgf@y=0pt
}
+ \anchor{left}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
\anchor{bin}{
\northwest
\pgf@y=0pt
@@ -1031,6 +1093,11 @@
\pgf@y=0pt
\pgf@x=-\pgf@x
}
+ \anchor{right}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-0.7\pgf@x
+ }
\anchor{bout}{
\northwest
\pgf@y=0pt
@@ -1073,6 +1140,19 @@
\pgf@x=-\pgf@x
\pgf@y=-\pgf@y
}
+ \anchorborder{% this is used when the node is used as a path element
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfpointborderrectangle{\pgfpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ }
+ \anchor{text}{%
+ % centered and a bit to the left (it's a triangle)!
+ \pgf@x=\dimexpr -.6\wd\pgfnodeparttextbox\relax
+ \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
\backgroundpath{
\pgfsetcolor{\ctikzvalof{color}}
@@ -1103,14 +1183,16 @@
\pgf@circ@draworfill
\endpgfscope
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
\fi
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
+ \fi
\pgfusepath{draw}
%draw inner shape
@@ -1147,6 +1229,11 @@
\northwest
\pgf@y=0pt
}
+ \anchor{left}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=0.7\pgf@x
+ }
\anchor{bin}{
\northwest
\pgf@y=0pt
@@ -1162,6 +1249,11 @@
\pgf@y=0pt
\pgf@x=-\pgf@x
}
+ \anchor{right}{
+ \northwest
+ \pgf@y=0pt
+ \pgf@x=-.7\pgf@x
+ }
\anchor{bout}{
\northwest
\pgf@y=0pt
@@ -1204,6 +1296,19 @@
\pgf@x=-\pgf@x
\pgf@y=-\pgf@y
}
+ \anchorborder{% this is used when the node is used as a path element
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfpointborderrectangle{\pgfpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ }
+ \anchor{text}{%
+ % centered and a bit to the left (it's a triangle)!
+ \pgf@x=\dimexpr -.6\wd\pgfnodeparttextbox\relax
+ \pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
\backgroundpath{
\pgfsetcolor{\ctikzvalof{color}}
@@ -1228,14 +1333,16 @@
\pgf@circ@draworfill
\endpgfscope
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}
\fi
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right-\pgf@circ@res@other}{0pt}}
+ \fi
\pgfusepath{draw}
%draw inner shape
@@ -1282,15 +1389,21 @@
\savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
\saveddimen{\boutshift}{%
- \ifpgf@circ@european@port@circle
- \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
- \edef\pgf@temp{ocirc}
- \edef\pgf@circ@temp{\ctikzvalof{tripoles/european not shape}}
- \ifx\pgf@temp\pgf@circ@temp % it's ocirc
- \pgfmathsetlength{\pgf@x}{2*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
- \else % it's ieee not circ
- \pgf@circ@notradius % defined together with ieeestd ports
- \pgf@x=2\pgf@circ@res@temp
+ \edef\pgf@temp{not}
+ \edef\pgf@circ@temp{#4}
+ \ifx\pgf@temp\pgf@circ@temp % is a not
+ \ifpgf@circ@european@port@circle
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \edef\pgf@temp{ocirc}
+ \edef\pgf@circ@temp{\ctikzvalof{tripoles/european not shape}}
+ \ifx\pgf@temp\pgf@circ@temp % it's ocirc
+ \pgfmathsetlength{\pgf@x}{2*\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \else % it's ieee not circ
+ \pgf@circ@notradius % defined together with ieeestd ports
+ \pgf@x=2\pgf@circ@res@temp
+ \fi
+ \else
+ \pgf@x=0pt
\fi
\else
\pgf@x=0pt
@@ -1355,7 +1468,7 @@
\anchor{bout}{\right\advance\pgf@x by \boutshift\pgf@y=0pt}
\anchor{left}{\left}% edges of component minus leads
- \anchor{right}{\right}
+ \anchor{right}{\right\advance\pgf@x by \boutshift\pgf@y=0pt}
\anchor{north east}{\northeast}% see \Compass macro
\anchor{south west}{\southwest}
@@ -1374,6 +1487,14 @@
\anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
\pgfpoint{\pgf@circ@res@right}{0cm}}
+ \anchorborder{% this is used when the node is used as a path element
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfextractx{\pgf@circ@res@right}{\northeast}
+ \pgfpointborderrectangle{\pgfpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ }
\backgroundpath{
\pgfsetcolor{\ctikzvalof{color}}
\pgfstartlinewidth=\pgflinewidth
@@ -1384,7 +1505,7 @@
{\pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@draworfill
\endpgfscope
- \ifpgfcirc@draw@leads
+ \ifpgfcirc@draw@input@leads
%input leads
\ifnum#3=1\relax
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}%
@@ -1402,13 +1523,14 @@
\advance\pgf@circ@res@count by -1
\repeat
\fi
+ \pgfusepath{draw}
\fi
%
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
- \pgfpathlineto{%
- \pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
- %
- \pgfusepath{draw}
+ \ifpgfcirc@draw@output@leads
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{ \pgfpoint{\ctikzvalof{tripoles/european #1 port/reserved}\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \fi
%
\edef\pgf@temp{not}
\edef\pgf@circ@temp{#4}