summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-04-23 03:00:42 +0000
committerNorbert Preining <norbert@preining.info>2022-04-23 03:00:42 +0000
commit4acee1a3ab0aae587d4f0a4327141056ee7e6081 (patch)
tree1cde72d1e942ae756d750c665cd346533074171b /graphics/pgf/contrib/circuitikz/tex
parentc65c806536b3d6b228d5d71f0e0c835968a3733a (diff)
CTAN sync 202204230300
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.6.sty (renamed from graphics/pgf/contrib/circuitikz/tex/circutikz-0.9.6.sty)0
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz.sty5
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex317
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex440
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircmonopoles.tex99
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircmultipoles.tex28
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex2
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex997
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex735
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex195
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex4
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex5
12 files changed, 1323 insertions, 1504 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/circutikz-0.9.6.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.6.sty
index 8605170b48..8605170b48 100644
--- a/graphics/pgf/contrib/circuitikz/tex/circutikz-0.9.6.sty
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz-0.9.6.sty
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
index b5fb2aeff7..c66633e787 100644
--- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
@@ -16,8 +16,8 @@
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}
-\def\pgfcircversion{1.4.6}
-\def\pgfcircversiondate{2022/02/04}
+\def\pgfcircversion{1.5.0}
+\def\pgfcircversiondate{2022/02/22}
\DeclareRelease{0.4}{2012/12/20}{circuitikz-0.4-body.tex}
\DeclareRelease{v0.4}{2012/12/20}{circuitikz-0.4-body.tex}
@@ -46,6 +46,7 @@
%% Version 3.0 of pgf/TikZ is required
\RequirePackage{tikz}
+\RequirePackage{regexpatch}%for color hack
\usetikzlibrary{calc}
%
% "arrows" library is deprecated, and behave badly with
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
index 9cc0b56eaf..a5075f08f6 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirc.defines.tex
@@ -67,7 +67,195 @@
\newdimen \pgfstartlinewidth
%%>>>
-% arrow tips macros and utilities %<<<1
+%% Colors%<<<
+
+% The following code is by @muzimuzhi --- see comment in
+% https://github.com/circuitikz/circuitikz/issues/605#issuecomment-1030745366
+\newif\ifpgf@circ@setcolor
+
+% similar to how `/tikz/draw` and `/tikz/fill` are defined
+%
+% - `color=none`, \pgfusecolor is not executed at the beginning of node path(s)
+% - `color` or `color=` (no or empty value), ignored
+% - `color=<color name>`, \pgfusecolor{<color name>} will be executed
+\ctikzset{
+ color/.code={%
+ \edef\pgf@circ@temp{#1}%
+ \ifx\pgf@circ@temp\pgf@nonetext
+ \pgf@circ@setcolorfalse
+ \else
+ \ifx\pgf@circ@temp\pgfutil@empty
+ \else
+ \pgf@circ@setcolortrue
+ \pgfkeyssetvalue{\circuitikzbasekey/color}{#1}%
+ \edef\ctikz@strokecolor{\ctikzvalof{color}}%
+ \fi
+ \fi
+ },
+ % init
+ color=none
+}
+
+\let\ctikz@strokecolor\pgfutil@empty
+\let\ctikz@fillcolor\pgfutil@empty
+% do our tracking of color
+\pgfkeys{/tikz/color/.add code={}{%
+ \edef\ctikz@strokecolor{#1}\ctikzset{color={#1}}}}
+% do our tracking of fill
+\pgfkeys{/tikz/fill/.add code={}{%
+ \edef\ctikz@fillcolor{#1}}}
+%
+% I do not know how to do the xpatchcmd in ConTeXt...
+%
+\ifpgfutil@format@is@latex
+ \pgfkeysgetvalue{/tikz/.unknown/.@cmd}{\my@temp}
+ \xpatchcmd*\my@temp % use starred-form to replace all (two places actually)
+ {\expandafter\tikz@addoption\expandafter}
+ {\edef\ctikz@strokecolor{\tikz@key}%
+ \expandafter\tikz@addoption\expandafter}
+ {}{%
+ \pgfutil@packagewarning{circuitikz}{%
+ Color patch failed, use only explicit color=... (see manual)}}
+ \pgfkeyslet{/tikz/.unknown/.@cmd}{\my@temp}
+\else
+ \pgfutil@packagewarning{circuitikz}{%
+ Not on LaTeX: patch failed, use only explicit color=...(see manual)}
+\fi
+%
+\def\pgf@circ@setcolor{%
+ \ifpgf@circ@setcolor
+ \pgfsetcolor{\ctikzvalof{color}}%
+ \fi
+}%
+%
+% Try our best to set the fill color the same as the draw
+% color. This needs the patch above
+%
+\def\pgf@circ@setfillcolorasdraw{%
+ \ifx\tikz@strokecolor\pgfutil@empty
+ % we do not have the stroke color. Resort to the
+ % last explicit color command; this will fail if
+ % the color is changed mid-draw.
+ % "Doctor, it hurts if I touch here..."
+ \ifx\ctikz@strokecolor\pgfutil@empty
+ % no info here. Try to use the current color.
+ \pgfsetfillcolor{.}%
+ \else
+ % Try with the last seen change-color command
+ \pgfsetfillcolor{\ctikz@strokecolor}
+ \fi
+ \else
+ % we have strokecolor, yay!
+ \pgfsetfillcolor{\tikz@strokecolor}
+ \fi
+}
+% we call this when we want to fill of the "draw"
+% color. So if we have no explicit color, use ".".
+\def\pgf@circ@fill@strokecolor{%
+ \pgf@circ@setfillcolorasdraw
+}
+% this is to select the \pgftext color; set it as
+% the stroke color (\pgftext uses the fill color)
+\def\pgf@circ@text@strokecolor{%
+ \pgf@circ@setfillcolorasdraw
+}
+% debug text
+\def\pgf@circ@debug@colors{%
+ \pgfscope
+ \pgfsetcolor{black}%
+ \pgftext[y=10pt]{\tiny S:\tikz@strokecolor~T:\tikz@textcolor~F:\tikz@fillcolor}%
+ \pgftext[y=16pt]{\tiny CS:\ctikz@strokecolor~CF:\ctikz@fillcolor}%
+ \endpgfscope
+}
+%>>>
+
+
+%% Macros for basic drawing%<<<
+%
+\long\gdef\pgf@circ@draw@component#1{%
+ \behindbackgroundpath{%
+ \pgf@circ@start@draw@hooks
+ #1%
+ \pgf@circ@end@draw@hooks
+ }%
+}%
+%
+% auxiliary macros to reset some thing in paths, for background images.
+% use with care and ALWAYS inside a \pgfscope, see here:
+% https://matrix.to/#/!NuxCISwYQJuyWwNsEI:matrix.org/$vQO6luq1F66LJ79dERmaqKI46qMBcjStqYCPi725uZE?via=matrix.org&via=2krueger.de&via=im.f3l.de
+% Thanks to @muzimuzhi
+%
+\def\pgf@circ@reset@arrows{%
+ \pgfsetshortenstart{+0pt}\pgfsetshortenend{+0pt}\pgfsetarrows{-}%
+}
+\def\pgf@circ@reset@rounded{%
+ \pgfsetcornersarced{\pgfpointorigin}%
+}
+\def\pgf@circ@reset@arrows@rounded{%
+ \pgf@circ@reset@arrows\pgf@circ@reset@rounded
+}
+\def\pgf@circ@adjustfill{%
+ \ifx\ctikz@fillcolor\pgfutil@empty
+ % do nothing
+ \else
+ \ifx\ctikz@fillcolor\pgf@nonetext
+ % do nothing
+ \else
+ \pgfsetfillcolor{\ctikz@fillcolor}%
+ \fi
+ \fi
+}
+%% Hook macros for the start and end of component drawing. The idea is that
+%% specific macros overrides class macro that overrides generic macro
+%% the generic macro is the one that resets arrows and curved path parameters
+%% but let the path inherits the rest (dashed, etc.)
+
+\def\pgf@circ@start@draw@hooks{%
+ % \typeout{SHAPE: \pgf@sm@shape@name}
+ \ifcsname ctikz@hook@start@draw@component@\pgf@sm@shape@name\endcsname
+ \csname ctikz@hook@start@draw@component@\pgf@sm@shape@name\endcsname
+ \else
+ \ifcsname ctikzclass\endcsname
+ \ifcsname ctikz@hook@start@draw@class@\ctikzclass\endcsname
+ \csname ctikz@hook@start@draw@class@\ctikzclass\endcsname
+ % class defined, but no hook, run generic hook
+ \else
+ \csname ctikz@hook@start@draw@default\endcsname
+ \fi
+ % we have no class, we did not run specific hook:run generic hook
+ \else
+ \csname ctikz@hook@start@draw@default\endcsname
+ \fi
+ \fi
+}
+\def\pgf@circ@end@draw@hooks{%
+ % \typeout{SHAPE: \pgf@sm@shape@name}
+ \ifcsname ctikz@hook@end@draw@component@\pgf@sm@shape@name\endcsname
+ \csname ctikz@hook@end@draw@component@\pgf@sm@shape@name\endcsname
+ \else
+ \ifcsname ctikzclass\endcsname
+ \ifcsname ctikz@hook@end@draw@class@\ctikzclass\endcsname
+ \csname ctikz@hook@end@draw@class@\ctikzclass\endcsname
+ % class defined, but no hook, run generic hook
+ \else
+ \csname ctikz@hook@end@draw@default\endcsname
+ \fi
+ % we have no class, we did not run specific hook:run generic hook
+ \else
+ \csname ctikz@hook@end@draw@default\endcsname
+ \fi
+ \fi
+}
+%
+%% default hook is to stop the propagation of arrows parameters and
+%% arced corners.
+%
+\def\ctikz@hook@start@draw@default{\pgf@circ@reset@arrows@rounded}
+%
+%
+%>>>
+
+%% arrow tips macros and utilities %<<<1
% the default arrow is latexslim, which has been ported over old arrows library (deprecated)
% see https://tex.stackexchange.com/questions/234084/latex-arrow-tip-with-arrows-meta-library
@@ -138,6 +326,7 @@
\def\pgf@circ@setifdefinedfill#1#2{%
% if \ctikzclass is defined and \ctikzclass/fill is defined and is not none:
% set the fill color and execute \pgfusepath{#1}, else execute \pgfusepath{#2}
+ % \typeout{SETIFDEF:#1\space#2:}
\ifdefined\ctikzclass
\pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/fill}%
{% yes, it's defined
@@ -160,7 +349,16 @@
\def\pgf@circ@draworfill{%
\ifx\tikz@fillcolor\pgfutil@empty
- \pgf@circ@setifdefinedfill{draw,fill}{draw}
+ \ifx\ctikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{draw,fill}{draw}
+ \else
+ \ifx\ctikz@fillcolor\pgf@nonetext
+ \pgf@circ@setifdefinedfill{draw,fill}{draw}
+ \else
+ \pgfsetfillcolor{\ctikz@fillcolor}
+ \pgfusepath{draw, fill}
+ \fi
+ \fi
\else
\pgfsetfillcolor{\tikz@fillcolor}
\pgfusepath{draw, fill}
@@ -169,8 +367,18 @@
\def\pgf@circ@draworfillandclip{%
\ifx\tikz@fillcolor\pgfutil@empty
- \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip}
- \pgfusepath{draw, clip}
+ \ifx\ctikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip}
+ \pgfusepath{draw, clip}
+ \else
+ \ifx\ctikz@fillcolor\pgf@nonetext
+ \pgf@circ@setifdefinedfill{draw, clip, fill}{draw, clip}
+ \pgfusepath{draw, clip}
+ \else
+ \pgfsetfillcolor{\ctikz@fillcolor}
+ \pgfusepath{draw, clip, fill}
+ \fi
+ \fi
\else
\pgfsetfillcolor{\tikz@fillcolor}
\pgfusepath{draw, clip, fill}
@@ -178,8 +386,18 @@
}
\def\pgf@circ@maybefill{%
+ % \typeout{MAYBEFILL\tikz@fillcolor}%
\ifx\tikz@fillcolor\pgfutil@empty
- \pgf@circ@setifdefinedfill{fill}{discard}
+ \ifx\ctikz@fillcolor\pgfutil@empty
+ \pgf@circ@setifdefinedfill{fill}{discard}
+ \else
+ \ifx\ctikz@fillcolor\pgf@nonetext
+ \pgf@circ@setifdefinedfill{fill}{discard}
+ \else
+ \pgfsetfillcolor{\ctikz@fillcolor}
+ \pgfusepath{fill}
+ \fi
+ \fi
\else
\pgfsetfillcolor{\tikz@fillcolor}
\pgfusepath{fill}
@@ -219,20 +437,6 @@
\fi
}
-% auxiliary macro to reset some thing in paths, for background images.
-% use with care and ALWAYS inside a \pgfscope, see here:
-% https://matrix.to/#/!NuxCISwYQJuyWwNsEI:matrix.org/$vQO6luq1F66LJ79dERmaqKI46qMBcjStqYCPi725uZE?via=matrix.org&via=2krueger.de&via=im.f3l.de
-% Thanks to @muzimuzhi
-%
-\def\pgf@circ@reset@arrows{%
- \pgfsetshortenstart{+0pt}\pgfsetshortenend{+0pt}\pgfsetarrows{-}%
-}
-\def\pgf@circ@reset@rounded{%
- \pgfsetcornersarced{\pgfpointorigin}%
-}
-\def\pgf@circ@reset@arrows@rounded{%
- \pgf@circ@reset@arrows\pgf@circ@reset@rounded
-}
%%>>>
@@ -462,11 +666,9 @@
\pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-\pgf@x}{-\pgf@y}}
\fi
}
-
- #2
-
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ #2%
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northeast
\pgf@circ@res@up = \pgf@y
@@ -477,10 +679,8 @@
\pgf@circ@res@down = \pgf@y
\pgf@circ@scaled@Rlen=\scaledRlen
\pgfstartlinewidth=\pgflinewidth
- % no rounded corners nor default arrows on bipole's bodies
- \pgf@circ@reset@arrows@rounded
- #7
-
+ % we used to reset arced corners here --- now it's in the hooks. I hope.
+ #7%
\pgfsetlinewidth{\pgfstartlinewidth}
}
}
@@ -511,9 +711,54 @@
}
% Just up and down (very common)
-\def\pgfcirc@border@extend@updown#1#2{\pgfcirc@border@extend@full{1}{#1}{1}{#2}}% %>>>
+\def\pgfcirc@border@extend@updown#1#2{\pgfcirc@border@extend@full{1}{#1}{1}{#2}}%
+
+
+% set of symmetrical, geographical anchors when a \northwest saved anchor is available
+\long\def\pgfcirc@northwest@symmetric@geoanchors{%
+ \anchor{right}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{east}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{e}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{left}{\northwest\pgf@y=0pt}
+ \anchor{west}{\northwest\pgf@y=0pt}
+ \anchor{w}{\northwest\pgf@y=0pt}
+ \anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{s}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ \anchor{north}{\northwest\pgf@x=0pt}
+ \anchor{n}{\northwest\pgf@x=0pt}
+ \anchor{south west}{\northwest\pgf@y=-\pgf@y}
+ \anchor{sw}{\northwest\pgf@y=-\pgf@y}
+ \anchor{north east}{\northwest\pgf@x=-\pgf@x}
+ \anchor{ne}{\northwest\pgf@x=-\pgf@x}
+ \anchor{north west}{\northwest}
+ \anchor{nw}{\northwest}
+ \anchor{south east}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+ \anchor{se}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
+}
+% the same, when we have \northeast (I know...)
+\long\def\pgfcirc@northeast@symmetric@geoanchors{%
+ \anchor{north}{\northeast\pgf@x=0cm\relax}
+ \anchor{n}{\northeast\pgf@x=0cm\relax}
+ \anchor{east}{\northeast\pgf@y=0cm\relax}
+ \anchor{e}{\northeast\pgf@y=0cm\relax}
+ \anchor{right}{\northeast\pgf@y=0cm\relax}
+ \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{s}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
+ \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{w}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{left}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
+ \anchor{north east}{\northeast}
+ \anchor{ne}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{nw}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=-\pgf@y}
+ \anchor{se}{\northeast\pgf@y=-\pgf@y}
+ \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ \anchor{sw}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+}
+%>>>
-% text position in some component.%<<<1
+%% text position in some component.%<<<1
% (added with ieeestd logic ports. Maybe to be extended to other components,
% like amplifiers)
%
@@ -527,7 +772,7 @@
\ctikzset{left text distance/.initial=0.3em}%
%>>>
-% voltage direction options%<<<1
+%% voltage direction options%<<<1
\newif\ifpgf@circ@oldvoltagedirection % default false
\newif\ifpgf@circ@explicitvdir
@@ -541,7 +786,7 @@
\tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}%
%>>>
-% bipole definitions for path component and text decorations%%<<<1
+%% bipole definitions for path component and text decorations%%<<<1
%
% Option "t=*" for nodes
\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
@@ -623,11 +868,9 @@
\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
%%>>>
-% traditional styles %<<<1
+%% traditional styles %<<<1
%
\ctikzset{thickness/.initial=2}
-\ctikzset{color/.initial=black}
-\pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
\ctikzset{bipoles/border margin/.initial=1.1}
\ctikzset{bipoles/thickness/.initial=2}
\ctikzset{tripoles/thickness/.initial=2}
@@ -635,7 +878,7 @@
\ctikzset{nodes width/.initial=.04}
%%>>>
-% Styles definitions and macros%<<<1
+%% Styles definitions and macros%<<<1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% main style definitions
@@ -771,7 +1014,7 @@
\tikzset{cute/.style = {european currents, european voltages, american resistors, cute inductors, american ports}}
%%>>>
-% voltage and current options%<<<1
+%% voltage and current options%<<<1
%
\ctikzset{current arrow scale/.initial=16}
\ctikzset{current/distance/.initial = .5}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index d41ba541b3..94212962fb 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -246,6 +246,7 @@
{\ctikzvalof{bipoles/generic/height}}
{\ctikzvalof{bipoles/generic/width}}
{
+ % \pgf@circ@debug@colors
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgf@circ@draworfill
@@ -420,7 +421,6 @@
\endpgfscope
\pgfsetlinewidth{\pgfstartlinewidth}
- \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
\pgfsetarrowsend{latexslim}
\pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
@@ -428,6 +428,8 @@
\pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
}
%% Thermistor NTC
@@ -450,7 +452,6 @@
\endpgfscope
\pgfsetlinewidth{\pgfstartlinewidth}
- \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
\pgfsetarrowsend{latexslim}
\pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
@@ -458,6 +459,8 @@
\pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
+ \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$}
}
%% Varistor
@@ -480,7 +483,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfusepath{draw}
\endpgfscope
-
+ \pgf@circ@text@strokecolor
\pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}}
}
@@ -896,25 +899,28 @@
{\ctikzvalof{bipoles/ecapacitor/height}}
{\ctikzvalof{bipoles/ecapacitor/width}}
{
- \pgfsetrectcap
- % % % Draw plus pole
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgf@circ@draworfill
- % % Draw minus pole
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfsetfillcolor{\ctikzvalof{color}}
- \pgfusepath{draw,fill}
- \pgfsetfillcolor{\ctikzvalof{color}}
+ \pgfscope
+ \pgfsetrectcap
+ % % % Draw plus pole
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgf@circ@draworfill
+ % % Draw minus pole
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgf@circ@setcolor
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{draw,fill}
+ \endpgfscope
% % plus pole annotation
+ \pgf@circ@text@strokecolor
\pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}]
{\ctikzvalof{bipoles/ecapacitor/font} $+$}
}
@@ -1125,14 +1131,38 @@
%
% generic core anchor settings
\ctikzset{bipoles/inductors/core distance/.initial={2pt}}
+\ctikzset{bipoles/inductors/dot x distance/.initial={4pt}}
+\ctikzset{bipoles/inductors/dot y distance/.initial={1pt}}
\def\pgfcir@basic@core@anchors{%
\saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}}
+ \saveddimen{\dotXdistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/dot x distance}}}
+ \saveddimen{\dotYdistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/dot y distance}}}
\anchor{core east}{%
\northeast\advance\pgf@y by\coredistance
}
\anchor{core west}{%
\northeast\advance\pgf@y by\coredistance\pgf@x=-\pgf@x
}
+ \anchor{ll dot}{%
+ \southwestborder
+ \advance\pgf@x by -\dotXdistance
+ \advance\pgf@y by -\dotYdistance
+ }
+ \anchor{ul dot}{%
+ \northeastborder
+ \advance\pgf@x by \dotXdistance\pgf@x=-\pgf@x
+ \advance\pgf@y by \dotYdistance
+ }
+ \anchor{lr dot}{%
+ \southwestborder
+ \advance\pgf@x by -\dotXdistance\pgf@x=-\pgf@x
+ \advance\pgf@y by -\dotYdistance
+ }
+ \anchor{ur dot}{%
+ \northeastborder
+ \advance\pgf@x by \dotXdistance
+ \advance\pgf@y by \dotYdistance
+ }
}
%
\ctikzset{bipoles/americaninductor/height/.initial=.3}
@@ -1524,6 +1554,7 @@
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@fill@strokecolor
\pgfusepath{draw,fill}
}
@@ -1543,6 +1574,7 @@
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@fill@strokecolor
\pgfusepath{draw,fill}
\pgfscope
\pgf@circ@set@relative@thickness{modifier thickness}
@@ -1575,6 +1607,7 @@
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@fill@strokecolor
\pgfusepath{draw,fill}
\pgfscope
@@ -1772,6 +1805,12 @@
\pgfkeys{tikz/tert/wye/.add code={}{\pgf@circ@tert@wyetrue}}
\pgfkeys{tikz/tert/zig/.add code={}{\pgf@circ@tert@zigtrue}}%
+% nullator and norator
+\ctikzset{bipoles/nullator/height/.initial=.30}
+\ctikzset{bipoles/nullator/width/.initial=.60}
+\ctikzset{bipoles/norator/height/.initial=.25}
+\ctikzset{bipoles/norator/width/.initial=.60}%must be greater than 2*height
+
%%>>>
%% Nodes definitions for sources%<<<
@@ -1929,12 +1968,14 @@
{\ctikzvalof{bipoles/vsourceam/width}}
{
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
- \pgf@circ@draworfill
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgf@circ@text@strokecolor
\ifpgf@circ@oldvoltagedirection
- \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{\ctikzvalof{bipoles/vsourceam/inner plus}}
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{\ctikzvalof{bipoles/vsourceam/inner plus}}
\pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{\ctikzvalof{bipoles/vsourceam/inner minus}}
\else
\pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{\ctikzvalof{bipoles/vsourceam/inner minus}}
@@ -2075,14 +2116,13 @@
\pgf@circ@draworfill
% Draw triangle
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@draworfill
-
- \pgfusepath{draw}
+ \pgfusepath{draw}
}
%% Empty Source
@@ -2109,8 +2149,10 @@
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpointorigin}
- \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
- \pgf@circ@maybefill
+ \pgfscope
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@maybefill
+ \endpgfscope
\edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
\pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}}
\pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up}
@@ -2636,15 +2678,16 @@
{\ctikzvalof{bipoles/cvsourceam/height}}
{\ctikzvalof{bipoles/cvsourceam/width}}
{
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
- \pgfpathclose
- \pgf@circ@draworfill
-
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgf@circ@text@strokecolor
\ifpgf@circ@oldvoltagedirection
\pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{\ctikzvalof{bipoles/cvsourceam/inner plus}}
\pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{\ctikzvalof{bipoles/cvsourceam/inner minus}}
@@ -2957,6 +3000,49 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}}
\pgfsetroundcap\pgfusepath{draw}
}
+
+% nullator
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/nullator/height}}
+{nullator}
+{\ctikzvalof{bipoles/nullator/height}}
+{\ctikzvalof{bipoles/nullator/width}}
+{
+ \pgfpointorigin
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+}
+% norator
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/norator/height}}
+{norator}
+{\ctikzvalof{bipoles/norator/height}}
+{\ctikzvalof{bipoles/norator/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@res@other=\dimexpr\pgf@circ@res@right-\pgf@circ@res@up\relax
+ \pgfmathsetmacro{\@@angle}{atan2(\pgf@circ@res@other,\pgf@circ@res@up)}
+ % \typeout{ANGLE\space\@@angle}
+ \pgfmathsetlength{\pgf@circ@res@step}{\pgf@circ@res@up*cos(\@@angle)}
+ \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@res@up*sin(\@@angle)}
+ % right semicircle
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgf@circ@res@temp}}
+ \pgfpatharc{180-\@@angle}{-180+\@@angle}{\pgf@circ@res@up}
+ % connect to left semicircle
+ \pgfpathlineto
+ {\pgfpoint{-\pgf@circ@res@other+\pgf@circ@res@step}{\pgf@circ@res@temp}}
+ % left semicircle
+ \pgfpatharc{\@@angle}{360-\@@angle}{\pgf@circ@res@up}
+ % connect to right semicircle
+ \pgfpathlineto
+ {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgf@circ@res@temp}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+}
+
% %>>>
%% Paths definitions for Sources%<<<
@@ -3119,6 +3205,10 @@
\pgfcirc@style@to@style{noise current source}{isourceN}
\pgfcirc@style@to@style{noise current source}{nI}
+% norator, nullator
+\pgfcirc@activate@bipole@simple{l}{nullator}
+\pgfcirc@activate@bipole@simple{l}{norator}
+
% build alias with voltage and current directions (legacy)
\def\pgf@temp#1{
@@ -3140,6 +3230,7 @@
\pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_}
% %>>>
+
%%%%%%%%%%%%%%
%% Diodes
%%%%%%%%%%%%%%
@@ -3239,6 +3330,18 @@
%% Node components for diodes %<<<1
+% beware, this shift to the left the coordinates
+\def\pgf@circ@fulldiode@triangle@shift{%
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{draw,fill}
+ % \pgf@circ@debug@colors
+}
+
%% Black generic diode
\pgfcircdeclarebipolescaled{diodes}
{}
@@ -3249,14 +3352,8 @@
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
-
\pgfscope
- \pgftransformxshift{\pgf@circ@res@left}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfusepath{draw,fill}
+ \pgf@circ@fulldiode@triangle@shift
\endpgfscope
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
@@ -3271,21 +3368,12 @@
{\ctikzvalof{bipoles/diode/height}}
{\ctikzvalof{bipoles/diode/width}}
{
-
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
-
- \pgfscope
- \pgftransformxshift{\pgf@circ@res@left}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfusepath{draw,fill}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfusepath{draw}
- \endpgfscope
+ \pgf@circ@fulldiode@triangle@shift
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
}
%% Black alternative zigzag Zener diode
@@ -3298,22 +3386,13 @@
{\ctikzvalof{bipoles/diode/height}}
{\ctikzvalof{bipoles/diode/width}}
{
-
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
-
- \pgfscope
- \pgftransformxshift{\pgf@circ@res@left}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfusepath{draw,fill}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
- \pgfusepath{draw}
- \endpgfscope
+ \pgf@circ@fulldiode@triangle@shift
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}}
+ \pgfusepath{draw}
}
%% Black Schottky diode
@@ -3324,26 +3403,16 @@
{\ctikzvalof{bipoles/diode/height}}
{\ctikzvalof{bipoles/diode/width}}
{
-
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfscope
- \pgftransformxshift{\pgf@circ@res@left}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfusepath{draw,fill}
-
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
- \pgfusepath{draw}
- \endpgfscope
-
+ \pgf@circ@fulldiode@triangle@shift
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}}
+ \pgfusepath{draw}
}
%% Black tunnel diode
@@ -3354,22 +3423,13 @@
{\ctikzvalof{bipoles/diode/height}}
{\ctikzvalof{bipoles/diode/width}}
{
-
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfscope
- \pgftransformxshift{\pgf@circ@res@left}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfusepath{draw,fill}
-
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfusepath{draw}
- \endpgfscope
+ \pgf@circ@fulldiode@triangle@shift
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
}
%
@@ -3377,6 +3437,7 @@
%
\def\pgf@circ@draw@ledarrows{%
\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgf@circ@fill@strokecolor
\pgfsetarrowsend{latexslim}
\ifpgf@led@fliparrows
\pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
@@ -3399,6 +3460,7 @@
%
\def\pgf@circ@draw@pdarrows{%
\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgf@circ@fill@strokecolor
\pgfsetarrowsstart{latexslim}
\ifpgf@pd@fliparrows
\pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}}
@@ -3421,6 +3483,7 @@
%
\def\pgf@circ@draw@laserarrows{%
\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgf@circ@fill@strokecolor
\pgfsetarrowsend{latexslim}
\pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{1.1\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{2.1\pgf@circ@res@up}}
@@ -3439,20 +3502,13 @@
{\ctikzvalof{bipoles/diode/height}}
{\ctikzvalof{bipoles/diode/width}}
{
-
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfscope
- \pgftransformxshift{\pgf@circ@res@left}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfusepath{draw,fill}
+ \pgf@circ@fulldiode@triangle@shift
\endpgfscope
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
-
\pgf@circ@draw@ledarrows
}
@@ -3466,22 +3522,15 @@
{\ctikzvalof{bipoles/diode/height}}
{\ctikzvalof{bipoles/diode/width}}
{
-
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfscope
- \pgftransformxshift{\pgf@circ@res@left}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfusepath{draw,fill}
+ \pgf@circ@fulldiode@triangle@shift
\endpgfscope
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfusepath{draw}
-
\pgf@circ@draw@laserarrows
}
@@ -3495,20 +3544,13 @@
{\ctikzvalof{bipoles/diode/height}}
{\ctikzvalof{bipoles/diode/width}}
{
-
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfscope
- \pgftransformxshift{\pgf@circ@res@left}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}}
- \pgfusepath{draw,fill}
+ \pgf@circ@fulldiode@triangle@shift
\endpgfscope
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
-
\pgf@circ@draw@pdarrows
}
@@ -3526,6 +3568,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}}
+ \pgf@circ@fill@strokecolor
\pgfusepath{draw,fill}
%
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}}
@@ -3821,6 +3864,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
+ \pgf@circ@fill@strokecolor
\pgfusepath{draw, fill}
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -3865,6 +3909,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
\pgfpathclose
\ifnum#2=0\relax
+ \pgf@circ@fill@strokecolor
\pgfusepath{draw,fill}
\else
\pgf@circ@draworfill
@@ -3884,7 +3929,7 @@
\fi
% draw the gate thing;
- #4
+ #4%
% draw the leads in/out
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}}
@@ -4076,7 +4121,8 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}}
\ifnum#2=0\relax
- \pgfusepath{draw,fill}
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{draw,fill}
\else
\pgf@circ@draworfill
\fi
@@ -4520,7 +4566,7 @@
{\ctikzvalof{bipoles/cuteswitch/width}}{
\pgfscope
% This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
- % If cnnecting nodes are scaled, we have to modify this
+ % If connecting nodes are scaled, we have to modify this
\pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
\pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp
\pgfsetlinewidth{2\pgf@circ@res@temp}
@@ -4529,7 +4575,8 @@
\pgfsetroundcap\pgfusepath{draw}
\endpgfscope
\pgfscope % arrow
- #3
+ \pgf@circ@fill@strokecolor
+ #3%
\endpgfscope
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}}
@@ -4695,8 +4742,8 @@
\pgf@x=-\pgf@x
\pgf@y=-\pgf@y
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -4798,8 +4845,8 @@
\anchor{north west}{ \northwest }
\anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
@@ -4816,7 +4863,8 @@
\pgfsetroundcap\pgfusepath{draw}
\endpgfscope
\pgfscope % arrow
- #3
+ \pgf@circ@fill@strokecolor
+ #3%
\endpgfscope
% terminals
\pgfscope
@@ -5151,9 +5199,11 @@
{\ctikzvalof{bipoles/esource/width}}
{
\pgfpointorigin
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
- \pgf@circ@draworfill
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \endpgfscope
% draw the text label
% get the rotation
\ifpgf@circuit@straightinstruments
@@ -5164,7 +5214,7 @@
\fi
% and unrotate the scope
\pgfscope
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@text@strokecolor
\pgftransformrotate{\rot}
\pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
\endpgfscope
@@ -5179,9 +5229,11 @@
{\ctikzvalof{bipoles/esource/width}}
{
\pgfpointorigin
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
- \pgf@circ@draworfill
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ \endpgfscope
% draw the text label
% get the rotation
\ifpgf@circuit@straightinstruments
@@ -5193,7 +5245,7 @@
% and unrotate the scope
\pgfscope
\pgftransformrotate{\rot}
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgfsetlinewidth{\pgfstartlinewidth}
% arrow: create a center hole to have better visual
\pgfscope
@@ -5212,6 +5264,7 @@
\pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}}
\pgfusepath{draw}
\endpgfscope
+ \pgf@circ@text@strokecolor
\pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
\endpgfscope
}
@@ -5268,6 +5321,7 @@
\pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}}
\pgfusepath{draw}
\endpgfscope
+ \pgf@circ@text@strokecolor
\pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}}
\endpgfscope
}
@@ -5302,7 +5356,7 @@
\pgfscope
\pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}}
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
- \pgf@circ@draworfill
+ \pgf@circ@draworfill
\endpgfscope
\def\@starta{103}\def\@stopa{77}
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -5318,7 +5372,7 @@
\pgfusepath{draw}
\pgf@circ@draworfill
\endpgfscope
- #2
+ #2%
\endpgfscope
}
}
@@ -5401,7 +5455,7 @@
\pgf@circ@res@left=-\pgf@circ@res@right
\pgfscope
\pgfstartlinewidth=\pgflinewidth
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
% external ellipse
\pgfscope
\pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
@@ -5476,7 +5530,7 @@
\def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}}
\pgfscope
\pgfstartlinewidth=\pgflinewidth
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
% external ellipse
\pgfscope
\pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
@@ -5823,8 +5877,8 @@
\pgf@y=-\pgf@y
\pgf@x=0.5\pgf@x
}
- \behindbackgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen
\pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen
@@ -5837,7 +5891,7 @@
\pgfseteorule
\pgfusepath{clip}
\pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}}
- \pgfsetfillcolor{\ctikzvalof{color}}
+ \pgf@circ@fill@strokecolor
\pgfusepath{fill, draw}
\endpgfscope
\pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
@@ -6091,6 +6145,7 @@
\pgfusepath{draw}
\pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@fill@strokecolor
\pgfusepath{stroke,fill}
}
@@ -6223,5 +6278,66 @@
\pgfcirc@activate@bipole@simple{l}{loudspeaker}
% %>>>
+%% Buzzer and reverse buzzer %<<<
+\ctikzset{bipoles/buzzer/height/.initial=0.6}
+\ctikzset{bipoles/buzzer/width/.initial=.4}%
+\ctikzset{bipoles/buzzer/span/.initial=.6}%
+
+\pgfcircdeclarebipolescaled{misc}
+{}
+{0}
+{buzzer}
+{\ctikzvalof{bipoles/buzzer/height}}
+{\ctikzvalof{bipoles/buzzer/width}}{
+ % this is the height of the semicircle
+ \pgf@circ@res@other=\dimexpr\pgf@circ@res@up-\pgf@circ@res@right\relax
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpatharc{0}{180}{\pgf@circ@res@right}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{\pgf@circ@res@other}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+}
+\pgfcirc@activate@bipole@simple{l}{buzzer}
+%
+\pgfcircdeclarebipolescaled{misc}
+{}
+{0}
+{rbuzzer}
+{\ctikzvalof{bipoles/buzzer/height}}
+{\ctikzvalof{bipoles/buzzer/width}}{
+ % this is the height of the semicircle
+ \pgf@circ@res@other=\dimexpr\pgf@circ@res@up-\pgf@circ@res@right\relax
+ % this is the height where the pins touch the semicircle
+ \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@res@up-
+ \pgf@circ@res@right*sqrt(1-\ctikzvalof{bipoles/buzzer/span}*\ctikzvalof{bipoles/buzzer/span})}
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpatharc{0}{-180}{\pgf@circ@res@right}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+}
+\pgfcirc@activate@bipole@simple{l}{rbuzzer}
+% %>>>
+
% end of pgfcircbipoles.tex
% vim: set fdm=marker fmr=%<<<,%>>>:
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircmonopoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircmonopoles.tex
index 69235549a7..4c267929b5 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircmonopoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircmonopoles.tex
@@ -46,6 +46,8 @@
\ctikzset{monopoles/bareantenna/width/.initial=.25}
\ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
\ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
+\ctikzset{monopoles/dinantenna/width/.initial=.2}
+\ctikzset{monopoles/dinantenna/height/.initial=.6}
\ctikzset{monopoles/waves/width/.initial=0.5}%
%>>>
@@ -78,7 +80,7 @@
\anchor{left}{\pgfpointorigin}
\anchor{right}{\pgfpointorigin}
\anchor{center}{\pgfpointorigin}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@scaled@Rlen
\pgfscope
@@ -299,7 +301,7 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
\pgfscope
@@ -361,7 +363,7 @@
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{monopoles/vcc/width}\pgf@circ@scaled@Rlen
\pgfscope
@@ -483,7 +485,7 @@
\anchor{text}{\northeast\pgf@xa=\pgf@x\pgf@ya=\pgf@y
\pgfpoint{\dimexpr-.5\wd\pgfnodeparttextbox+.8\pgf@xa}
{\dimexpr-.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@ya}}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgfstartlinewidth=\pgflinewidth
\pgf@circ@scaled@Rlen=\scaledRlen
@@ -513,7 +515,7 @@
\def\pgf@circ@antennabody{%
\pgfstartlinewidth=\pgflinewidth
\pgf@circ@scaled@Rlen=\scaledRlen
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgf@circ@res@step=\ctikzvalof{monopoles/bareantenna/width}\pgf@circ@scaled@Rlen
\pgfscope
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
@@ -577,11 +579,11 @@
\anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
\anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt}
\anchor{north west}{\northeast\pgf@x=-\pgf@x}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen
\pgf@circ@res@step=0.5\pgf@circ@res@step
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgfscope
% define a triangle for clipping the waves
\pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}}
@@ -601,8 +603,8 @@
}
}
-% the three types of antennas: simple, TX, RX. Notice that you can flip them...
-
+% the four types of antennas: simple, din, TX, RX. Notice that you can flip them...
+%
\pgfdeclareshape{bareantenna}{
\savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
@@ -631,10 +633,58 @@
\anchor{north west}{\northeast\pgf@x=-\pgf@x}
\anchor{south east}{\northeast\pgf@y=0pt\relax}
\anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgf@circ@antennabody
}
}
+%
+\pgfdeclareshape{dinantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@step=\ctikzvalof{monopoles/dinantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@other=\ctikzvalof{monopoles/dinantenna/height}\pgf@circ@scaled@Rlen
+ \pgf@x=\pgf@circ@res@step
+ \pgf@y=\pgf@circ@res@other
+ }
+ \anchor{text}{
+ \northeast
+ \pgf@y=\dimexpr.5\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \pgf@circ@draw@component{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@setcolor
+ \pgf@circ@res@right=\ctikzvalof{monopoles/dinantenna/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@up=\ctikzvalof{monopoles/dinantenna/height}\pgf@circ@scaled@Rlen
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
\pgfdeclareshape{bareTXantenna}{
\savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
@@ -672,7 +722,7 @@
\anchor{north west}{\northeast\pgf@x=-\pgf@x}
\anchor{south east}{\northeast\pgf@y=0pt\relax}
\anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgf@circ@antennabody
\pgf@circ@antennawaves
}
@@ -713,7 +763,7 @@
\anchor{north west}{\northeast\pgf@x=-\pgf@x}
\anchor{south east}{\northeast\pgf@y=0pt\relax}
\anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgf@circ@antennabody
\pgftransformxshift{-5.2\pgf@circ@res@step}
\pgf@circ@antennawaves
@@ -770,10 +820,10 @@
\anchor{north west}{\northeast\pgf@x=-\pgf@x}
\anchor{south east}{\northeast\pgf@y=0pt\relax}
\anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgfstartlinewidth=\pgflinewidth
\pgf@circ@scaled@Rlen=\scaledRlen
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\northeast
\pgf@circ@res@right=\pgf@x
\pgf@circ@res@up=\pgf@y
@@ -840,7 +890,7 @@
\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
}
}
- \behindbackgroundpath{
+ \pgf@circ@draw@component{
\pgfextracty{\pgf@circ@res@up}{\northwest}
\pgfextractx{\pgf@circ@res@right}{\southeast}
\pgfextractx{\pgf@circ@res@left}{\northwest}
@@ -889,7 +939,7 @@
\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
}
}
- \behindbackgroundpath{
+ \pgf@circ@draw@component{
\pgfextracty{\pgf@circ@res@up}{\northwest}
\pgfextractx{\pgf@circ@res@right}{\southeast}
\pgfextractx{\pgf@circ@res@left}{\northwest}
@@ -946,7 +996,7 @@
\dimexpr-.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
}
- \behindbackgroundpath{
+ \pgf@circ@draw@component{
\pgfextracty{\pgf@circ@res@up}{\northwest}
\pgfextractx{\pgf@circ@res@right}{\southeast}
\pgfextractx{\pgf@circ@res@left}{\northwest}
@@ -996,7 +1046,7 @@
\pgf@x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf@x
\pgf@y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf@y
}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgfstartlinewidth=\pgflinewidth
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{monopoles/antenna/width}\pgf@circ@scaled@Rlen
@@ -1014,7 +1064,7 @@
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfusepath{draw}
\endpgfscope
@@ -1047,7 +1097,7 @@
\pgf@x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf@x
\pgf@y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf@y
}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgfstartlinewidth=\pgflinewidth
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{monopoles/txantenna/width}\pgf@circ@scaled@Rlen
@@ -1065,7 +1115,7 @@
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfusepath{draw}
\endpgfscope
@@ -1109,7 +1159,7 @@
\pgf@x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf@x
\pgf@y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf@y
}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgfstartlinewidth=\pgflinewidth
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{monopoles/rxantenna/width}\pgf@circ@scaled@Rlen
@@ -1127,7 +1177,7 @@
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{4\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{3\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{4\pgf@circ@res@step-0.5\pgflinewidth}{6\pgf@circ@res@step}}
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfusepath{draw}
\endpgfscope
@@ -1177,7 +1227,7 @@
\advance \pgf@x by -.5\wd\pgfnodeparttextbox
\pgf@y=-1.5\ht\pgfnodeparttextbox
}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{monopoles/match/width}\pgf@circ@scaled@Rlen
@@ -1189,6 +1239,7 @@
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
\pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0.5\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{2\pgf@circ@res@step}{0}}
+ \pgf@circ@fill@strokecolor
\pgfusepath{fill}
\pgfsetlinewidth{\pgfstartlinewidth}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircmultipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircmultipoles.tex
index a53bbe03f2..5ebf59cbde 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircmultipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircmultipoles.tex
@@ -205,7 +205,7 @@
\anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
\anchor{west}{\northwest\pgf@y=0pt }
% start drawing
- \backgroundpath{%
+ \pgf@circ@draw@component{%
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
@@ -224,7 +224,7 @@
\pgfpatharc{0}{180}{0.2*\pgf@circ@res@left}
\fi
\pgfusepath{stroke}%
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
% Adding the pin number
\ifpgf@circuit@chip@shownumbers
\pgf@circ@count@a=\numpins\relax
@@ -239,6 +239,7 @@
\pgfmathsetmacro{\quadrant}{0}
\fi
\def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ \pgfscope\pgf@circ@text@strokecolor
\def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
\pgfmathloop%
\ifnum\pgf@circ@count@a>0
@@ -289,6 +290,7 @@
\fi
\advance\pgf@circ@count@a-1\relax%
\repeatpgfmathloop
+ \endpgfscope % for color of text
\fi
\endpgfscope
% draw external pins or pads
@@ -438,7 +440,7 @@
\anchor{south}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
\anchor{west}{\northwest\pgf@y=0pt }
% start drawing
- \backgroundpath{%
+ \pgf@circ@draw@component{%
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
@@ -463,7 +465,7 @@
\pgfpathclose
\pgf@circ@draworfill
% Adding the pin number
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\ifpgf@circuit@chip@shownumbers
\pgf@circ@count@a=\numpins%
\divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a
@@ -478,6 +480,7 @@
\fi
\def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
\def\mytext{\ctikzvalof{multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space}
+ \pgfscope\pgf@circ@text@strokecolor
\pgfmathloop%
\ifnum\pgf@circ@count@a>0
\ifcase\quadrant % rotation 0
@@ -567,6 +570,7 @@
\fi
\advance\pgf@circ@count@a-1\relax%
\repeatpgfmathloop
+ \endpgfscope % for the text labels
\fi
\endpgfscope
\ifdim\pgf@circ@res@other>0pt
@@ -801,8 +805,8 @@
\anchor{ext north west}{ \extnorthwest \advance\pgf@x by -\width}
\anchor{ext south east}{ \extnorthwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y \advance\pgf@x by -\width}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@res@right = \width
\pgf@circ@res@left = -\width
@@ -1045,7 +1049,7 @@
\anchor{f}{\topright\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
\anchor{g}{\pgfpointorigin}
\anchor{dot}{\topright\pgf@y=-\pgf@y\advance\pgf@x by \dotspace}
- \behindbackgroundpath{%
+ \pgf@circ@draw@component{%
\southwest % I do not want the dot here, it will stick out
\pgf@circ@res@up = -\pgf@y
\pgf@circ@res@down = \pgf@y
@@ -1053,7 +1057,7 @@
\pgf@circ@res@left = -\pgf@x
\pgfscope
\pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgfpathrectanglecorners%
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
{\pgfpoint{\pgf@circ@res@left+\dotspace}{\pgf@circ@res@up}}
@@ -1313,7 +1317,7 @@
\anchor{bup}{\northwest\pgf@x=0pt }
\anchor{bdown}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
% start drawing
- \backgroundpath{%
+ \pgf@circ@draw@component{%
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
@@ -1322,7 +1326,7 @@
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step = \ctikzvalof{multipoles/flipflop/pin spacing}\pgf@circ@scaled@Rlen
\pgf@circ@res@other = \ctikzvalof{multipoles/external pins width}\pgf@circ@scaled@Rlen
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgfscope% (for the line width)
\pgf@circ@setlinewidth{multipoles}{\pgflinewidth}
\pgfpathrectanglecorners{\pgfpoint{-\width/2}{-\height/2}}{\pgfpoint{\width/2}{\height/2}}%
@@ -1342,6 +1346,7 @@
\pgfmathsetmacro{\quadrant}{0}
\fi
\def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax}
+ \pgfscope\pgf@circ@text@strokecolor
% text
\def\mytext{\ctikzvalof{multipoles/flipflop/font}\space
\ctikzvalof{multipoles/flipflop/t\the\pgf@circ@count@c}%
@@ -1448,6 +1453,7 @@
at=\pgfpoint{0pt}{\pgf@circ@res@down+\pgf@circ@res@temp},
rotate=\rot]{\mytext}
\fi
+ \endpgfscope % for text labels
% external pins
\ifdim\pgf@circ@res@other>0pt
\pgfscope
@@ -1788,7 +1794,7 @@
\pgf@y=-.5\ht\pgfnodeparttextbox%
\advance\pgf@y by+.5\dp\pgfnodeparttextbox%
}%
- \backgroundpath{%
+ \pgf@circ@draw@component{%
\topleft
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
index 4518f16479..0cacd11fb4 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircpath.tex
@@ -263,7 +263,7 @@
\ctikzset{bipole/nodes/right/.initial=none}
\tikzset{bipole nodes/.style n args={2}{%
\circuitikzbasekey/bipole/nodes/left=#1,
- \circuitikzbasekey/bipole/nodes/right=#2
+ \circuitikzbasekey/bipole/nodes/right=#2%
}
}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
index aa481caaf9..44816fafc4 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircquadpoles.tex
@@ -184,16 +184,16 @@
\northwest
\pgf@x=0pt
}
- #3
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ #3%
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
\pgf@circ@res@right = -\pgf@x
\pgf@circ@res@left = \pgf@x
- #2
+ #2%
}
}
}
@@ -457,10 +457,16 @@
% Option "boxed" for nodes and twoports
\newif\ifpgf@circuit@boxed
-\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue}}
-\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue}}
-\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue}}
-\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue}}
+\newif\ifpgf@circuit@boxedcircled\pgf@circuit@boxedcircledtrue
+\pgfkeys{/tikz/boxed/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledtrue}}
+\ctikzset{boxed/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledtrue}}
+\pgfkeys{/tikz/box/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledtrue}}
+\ctikzset{box/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledtrue}}
+% boxed, no circle
+\pgfkeys{/tikz/boxed only/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledfalse}}
+\ctikzset{boxed only/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledfalse}}
+\pgfkeys{/tikz/box only/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledfalse}}
+\ctikzset{box only/.add code={}{\pgf@circuit@boxedtrue\pgf@circuit@boxedcircledfalse}}
% Option "dashed" for nodes and twoports
\newif\ifpgf@circuit@dashed
@@ -480,14 +486,23 @@
%% Node shapes definition for path-style block diagrams%<<<
%% Draw the two-port fillable box
-\def\pgf@circ@twoportbox{
+\def\pgf@circ@twoportbox{%
\pgfscope
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}%
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}%
\pgf@circ@draworfill
\endpgfscope
}
-
+\def\pgf@circ@inputarrow{%
+ \ifpgf@circuit@inputarrow
+ {%
+ % Remove this: the line will overrun the tip, resulting in bad look. See issue #613, thanks to Laurenz Preindl
+ % \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}%
+ \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}%
+ }%
+ \fi
+}
%% Generic two port box
\pgfcircdeclarebipolescaled{blocks}
{}
@@ -507,14 +522,7 @@
\fi
% draw outer box
\pgf@circ@twoportbox
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -528,6 +536,7 @@
\fi\fi
% draw inner symbol
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
}
@@ -553,15 +562,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
%get texts
\def\pgfcirc@tin{\ctikzvalof{bipoles/twoport/text in}}
\def\pgfcirc@tout{\ctikzvalof{bipoles/twoport/text out}}
@@ -594,6 +595,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\texti}
\pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textii}
}
@@ -675,15 +677,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -749,15 +743,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -820,15 +806,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -894,15 +872,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -958,15 +928,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1032,15 +994,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1096,15 +1050,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1164,15 +1110,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\texti{A}
\def\textii{D}
@@ -1201,6 +1139,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
\pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
}
@@ -1226,15 +1165,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\texti{D}
\def\textii{A}
@@ -1263,6 +1194,7 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0.45\pgf@circ@res@left,y=0.45\pgf@circ@res@up]{\textsf{\texti}}
\pgftext[center,x=0.45\pgf@circ@res@right,y=0.45\pgf@circ@res@down]{\textsf{\textii}}
}
@@ -1288,15 +1220,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1310,6 +1234,7 @@
\fi\fi
% draw inner symbol
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\textsf{DSP}}
}
@@ -1334,15 +1259,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1356,6 +1273,7 @@
\fi\fi
% draw inner symbol
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\textsf{FFT}}
}
@@ -1425,6 +1343,7 @@
\pgf@circ@draworfill
% draw inner text
+ \pgf@circ@text@strokecolor
\pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
}
@@ -1494,8 +1413,6 @@
\pgfpathclose
\pgf@circ@draworfill
- % draw inner text
- \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
% draw arrow
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -1503,6 +1420,9 @@
\pgfpathmoveto{\pgfpoint{-0.8\pgf@circ@res@step}{-0.5\pgf@circ@res@step}}
\pgfpathlineto{\pgfpoint{0.6\pgf@circ@res@step}{0.6\pgf@circ@res@step}}
\pgfusepath{draw}
+ % draw inner text
+ \pgf@circ@text@strokecolor
+ \pgftext[center,x=-0.12\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
}
%% pi attenuator
@@ -1526,15 +1446,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1580,15 +1492,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1639,15 +1543,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1690,15 +1586,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1746,15 +1634,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1768,6 +1648,7 @@
\fi\fi
% inner symbol
+ \pgf@circ@text@strokecolor
\pgftext[center,x=0,y=0]{\Large$\varphi$}
}
@@ -1792,15 +1673,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1813,15 +1686,16 @@
\pgftransformrotate{90}
\fi\fi
- % inner symbol
- \pgftext[center,x=0,y=0]{\Large$\varphi$}
-
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
\pgfsetarrowsend{latex}
\pgfpathmoveto{\pgfpoint{0.75\pgf@circ@res@left}{0.65\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.65\pgf@circ@res@up}}
\pgfusepath{draw}
+ % inner symbol
+ \pgf@circ@text@strokecolor
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
}
%% detector
@@ -1845,15 +1719,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetarrows{-} %never draw arrows
@@ -1904,15 +1770,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -1983,15 +1841,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -2062,15 +1912,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -2154,15 +1996,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -2260,15 +2094,7 @@
% draw outer box
\pgf@circ@twoportbox
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
-
+ \pgf@circ@inputarrow
% rotate inner symbol
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
@@ -2354,12 +2180,10 @@
\pgfcirc@activate@bipole@simple{l}{tdcac}
% %>>>
-%% Node shapes for Block elements%<<<
-
-\pgfdeclareshape{mixer}
-{
- \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
- \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+%% Node shapes for Block elements %<<<
+%
+% utility macro for the anchors
+\def\pgf@circ@circular@rf@anchors#1{%
\savedanchor\northwest{
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
\ifpgf@circuit@boxed
@@ -2368,165 +2192,75 @@
\pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
\pgf@x=.5\pgf@x
\else
- \pgf@y=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+ \pgf@y=\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
\pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
+ \pgf@x=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
\pgf@x=.5\pgf@x
\fi
}
- \anchor{center}{
- \pgfpointorigin
- }
- \anchor{left}{%
- \northwest
- \pgf@y=0pt
- }
- \anchor{right}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{3}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{4}{
- \northwest
- \pgf@y=\pgf@y
- \pgf@x=0pt
- }
- \anchor{in 1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in 2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{in2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{out}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{center}{
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{north}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{e}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{w}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{s}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{n}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{down}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{up}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{south west}{
- \northwest
- \pgf@y=-\pgf@y
- }
- \anchor{north east}{
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{north west}{
- \northwest
- }
- \anchor{south east}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
- }
+ % border anchors
\anchorborder{
\pgf@circ@res@left=\pgf@x
\pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{\ctikzvalof{tripoles/mixer/width}*\scaledRlen/2}{\ctikzvalof{tripoles/mixer/width}*\scaledRlen/2}}
+ \ifnum\componentisboxed=0
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{\ctikzvalof{tripoles/#1/width}*\scaledRlen/2}{\ctikzvalof{tripoles/#1/width}*\scaledRlen/2}}
+ \else
+ \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{\ctikzvalof{tripoles/#1/width}*\scaledRlen/2}{\ctikzvalof{tripoles/#1/width}*\scaledRlen/2}}
+ \fi
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgfcirc@northwest@symmetric@geoanchors
+ \anchor{geocenter}{\pgfpointorigin}
+ \anchor{up}{\northwest\pgf@x=0pt}
+ \anchor{down}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ % Deprecated number anchors
+ \anchor{1}{\northwest\pgf@y=0pt}
+ \anchor{2}{\northwest\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{3}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{4}{\northwest\pgf@y=\pgf@y\pgf@x=0pt}
+ % input output anchors (also quite bad)
+ \anchor{in 1}{\northwest\pgf@y=0pt}
+ \anchor{in1}{\northwest\pgf@y=0pt}
+ \anchor{in}{\northwest\pgf@y=0pt}
+ \anchor{in 2}{\northwest\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{in2}{\northwest\pgf@y=-\pgf@y\pgf@x=0pt}
+ \anchor{out}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+}
+% draw the body rectangle and circle if and when needed
+\def\pgf@circ@circular@rf@box@circle{%
+ \pgfstartlinewidth=\pgflinewidth
+ % draw outer box
+ \ifpgf@circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
+ \fi
+ % draw outer circle
+ \ifpgf@circuit@boxed
+ \pgf@circ@res@step=.7\pgf@circ@res@step
+ \pgfsetdash{}{0pt} % draw solid circle if boxed
+ \else
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+ \ifpgf@circuit@boxedcircled
+ \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
+ \fi
+ \pgf@circ@draworfill
+}
+%
+\pgfdeclareshape{mixer}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}}
+ % build the anchor set
+ \anchor{center}{\pgfpointorigin}
+ \pgf@circ@circular@rf@anchors{mixer}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
-
\pgf@circ@res@step=\ctikzvalof{tripoles/mixer/width}\pgf@circ@scaled@Rlen
-
\pgfscope
- \pgfstartlinewidth=\pgflinewidth
-
- % draw outer box
- \ifpgf@circuit@boxed
- \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
- \fi
-
- % draw outer circle
- \ifpgf@circuit@boxed
- \pgf@circ@res@step=.7\pgf@circ@res@step
- \pgfsetdash{}{0pt} % draw solid circle if boxed
- \else
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \fi
- \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgf@circ@draworfill
-
+ \pgf@circ@circular@rf@box@circle
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -2537,7 +2271,6 @@
\pgfpathmoveto{\pgfpointpolar{45}{0.5\pgf@circ@res@step}}
\pgfpathlineto{\pgfpointpolar{-135}{0.5\pgf@circ@res@step}}
\pgfusepath{draw}
-
\endpgfscope
}
}
@@ -2546,177 +2279,19 @@
{
\savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
- \savedanchor\northwest{
- \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
- \ifpgf@circuit@boxed
- \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@x=.5\pgf@x
- \else
- \pgf@y=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
- \pgf@x=.5\pgf@x
- \fi
- }
- \anchor{center}{
- \pgfpointorigin
- }
- \anchor{left}{%
- \northwest
- \pgf@y=0pt
- }
- \anchor{right}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{3}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{4}{
- \northwest
- \pgf@y=\pgf@y
- \pgf@x=0pt
- }
- \anchor{in 1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{in 2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{in2}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{out}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{center}{
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{north}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{e}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{w}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{s}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{n}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{down}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{up}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{south west}{
- \northwest
- \pgf@y=-\pgf@y
- }
- \anchor{north east}{
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{north west}{
- \northwest
- }
- \anchor{south east}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchorborder{
- \pgf@circ@res@left=\pgf@x
- \pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{\ctikzvalof{tripoles/adder/width}*\scaledRlen/2}{\ctikzvalof{tripoles/adder/width}*\scaledRlen/2}}
- }
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}}
+ % build the anchor set
+ \anchor{center}{\pgfpointorigin}
+ \pgf@circ@circular@rf@anchors{adder}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
-
\pgf@circ@res@step=\ctikzvalof{tripoles/adder/width}\pgf@circ@scaled@Rlen
-
\pgfscope
- \pgfstartlinewidth=\pgflinewidth
-
- % draw outer box
- \ifpgf@circuit@boxed
- \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
- \fi
-
- % draw outer circle
- \ifpgf@circuit@boxed
- \pgf@circ@res@step=.7\pgf@circ@res@step{}
- \pgfsetdash{}{0pt} % draw solid circle if boxed
- \else
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \fi
- \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgf@circ@draworfill
-
+ \pgf@circ@circular@rf@box@circle
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
-
\pgfpathmoveto{\pgfpointorigin}
\pgfpathmoveto{\pgfpointpolar{0}{0.3\pgf@circ@res@step}}
\pgfpathlineto{\pgfpointpolar{180}{0.3\pgf@circ@res@step}}
@@ -2725,7 +2300,6 @@
\pgfpathlineto{\pgfpointpolar{270}{0.3\pgf@circ@res@step}}
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
\pgfusepath{draw}
-
\endpgfscope
}
}
@@ -2734,126 +2308,22 @@
{
\savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
- \savedanchor\northwest{
- \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
- \ifpgf@circuit@boxed
- \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \else
- \pgf@y=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen
- \fi
- }
- \anchor{center}{
- \pgfpointorigin
- }
- \anchor{north}{
- \northwest
- \pgf@x=.5\pgf@x
- }
- \anchor{south}{
- \northwest
- \pgf@x=.5\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{up}{
- \northwest
- \pgf@x=.5\pgf@x
- }
- \anchor{down}{
- \northwest
- \pgf@x=.5\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{n}{
- \northwest
- \pgf@x=.5\pgf@x
- }
- \anchor{s}{
- \northwest
- \pgf@x=.5\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{e}{
- \northwest
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{w}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{up}{
- \northwest
- \pgf@x=.5\pgf@x
- }
- \anchor{down}{
- \northwest
- \pgf@x=.5\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{right}{
- \northwest
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{left}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y}
- \anchor{north east}{ \northwest \pgf@x=0pt\relax}
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
+ \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}}
+ % build the anchor set --- the center of an oscillator is on the right
+ \anchor{center}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \pgf@circ@circular@rf@anchors{oscillator}
+ % border anchors
\anchor{text}{
\pgf@x=-2\pgf@x
\advance \pgf@x by -.5\wd\pgfnodeparttextbox
\advance \pgf@y by -1.5\ht\pgfnodeparttextbox
}
- \anchorborder{
- \pgf@circ@res@left=\pgf@x
- \pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{\ctikzvalof{tripoles/oscillator/width}*\scaledRlen/2}{\ctikzvalof{tripoles/oscillator/width}*\scaledRlen/2}}
- \pgfmathsetlength{\pgf@x}{\pgf@x-\ctikzvalof{tripoles/oscillator/width}*\scaledRlen/2}
- }
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
-
\pgf@circ@res@step=\ctikzvalof{tripoles/oscillator/width}\pgf@circ@scaled@Rlen{}
-
\pgfscope
- \pgfstartlinewidth=\pgflinewidth
-
- \pgftransformxshift{-0.5\pgf@circ@res@step} % The oscillator is shifted to the left, so a connection comes out of the anchor "east"
-
- % draw outer box
- \ifpgf@circuit@boxed{}
- \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
- \fi
-
- % draw outer circle
- \ifpgf@circuit@boxed
- \pgf@circ@res@step=.7\pgf@circ@res@step{}
- \pgfsetdash{}{0pt} % draw solid circle if boxed
- \else
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \fi
- \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgf@circ@draworfill
-
+ \pgf@circ@circular@rf@box@circle
% draw inner sine waves
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
@@ -2863,9 +2333,7 @@
\pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
\pgfpathsine{\pgfpoint{.15\pgf@circ@res@step}{-.15\pgf@circ@res@step}}
\pgfpathcosine{\pgfpoint{.15\pgf@circ@res@step}{.15\pgf@circ@res@step}}
-
\pgfusepath{draw}
-
\endpgfscope
}
}
@@ -2874,147 +2342,24 @@
{
\savedmacro{\ctikzclass}{\edef\ctikzclass{blocks}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
- \savedanchor\northwest{
- \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
- \ifpgf@circuit@boxed
- \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@x=.5\pgf@x
- \else
- \pgf@y=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
- \pgf@y=.5\pgf@y
- \pgf@x=-\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
- \pgf@x=.5\pgf@x
- \fi
- }
- \anchor{center}{
- \pgfpointorigin
- }
- \anchor{left}{%
- \northwest
- \pgf@y=0pt
- }
- \anchor{right}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{1}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{2}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{3}{
- \northwest
- \pgf@y=-\pgf@y
- \pgf@x=0pt
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{north}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{e}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{w}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{s}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{n}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{down}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{up}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{south west}{
- \northwest
- \pgf@y=-\pgf@y
- }
- \anchor{north east}{
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{north west}{
- \northwest
- }
- \anchor{south east}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchorborder{
- \pgf@circ@res@left=\pgf@x
- \pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{\ctikzvalof{tripoles/circulator/width}*\scaledRlen/2}{\ctikzvalof{tripoles/circulator/width}*\scaledRlen/2}}
- }
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \savedmacro{\componentisboxed}{\edef\componentisboxed{\ifpgf@circuit@boxed 1\else 0\fi}}
+ % build the anchor set
+ \anchor{center}{\pgfpointorigin}
+ \pgf@circ@circular@rf@anchors{circulator}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
-
\pgf@circ@res@step=\ctikzvalof{tripoles/circulator/width}\pgf@circ@scaled@Rlen
-
\pgfscope
- \pgfstartlinewidth=\pgflinewidth
-
- % draw outer box
- \ifpgf@circuit@boxed
- \pgfnode{blockbox}{center}{}{pgf@box}{\pgfusepath{draw}}
- \fi
-
- % draw outer circle
- \ifpgf@circuit@boxed{}
- \pgf@circ@res@step=.7\pgf@circ@res@step{}
- \pgfsetdash{}{0pt} % draw solid circle if boxed
- \else
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \fi
- \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step}
- \pgf@circ@draworfill
-
+ \pgf@circ@circular@rf@box@circle
% inner arrow
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetlinewidth{\pgfstartlinewidth}
-
\pgfsetarrowsend{latex}
\pgfpathmoveto{\pgfpoint{-0.25\pgf@circ@res@step}{0}}
\pgfpatharc{180}{-90} {0.25\pgf@circ@res@step}
\pgfpathlineto{\pgfpoint{-5pt}{-0.2\pgf@circ@res@step}}
\pgfusepath{draw}
-
\endpgfscope
}
}
@@ -3093,8 +2438,8 @@
\advance \pgf@x by -.5\wd\pgfnodeparttextbox
\advance \pgf@y by -1.5\ht\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{quadpoles/gridnode/width}\pgf@circ@scaled@Rlen
@@ -3118,15 +2463,7 @@
% draw outer box
\pgf@circ@twoportbox
-
-
- \ifpgf@circuit@inputarrow
- {
- \advance \pgf@circ@res@left by -.5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
- \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfnode{inputarrow}{tip}{}{pgf@inputarrow}{\pgfusepath{fill}}
- }
- \fi
+ \pgf@circ@inputarrow
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetarrows{-} %never draw arrows
@@ -3226,8 +2563,8 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\northwest
@@ -3240,6 +2577,8 @@
% draw outer box
\pgf@circ@twoportbox
+ \pgf@circ@inputarrow
+
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
@@ -3353,8 +2692,8 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\northwest
@@ -3367,7 +2706,7 @@
% draw outer box
\pgf@circ@twoportbox
-
+ \pgf@circ@inputarrow
% draw inner stuff
\pgfsetdash{}{0pt} % always draw solid line for inner symbol
\pgfsetarrows{-} %never draw arrows
@@ -3530,8 +2869,8 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -3546,11 +2885,10 @@
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgf@circ@draworfill
-
% draw inner stuff
- #2
-
+ #2%
% draw inner text
+ \pgf@circ@text@strokecolor
\pgftext[center,x=-0.15\pgf@circ@res@step,y=0]{\ctikzvalof{bipoles/twoport/text}}
}
}
@@ -3682,8 +3020,8 @@
\advance \pgf@y by 0.5\ht\pgfnodeparttextbox
\pgf@x=-.5\wd\pgfnodeparttextbox
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\northwest
@@ -3696,6 +3034,7 @@
% draw outer box
\pgf@circ@twoportbox
+ \pgf@circ@inputarrow
% draw inner stuff
% rotate inner symbol
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
index f489ac58e6..ca5e2b00a8 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircshapes.tex
@@ -9,30 +9,30 @@
% 2. under the GNU Public License.
%
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
+%
+% This file has folding marks for vim (See last line).
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Other shapes
-%% Nothing
+%% Nothing: empty shape%<<<
\pgfdeclareshape{emptyshape}{
\savedanchor{\northeast}{%
\pgf@x=.5\wd\pgfnodeparttextbox%
\pgf@y=.5\ht\pgfnodeparttextbox%
}
- \anchor{north}{\northeast\pgf@x=0cm\relax}
- \anchor{east}{\northeast\pgf@y=0cm\relax}
- \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
- \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
- \anchor{north east}{\northeast}
- \anchor{north west}{\northeast\pgf@x=-\pgf@x}
- \anchor{south east}{\northeast\pgf@y=-\pgf@y}
- \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ % geo anchors based on north-east
+ \pgfcirc@northeast@symmetric@geoanchors
\anchor{text}{\pgfpoint{-.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox}}
\anchor{center}{
\pgfpointorigin
}
-}
+}%
+%>>>
+
+%% Poles%<<<
%
% Provision for changing opacity. Only expert use, see the manual.
%
@@ -43,6 +43,7 @@
\ctikzset{poles/full fill opacity/.initial=1.0}% better not touch it
\tikzset{full poles opacity/.code={%
\ctikzset{poles/full fill opacity=#1}%
+
}}
%
@@ -62,31 +63,20 @@
\pgf@x=-\pgf@y
}
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
- \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{west}{ \northwest \pgf@y=0pt }
- \anchor{w}{ \northwest \pgf@y=0pt }
- \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{north}{ \northwest \pgf@x=0pt }
- \anchor{n}{ \northwest \pgf@x=0pt }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
- \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % geo anchors based on north-west
+ \pgfcirc@northwest@symmetric@geoanchors
\anchorborder{
\pgf@circ@res@left=\pgf@x
\pgf@circ@res@up=\pgf@y
\pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
}{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
}
- \behindforegroundpath{
- \pgfscope
+ \pgf@circ@draw@component{
\pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
+ \pgf@circ@fill@strokecolor
\pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
\pgfusepath{draw,fill}
- \endpgfscope
}
}
@@ -101,41 +91,29 @@
\pgf@x=-\pgf@y
}
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
- \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{west}{ \northwest \pgf@y=0pt }
- \anchor{w}{ \northwest \pgf@y=0pt }
- \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{north}{ \northwest \pgf@x=0pt }
- \anchor{n}{ \northwest \pgf@x=0pt }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
- \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % geo anchors based on north-west
+ \pgfcirc@northwest@symmetric@geoanchors
\anchorborder{
\pgf@circ@res@left=\pgf@x
\pgf@circ@res@up=\pgf@y
\pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
}{\pgfpoint{\ctikzvalof{nodes width}*\pgf@circ@Rlen}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
}
- \behindforegroundpath{
- \pgfscope
- \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
- \ifx\tikz@fillcolor\pgfutil@empty
- % set the default fill color to white
- \pgfsetfillcolor{\ctikzvalof{open poles fill}}
- % ...but override it if the class is defined!
- % note that this element has no class, but will inherit it when used
- % into another component
- \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
- \else
- \pgfsetfillcolor{\tikz@fillcolor}
- \fi
- \pgfusepath{draw,fill}
- \endpgfscope
+ \pgf@circ@draw@component{
+ \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgf@circ@setcolor
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{\ctikzvalof{open poles fill}}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfusepath{draw,fill}
}
}
@@ -150,18 +128,8 @@
\pgf@x=-\pgf@y
}
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
- \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{west}{ \northwest \pgf@y=0pt }
- \anchor{w}{ \northwest \pgf@y=0pt }
- \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{north}{ \northwest \pgf@x=0pt }
- \anchor{n}{ \northwest \pgf@x=0pt }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
- \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % geo anchors based on north-west
+ \pgfcirc@northwest@symmetric@geoanchors
\anchorborder{
% \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
\pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
@@ -178,17 +146,16 @@
\pgf@x=\@@switchx\pgf@x
\pgf@y=\@@switchy\pgf@y
}
- \behindforegroundpath{
- \pgfscope
- \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
- \pgftransformrotate{45}
- \pgfpathrectanglecorners
- {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
- {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
- \pgfusepath{draw,fill}
- \endpgfscope
+ \pgf@circ@draw@component{
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgf@circ@setcolor
+ \pgf@circ@fill@strokecolor
+ \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
}
}
@@ -203,18 +170,8 @@
\pgf@x=-\pgf@y
}
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
- \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{west}{ \northwest \pgf@y=0pt }
- \anchor{w}{ \northwest \pgf@y=0pt }
- \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{north}{ \northwest \pgf@x=0pt }
- \anchor{n}{ \northwest \pgf@x=0pt }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
- \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % geo anchors based on north-west
+ \pgfcirc@northwest@symmetric@geoanchors
\anchorborder{
% \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
\pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
@@ -231,27 +188,25 @@
\pgf@x=\@@switchx\pgf@x
\pgf@y=\@@switchy\pgf@y
}
- \behindforegroundpath{
- \pgfscope
- \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
- \pgftransformrotate{45}
- \pgfpathrectanglecorners
- {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
- {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
- \ifx\tikz@fillcolor\pgfutil@empty
- % set the default fill color to white
- \pgfsetfillcolor{\ctikzvalof{open poles fill}}
- % ...but override it if the class is defined!
- % note that this element has no class, but will inherit it when used
- % into another component
- \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
- \else
- \pgfsetfillcolor{\tikz@fillcolor}
- \fi
- \pgfusepath{draw,fill}
- \endpgfscope
+ \pgf@circ@draw@component{
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgf@circ@setcolor
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{\ctikzvalof{open poles fill}}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfusepath{draw,fill}
}
}
@@ -266,18 +221,8 @@
\pgf@x=-\pgf@y
}
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
- \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{west}{ \northwest \pgf@y=0pt }
- \anchor{w}{ \northwest \pgf@y=0pt }
- \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{north}{ \northwest \pgf@x=0pt }
- \anchor{n}{ \northwest \pgf@x=0pt }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
- \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % geo anchors based on north-west
+ \pgfcirc@northwest@symmetric@geoanchors
\anchorborder{
\pgf@xa=\pgf@x
\pgf@ya=\pgf@y
@@ -286,16 +231,15 @@
{\pgfqpoint{\pgf@xa}{\pgf@ya}}
{\pgfqpoint{\pgf@circ@res@up}{\pgf@circ@res@up}}
}
- \behindforegroundpath{
- \pgfscope
- \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
- \pgfpathrectanglecorners
- {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
- {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
- \pgfusepath{draw,fill}
- \endpgfscope
+ \pgf@circ@draw@component{
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgf@circ@setcolor
+ \pgf@circ@fill@strokecolor
+ \pgfsetfillopacity{\ctikzvalof{poles/full fill opacity}}% normally 1.0
+ \pgfusepath{draw,fill}
}
}
%% square terminal, unfilled
@@ -309,18 +253,8 @@
\pgf@x=-\pgf@y
}
\anchor{center}{ \pgf@y=0pt \pgf@x=0pt }
- \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{e}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{west}{ \northwest \pgf@y=0pt }
- \anchor{w}{ \northwest \pgf@y=0pt }
- \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{s}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{north}{ \northwest \pgf@x=0pt }
- \anchor{n}{ \northwest \pgf@x=0pt }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
- \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
+ % geo anchors based on north-west
+ \pgfcirc@northwest@symmetric@geoanchors
\anchorborder{
\pgf@xa=\pgf@x
\pgf@ya=\pgf@y
@@ -329,99 +263,24 @@
{\pgfqpoint{\pgf@xa}{\pgf@ya}}
{\pgfqpoint{\pgf@circ@res@up}{\pgf@circ@res@up}}
}
- \behindforegroundpath{
- \pgfscope
- \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
- \pgfpathrectanglecorners
- {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
- {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
- \ifx\tikz@fillcolor\pgfutil@empty
- % set the default fill color to white
- \pgfsetfillcolor{\ctikzvalof{open poles fill}}
- % ...but override it if the class is defined!
- % note that this element has no class, but will inherit it when used
- % into another component
- \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
- \else
- \pgfsetfillcolor{\tikz@fillcolor}
- \fi
- \pgfusepath{draw,fill}
- \endpgfscope
- }
-}
-% BNC connector
-
-\pgfdeclareshape{bnc}{
- \anchor{center}{
- \pgfpointorigin
- }
- % BNC size is 2.5 times the size of the internal "ocirc"
- \savedanchor\northwest{%
- \pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
- \pgf@y=2.5\pgf@y
- \pgf@x=-\pgf@y
- }
- % center is on the opening
- \anchor{center}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{zero}{ \pgfpointorigin }
- \anchor{hot}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{shield}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- % geo-anchors
- \anchor{east}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{right}{ \northwest \pgf@y=0pt \pgf@x=-\pgf@x }
- \anchor{west}{ \northwest \pgf@y=0pt }
- \anchor{left}{ \northwest \pgf@y=0pt }
- \anchor{south}{ \northwest \pgf@x=0pt \pgf@y=-\pgf@y }
- \anchor{north}{ \northwest \pgf@x=0pt }
- \anchor{south west}{ \northwest \pgf@y=-\pgf@y }
- \anchor{north east}{ \northwest \pgf@x=-\pgf@x }
- \anchor{north west}{ \northwest }
- \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
- % put the node text above and centered
- \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
- \pgfpoint{-.5\wd\pgfnodeparttextbox}{
- \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
- }
- }
- \anchorborder{
- \pgf@circ@res@left=\pgf@x
- \pgf@circ@res@up=\pgf@y
- \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
- }{\pgfpoint{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}{2.5*\ctikzvalof{nodes width}*\pgf@circ@Rlen}}
- }
- \behindforegroundpath{
- \pgfextracty{\pgf@circ@res@other}{\northwest}
- \pgf@circ@res@step=\ctikzvalof{nodes width}\pgf@circ@Rlen
- \pgfscope
- \pgfstartlinewidth=\pgflinewidth
- \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
- \pgfsetcolor{\ctikzvalof{color}}
- % external circle
- \pgfscope
- % clipping path: first a rectangle bigger then the shape
- % to avoid problems with the line thickness
- \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
- {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
- % next the opening to the right
- \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
- {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
- % do the difference and clip before drawing
- \pgfseteorule
- \pgfusepath{clip}
- \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
- \pgfusepath{draw}
- \endpgfscope
- % internal circle
- \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
- \pgf@circ@draworfill
- % and the contact line to the right
- \pgfsetlinewidth{\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
- \pgfusepath{draw}
- \endpgfscope
+ \pgf@circ@draw@component{
+ \pgfmathsetlength{\pgf@circ@res@temp}{\ctikzvalof{nodes width}*\pgf@circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{-\pgf@circ@res@temp}{-\pgf@circ@res@temp}}
+ {\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
+ \pgf@circ@setcolor
+ \pgfsetfillopacity{\ctikzvalof{poles/open fill opacity}}% normally 1.0
+ \ifx\tikz@fillcolor\pgfutil@empty
+ % set the default fill color to white
+ \pgfsetfillcolor{\ctikzvalof{open poles fill}}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf@circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz@fillcolor}
+ \fi
+ \pgfusepath{draw,fill}
}
}
@@ -432,14 +291,8 @@
\pgf@x=.5\pgflinewidth%
\pgf@y=.5\pgflinewidth%
}
- \anchor{north}{\northeast\pgf@x=0cm\relax}
- \anchor{east}{\northeast\pgf@y=0cm\relax}
- \anchor{south}{\northeast\pgf@y=-\pgf@y \pgf@x=0cm\relax}
- \anchor{west}{\northeast\pgf@y=0cm\pgf@x=-\pgf@x}
- \anchor{north east}{\northeast}
- \anchor{north west}{\northeast\pgf@x=-\pgf@x}
- \anchor{south east}{\northeast\pgf@y=-\pgf@y}
- \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x}
+ % geo anchors based on north-east
+ \pgfcirc@northeast@symmetric@geoanchors
\anchor{center}{
\pgfpointorigin
}
@@ -447,17 +300,18 @@
\pgf@circ@res@left=\pgf@x
\pgf@circ@res@up=\pgf@y
}
- \behindforegroundpath{
- \pgfscope
- \pgfpathrectanglecorners
- {\pgfpoint{0}{.5\pgflinewidth}}
- {\pgfpoint{0}{-.5\pgflinewidth}}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfusepath{draw,fill}
- \endpgfscope
+ \pgf@circ@draw@component{
+ \pgfpathrectanglecorners
+ {\pgfpoint{0}{.5\pgflinewidth}}
+ {\pgfpoint{0}{-.5\pgflinewidth}}
+ \pgf@circ@setcolor
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{draw,fill}
}
}
+% %>>>
+%% Arrows%<<<
%% transistor arrow
\def\pgf@circ@find@linescale{
@@ -530,22 +384,20 @@
\pgf@circ@res@temp=\@@factor\pgflinewidth
\advance\pgf@x by -.5\pgf@circ@res@temp
}
- \behindforegroundpath{
- \pgfscope
- \northwest
- \pgf@circ@res@up=\pgf@y
- \pgf@circ@res@left=\pgf@x
- \tip
- \pgf@circ@res@step = \pgf@x
- %
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
- \pgfpathclose
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfusepath{fill} % just fill
- \endpgfscope
+ \pgf@circ@draw@component{
+ \northwest
+ \pgf@circ@res@up=\pgf@y
+ \pgf@circ@res@left=\pgf@x
+ \tip
+ \pgf@circ@res@step = \pgf@x
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgfpathclose
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{fill} % just fill
}
}
@@ -581,22 +433,21 @@
\divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
\pgf@x =\pgf@circ@res@step
}
- \behindforegroundpath{
- \pgfscope
- \ifpgfcirc@really@draw@currarrow
- \pgf@circ@reset@arrows@rounded
- \pgf@circ@res@step = \pgf@circ@Rlen
- \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
-
- \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
- \pgfpathclose
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfusepath{draw,fill}
- \fi
- \endpgfscope
+ \pgf@circ@draw@component{
+ \ifpgfcirc@really@draw@currarrow
+ \pgf@circ@reset@arrows@rounded
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
+
+ \pgfpathmoveto{\pgfpoint{-.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{1\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgf@circ@setcolor
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{draw,fill}
+ \fi
}
}
@@ -637,20 +488,19 @@
\divide \pgf@circ@res@step by \ctikzvalof{current arrow scale}
\pgf@x =\pgf@circ@res@step
}
- \behindforegroundpath{
- \pgfscope
- \ifpgfcirc@really@draw@flowarrow
- \pgf@circ@reset@arrows@rounded
- \pgf@circ@res@step = \pgf@circ@Rlen
- \divide \pgf@circ@res@step by 4
- \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfusepath{draw}
- \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
- \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
- \fi
- \endpgfscope
+ \pgf@circ@draw@component{
+ \ifpgfcirc@really@draw@flowarrow
+ \pgf@circ@reset@arrows@rounded
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 4
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgf@circ@setcolor
+ \pgfusepath{draw}
+ \pgf@circ@fill@strokecolor
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
+ \fi
}
}
@@ -680,39 +530,35 @@
\anchor{tip}{
\tip
}
- \behindforegroundpath{
-
- \pgfscope
- \pgf@circ@reset@arrows@rounded
- \pgf@circ@res@step = \pgf@circ@Rlen
- \divide \pgf@circ@res@step by 16
- \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
- \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
- \pgfpathlineto{\pgfpoint{0pt}{0pt}}
- \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
- \pgfpathclose
- \pgfsetcolor{\ctikzvalof{color}}
- \pgfusepath{fill}
- \endpgfscope
+ \pgf@circ@draw@component{
+ \pgf@circ@reset@arrows@rounded
+ \pgf@circ@res@step = \pgf@circ@Rlen
+ \divide \pgf@circ@res@step by 16
+ \pgfpathmoveto{\pgfpoint{-1.7\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{-.8\pgf@circ@res@step}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{-1.7\pgf@circ@res@step}{.8\pgf@circ@res@step}}
+ \pgfpathclose
+ \pgf@circ@setcolor
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{fill}
}
}
+% %>>>
-
+%% boxes%<<<
%% box
\pgfdeclareshape{box}{
\anchor{center}{
\pgfpointorigin
}
- \behindforegroundpath{
-
- \pgfscope
- \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
- \pgf@circ@res@step = 0.5\pgf@circ@res@step
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
- \pgf@circ@draworfill
- \endpgfscope
+ \pgf@circ@draw@component{
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgf@circ@draworfill
}
}
@@ -723,18 +569,18 @@
\anchor{center}{
\pgfpointorigin
}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{blocks/scale}\pgf@circ@Rlen}
- \pgfscope
- \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
- \pgf@circ@res@step = 0.5\pgf@circ@res@step
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
- \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
- \pgf@circ@draworfill
- \endpgfscope
+ \pgf@circ@res@step = \ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@step = 0.5\pgf@circ@res@step
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{\pgf@circ@res@step}}{\pgfpoint{\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ \pgf@circ@draworfill
}
}
+% %>>>
+%% crossings%<<<
% full nodes for wire crossing
\pgfdeclareshape{jump crossing}
@@ -757,7 +603,7 @@
\anchor{north east}{ \northwest \pgf@x=-\pgf@x }
\anchor{north west}{ \northwest }
\anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
- \behindbackgroundpath{
+ \pgf@circ@draw@component{
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
@@ -798,7 +644,7 @@
\anchor{north east}{ \northwest \pgf@x=-\pgf@x }
\anchor{north west}{ \northwest }
\anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
- \behindbackgroundpath{
+ \pgf@circ@draw@component{
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
@@ -816,5 +662,226 @@
}
}
+% %>>>
+
+%% Connectors (BNC and IEC connectors; see https://github.com/circuitikz/circuitikz/issues/611)%<<<
+
+% define new class
+\ctikzset{connectors/scale/.initial=1.0}
+\ctikzset{connectors/fill/.initial=none}
+\ctikzset{connectors/thickness/.initial=none}
+% parameters. To have round sockets, 3*height==2*width
+\ctikzset{bipoles/iecconn/height/.initial=.2}
+\ctikzset{bipoles/iecconn/width/.initial=.3}
+% objects
+\pgfcircdeclarebipolescaled{connectors}
+{
+ \anchor{plug center}{\northeast\pgf@y=0pt\divide\pgf@x by 3 }
+ \anchor{socket center}{\northeast\pgf@y=0pt\pgf@x=-0.333333\pgf@x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iecconn/height}}%symmetrical
+{iecconn}
+{\ctikzvalof{bipoles/iecconn/height}}
+{\ctikzvalof{bipoles/iecconn/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left/3}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{-90}{0.66666\pgf@circ@res@left and \pgf@circ@res@up}
+ \pgfusepath{draw}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left/3}{\pgf@circ@res@up/2}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down/2}}
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{draw, fill}
+}
+\pgfcirc@activate@bipole@simple{l}{iecconn}
+\pgfcirc@style@to@style{iecconn}{iec connector}
+
+\long\def\pgfcirc@declare@iecsocket#1#2#3{% #1 name, #2 anchors, #3 drawing code
+ \pgfdeclareshape{#1}{%
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{connectors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/iecconn/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/iecconn/width}\pgf@circ@scaled@Rlen
+ \divide\pgf@x by 6
+ }
+ \pgfcirc@northwest@symmetric@geoanchors
+ #2%
+ \pgf@circ@draw@component{%
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfstartlinewidth=\pgflinewidth
+ \northwest
+ \pgf@circ@res@up=\pgf@y
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ #3%
+ \pgfusepath{draw}
+ }
+ }
+}
+
+\long\def\pgfcirc@declare@iecplug#1#2{% #1 name, #2 anchors (drawing code is the same)
+ \pgfdeclareshape{#1}{%
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{connectors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/iecconn/height}\pgf@circ@scaled@Rlen
+ \pgf@y=.25\pgf@y
+ \pgf@x=-\ctikzvalof{bipoles/iecconn/width}\pgf@circ@scaled@Rlen
+ \divide\pgf@x by 3
+ }
+ \pgfcirc@northwest@symmetric@geoanchors
+ \anchor{plug center}{\pgfpointorigin}
+ #2%
+ \pgf@circ@draw@component{%
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfstartlinewidth=\pgflinewidth
+ \northwest
+ \pgf@circ@res@up=\pgf@y
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-\pgf@circ@res@left}{-\pgf@circ@res@up}}
+ \pgf@circ@setcolor
+ \pgf@circ@fill@strokecolor
+ \pgfusepath{draw, fill}
+ }
+ }
+}
+
+\pgfcirc@declare@iecsocket{iecsocketR}{%
+ % notice: center is on the left side
+ \anchor{center}{\northwest\pgf@y=0pt}
+ \anchor{socket center}{\northwest\pgf@y=0pt}
+ % put the node text above and to the left, ignore depth
+ \anchor{text}{%
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-\pgf@circ@res@left}{%
+ .5\ht\pgfnodeparttextbox+\pgf@circ@res@up
+ }%
+ }%
+}{% drawing
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{270}{2\pgf@circ@res@left and \pgf@circ@res@up}
+}
+\pgfcirc@declare@iecsocket{iecsocketL}{%
+ % notice: center is on the left side
+ \anchor{center}{\northwest\pgf@y=0pt}
+ \anchor{socket center}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ % put the node text above and to the left, ignore depth
+ \anchor{text}{%
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-\wd\pgfnodeparttextbox+\pgf@circ@res@left}{%
+ .5\ht\pgfnodeparttextbox+\pgf@circ@res@up
+ }%
+ }%
+}{% drawing
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpatharc{90}{-90}{2\pgf@circ@res@left and \pgf@circ@res@up}
+}
+
+\pgfcirc@declare@iecplug{iecplugL}{%
+ % notice: center is on the left side
+ \anchor{center}{\northwest\pgf@y=0pt}
+ % put the node text above and to the right, ignore depth
+ % the text is higher to match the iec socket position
+ \anchor{text}{%
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-\wd\pgfnodeparttextbox+\pgf@circ@res@left}{
+ .5\ht\pgfnodeparttextbox+2\pgf@circ@res@up
+ }
+ }
+}
+\pgfcirc@declare@iecplug{iecplugR}{%
+ % notice: center is on the left side
+ \anchor{center}{\northwest\pgf@y=0pt}
+ % put the node text above and to the right, ignore depth
+ % the text is higher to match the iec socket position
+ \anchor{text}{%
+ \pgfextractx{\pgf@circ@res@left}{\northwest}
+ \pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-\pgf@circ@res@left}{
+ .5\ht\pgfnodeparttextbox+2\pgf@circ@res@up
+ }
+ }
+}
+% BNC connector
+
+\pgfdeclareshape{bnc}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{connectors}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ % BNC size is 2.5 times the size of the internal "ocirc", when class scale is=1
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{nodes width}\pgf@circ@scaled@Rlen
+ \pgf@y=2.5\pgf@y
+ \pgf@x=-\pgf@y
+ }
+ % center is on the opening
+ \anchor{center}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{zero}{\pgfpointorigin}
+ \anchor{hot}{\northwest\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{shield}{\northwest\pgf@x=0pt\pgf@y=-\pgf@y}
+ % geo-anchors
+ \pgfcirc@northwest@symmetric@geoanchors
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northwest}
+ \pgfpoint{-.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
+ }
+ }
+ \anchorborder{
+ \pgf@circ@res@left=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}
+ }{\pgfpoint{2.5*\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}{2.5*\ctikzvalof{nodes width}*\pgf@circ@scaled@Rlen}}
+ }
+ \pgf@circ@draw@component{
+ \pgfextracty{\pgf@circ@res@other}{\northwest}
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{nodes width}*\scaledRlen}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgf@circ@setcolor
+ % external circle
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{-2\pgf@circ@res@other}{-2\pgf@circ@res@other}}
+ {\pgfpoint{2\pgf@circ@res@other}{2\pgf@circ@res@other}}
+ % next the opening to the right
+ \pgfpathrectanglecorners{\pgfpoint{-\pgf@circ@res@step}{-\pgf@circ@res@step}}
+ {\pgfpoint{2\pgf@circ@res@other}{\pgf@circ@res@step}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal circle
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@step}
+ \pgf@circ@draworfill
+ % and the contact line to the right
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
+ \pgfusepath{draw}
+ }
+}
+% %>>>
\endinput
+% vim: set fdm=marker fmr=%<<<,%>>>:
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
index d0cf0b295a..711276dd77 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
@@ -432,9 +432,10 @@
\anchor{east}{\pgfextractx{\pgf@circ@res@right}{\northeast}%
\pgfpoint{\pgf@circ@res@right}{0cm}}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
- #3
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
+ % \pgf@circ@debug@colors
+ #3%
}
}
}
@@ -867,8 +868,8 @@
\pgf@x=\dimexpr -.6\wd\pgfnodeparttextbox\relax
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -1011,8 +1012,8 @@
\pgf@x=\dimexpr -.6\wd\pgfnodeparttextbox\relax
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -1147,8 +1148,8 @@
\pgf@x=\dimexpr -.6\wd\pgfnodeparttextbox\relax
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -1303,8 +1304,8 @@
\pgf@x=\dimexpr -.6\wd\pgfnodeparttextbox\relax
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
@@ -1445,7 +1446,7 @@
\else
\expandafter\pgfutil@g@addto@macro\csname pgf@sh@s@european #1 port\endcsname{%
\pgfmathloop%
- \ifnum\pgfmathcounter>#3%
+ \ifnum\pgfmathcounter>#3
\else%
%\pgfutil@ifundefined{pgf@anchor@european #1 port@in \pgfmathcounter}{% redundant
\expandafter\xdef\csname pgf@anchor@european #1 port@in \pgfmathcounter\endcsname{%
@@ -1489,8 +1490,8 @@
\pgfpointborderrectangle{\pgfpoint{\pgf@xa}{\pgf@ya}}
{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgfstartlinewidth=\pgflinewidth
\pgfscope
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
@@ -1544,9 +1545,10 @@
\pgfusepath{draw}
\fi
\fi
- %
+ \pgf@circ@text@strokecolor
\pgfpathmoveto{\pgfpointorigin}
\pgftext{#2}
+ %
}
}
}
@@ -2031,10 +2033,10 @@
\anchor{south}{\southwest\pgf@x=0pt\relax}
\anchor{west}{\northwest\pgf@y=0pt\relax}
- \backgroundpath{
+ \pgf@circ@draw@component{
\pgfscope
- \pgfsetcolor{\ctikzvalof{color}}
- #4
+ \pgf@circ@setcolor
+ #4%
\endpgfscope
% output lead:
\pgfextractx{\pgf@circ@res@right}{\bottomright} %body+ball border
@@ -2128,7 +2130,7 @@
% \typeout{INNER\space\pgf@circ@count@a}
\pgfmathsetlength{\pgf@circ@res@right}{\pgf@circ@res@left-2*\stdH*(1-cos(atan(\pgf@circ@res@temp/(2*\stdH))))}
% hook for xor/xnor
- #1
+ #1%
\fi\fi
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp}}%
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pinlen}{\pgf@circ@res@temp}}%
@@ -2152,7 +2154,7 @@
\pgfpathclose
\pgf@circ@draworfill
% hook for xor/xnor
- #2
+ #2%
% rack now; skip if not needed.
% \typeout{WHAT\space \inputs\space \inners}
\ifnum\inputs>\inners
@@ -2369,10 +2371,10 @@
\anchor{south}{\southwest\pgf@x=0pt\relax}
\anchor{west}{\northwest\pgf@y=0pt\relax}
- \backgroundpath{
+ \pgf@circ@draw@component{
\pgfscope
- \pgfsetcolor{\ctikzvalof{color}}
- #3
+ \pgf@circ@setcolor
+ #3%
\endpgfscope
% output lead:
\pgfextractx{\pgf@circ@res@right}{\bottomright} %body+ball border
@@ -2470,9 +2472,9 @@
\anchor{north east}{\northwest\pgf@x=-\pgf@x}
\anchor{north west}{\northwest}
\anchor{south east}{\northwest\pgf@x=-\pgf@x\pgf@y=-\pgf@y}
- \backgroundpath{
+ \pgf@circ@draw@component{
\pgfscope
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgfextractx{\pgf@circ@res@left}{\northwest}
\pgfextracty{\pgf@circ@res@up}{\northwest}
\pgf@circ@res@left=0.7\pgf@circ@res@left
@@ -2519,10 +2521,10 @@
\pgfpointborderellipse{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}%
{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@temp}}
}
- \behindforegroundpath{
+ \pgf@circ@draw@component{
\pgfscope
\northwest\pgf@circ@res@temp=\pgf@y
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
\pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@temp}
\ifx\tikz@fillcolor\pgfutil@empty
@@ -2715,9 +2717,9 @@
\anchor{south}{\southwest\pgf@x=0pt\relax}
\anchor{west}{\northwest\pgf@y=0pt\relax}
- \backgroundpath{
+ \pgf@circ@draw@component{
\pgfscope
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
\pgfextractx{\pgf@circ@res@left}{\bodyleft}
\pgfextracty{\pgf@circ@res@up}{\bodyleft}
\pgfextractx{\pgf@circ@res@right}{\bodyright}
@@ -2736,7 +2738,7 @@
\fi
\pgfusepath{draw}
\fi
- #3
+ #3%
\endpgfscope
% output lead:
\pgfextractx{\pgf@circ@res@right}{\bottomright} %body+ball border
@@ -3808,10 +3810,10 @@
\pgf@x=-\ctikzvalof{tripoles/#1/bodydiode distance}\pgf@x
\pgf@y=\pgf@ya
}
- #2
- \backgroundpath{
+ #2%
+ \pgf@circ@draw@component{
\pgftransformationadjustments
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
%
\ifnum \ctikzvalof{tripoles/#1/curr direction} > 0
\pgf@circuit@trans@ntypetrue
@@ -3826,7 +3828,7 @@
\pgf@circ@res@left = \pgf@x
\pgf@circ@scaled@Rlen=\scaledRlen
%
- #3
+ #3%
% BODY DIODE
\ifpgf@circuit@fet@bodydiode
\drawbodydiode{#1}
@@ -4013,6 +4015,7 @@
\ifpgf@circuit@bpt@drawphoto
\pgfscope
+ \pgf@circ@fill@strokecolor
\pgfsetarrowsstart{latexslim}
\pgfpathmoveto{\pgfpointadd{\pgfpoint
{\ctikzvalof{tripoles/#1/base width}\pgf@circ@res@left}
@@ -4182,9 +4185,9 @@
\anchor{C}{\ifnum\cdir<0\southeast\else\northeast\fi}
\anchor{collector}{\ifnum\cdir<0\southeast\else\northeast\fi}
- \backgroundpath{
+ \pgf@circ@draw@component{
\pgftransformationadjustments
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@setcolor
%
% set the type and up and down number of connections
%
@@ -4903,6 +4906,7 @@
\else
\edef\@@default{default}%
\ifx\@@tmp\@@default % fill with the pen color
+ \pgf@circ@fill@strokecolor
\pgfusepath{draw, fill}%
\else
\pgfsetfillcolor{\@@tmp}%
@@ -5316,8 +5320,8 @@
}
-\long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3
-{\pgfcircdeclaretransistor{#1}{
+\long\def\pgfdeclaretransistorwrapperaddbulk#1#2#3{
+ \pgfcircdeclaretransistor{#1}{
\anchor{bulk}{\left\pgf@x=0pt}
\anchor{B}{\left\pgf@x=0pt}%override Base anchor from npn&igbt
\anchor{inner up}{
@@ -5328,7 +5332,7 @@
\northeast
\pgf@y=-\ctikzvalof{tripoles/#1/gate height}\pgf@y
}
- #2
+ #2%
}
{#3}
}
@@ -5475,7 +5479,7 @@
\pgf@x=\ctikzvalof{tripoles/#1/conn kink}\pgf@x
}
% extra anchors (or override)
- #2
+ #2%
}{%
% add the circle if requested (before everything else, so we can fill it)
\pgfcirc@transistorcircle
@@ -5574,7 +5578,7 @@
\endpgfscope
% extra drawings
- #3
+ #3%
}
}
@@ -6014,16 +6018,14 @@
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
-
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
\pgf@circ@res@right = -\pgf@x
\pgf@circ@res@left = \pgf@x
\pgf@circ@scaled@Rlen=\scaledRlen
-
% Triangle
\pgfscope
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
@@ -6031,14 +6033,12 @@
\pgf@circ@res@step=\pgf@circ@res@right
\advance\pgf@circ@res@step by -\pgf@circ@res@left
\pgf@circ@res@step=\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@step
-
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@step}{0pt}}
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
\pgfpathclose
\pgf@circ@draworfill
\endpgfscope
-
% Negative input terminal
\pgfpathmoveto{\pgfpoint
{\pgf@circ@res@left}
@@ -6046,8 +6046,6 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
-
% Positive input terminal
\pgfpathmoveto{\pgfpoint
{\pgf@circ@res@left}
@@ -6055,13 +6053,14 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
-
% Output terminal
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@right}{0pt}}
\pgfsetrectcap
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
}
}
@@ -6193,8 +6192,8 @@
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
@@ -6218,7 +6217,6 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
\pgfpathmoveto{\pgfpoint
{\pgf@circ@res@left}
@@ -6226,16 +6224,15 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}
\pgfsetrectcap
\pgfusepath{draw}
-
-
+ \pgf@circ@text@strokecolor
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/en amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/en amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/en amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
\pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\hbox{\ctikzvalof{tripoles/en amp/font2}\ctikzvalof{tripoles/en amp/text}}}
- % \pgftext[top, y=-.5ex, at=\pgfpoint{0pt}{\pgf@circ@res@up}]{\ctikzvalof{tripoles/en amp/font2}$\mathstrut{\triangleright}\,\mathrm{A}$}
}
}
@@ -6436,8 +6433,8 @@
\fi
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -6508,7 +6505,6 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
% Positive input terminal
\pgfpathmoveto{\pgfpoint
@@ -6517,16 +6513,15 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}}
+ \pgfsetrectcap
+ \pgfusepath{draw}
+ \pgf@circ@text@strokecolor
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
\pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd op amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd op amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
-
% Negative output terminal label
\pgftext[right, bottom, x=3pt, y=1pt, at=\pgfpoint{0pt}{0.425\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@oplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
-
% Positive output terminal label
\pgftext[right, top, x=3pt, y=-1pt, at=\pgfpoint{0pt}{0.425\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd op amp/font} \ifpgf@circuit@oa@oplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
-
- \pgfsetrectcap
- \pgfusepath{draw}
}
}
@@ -6756,8 +6751,8 @@
}
% let's start drawing the component
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
%
\northwest
\pgf@circ@res@up = \pgf@y
@@ -6797,7 +6792,6 @@
{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}}
%
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
% input terminal down
\pgfpathmoveto{\pgfpoint
@@ -6807,19 +6801,21 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
% output leads down and up
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}} %
- \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$-\;$\else$+\;$\fi}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}} %
- \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$+\;$\else$-\;$\fi}
%
\pgfsetrectcap
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/fd inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
+ \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$-\;$\else$+\;$\fi}
+ \pgftext[right, at=\pgfpoint{\ctikzvalof{tripoles/fd inst amp/port width}\pgf@circ@res@right}{\ctikzvalof{tripoles/fd inst amp/output height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/fd inst amp/font}\ifpgf@circuit@oa@oplusup$+\;$\else$-\;$\fi}
}
}
@@ -6964,8 +6960,8 @@
\fi
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -6999,22 +6995,19 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
-
-
\pgfpathmoveto{\pgfpoint
{\pgf@circ@res@left}
{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
-
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@right}{0pt}} %
\pgfsetrectcap
\pgfusepath{draw}
-
+ \pgf@circ@text@strokecolor
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/gm amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/gm amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/gm amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
}
}
@@ -7196,8 +7189,8 @@
}
% let's start drawing the component
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
%
\northwest
\pgf@circ@res@up = \pgf@y
@@ -7238,7 +7231,6 @@
{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}}
%
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
% Positive input terminal
\pgfpathmoveto{\pgfpoint
@@ -7248,7 +7240,6 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
% Output terminal
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
@@ -7256,6 +7247,9 @@
%
\pgfsetrectcap
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
}
}
@@ -7483,8 +7477,8 @@
}
% drawing of the component
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -7542,7 +7536,6 @@
{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}}
%
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
% Positive input terminal
\pgfpathmoveto{\pgfpoint
@@ -7552,7 +7545,6 @@
\pgfpathlineto{\pgfpoint
{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}
{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}}
- \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
% Output terminal
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
@@ -7560,6 +7552,9 @@
%
\pgfsetrectcap
\pgfusepath{draw}
+ \pgf@circ@text@strokecolor
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@up}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@plus\else\pgf@circ@ampli@minus\fi}
+ \pgftext[left, at=\pgfpoint{\ctikzvalof{tripoles/inst amp ra/port width}\pgf@circ@res@left}{\ctikzvalof{tripoles/inst amp ra/input height}\pgf@circ@res@down}]{\ctikzvalof{tripoles/inst amp ra/font} \ifpgf@circuit@oa@iplusup\pgf@circ@ampli@minus\else\pgf@circ@ampli@plus\fi}
}
}
@@ -7618,8 +7613,8 @@
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -7779,8 +7774,8 @@
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -7914,8 +7909,8 @@
\fi
\pgf@y=\dimexpr.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
}
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\northwest
\pgf@circ@res@up = \pgf@y
@@ -8087,8 +8082,8 @@
\anchor{north east}{ \northwest \pgf@x=-\pgf@x }
\anchor{north west}{ \northwest }
\anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y }
- \backgroundpath{
- \pgfsetcolor{\ctikzvalof{color}}
+ \pgf@circ@draw@component{
+ \pgf@circ@setcolor
\pgf@circ@scaled@Rlen=\scaledRlen
\pgf@circ@res@step=\ctikzvalof{tripoles/magnetron/width}\pgf@circ@scaled@Rlen
\northwest
@@ -8254,10 +8249,9 @@
}
% Extra anchors
- #2
+ #2%
- \backgroundpath{
- \pgfscope
+ \pgf@circ@draw@component{
% Line width for tripoles
\pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
\pgf@circ@scaled@Rlen=\scaledRlen
@@ -8281,7 +8275,7 @@
\pgf@circ@draworfill
% Grid drawing
- #3
+ #3%
% Filament (is not drawn by default)
\ifpgf@circuit@tubes@filament
@@ -8324,7 +8318,6 @@
% Draw the background
\pgfusepath{draw}
- \endpgfscope
}
}
}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
index d50d411165..f614b86f22 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircutils.tex
@@ -397,7 +397,9 @@
\n1 = {veclen(\x1,\y1)},
\n2 = {atan2(\y2,\x2)} in
% node[above]{\n1, \n2}
- (#5.center) ++({\n2+(#4)}:{-0.5*(\n1)*(#3)}) -- ++({\n2+(#4)}:{(\n1)*(#3)});
+ % notice that some node has the "center" on one side, so
+ % midway from east to west is a safer bet for the center
+ ($(#5.west)!0.5!(#5.east)$) ++({\n2+(#4)}:{-0.5*(\n1)*(#3)}) -- ++({\n2+(#4)}:{(\n1)*(#3)});
\endscope
}
\endinput
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
index 00010903bf..5158fbb561 100644
--- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
@@ -10,11 +10,12 @@
%
% See the files gpl-3.0_license.txt and lppl-1-3c_license.txt for more details.
-\def\pgfcircversion{1.4.6}
-\def\pgfcircversiondate{2022/02/04}
+\def\pgfcircversion{1.5.0}
+\def\pgfcircversiondate{2022/02/22}
\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
\usemodule[tikz]
+\usemodule[regexpatch]%for color hack
\startmodule[circuitikz]
\usetikzlibrary[calc]