summaryrefslogtreecommitdiff
path: root/graphics/pgf
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
parentc65c806536b3d6b228d5d71f0e0c835968a3733a (diff)
CTAN sync 202204230300
Diffstat (limited to 'graphics/pgf')
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/changelog.tex71
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdfbin17674 -> 17645 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdfbin1485592 -> 1518613 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex301
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/ctikzmanutils.sty10
-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
17 files changed, 1658 insertions, 1551 deletions
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
index a1599a272c..f4200948a6 100644
--- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
@@ -5,6 +5,67 @@ full list of changes.
\begin{itemize}
\item
+ Version 1.5.0 (2022-04-22)
+
+ In this version, several internal changes have been included in order
+ to streamline and organize better the components and to change the
+ management of color. The changes are pretty deep and subtle, so a bug
+ or unexpected behaviour is always possible. You can use the 1.4.6
+ rollback point in case of trouble, but be sure to report any bug.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Added connectors shapes, and included the BNC into that class;
+ thanks to
+ \href{https://github.com/circuitikz/circuitikz/issues/611}{Alexander
+ Sauter for suggesting them and helping in the design}
+ \item
+ Added nullator and norator shapes, suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/615}{user
+ atticus-sullivan on GitHub}
+ \item
+ Added buzzer and reversed buzzer bipoles, suggested by
+ \href{https://tex.stackexchange.com/q/640501/38080}{user Michael.H}
+ \item
+ Added ``dot'' anchors to inductances
+ \item
+ Added ``boxed only'' option for some circular blocks, suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/621}{user
+ myzinsky}
+ \item
+ Added DIN antenna shape, suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/620}{user
+ myzinsky}
+ \item
+ Fixed block/input arrow connection, thanks to
+ \href{https://github.com/circuitikz/circuitikz/issues/613}{Laurenz
+ Preindl for reporting}
+ \item
+ Fixed a problem with generic tunable arrows, noticed thanks to
+ \href{https://tex.stackexchange.com/q/637182/38080}{this question on
+ TeX.SX}
+ \end{itemize}
+
+ Internal changes:
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Added a generic drawing function for shapes, which are now drawn
+ always in background
+ \item
+ Added a hook system to be able to change component drawing settings
+ per-shape, per-class or globally
+ \item
+ All the 250+ shapes are now ``protected'' by possible external arrow
+ and arced corners parameters
+ \item
+ Completely changed the management of the shapes' color, thanks to
+ \href{https://github.com/circuitikz/circuitikz/issues/605}{GitHub
+ user muzimuzhi}
+ \end{itemize}
+\item
Version 1.4.6 (2022-02-04)
A nasty bug fix and some hack to avoid that some global Ti\emph{k}Z
@@ -509,7 +570,7 @@ full list of changes.
Rewrite of the path generation macros
\item
Several small bugs fixed (no one ever used some
- ``f\^{}\textgreater{}'' options\ldots{})
+ ``f\^{}\textgreater{}'' options\ldots)
\end{itemize}
\item
Version 1.2.0 (2020-06-21)
@@ -871,7 +932,7 @@ A detailed list of changes can be seen below.
\item
Fixed a (puzzling) problem with coupler2
\item
- Fixed a compatibility problem with newer PGF (\textgreater{}3.0.1a)
+ Fixed a compatibility problem with newer PGF (\textgreater3.0.1a)
\end{itemize}
\item
Version 0.9.2 (2019-06-21)
@@ -1021,7 +1082,7 @@ A detailed list of changes can be seen below.
\item
Fixed direction of controlled american voltage source
\item
- ``v\textless{}='' and ``i\textless{}='' do not rotate the sources
+ ``v\textless='' and ``i\textless='' do not rotate the sources
anymore(see them as ``counting direction indication'', this can be
different then the shape orientation); Use the option ``invert'' to
change the direction of the source/apperance of the shape.
@@ -1057,7 +1118,7 @@ A detailed list of changes can be seen below.
\item
Allow use of voltage label at a {[}short{]}
\item
- Correct line joins between path components (to{[}\ldots{}{]})
+ Correct line joins between path components (to{[}\ldots{]})
\item
New Pole-shape .-. to fill perpendicular joins
\item
@@ -1086,7 +1147,7 @@ A detailed list of changes can be seen below.
\item
Fixed varcap symbol at small scalings
\item
- New packet-option "straightvoltages, to draw straight(no curved)
+ New packet-option ``straightvoltages, to draw straight(no curved)
voltage arrows
\item
New option ``invert'' to revert the node direction at paths
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
index 3bce331cd0..7f8ee18f84 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
index 5372b62034..98f4c5b3a2 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index f299603351..37e8bffc10 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -198,13 +198,13 @@ Correcting this will need a big rewrite of the path routines, and although the a
This same issue create a lot of problem of compatibility between \Circuitikz{} and the new \texttt{pic} Ti\emph{k}Z feature, so basically don't put components into \texttt{pic}s.
-Also, notice that most components will interact in a funny way with global path options, like \texttt{rounded corners} or the arrow options (like \texttt{->} or \texttt{shorten <} and so on). Depending on the specific component, some parameter is inherited by the internal shape, and some other is reset,\footnote{This is not easy to fix. We want some option to go through --- fill color, dashed pattern for example --- and some other to stay only in the outer path; and if the background shape need some option for drawing the internal shape, like for example a rounded corner, it \emph{must} reset the external option. So there is no perfect solution.} so basically it's better not to use them.
+Also, notice that several components will interact in a funny way with global path options. Depending on the specific component, some parameter is inherited by the internal shape, and some other is reset. This is not easy to fix in general. We want some option to go through --- fill color, dashed pattern for example --- and some other to stay only in the outer path; and if the background shape need some option for drawing the internal shape, like for example a rounded corner, it \emph{must} reset the external option. So there is no perfect solution, although since \texttt{v1.5.0} the shapes have been ``robustified'', so that by default arced corners and arrows parameters will \emph{not} be propagated into the shape.
Arrows with \texttt{to[]} components don't work, anyway, so basically avoid this situation.
\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
\begin{circuitikz}[]
\draw (0,3) to[R] ++(3,0) node[npn, anchor=B]{};
- % arrows will not work and give bad results
+ % arrows will not work and give strange results
% so basically do not use them!
\draw[<->] (0,1.5) to[R] ++(3,0) node[npn, anchor=B]{};
\draw[shorten <=10pt] (0,0) to[R] ++(3,0)
@@ -2286,6 +2286,32 @@ Inductors have additional anchors to add core lines (for historical reasons, the
Notice that the core lines will \textbf{not} change the position of labels. You have to move them by hand if needed (or position them on the other side); see~\ref{sec:adjust-label-position}.
+\paragraph{Dot anchors.}
+Inductances have also ``dot'' anchors\footnote{proposed by Romano in a discussion by \href{https://github.com/circuitikz/circuitikz/issues/618}{GitHub user AndreaDiPietro92}},
+to help positioning dots when specifying mutual inductance signs. The anchors are name \texttt{lr dot} (for lower right dot), \texttt{ur dot} (upper right) and so on:
+\begin{quote}
+ \showanchors{cuteinductorshape}{}(lr dot/-45/0.2, ur dot/45/0.2, ll dot/-135/0.2, ul dot/135/0.2)
+ \quad
+ \showanchors{cuteinductorshape}{}(ur dot/-60/0.3, ul dot/-120/0.3, core west/135/0.2, core east/45/0.2)
+\end{quote}
+and as you can see, you have to be careful if you use dot anchors and core anchors together.
+You can change the position of the dots by changing the keys \texttt{bipoles/inductors/dot x distance} (default \texttt{4pt}), which represent how much the dot extends outside the component width, and the corresponding \texttt{dot y distance} (default \texttt{1pt}), which serves the same scope in the height direction.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[]
+ \ctikzset{bipoles/inductors/.cd, dot x distance=3pt,
+ dot y distance=0pt}
+ \draw (0,2) to[L=$L_1$, name=l1] ++(3,0);
+ \draw (0,0) to[L, l_=$L_2$, name=l2, inductors/width=1.4,
+ inductors/coils=11] ++(3,0);
+ \path (l1.ur dot) node[circ]{} (l2.ul dot) node[circ]{};
+ \draw ([yshift=-0.2cm]l1.south)
+ to[out=-45, in=45] node[right]{$M$}
+ ([yshift=0.2cm]l2.north);
+\end{circuitikz}
+\end{LTXexample}
+
+Notice that the position of the dot anchors does not coincide with the position of the dots in the transformers (see section~\ref{sec:transformers}), because there they depend on the size of the complete double-bipole more that on the size of the inductances.
\subsection{Diodes and such}
@@ -2590,6 +2616,42 @@ The transformer shapes vector group options can be specified for the primary (\t
\end{circuitikz}
\end{LTXexample}
+\subsubsection{Nullator and norator}
+
+These are special elements used in some approaches to model ideal amplifiers\footnote{See \href{https://en.m.wikipedia.org/wiki/Nullor}{the Wikipedia article}; suggested by \href{https://github.com/circuitikz/circuitikz/issues/615}{user atticus-sullivan on GitHub}.}.
+
+\begin{groupdesc}
+\circuitdescbip*{nullator}{Nullator element (virtual short circuit; forces V and I to zero)}{}
+\circuitdescbip*{norator}{Norator element (admits any combination of V and I)}{}
+\end{groupdesc}
+
+They are in the \texttt{sources} class, but they are not treated like sources in the labelling sense (they have both \texttt{bipoles/is voltage=false} and \texttt{bipoles/is current=false}, see~\ref{sec:source-vif}).
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz}[american]
+ \draw (0,0) node[ground](GND){}
+ to [I,l=$i_s$,invert]
+ ++(0,2.5) -- ++(1.5,0) coordinate(up)
+ to[nullator, v=0, i=0, name=A]
+ (up|-GND) node[ground]{};
+ \draw (up) to[R, *-*] ++(2,0) coordinate(out)
+ to[norator, v^=$v_o$]
+ (out|-GND) node[ground]{};
+\end{circuitikz}
+\end{LTXexample}
+
+The symbol shapes used here seems to be the most common in publications; if you prefer the shapes from the Wikipedia article, you can use the following definitions:
+
+\begin{LTXexample}[varwidth=true]
+\tikzset{noratorW/.style={voosource,
+ bipoles/oosource/circlesize=0.5,
+ bipoles/oosource/circleoffset=0.5},
+ nullatorW/.style={esource, sources/scale=0.5}}
+\begin{tikzpicture}
+ \draw (0,0) to[nullatorW] ++(2,0) to[noratorW] ++(0, -2);
+\end{tikzpicture}
+\end{LTXexample}
+
\subsubsection{DC sources}
\begin{groupdesc}
\circuitdescbip*{dcvsource}{DC voltage source}{}
@@ -2966,13 +3028,14 @@ If (default behaviour) \texttt{europeangfsurgearrester} option is active (or the
If otherwise \texttt{americangfsurgearrester} option is active (or the style \texttt{[american gas filled surge arrester]} is used), the shorthands the shorthands \texttt{gas filled surge arrester} and \texttt{gf surge arrester} are equivalent to the american version of the component.
\end{framed}
-
-
\begin{groupdesc}
\circuitdescbip*{lamp}{Lamp}{}
\circuitdescbip*{bulb}{Bulb}{}
\circuitdescbip*{loudspeaker}{loudspeaker}{}( north/90/0.4, north east/45/0.4, east/0/0.4, south east/-45/0.4, south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4, left/135/0.2, right/45/0.2, center/-135/0.2)
\circuitdescbip*{mic}{mic}{}( north/90/0.4, north east/45/0.4, east/0/0.4, south east/-45/0.4, south/-90/0.4, south west/-135/0.4, west/180/0.4, north west/135/0.4, left/135/0.2, right/45/0.2, center/-135/0.2)
+ \circuitdescbip*{buzzer}{Buzzer\footnotemark}{}(left/135/0.6, right/45/0.6)
+ \circuitdescbip*{rbuzzer}{Reversed buzzer}{}(left/135/0.6, right/45/0.6)
+ \footnotetext{Buzzers were suggested by \href{https://tex.stackexchange.com/questions/640501/buzzer-symbol-in-circuitikz}{user Michael.H on TeX.SX}}
\end{groupdesc}
You can use microphones and loudspeakers with \texttt{waves} (see section~\ref{sec:RF}) too:
@@ -3129,6 +3192,7 @@ The arrows are the ones set with the keys \texttt{tunable start arrow} and \text
\end{LTXexample}
Notice also the need to force a transparency group if you want a semitransparent arrow.
+
\subsection{Terminal shapes}\label{sec:terminals}
These are the so-called ``bipole nodes'' shapes, or poles (see section~\ref{sec:bipole-nodes}). These nodes are always filled; the ``open'' versions (starting with an \texttt{o}) are by default filled with the color specified by the key \texttt{open nodes fill} (by default \texttt{white}), but you can override locally it with the \texttt{fill} parameter.
@@ -3154,11 +3218,14 @@ Since version 0.9.0, ``bipole nodes'' shapes have all the standard geographical
The size of the poles is controlled by the key \texttt{nodes width} (default \texttt{0.04}, relative to the basic length).
Be sure to see section~\ref{sec:bipole-nodes} for more usage and configurability.
+\subsection{Connectors}\label{sec:connectors}
+
+Connectors have a class by themselves (\texttt{connectors}), so you can use the \texttt{scale}, \texttt{fill} and \texttt{thickness} properties as usual.
\subsubsection{BNC connector/terminal}
\begin{groupdesc}
- \circuitdesc*{bnc}{BNC connector}{}(left/135/0.6, right/45/0.6, center/-90/0.6, hot/0/0.6, zero/-135/0.6)
+ \circuitdesc*{bnc}{BNC connector}{}(left/135/0.6, right/45/0.6, center/-45/0.6, hot/0/0.6, zero/-135/0.6, shield/-90/0.4)
\end{groupdesc}
The BNC connector is defined so that you can easily connect it as input or output (but remember that you need to flip the text if you flip the component):
@@ -3183,14 +3250,88 @@ It also has a \texttt{zero} anchor if you need to rotate it about its real cente
\end{circuitikz}
\end{LTXexample}
+\subsubsection{IEC 60617 socket-plug connectors}
+
+Plug and socket connectors (modeled on the IEC60617 standard) are available\footnote{Since \texttt{v1.5.0}; thanks to Alexander Sauter for suggesting them and \href{https://github.com/circuitikz/circuitikz/issues/611}{helping in the design}.} both in path-style form and, with separated but matching shapes for plug and socket, in node-style. There are two differently oriented shapes for each type to ease the construction of ``split'' connections (see the examples below). \textbf{Notice} that the elements in the following table are scaled by a factor 1.5, to better show the position of the anchors.
+
+\begin{groupdesc}
+ \ctikzset{connectors/scale=1.5}
+ \circuitdescbip[iecconn]{iec connector}{IEC 60617 connector}{iecconn}(left/145/0.3, right/45/0.3, center/-90/0.4, plug center/90/0.4, socket center/-135/0.3)
+ \circuitdesc{iecconnshape}{IEC 60617 connector}{\tiny text}(left/145/0.3, right/45/0.3, center/-90/0.2)
+ \circuitdesc{iecsocketL}{IEC 60617 female socket, left side}{\tiny text}(left/145/0.3, right/45/0.3, center/-90/0.2, socket center/0/0.2)
+ \circuitdesc{iecplugR}{IEC 60617 male plug, right side}{\tiny text}(left/145/0.3, right/45/0.3, center/-90/0.2, plug center/90/0.4)
+ \circuitdesc{iecplugL}{IEC 60617 male plug, left side}{\tiny text}(left/145/0.3, right/45/0.3, center/-90/0.2, plug center/90/0.4)
+ \circuitdesc{iecsocketR}{IEC 60617 female socket, right side}{\tiny text}(left/145/0.3, right/45/0.3, center/-90/0.4, socket center/-135/0.3)
+\end{groupdesc}
+
+The \texttt{center} anchors (as well as the text position) of the split elements of the connectors are on the side of the component (similar to what happens with grounds and supply voltage arrows) to ease the most common use.
+
+Also, the text for the plug nodes is raised to the same level of the text in the sockets, and it will ignore descendants, so that the two text lines up when the two components are put side by side.
+
+The \texttt{plug center} anchor always point to the center of the rectangular plug shape, and the \texttt{socket center} to the center of the semicircle in the sockets.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}
+ \draw (0,1) node[bnc]{} to[R] ++(2,0)
+ to[iec connector] ++(1,0);
+ \draw (0,0) node[bnc]{} to[R] ++(2,0)
+ to[iec connector, invert] ++(1,0);
+\end{circuitikz}
+\end{LTXexample}
+
+Aligning ``disconnected'' plugs and sockets is reasonably easy:
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}
+ \draw (0,2) to[iec connector, name=C1] ++(2,0) coordinate(stop)
+ (C1.nw) node[above left, inner xsep=0pt]{s1}
+ (C1.ne) node[above right, inner xsep=0pt]{p1};
+ \draw (0,1) coordinate(tmp) -- (tmp-|C1.left)
+ node[iecsocketL](S2){s2};
+ \draw (0,0) coordinate(tmp) (tmp-|C1.socket center)
+ node[iecplugR](P3){p3} (P3.right) -- (tmp-|stop);
+ \draw[red, dashed] ([yshift=1cm]C1.socket center) -- ++(0,-4);
+\end{circuitikz}
+\end{LTXexample}
+
+You can choose the best shape when rotating them, to simplify the positioning (shape rotates around the \texttt{center} anchor).
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}
+ \draw (0,0) -| ++(1,-1) node[iecsocketL, rotate=-90]{}
+ (2,-1) -| ++(1,1) node[iecplugR, rotate=90]{};
+\end{circuitikz}
+\end{LTXexample}
+
+Choosing the proper left/right shape results in easily build ``mixed'' connectors; you can use the node text position properties to have lined-up labels, but remember that the text is outside the bounding box:
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[]
+ \path (0,2); % for the bounding box, text is not accounted for
+ \draw (0,1) -- ++(1,0) node[iecsocketL](s1){S1};
+ \draw [red] (s1.e) node[iecplugR](p1){P1} (p1.e) -- ++(1,0);
+ \draw (0,0) -- ++(1,0) node[iecplugL](p2){P2};
+ \draw[blue] (p2.e) node[iecsocketR](s2){S2} (s2.e) -- ++(1,0);
+\end{circuitikz}
+\end{LTXexample}
+
+You can use the \texttt{plug center} anchor to add the IEC ``multiplier'':
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[]
+ \draw (0,0) to[iec connector, connectors/scale=2, name=A,
+ a={\small\ttfamily output bus}] ++(3,0);
+ \draw (A.plug center) ++(-.2,-.4) -- ++(.4,.8) node[above]{8};
+\end{circuitikz}
+\end{LTXexample}
\subsection{Block diagram components}
\noindent Contributed by Stefan Erhardt.
\begin{groupdesc}
- \circuitdesc*{mixer}{mixer}{}( w/180/0.1,s/-90/0.1,e/0/0.1,n/90/0.1 )
+ \circuitdesc*{mixer}{mixer}{}( w/180/0.1,s/-90/0.1,e/0/0.1,n/90/0.1, center/-120/0.3, geocenter/-60/.3 )
\circuitdesc*{adder}{adder}{}( west/180/0.1,south/-90/0.1,east/0/0.1,north/90/0.1 )
- \circuitdesc*{oscillator}{oscillator}{}( w/180/0.1,s/-90/0.1,e/0/0.1,n/90/0.1 )
+ \circuitdesc*{oscillator}{oscillator}{}( w/180/0.1,s/-90/0.1,e/0/0.1,n/90/0.1, center/45/0.2, geocenter/-45/.3 )
\circuitdesc*{circulator}{circulator}{}( left/180/0.1,down/-90/0.1,right/0/0.1, up/90/0.1 )
\circuitdesc*{wilkinson}{wilkinson divider}{}( in/180/0.1, out2/45/0.1, out1/-45/0.1 )
\circuitdesc*{splitter}{resistive splitter\footnotemark}{}( in/180/0.1, out2/45/0.1, out1/-45/0.1 )
@@ -3253,7 +3394,16 @@ The ports of the \texttt{mixer}, \texttt{adder}, \texttt{oscillator} and \texttt
;\end{circuitikz}
\end{LTXexample}
-Moreover, the have proper border anchors since version \texttt{1.2.3}, so you can do things like this:
+The \texttt{oscillator} has a displaced \texttt{center} anchor, to simplify the task of putting it at the left side of a circuit; it also as a special position for the node text. The four round elements (mixer, circulator, adder, and the oscillator) have a \texttt{geocenter} anchor which corresponds always to the center of the circle.
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{tikzpicture}[>=Stealth]
+ \draw (0,0)node[oscillator](O){$f_0$} -- ++(1,0);
+ \draw[blue, ->] (1,1) -- (O.center);
+ \draw[red, ->] (1,1) -- (O.geocenter);
+\end{tikzpicture}
+\end{LTXexample}
+
+Moreover, the have proper border anchors since version \texttt{1.2.3} (and fixed for boxed elements in \texttt{1.5.0}), so you can do things like this:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
@@ -3394,15 +3544,16 @@ Some two-ports have the option to place a normal label (\texttt{l=}) and a inner
\end{circuitikz}
\end{LTXexample}
+
\paragraph{Box option}
-Some devices have the possibility to add a box around them. The inner symbol scales down to fit inside the box.
+Several devices have the possibility to add a box around them with the \texttt{box} or \texttt{boxed} option. The inner symbol scales down to fit inside the box. For the ``circled'' devices (mixer, adder, oscillator and circulator) the inner circle is normally drawn, unless you use the \texttt{box only} or \texttt{boxed only} option.\footnote{Since 1.5.0, suggested by \href{https://github.com/circuitikz/circuitikz/issues/621}{GitHUb user myzinsky}}
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
- (0,0) node[mixer,box,anchor=east] (m) {}
- to[amp,box,>,-o] ++(2.5,0)
- (m.west) node[inputarrow] {} to[short,-o] ++(-0.8,0)
- (m.south) node[inputarrow,rotate=90] {} --
- ++(0,-0.7) node[oscillator,box,anchor=north] {};
+ (0,0) node[mixer, box only, anchor=east](m){}
+ to[amp, boxed, >, -o] ++(2.5,0)
+ (m.west) node[inputarrow]{} to[short,-o] ++(-0.8,0)
+ (m.south) node[inputarrow,rotate=90]{} --
+ ++(0,-0.7) node[oscillator, box, anchor=north]{};
\end{circuitikz}
\end{LTXexample}
@@ -4244,6 +4395,8 @@ Notes that in the transmission and receiving antennas, the ``waves'' are outside
\begin{groupdesc}
\circuitdesc*{bareantenna}{Bare Antenna}{A}( top/90/0.1, bottom/180/0.3, left/180/0.3, right/45/0.3, center/0/0.3 )
+ \circuitdesc*{dinantenna}{DIN antenna\footnotemark}{A}(left/135/0.6, right/45/0.6, center/-45/0.6)
+ \footnotetext{Since 1.5.0, suggested by \href{https://github.com/circuitikz/circuitikz/issues/621}{GitHUb user myzinsky}}
\circuitdesc*{bareTXantenna}{Bare TX Antenna}{Tx}( top/90/0.1, center/180/0.3, waves/90/0.3 )
\circuitdesc*{bareRXantenna}{Bare RX Antenna}{Rx}( top/90/0.1, center/0/0.3, waves/90/0.3 )
\circuitdesc{waves}{Waves}{}( north/90/0.4, north east/45/0.4, east/-45/0.4, south east/-45/0.4,
@@ -4341,7 +4494,7 @@ The symbols can also be used along a path, using the transistor-path-syntax(\tex
-\subsection{Double bipoles (transformers)}
+\subsection{Double bipoles (transformers)}\label{sec:transformers}
Transformers automatically use the inductor shape currently selected. These are the three possibilities:
\begin{groupdesc}
@@ -8240,10 +8393,45 @@ To correct the line ending, there are support shapes to fill the missing rectang
\section{Colors}
-Color support in \Circuitikz{} is quite limited. You will have no problem if:
+
+Color support in \Circuitikz{} has been quite limited since version 1.5.0; form that one onward there has been an effort to make component's behavior more intuitive.
+
+Part of the problem is how colors in paths are treated by \TikZ{} itself; you can see part of the discussion \href{https://github.com/circuitikz/circuitikz/issues/605}{this issue} and in \href{https://tex.stackexchange.com/questions/634987/pgf-basic-layer-struggling-again-with-colors}{this question on TeX.SX} --- many thanks to \texttt{@muzimuzhi} for helping there. Basically, nodes are drawn \emph{after} the path is completed, and color is applied to the path at the end. Look at this code (pure \TikZ, no \Circuitikz{} here):
+
+\begin{LTXexample}[varwidth=true]
+\tikz \draw[thick] (0,0) -- (1,0) {[color=red] -- (2,0) node[draw]{}} --(3,0);
+
+\tikz \draw[thick] (0,0) -- (1,0) [color=red] -- (2,0) node[draw]{} --(3,0);
+\end{LTXexample}
+
+So the path is drawn with the last ``effective'' (in current group) color. The deferred behavior of the color properties is very difficult to track for \Circuitikz, especially when the shorthand \texttt{color-name} (e.g., \texttt{red} instead of \texttt{color=red}) is used. \Circuitikz{} will try to patch the default commands to keep track of the ``current color''; if it fails will give a warning like \texttt{patch failed, use only explicit color=...}.
+
+Before 1.5.0, \Circuitikz{} used black as the default color. Now it tries to follow the current color, as \TikZ does normally; but notice that there is a difference with the fill strategy:
+
+\begin{LTXexample}[pos=t]
+\color{red}
+Red text
+\tikz \draw (0,0) -- node[draw] {x} (1,0) -- node[draw=cyan] {y} (2,0);
+\tikz \draw (0,0) to[R] (2,0) to[R,color=cyan] (4,0) to [generic] (6,0) to [fullgeneric] (8,0);
+
+\color{blue}
+Blue text
+\tikz \draw (0,0) -- node[draw] {x} (1,0) -- node[draw=cyan] {y} (2,0);
+\tikz \draw (0,0) to[R] (2,0) to[R,color=cyan] (4,0) to [generic] (6,0) to [fullgeneric] (8,0);
+
+\color{black}
+Black text
+\tikz \draw[fill=yellow] (0,0) -- node[draw, fill] {x} (1,0) -- node[draw=cyan] {y} (2,0);
+\tikz \draw[fill=yellow] (0,0) to[R] (2,0) to[R,color=cyan] (4,0) to [generic] (6,0) to [fullgeneric] (8,0);
+\end{LTXexample}
+
+\Circuitikz{} components that are fillable will inherit the \texttt{fill} property of the path (it is almost impossible to do otherwise) as if the \texttt{fill} flag was present. ``Full''-type elements (for example, full diodes or similar) are filled with the draw color; elements with intrinsic labels (i.e., labels that are part of the shape, like signs on amplifiers and pin numbers in chip) are drawn with the ``draw'' colors.
+
+Basically, you should have no problem if:
\begin{enumerate}
- \item You stick to use styles (see~\ref{sec:styling-fillcolor}) for filling your components, or using a direct \texttt{fill=...} option directly;
- \item when coloring whole circuits, use the option \texttt{color=...} in your global picture options or in the \verb|\draw| command (not just the color name as a shorthand);
+ \item You stick to use styles (see~\ref{sec:styling-fillcolor}) for filling your components, or using a direct \texttt{fill=...} option in the component node or \texttt{to} option;
+ \item do not try to change the color mid-path; sometimes it works (see the examples below), but it's better to avoid it (using different paths is better);
+ \item when coloring whole circuits, it's better to use the option \texttt{color=...} in your global picture options or in the \verb|\draw| command (not just the color name as a shorthand);
\item forget about transparency.
\end{enumerate}
@@ -8251,9 +8439,8 @@ Nevertheless, if you really need to do strange things with colors you can read o
\subsection{Shape colors}
-The color of the components is stored in the key \verb!\circuitikzbasekey/color!. Circui\TikZ\ tries to follow the color set in \TikZ, although sometimes it fails. If you change color in the picture, please do not use just the color name as a style, like \verb![red]!, but rather assign the style \verb![color=red]!.
+The color of the components is stored in the key \verb!\circuitikzbasekey/color!. Circui\TikZ\ tries to follow the color set in \TikZ, although sometimes it fails. The following circuit will fail to draw the circuit in red if the patching of the inner commands of \TikZ{} fails, like for example in \ConTeXt{}.
-Compare for instance
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw[red]
(0,2) node[and port](myand1){1}
@@ -8264,7 +8451,7 @@ Compare for instance
;\end{circuitikz}
\end{LTXexample}
-and
+If you see this problem, please do not use just the color name as a style, like \verb![red]!, but rather assign the style \verb![color=red]!.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw[color=red]
@@ -8276,7 +8463,7 @@ and
;\end{circuitikz}
\end{LTXexample}
-One can of course change the color \emph{in medias res}:
+One can of course change the color directly in the component:
\begin{LTXexample}[pos=t, varwidth=true]
\begin{circuitikz} \draw
(0,0) node[pnp, color=blue](pnp2){q1}
@@ -8288,7 +8475,8 @@ One can of course change the color \emph{in medias res}:
;\end{circuitikz}
\end{LTXexample}
-The all-in-one stream of bipoles poses some challanges, as only the actual body of the bipole, and not the connecting lines, will be rendered in the specified color.
+The all-in-one stream of bipoles poses some challenges, as only the actual body of the bipole, and not the connecting lines, will be rendered in the specified color (Notice that the following example uses the special \texttt{siunitx} shorthand; you can use it only in simple cases like here, in general using the full \verb|\SI{}| or \verb|\qty{}| commands).
+
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
(0,0) to[V=1<\volt>] (0,2)
@@ -8297,16 +8485,28 @@ The all-in-one stream of bipoles poses some challanges, as only the actual body
;\end{circuitikz}
\end{LTXexample}
-Which, for some bipoles, can be frustrating:
+The postponed application of colors creates problem if you want to use arrows for voltages, because the ``arrows'' are partially part of the path, partially nodes:
+
+\begin{LTXexample}[varwidth=true]
+\begin{circuitikz} \draw
+ (0,0){[red] to[V=1<\volt>] (0,2) }
+ to[R=1<\ohm>] (2,2)
+ to[C=1<\farad>] (2,0) -- (0,0)
+;\end{circuitikz}
+\end{LTXexample}
+
+...and that can become quite frustrating:
+
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
- (0,0){to[V=1<\volt>, color=red] (0,2) }
+ (0,0) to[V=1<\volt>, color=red] (0,2)
to[R=1<\ohm>] (2,2)
to[C=1<\farad>] (2,0) -- (0,0)
;\end{circuitikz}
\end{LTXexample}
-The only way out is to specify different paths:
+In those cases, the only way out is to specify different paths (and/or using advanced voltages, see~\ref{sec:vif-anchors})
+
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw[color=red]
(0,0) to[V=1<\volt>, color=red] (0,2);
@@ -8315,8 +8515,6 @@ The only way out is to specify different paths:
;\end{circuitikz}
\end{LTXexample}
-And yes: this is a bug and \emph{not} a feature\ldots
-
\subsection{Fill colors}
Since version 0.9.0, you can also fill most shapes with a color (the manual specifies which ones are fillable or not). The syntax is quite intuitive:
@@ -8332,7 +8530,7 @@ Since version 0.9.0, you can also fill most shapes with a color (the manual spec
\end{LTXexample}
-This fill color will override any color defined by the style (see section~\ref{sec:styling-fillcolor}). If you want to override a style fill color with no-fill for a specific component, you need to override the style --- it's a bit unfortunate but it should be an exceptional thing anyway:
+This fill color will override any color defined by the style (see section~\ref{sec:styling-fillcolor}). If you want to override a style fill color with no-fill for a specific component, you need to override the style --- it's a bit unfortunate, but should be an exceptional thing anyway. Notice that in simple case \texttt{fill opacity} works, but don't count too much on it.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
@@ -8341,13 +8539,14 @@ This fill color will override any color defined by the style (see section~\ref{s
\draw[red] (1.5,3) -- (1.5, -1);
\draw
(0,2) node[and port](myand1){1}
- (0,0) node[and port, fill=cyan](myand2){2}
+ (0,0) node[and port, fill=cyan, fill opacity=0.7](myand2){2}
(2,1) node[xnor port, circuitikz/logic ports/fill=none
](myxnor){3}
(myand1.out) -| (myxnor.in 1)
(myand2.out) -| (myxnor.in 2)
;\end{circuitikz}
\end{LTXexample}
+
You can combine shape colors with fill colors, too, but you should use the \texttt{draw} color option style for this:
\begin{LTXexample}[varwidth=true]
@@ -8360,14 +8559,11 @@ You can combine shape colors with fill colors, too, but you should use the \text
;\end{circuitikz}
\end{LTXexample}
-This is because, as you can see from the following example in port \texttt{2}, you can't specify both a fill and a color in the node (yes, it's a bug too, but it's quite complex to solve given the current circuit\TikZ{} architecture).
-A workaround is shown in port \texttt{3}:
-
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
(0,2) node[and port, color=black](myand1){1}
(0,0) node[and port, color=blue, fill=cyan](myand2){2}
- (2,1) {[color=blue] node[xnor port, fill=cyan](myxnor){3}}
+ (2,1) node[xnor port, color=red, fill=cyan](myxnor){3}
(myand1.out) -| (myxnor.in 1)
(myand2.out) -| (myxnor.in 2)
;\end{circuitikz}
@@ -8375,7 +8571,7 @@ A workaround is shown in port \texttt{3}:
\subsubsection{Background colors different from white}
-Notice also that the connection point are always filled, although the color \emph{tries} to follow the color of the filling of the component (but look at section~\ref{sec:transparent-poles}). Moreover, if you want to pass fill transparency down to path-style components, you \emph{have} to put it into the options of the \verb|\draw| command.
+Notice also that the connection point are always filled, and the color \emph{tries} to follow the color of the filling of the component (but look at section~\ref{sec:transparent-poles}). Moreover, if you want to pass fill transparency down to path-style components, you \emph{have} to put it into the options of the \verb|\draw| command.
\begin{LTXexample}[varwidth=true, pos=t]
\begin{circuitikz}
@@ -8886,11 +9082,37 @@ at the start of anchors and macros definition, and use (for example, the exact c
\end{lstlisting}
in all the \texttt{savedanchors}.
-Then, in the drawing part, you should start with:
+Then, to draw your component, you should start with\footnote{Since \texttt{v1.5.0}; component defined with this mechanism will not be compatible with older \Circuitikz{}.}:
\begin{lstlisting}
- \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgf@circ@draw@component{%
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ ...
+ }
\end{lstlisting}
-and then use \verb|\pgf@circ@scaled@Rlen| (or the anchors) as default lengths while you draw it.
+and then use \verb|\pgf@circ@scaled@Rlen| (or the anchors) as the default length while you draw it.
+
+The special command \verb|\pgf@circ@draw@component| will issue a \texttt{\textbackslash behindforegroundpath} command, and take care of calling the start and end hooks for the component. Notice that, given the use of \texttt{\textbackslash behindforegroundpath}, you must take care to use the path you define here! The path itself is protected bu a \texttt{pgfscope} (and so also by a \TeX{} group), so local definitions will be reset after exiting.
+
+\subsubsection{The internal hook system}\label{sec:drawing-hooks}
+
+Since version \texttt{v1.5.0}, before starting the drawing of any component, \Circuitikz{} will check for the existence of three different hooks, in the following order (suppose that the shape name is \texttt{\emph{myname}}, and it has a class \texttt{\emph{myclass}}:
+\begin{itemize}
+ \item \texttt{\textbackslash ctikz@hook@start@draw@component@\emph{myname}}
+ \item \texttt{\textbackslash ctikz@hook@start@draw@class@\emph{myclass}}
+ \item \texttt{\textbackslash ctikz@hook@start@draw@default}
+\end{itemize}
+The first one that is defined in the current (or outer) scope is used, and the following ones are not used. This hooks can be used to set drawing parameters, or to reset them to a known state: \TikZ{} normally inherit most of the drawing option, but that can lead to surprises (like unexpected arrows, etc.).
+
+In the same way, before leaving \verb|\pgf@circ@draw@component|, a set of similar hooks (with \texttt{end} instead of \texttt{start}) is tried, with the same logic.
+
+The only predefined hook is \texttt{\textbackslash ctikz@hook@start@draw@default}, which is set to the equivalent of:
+\begin{lstlisting}
+ \pgfsetshortenstart{+0pt}\pgfsetshortenend{+0pt}\pgfsetarrows{-}%
+ \def\pgf@circ@reset@rounded{\pgfsetcornersarced{\pgfpointorigin}}%
+\end{lstlisting}
+which mean that, by default, arrows parameters are reset to the default (no shorten, no arrows) and that corners are not rounded. If you want to override them, just define the appropriate hook for you component/class and the generic one will not be called.
+
+No \texttt{...@end@draw@...} hook is defined by default.
\subsubsection{Finishing your work}
@@ -9147,8 +9369,7 @@ Here a series of example, contributed by several people, is shown with their cod
\subsection{An example with the \texttt{compatibility} option}
\label{ex:compatibility}
-\IfFileExists{compatibility.pdf}
-{\fbox{\includegraphics{compatibility.pdf}}}
+\IfFileExists{compatibility.pdf}{\fbox{\includegraphics{compatibility.pdf}}}{}%
\begin{lstlisting}
\documentclass{standalone}
diff --git a/graphics/pgf/contrib/circuitikz/doc/ctikzmanutils.sty b/graphics/pgf/contrib/circuitikz/doc/ctikzmanutils.sty
index 25a5b5f9e8..8ed0088ca2 100644
--- a/graphics/pgf/contrib/circuitikz/doc/ctikzmanutils.sty
+++ b/graphics/pgf/contrib/circuitikz/doc/ctikzmanutils.sty
@@ -133,7 +133,10 @@
\IfBooleanTF{#1}{%
\draw (0,0) node[#3,scale=#2, fill=fillcol](N){#5};
}{
- \draw (0,0) node[#3,scale=#2](N){#5};
+ % if it's non-fillable, red should not go through
+ \draw (0,0) node[#3,scale=#2,
+ % fill=red
+ ](N){#5};
}
\IfValueT{#6}{%
\foreach \n/\a/\d in {#6} \path(N.\n) \showcoord(\n)<\a:\d>;
@@ -164,7 +167,10 @@
\IfBooleanTF{#1}{%
\draw (0,0) to[#3, name=B, fill=fillcol] (2,0);
}{
- \draw (0,0) to[#3, name=B] (2,0);
+ % if it's non-fillable, red should not go through
+ \draw (0,0) to[#3, name=B,
+ %fill=red
+ ] (2,0);
}
\IfValueT{#7}{%
\foreach \n/\a/\d in {#7} \path(B.\n) \showcoord(\n)<\a:\d>;
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]